From bf608716df44de572758138b9c3f87412db2f9fc Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 5 May 2026 21:09:42 +0000 Subject: [PATCH 1/2] feat: add PySparkNotebookBatch message PiperOrigin-RevId: 910808400 Source-Link: https://github.com/googleapis/googleapis/commit/3adc515b8bda328fb894f86765d9c5ec8c944480 Source-Link: https://github.com/googleapis/googleapis-gen/commit/96ec613537b3756c0969fae142802e879b9b8c50 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRhdGFwcm9jLy5Pd2xCb3QueWFtbCIsImgiOiI5NmVjNjEzNTM3YjM3NTZjMDk2OWZhZTE0MjgwMmU4NzliOWI4YzUwIn0= --- .../google-cloud-dataproc/.OwlBot.yaml | 19 + .../google-cloud-dataproc/.eslintignore | 7 + .../google-cloud-dataproc/.eslintrc.json | 4 + .../google-cloud-dataproc/.gitattributes | 4 + .../google-cloud-dataproc/.gitignore | 14 + .../google-cloud-dataproc/.jsdoc.js | 55 + .../google-cloud-dataproc/.mocharc.js | 33 + owl-bot-staging/google-cloud-dataproc/.nycrc | 24 + .../google-cloud-dataproc/.prettierignore | 6 + .../google-cloud-dataproc/.prettierrc.js | 22 + .../google-cloud-dataproc/CODE_OF_CONDUCT.md | 94 + .../google-cloud-dataproc/CONTRIBUTING.md | 76 + owl-bot-staging/google-cloud-dataproc/LICENSE | 202 + .../google-cloud-dataproc/README.md | 158 + .../dataproc/v1/autoscaling_policies.proto | 399 + .../google/cloud/dataproc/v1/batches.proto | 436 + .../google/cloud/dataproc/v1/clusters.proto | 1791 + .../google/cloud/dataproc/v1/jobs.proto | 1045 + .../cloud/dataproc/v1/node_groups.proto | 174 + .../google/cloud/dataproc/v1/operations.proto | 212 + .../cloud/dataproc/v1/session_templates.proto | 217 + .../google/cloud/dataproc/v1/sessions.proto | 379 + .../google/cloud/dataproc/v1/shared.proto | 627 + .../dataproc/v1/workflow_templates.proto | 890 + .../google-cloud-dataproc/protos/protos.d.ts | 29074 ++++++ .../google-cloud-dataproc/protos/protos.js | 77201 ++++++++++++++++ .../google-cloud-dataproc/protos/protos.json | 9294 ++ ...olicy_service.create_autoscaling_policy.js | 73 + ...olicy_service.delete_autoscaling_policy.js | 68 + ...g_policy_service.get_autoscaling_policy.js | 68 + ...olicy_service.list_autoscaling_policies.js | 80 + ...olicy_service.update_autoscaling_policy.js | 61 + .../v1/batch_controller.create_batch.js | 86 + .../v1/batch_controller.delete_batch.js | 63 + .../v1/batch_controller.get_batch.js | 63 + .../v1/batch_controller.list_batches.js | 93 + .../v1/cluster_controller.create_cluster.js | 90 + .../v1/cluster_controller.delete_cluster.js | 91 + .../v1/cluster_controller.diagnose_cluster.js | 99 + .../v1/cluster_controller.get_cluster.js | 72 + .../v1/cluster_controller.list_clusters.js | 95 + .../v1/cluster_controller.start_cluster.js | 91 + .../v1/cluster_controller.stop_cluster.js | 91 + .../v1/cluster_controller.update_cluster.js | 154 + .../generated/v1/job_controller.cancel_job.js | 72 + .../generated/v1/job_controller.delete_job.js | 72 + .../generated/v1/job_controller.get_job.js | 72 + .../generated/v1/job_controller.list_jobs.js | 102 + .../generated/v1/job_controller.submit_job.js | 85 + .../job_controller.submit_job_as_operation.js | 86 + .../generated/v1/job_controller.update_job.js | 87 + ...node_group_controller.create_node_group.js | 88 + .../node_group_controller.get_node_group.js | 63 + ...node_group_controller.resize_node_group.js | 98 + .../v1/session_controller.create_session.js | 88 + .../v1/session_controller.delete_session.js | 73 + .../v1/session_controller.get_session.js | 61 + .../v1/session_controller.list_sessions.js | 88 + .../session_controller.terminate_session.js | 73 + ...late_controller.create_session_template.js | 66 + ...late_controller.delete_session_template.js | 61 + ...emplate_controller.get_session_template.js | 61 + ...plate_controller.list_session_templates.js | 79 + ...late_controller.update_session_template.js | 61 + ...pet_metadata_google.cloud.dataproc.v1.json | 2155 + ...mplate_service.create_workflow_template.js | 73 + ...mplate_service.delete_workflow_template.js | 74 + ..._template_service.get_workflow_template.js | 74 + ...ce.instantiate_inline_workflow_template.js | 84 + ...e_service.instantiate_workflow_template.js | 92 + ...emplate_service.list_workflow_templates.js | 79 + ...mplate_service.update_workflow_template.js | 62 + .../google-cloud-dataproc/src/index.ts | 41 + .../v1/autoscaling_policy_service_client.ts | 1627 + ...oscaling_policy_service_client_config.json | 51 + ...autoscaling_policy_service_proto_list.json | 12 + .../src/v1/batch_controller_client.ts | 1832 + .../v1/batch_controller_client_config.json | 42 + .../src/v1/batch_controller_proto_list.json | 12 + .../src/v1/cluster_controller_client.ts | 2563 + .../v1/cluster_controller_client_config.json | 72 + .../src/v1/cluster_controller_proto_list.json | 12 + .../src/v1/gapic_metadata.json | 589 + .../google-cloud-dataproc/src/v1/index.ts | 26 + .../src/v1/job_controller_client.ts | 2119 + .../src/v1/job_controller_client_config.json | 69 + .../src/v1/job_controller_proto_list.json | 12 + .../src/v1/node_group_controller_client.ts | 1673 + .../node_group_controller_client_config.json | 38 + .../v1/node_group_controller_proto_list.json | 12 + .../src/v1/session_controller_client.ts | 1972 + .../v1/session_controller_client_config.json | 46 + .../src/v1/session_controller_proto_list.json | 12 + .../v1/session_template_controller_client.ts | 1583 + ...ion_template_controller_client_config.json | 46 + ...ession_template_controller_proto_list.json | 12 + .../v1/workflow_template_service_client.ts | 2209 + ...rkflow_template_service_client_config.json | 69 + .../workflow_template_service_proto_list.json | 12 + .../system-test/fixtures/sample/src/index.js | 34 + .../system-test/fixtures/sample/src/index.ts | 74 + .../system-test/install.ts | 49 + .../gapic_autoscaling_policy_service_v1.ts | 1665 + .../test/gapic_batch_controller_v1.ts | 1870 + .../test/gapic_cluster_controller_v1.ts | 2741 + .../test/gapic_job_controller_v1.ts | 2267 + .../test/gapic_node_group_controller_v1.ts | 1690 + .../test/gapic_session_controller_v1.ts | 2070 + .../gapic_session_template_controller_v1.ts | 1665 + .../gapic_workflow_template_service_v1.ts | 2244 + .../google-cloud-dataproc/tsconfig.json | 22 + .../google-cloud-dataproc/webpack.config.js | 64 + 112 files changed, 161342 insertions(+) create mode 100644 owl-bot-staging/google-cloud-dataproc/.OwlBot.yaml create mode 100644 owl-bot-staging/google-cloud-dataproc/.eslintignore create mode 100644 owl-bot-staging/google-cloud-dataproc/.eslintrc.json create mode 100644 owl-bot-staging/google-cloud-dataproc/.gitattributes create mode 100644 owl-bot-staging/google-cloud-dataproc/.gitignore create mode 100644 owl-bot-staging/google-cloud-dataproc/.jsdoc.js create mode 100644 owl-bot-staging/google-cloud-dataproc/.mocharc.js create mode 100644 owl-bot-staging/google-cloud-dataproc/.nycrc create mode 100644 owl-bot-staging/google-cloud-dataproc/.prettierignore create mode 100644 owl-bot-staging/google-cloud-dataproc/.prettierrc.js create mode 100644 owl-bot-staging/google-cloud-dataproc/CODE_OF_CONDUCT.md create mode 100644 owl-bot-staging/google-cloud-dataproc/CONTRIBUTING.md create mode 100644 owl-bot-staging/google-cloud-dataproc/LICENSE create mode 100644 owl-bot-staging/google-cloud-dataproc/README.md create mode 100644 owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/autoscaling_policies.proto create mode 100644 owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/batches.proto create mode 100644 owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/clusters.proto create mode 100644 owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/jobs.proto create mode 100644 owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/node_groups.proto create mode 100644 owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/operations.proto create mode 100644 owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/session_templates.proto create mode 100644 owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/sessions.proto create mode 100644 owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/shared.proto create mode 100644 owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/workflow_templates.proto create mode 100644 owl-bot-staging/google-cloud-dataproc/protos/protos.d.ts create mode 100644 owl-bot-staging/google-cloud-dataproc/protos/protos.js create mode 100644 owl-bot-staging/google-cloud-dataproc/protos/protos.json create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.create_autoscaling_policy.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.delete_autoscaling_policy.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.get_autoscaling_policy.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.list_autoscaling_policies.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.update_autoscaling_policy.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/batch_controller.create_batch.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/batch_controller.delete_batch.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/batch_controller.get_batch.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/batch_controller.list_batches.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.create_cluster.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.delete_cluster.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.diagnose_cluster.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.get_cluster.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.list_clusters.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.start_cluster.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.stop_cluster.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.update_cluster.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.cancel_job.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.delete_job.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.get_job.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.list_jobs.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.submit_job.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.submit_job_as_operation.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.update_job.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/node_group_controller.create_node_group.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/node_group_controller.get_node_group.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/node_group_controller.resize_node_group.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_controller.create_session.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_controller.delete_session.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_controller.get_session.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_controller.list_sessions.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_controller.terminate_session.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_template_controller.create_session_template.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_template_controller.delete_session_template.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_template_controller.get_session_template.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_template_controller.list_session_templates.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_template_controller.update_session_template.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/snippet_metadata_google.cloud.dataproc.v1.json create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.create_workflow_template.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.delete_workflow_template.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.get_workflow_template.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.instantiate_inline_workflow_template.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.instantiate_workflow_template.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.list_workflow_templates.js create mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.update_workflow_template.js create mode 100644 owl-bot-staging/google-cloud-dataproc/src/index.ts create mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/autoscaling_policy_service_client.ts create mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/autoscaling_policy_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/autoscaling_policy_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/batch_controller_client.ts create mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/batch_controller_client_config.json create mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/batch_controller_proto_list.json create mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/cluster_controller_client.ts create mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/cluster_controller_client_config.json create mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/cluster_controller_proto_list.json create mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/index.ts create mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/job_controller_client.ts create mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/job_controller_client_config.json create mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/job_controller_proto_list.json create mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/node_group_controller_client.ts create mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/node_group_controller_client_config.json create mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/node_group_controller_proto_list.json create mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/session_controller_client.ts create mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/session_controller_client_config.json create mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/session_controller_proto_list.json create mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/session_template_controller_client.ts create mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/session_template_controller_client_config.json create mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/session_template_controller_proto_list.json create mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/workflow_template_service_client.ts create mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/workflow_template_service_client_config.json create mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/workflow_template_service_proto_list.json create mode 100644 owl-bot-staging/google-cloud-dataproc/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-cloud-dataproc/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-cloud-dataproc/system-test/install.ts create mode 100644 owl-bot-staging/google-cloud-dataproc/test/gapic_autoscaling_policy_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-dataproc/test/gapic_batch_controller_v1.ts create mode 100644 owl-bot-staging/google-cloud-dataproc/test/gapic_cluster_controller_v1.ts create mode 100644 owl-bot-staging/google-cloud-dataproc/test/gapic_job_controller_v1.ts create mode 100644 owl-bot-staging/google-cloud-dataproc/test/gapic_node_group_controller_v1.ts create mode 100644 owl-bot-staging/google-cloud-dataproc/test/gapic_session_controller_v1.ts create mode 100644 owl-bot-staging/google-cloud-dataproc/test/gapic_session_template_controller_v1.ts create mode 100644 owl-bot-staging/google-cloud-dataproc/test/gapic_workflow_template_service_v1.ts create mode 100644 owl-bot-staging/google-cloud-dataproc/tsconfig.json create mode 100644 owl-bot-staging/google-cloud-dataproc/webpack.config.js diff --git a/owl-bot-staging/google-cloud-dataproc/.OwlBot.yaml b/owl-bot-staging/google-cloud-dataproc/.OwlBot.yaml new file mode 100644 index 000000000000..eb0d3ad0b3be --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/.OwlBot.yaml @@ -0,0 +1,19 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +deep-copy-regex: + - source: /google/cloud/dataproc/google-cloud-dataproc-nodejs + dest: /owl-bot-staging/google-cloud-dataproc + +api-name: dataproc \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-dataproc/.eslintignore b/owl-bot-staging/google-cloud-dataproc/.eslintignore new file mode 100644 index 000000000000..cfc348ec4d11 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-cloud-dataproc/.eslintrc.json b/owl-bot-staging/google-cloud-dataproc/.eslintrc.json new file mode 100644 index 000000000000..3e8d97ccb390 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/.eslintrc.json @@ -0,0 +1,4 @@ +{ + "extends": "./node_modules/gts", + "root": true +} diff --git a/owl-bot-staging/google-cloud-dataproc/.gitattributes b/owl-bot-staging/google-cloud-dataproc/.gitattributes new file mode 100644 index 000000000000..33739cb74e44 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/.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-dataproc/.gitignore b/owl-bot-staging/google-cloud-dataproc/.gitignore new file mode 100644 index 000000000000..d4f03a0df2e8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/.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-dataproc/.jsdoc.js b/owl-bot-staging/google-cloud-dataproc/.jsdoc.js new file mode 100644 index 000000000000..df3c31bed8ee --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/.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/dataproc', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-cloud-dataproc/.mocharc.js b/owl-bot-staging/google-cloud-dataproc/.mocharc.js new file mode 100644 index 000000000000..5eb34e86c874 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/.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-dataproc/.nycrc b/owl-bot-staging/google-cloud-dataproc/.nycrc new file mode 100644 index 000000000000..81a95fc94b00 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/.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-dataproc/.prettierignore b/owl-bot-staging/google-cloud-dataproc/.prettierignore new file mode 100644 index 000000000000..9340ad9b86d3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/owl-bot-staging/google-cloud-dataproc/.prettierrc.js b/owl-bot-staging/google-cloud-dataproc/.prettierrc.js new file mode 100644 index 000000000000..7649ee3c254e --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/.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-dataproc/CODE_OF_CONDUCT.md b/owl-bot-staging/google-cloud-dataproc/CODE_OF_CONDUCT.md new file mode 100644 index 000000000000..2add2547a812 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/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-dataproc/CONTRIBUTING.md b/owl-bot-staging/google-cloud-dataproc/CONTRIBUTING.md new file mode 100644 index 000000000000..a8b18d88f3a5 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/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 Dataproc 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=dataproc.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-dataproc/LICENSE b/owl-bot-staging/google-cloud-dataproc/LICENSE new file mode 100644 index 000000000000..d64569567334 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/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-dataproc/README.md b/owl-bot-staging/google-cloud-dataproc/README.md new file mode 100644 index 000000000000..f03edb07a90c --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/README.md @@ -0,0 +1,158 @@ +[//]: # "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 Dataproc 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/dataproc.svg)](https://www.npmjs.org/package/@google-cloud/dataproc) + +Cloud Dataproc API client for Node.js + +[//]: # "partials.introduction" + +A comprehensive list of changes in each version may be found in +[the CHANGELOG][homepage_changelog]. + +* [Cloud Dataproc API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/dataproc/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 Dataproc 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/dataproc +``` + +[//]: # "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 | +| --------------------------- | --------------------------------- | +| create autoscaling policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.create_autoscaling_policy.js) | +| delete autoscaling policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.delete_autoscaling_policy.js) | +| get autoscaling policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.get_autoscaling_policy.js) | +| list autoscaling policies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.list_autoscaling_policies.js) | +| update autoscaling policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.update_autoscaling_policy.js) | +| create batch | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/batch_controller.create_batch.js) | +| delete batch | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/batch_controller.delete_batch.js) | +| get batch | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/batch_controller.get_batch.js) | +| list batches | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/batch_controller.list_batches.js) | +| create cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/cluster_controller.create_cluster.js) | +| delete cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/cluster_controller.delete_cluster.js) | +| diagnose cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/cluster_controller.diagnose_cluster.js) | +| get cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/cluster_controller.get_cluster.js) | +| list clusters | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/cluster_controller.list_clusters.js) | +| start cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/cluster_controller.start_cluster.js) | +| stop cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/cluster_controller.stop_cluster.js) | +| update cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/cluster_controller.update_cluster.js) | +| cancel job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/job_controller.cancel_job.js) | +| delete job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/job_controller.delete_job.js) | +| get job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/job_controller.get_job.js) | +| list jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/job_controller.list_jobs.js) | +| submit job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/job_controller.submit_job.js) | +| submit job as operation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/job_controller.submit_job_as_operation.js) | +| update job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/job_controller.update_job.js) | +| create node group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/node_group_controller.create_node_group.js) | +| get node group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/node_group_controller.get_node_group.js) | +| resize node group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/node_group_controller.resize_node_group.js) | +| create session | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/session_controller.create_session.js) | +| delete session | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/session_controller.delete_session.js) | +| get session | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/session_controller.get_session.js) | +| list sessions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/session_controller.list_sessions.js) | +| terminate session | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/session_controller.terminate_session.js) | +| create session template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/session_template_controller.create_session_template.js) | +| delete session template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/session_template_controller.delete_session_template.js) | +| get session template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/session_template_controller.get_session_template.js) | +| list session templates | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/session_template_controller.list_session_templates.js) | +| update session template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/session_template_controller.update_session_template.js) | +| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/snippet_metadata_google.cloud.dataproc.v1.json) | +| create workflow template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/workflow_template_service.create_workflow_template.js) | +| delete workflow template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/workflow_template_service.delete_workflow_template.js) | +| get workflow template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/workflow_template_service.get_workflow_template.js) | +| instantiate inline workflow template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/workflow_template_service.instantiate_inline_workflow_template.js) | +| instantiate workflow template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/workflow_template_service.instantiate_workflow_template.js) | +| list workflow templates | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/workflow_template_service.list_workflow_templates.js) | +| update workflow template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/workflow_template_service.update_workflow_template.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/dataproc@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-dataproc/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-dataproc/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=dataproc.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-dataproc/samples +[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/CHANGELOG.md +[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc diff --git a/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/autoscaling_policies.proto b/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/autoscaling_policies.proto new file mode 100644 index 000000000000..e9d6fa76ff7b --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/autoscaling_policies.proto @@ -0,0 +1,399 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.dataproc.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; + +option go_package = "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpb"; +option java_multiple_files = true; +option java_outer_classname = "AutoscalingPoliciesProto"; +option java_package = "com.google.cloud.dataproc.v1"; +option (google.api.resource_definition) = { + type: "dataproc.googleapis.com/Region" + pattern: "projects/{project}/regions/{region}" +}; + +// The API interface for managing autoscaling policies in the +// Dataproc API. +service AutoscalingPolicyService { + option (google.api.default_host) = "dataproc.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates new autoscaling policy. + rpc CreateAutoscalingPolicy(CreateAutoscalingPolicyRequest) + returns (AutoscalingPolicy) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/autoscalingPolicies" + body: "policy" + additional_bindings { + post: "/v1/{parent=projects/*/regions/*}/autoscalingPolicies" + body: "policy" + } + }; + option (google.api.method_signature) = "parent,policy"; + } + + // Updates (replaces) autoscaling policy. + // + // Disabled check for update_mask, because all updates will be full + // replacements. + rpc UpdateAutoscalingPolicy(UpdateAutoscalingPolicyRequest) + returns (AutoscalingPolicy) { + option (google.api.http) = { + put: "/v1/{policy.name=projects/*/locations/*/autoscalingPolicies/*}" + body: "policy" + additional_bindings { + put: "/v1/{policy.name=projects/*/regions/*/autoscalingPolicies/*}" + body: "policy" + } + }; + option (google.api.method_signature) = "policy"; + } + + // Retrieves autoscaling policy. + rpc GetAutoscalingPolicy(GetAutoscalingPolicyRequest) + returns (AutoscalingPolicy) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/autoscalingPolicies/*}" + additional_bindings { + get: "/v1/{name=projects/*/regions/*/autoscalingPolicies/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Lists autoscaling policies in the project. + rpc ListAutoscalingPolicies(ListAutoscalingPoliciesRequest) + returns (ListAutoscalingPoliciesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/autoscalingPolicies" + additional_bindings { + get: "/v1/{parent=projects/*/regions/*}/autoscalingPolicies" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes an autoscaling policy. It is an error to delete an autoscaling + // policy that is in use by one or more clusters. + rpc DeleteAutoscalingPolicy(DeleteAutoscalingPolicyRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/autoscalingPolicies/*}" + additional_bindings { + delete: "/v1/{name=projects/*/regions/*/autoscalingPolicies/*}" + } + }; + option (google.api.method_signature) = "name"; + } +} + +// Describes an autoscaling policy for Dataproc cluster autoscaler. +message AutoscalingPolicy { + option (google.api.resource) = { + type: "dataproc.googleapis.com/AutoscalingPolicy" + pattern: "projects/{project}/locations/{location}/autoscalingPolicies/{autoscaling_policy}" + pattern: "projects/{project}/regions/{region}/autoscalingPolicies/{autoscaling_policy}" + }; + + // The type of the clusters for which this autoscaling policy is to be + // configured. + enum ClusterType { + // Not set. + CLUSTER_TYPE_UNSPECIFIED = 0; + + // Standard dataproc cluster with a minimum of two primary workers. + STANDARD = 1; + + // Clusters that can use only secondary workers and be scaled down to zero + // secondary worker nodes. + ZERO_SCALE = 2; + } + + // Required. The policy id. + // + // The id must contain only letters (a-z, A-Z), numbers (0-9), + // underscores (_), and hyphens (-). Cannot begin or end with underscore + // or hyphen. Must consist of between 3 and 50 characters. + // + string id = 1; + + // Output only. The "resource name" of the autoscaling policy, as described + // in https://cloud.google.com/apis/design/resource_names. + // + // * For `projects.regions.autoscalingPolicies`, the resource name of the + // policy has the following format: + // `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` + // + // * For `projects.locations.autoscalingPolicies`, the resource name of the + // policy has the following format: + // `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` + string name = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Autoscaling algorithm for policy. + oneof algorithm { + BasicAutoscalingAlgorithm basic_algorithm = 3 + [(google.api.field_behavior) = REQUIRED]; + } + + // Required. Describes how the autoscaler will operate for primary workers. + InstanceGroupAutoscalingPolicyConfig worker_config = 4 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Describes how the autoscaler will operate for secondary workers. + InstanceGroupAutoscalingPolicyConfig secondary_worker_config = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The labels to associate with this autoscaling policy. + // Label **keys** must contain 1 to 63 characters, and must conform to + // [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). + // Label **values** may be empty, but, if present, must contain 1 to 63 + // characters, and must conform to [RFC + // 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be + // associated with an autoscaling policy. + map labels = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The type of the clusters for which this autoscaling policy is to + // be configured. + ClusterType cluster_type = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// Basic algorithm for autoscaling. +message BasicAutoscalingAlgorithm { + oneof config { + // Required. YARN autoscaling configuration. + BasicYarnAutoscalingConfig yarn_config = 1 + [(google.api.field_behavior) = REQUIRED]; + } + + // Optional. Duration between scaling events. A scaling period starts after + // the update operation from the previous event has completed. + // + // Bounds: [2m, 1d]. Default: 2m. + google.protobuf.Duration cooldown_period = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Basic autoscaling configurations for YARN. +message BasicYarnAutoscalingConfig { + // Required. Timeout for YARN graceful decommissioning of Node Managers. + // Specifies the duration to wait for jobs to complete before forcefully + // removing workers (and potentially interrupting jobs). Only applicable to + // downscaling operations. + // + // Bounds: [0s, 1d]. + google.protobuf.Duration graceful_decommission_timeout = 5 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Fraction of average YARN pending memory in the last cooldown + // period for which to add workers. A scale-up factor of 1.0 will result in + // scaling up so that there is no pending memory remaining after the update + // (more aggressive scaling). A scale-up factor closer to 0 will result in a + // smaller magnitude of scaling up (less aggressive scaling). See [How + // autoscaling + // works](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/autoscaling#how_autoscaling_works) + // for more information. + // + // Bounds: [0.0, 1.0]. + double scale_up_factor = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Fraction of average YARN pending memory in the last cooldown + // period for which to remove workers. A scale-down factor of 1 will result in + // scaling down so that there is no available memory remaining after the + // update (more aggressive scaling). A scale-down factor of 0 disables + // removing workers, which can be beneficial for autoscaling a single job. + // See [How autoscaling + // works](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/autoscaling#how_autoscaling_works) + // for more information. + // + // Bounds: [0.0, 1.0]. + double scale_down_factor = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Minimum scale-up threshold as a fraction of total cluster size + // before scaling occurs. For example, in a 20-worker cluster, a threshold of + // 0.1 means the autoscaler must recommend at least a 2-worker scale-up for + // the cluster to scale. A threshold of 0 means the autoscaler will scale up + // on any recommended change. + // + // Bounds: [0.0, 1.0]. Default: 0.0. + double scale_up_min_worker_fraction = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Minimum scale-down threshold as a fraction of total cluster size + // before scaling occurs. For example, in a 20-worker cluster, a threshold of + // 0.1 means the autoscaler must recommend at least a 2 worker scale-down for + // the cluster to scale. A threshold of 0 means the autoscaler will scale down + // on any recommended change. + // + // Bounds: [0.0, 1.0]. Default: 0.0. + double scale_down_min_worker_fraction = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration for the size bounds of an instance group, including its +// proportional size to other groups. +message InstanceGroupAutoscalingPolicyConfig { + // Optional. Minimum number of instances for this group. + // + // Primary workers - Bounds: [2, max_instances]. Default: 2. + // Secondary workers - Bounds: [0, max_instances]. Default: 0. + int32 min_instances = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Maximum number of instances for this group. Required for primary + // workers. Note that by default, clusters will not use secondary workers. + // Required for secondary workers if the minimum secondary instances is set. + // + // Primary workers - Bounds: [min_instances, ). + // Secondary workers - Bounds: [min_instances, ). Default: 0. + int32 max_instances = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Weight for the instance group, which is used to determine the + // fraction of total workers in the cluster from this instance group. + // For example, if primary workers have weight 2, and secondary workers have + // weight 1, the cluster will have approximately 2 primary workers for each + // secondary worker. + // + // The cluster may not reach the specified balance if constrained + // by min/max bounds or other autoscaling settings. For example, if + // `max_instances` for secondary workers is 0, then only primary workers will + // be added. The cluster can also be out of balance when created. + // + // If weight is not set on any instance group, the cluster will default to + // equal weight for all groups: the cluster will attempt to maintain an equal + // number of workers in each group within the configured size bounds for each + // group. If weight is set for one group only, the cluster will default to + // zero weight on the unset group. For example if weight is set only on + // primary workers, the cluster will use primary workers only and no + // secondary workers. + int32 weight = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// A request to create an autoscaling policy. +message CreateAutoscalingPolicyRequest { + // Required. The "resource name" of the region or location, as described + // in https://cloud.google.com/apis/design/resource_names. + // + // * For `projects.regions.autoscalingPolicies.create`, the resource name + // of the region has the following format: + // `projects/{project_id}/regions/{region}` + // + // * For `projects.locations.autoscalingPolicies.create`, the resource name + // of the location has the following format: + // `projects/{project_id}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dataproc.googleapis.com/AutoscalingPolicy" + } + ]; + + // Required. The autoscaling policy to create. + AutoscalingPolicy policy = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A request to fetch an autoscaling policy. +message GetAutoscalingPolicyRequest { + // Required. The "resource name" of the autoscaling policy, as described + // in https://cloud.google.com/apis/design/resource_names. + // + // * For `projects.regions.autoscalingPolicies.get`, the resource name + // of the policy has the following format: + // `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` + // + // * For `projects.locations.autoscalingPolicies.get`, the resource name + // of the policy has the following format: + // `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataproc.googleapis.com/AutoscalingPolicy" + } + ]; +} + +// A request to update an autoscaling policy. +message UpdateAutoscalingPolicyRequest { + // Required. The updated autoscaling policy. + AutoscalingPolicy policy = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// A request to delete an autoscaling policy. +// +// Autoscaling policies in use by one or more clusters will not be deleted. +message DeleteAutoscalingPolicyRequest { + // Required. The "resource name" of the autoscaling policy, as described + // in https://cloud.google.com/apis/design/resource_names. + // + // * For `projects.regions.autoscalingPolicies.delete`, the resource name + // of the policy has the following format: + // `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` + // + // * For `projects.locations.autoscalingPolicies.delete`, the resource name + // of the policy has the following format: + // `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataproc.googleapis.com/AutoscalingPolicy" + } + ]; +} + +// A request to list autoscaling policies in a project. +message ListAutoscalingPoliciesRequest { + // Required. The "resource name" of the region or location, as described + // in https://cloud.google.com/apis/design/resource_names. + // + // * For `projects.regions.autoscalingPolicies.list`, the resource name + // of the region has the following format: + // `projects/{project_id}/regions/{region}` + // + // * For `projects.locations.autoscalingPolicies.list`, the resource name + // of the location has the following format: + // `projects/{project_id}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dataproc.googleapis.com/AutoscalingPolicy" + } + ]; + + // Optional. The maximum number of results to return in each response. + // Must be less than or equal to 1000. Defaults to 100. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The page token, returned by a previous call, to request the + // next page of results. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// A response to a request to list autoscaling policies in a project. +message ListAutoscalingPoliciesResponse { + // Output only. Autoscaling policies list. + repeated AutoscalingPolicy policies = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. This token is included in the response if there are more + // results to fetch. + string next_page_token = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/batches.proto b/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/batches.proto new file mode 100644 index 000000000000..04bec6acd990 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/batches.proto @@ -0,0 +1,436 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.dataproc.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dataproc/v1/shared.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpb"; +option java_multiple_files = true; +option java_outer_classname = "BatchesProto"; +option java_package = "com.google.cloud.dataproc.v1"; + +// The BatchController provides methods to manage batch workloads. +service BatchController { + option (google.api.default_host) = "dataproc.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a batch workload that executes asynchronously. + rpc CreateBatch(CreateBatchRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/batches" + body: "batch" + }; + option (google.api.method_signature) = "parent,batch,batch_id"; + option (google.longrunning.operation_info) = { + response_type: "Batch" + metadata_type: "google.cloud.dataproc.v1.BatchOperationMetadata" + }; + } + + // Gets the batch workload resource representation. + rpc GetBatch(GetBatchRequest) returns (Batch) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/batches/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists batch workloads. + rpc ListBatches(ListBatchesRequest) returns (ListBatchesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/batches" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes the batch workload resource. If the batch is not in terminal state, + // the delete fails and the response returns `FAILED_PRECONDITION`. + rpc DeleteBatch(DeleteBatchRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/batches/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// A request to create a batch workload. +message CreateBatchRequest { + // Required. The parent resource where this batch will be created. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dataproc.googleapis.com/Batch" + } + ]; + + // Required. The batch to create. + Batch batch = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The ID to use for the batch, which will become the final + // component of the batch's resource name. + // + // This value must be 4-63 characters. Valid characters are `/[a-z][0-9]-/`. + string batch_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A unique ID used to identify the request. If the service + // receives two + // [CreateBatchRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateBatchRequest)s + // with the same request_id, the second request is ignored and the + // Operation that corresponds to the first Batch created and stored + // in the backend is returned. + // + // Recommendation: Set this value to a + // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + // + // The value must contain only letters (a-z, A-Z), numbers (0-9), + // underscores (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// A request to get the resource representation for a batch workload. +message GetBatchRequest { + // Required. The fully qualified name of the batch to retrieve + // in the format + // "projects/PROJECT_ID/locations/DATAPROC_REGION/batches/BATCH_ID" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dataproc.googleapis.com/Batch" } + ]; +} + +// A request to list batch workloads in a project. +message ListBatchesRequest { + // Required. The parent, which owns this collection of batches. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dataproc.googleapis.com/Batch" + } + ]; + + // Optional. The maximum number of batches to return in each response. + // The service may return fewer than this value. + // The default page size is 20; the maximum page size is 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token received from a previous `ListBatches` call. + // Provide this token to retrieve the subsequent page. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A filter for the batches to return in the response. + // + // A filter is a logical expression constraining the values of various fields + // in each batch resource. Filters are case sensitive, and may contain + // multiple clauses combined with logical operators (AND/OR). + // Supported fields are `batch_id`, `batch_uuid`, `state`, and `create_time`. + // + // e.g. `state = RUNNING and create_time < "2023-01-01T00:00:00Z"` + // filters for batches in state RUNNING that were created before 2023-01-01 + // + // See https://google.aip.dev/assets/misc/ebnf-filtering.txt for a detailed + // description of the filter syntax and a list of supported comparisons. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field(s) on which to sort the list of batches. + // + // Currently the only supported sort orders are unspecified (empty) and + // `create_time desc` to sort by most recently created batches first. + // + // See https://google.aip.dev/132#ordering for more details. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// A list of batch workloads. +message ListBatchesResponse { + // The batches from the specified collection. + repeated Batch batches = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Output only. List of Batches that could not be included in the response. + // Attempting to get one of these resources may indicate why it was not + // included in the list response. + repeated string unreachable = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A request to delete a batch workload. +message DeleteBatchRequest { + // Required. The fully qualified name of the batch to retrieve + // in the format + // "projects/PROJECT_ID/locations/DATAPROC_REGION/batches/BATCH_ID" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "dataproc.googleapis.com/Batch" } + ]; +} + +// A representation of a batch workload in the service. +message Batch { + option (google.api.resource) = { + type: "dataproc.googleapis.com/Batch" + pattern: "projects/{project}/locations/{location}/batches/{batch}" + }; + + // The batch state. + enum State { + // The batch state is unknown. + STATE_UNSPECIFIED = 0; + + // The batch is created before running. + PENDING = 1; + + // The batch is running. + RUNNING = 2; + + // The batch is cancelling. + CANCELLING = 3; + + // The batch cancellation was successful. + CANCELLED = 4; + + // The batch completed successfully. + SUCCEEDED = 5; + + // The batch is no longer running due to an error. + FAILED = 6; + } + + // Historical state information. + message StateHistory { + // Output only. The state of the batch at this point in history. + State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Details about the state at this point in history. + string state_message = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the batch entered the historical state. + google.protobuf.Timestamp state_start_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The resource name of the batch. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A batch UUID (Unique Universal Identifier). The service + // generates this value when it creates the batch. + string uuid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the batch was created. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The application/framework-specific portion of the batch configuration. + oneof batch_config { + // Optional. PySpark batch config. + PySparkBatch pyspark_batch = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Spark batch config. + SparkBatch spark_batch = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. SparkR batch config. + SparkRBatch spark_r_batch = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. SparkSql batch config. + SparkSqlBatch spark_sql_batch = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. PySpark notebook batch config. + PySparkNotebookBatch pyspark_notebook_batch = 19 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Output only. Runtime information about batch execution. + RuntimeInfo runtime_info = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The state of the batch. + State state = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Batch state details, such as a failure + // description if the state is `FAILED`. + string state_message = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the batch entered a current state. + google.protobuf.Timestamp state_time = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The email address of the user who created the batch. + string creator = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The labels to associate with this batch. + // Label **keys** must contain 1 to 63 characters, and must conform to + // [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). + // Label **values** may be empty, but, if present, must contain 1 to 63 + // characters, and must conform to [RFC + // 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be + // associated with a batch. + map labels = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Runtime configuration for the batch execution. + RuntimeConfig runtime_config = 14 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Environment configuration for the batch execution. + EnvironmentConfig environment_config = 15 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The resource name of the operation associated with this batch. + string operation = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Historical state information for the batch. + repeated StateHistory state_history = 17 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A configuration for running an +// [Apache +// PySpark](https://spark.apache.org/docs/latest/api/python/getting_started/quickstart.html) +// batch workload. +message PySparkBatch { + // Required. The HCFS URI of the main Python file to use as the Spark driver. + // Must be a .py file. + string main_python_file_uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The arguments to pass to the driver. Do not include arguments + // that can be set as batch properties, such as `--conf`, since a collision + // can occur that causes an incorrect batch submission. + repeated string args = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HCFS file URIs of Python files to pass to the PySpark + // framework. Supported file types: `.py`, `.egg`, and `.zip`. + repeated string python_file_uris = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HCFS URIs of jar files to add to the classpath of the + // Spark driver and tasks. + repeated string jar_file_uris = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HCFS URIs of files to be placed in the working directory of + // each executor. + repeated string file_uris = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HCFS URIs of archives to be extracted into the working directory + // of each executor. Supported file types: + // `.jar`, `.tar`, `.tar.gz`, `.tgz`, and `.zip`. + repeated string archive_uris = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// A configuration for running an [Apache Spark](https://spark.apache.org/) +// batch workload. +message SparkBatch { + // The specification of the main method to call to drive the Spark + // workload. Specify either the jar file that contains the main class or the + // main class name. To pass both a main jar and a main class in that jar, add + // the jar to `jar_file_uris`, and then specify the main class + // name in `main_class`. + oneof driver { + // Optional. The HCFS URI of the jar file that contains the main class. + string main_jar_file_uri = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of the driver main class. The jar file that contains + // the class must be in the classpath or specified in `jar_file_uris`. + string main_class = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The arguments to pass to the driver. Do not include arguments + // that can be set as batch properties, such as `--conf`, since a collision + // can occur that causes an incorrect batch submission. + repeated string args = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HCFS URIs of jar files to add to the classpath of the + // Spark driver and tasks. + repeated string jar_file_uris = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HCFS URIs of files to be placed in the working directory of + // each executor. + repeated string file_uris = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HCFS URIs of archives to be extracted into the working directory + // of each executor. Supported file types: + // `.jar`, `.tar`, `.tar.gz`, `.tgz`, and `.zip`. + repeated string archive_uris = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// A configuration for running an +// [Apache SparkR](https://spark.apache.org/docs/latest/sparkr.html) +// batch workload. +message SparkRBatch { + // Required. The HCFS URI of the main R file to use as the driver. + // Must be a `.R` or `.r` file. + string main_r_file_uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The arguments to pass to the Spark driver. Do not include + // arguments that can be set as batch properties, such as `--conf`, since a + // collision can occur that causes an incorrect batch submission. + repeated string args = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HCFS URIs of files to be placed in the working directory of + // each executor. + repeated string file_uris = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HCFS URIs of archives to be extracted into the working directory + // of each executor. Supported file types: + // `.jar`, `.tar`, `.tar.gz`, `.tgz`, and `.zip`. + repeated string archive_uris = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// A configuration for running +// [Apache Spark SQL](https://spark.apache.org/sql/) queries as a batch +// workload. +message SparkSqlBatch { + // Required. The HCFS URI of the script that contains Spark SQL queries to + // execute. + string query_file_uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Mapping of query variable names to values (equivalent to the + // Spark SQL command: `SET name="value";`). + map query_variables = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH. + repeated string jar_file_uris = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// A configuration for running a PySpark Notebook batch workload. +message PySparkNotebookBatch { + // Required. The HCFS URI of the notebook file to execute. + string notebook_file_uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The parameters to pass to the notebook. + map params = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HCFS URIs of Python files to pass to the PySpark framework. + repeated string python_file_uris = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH. + repeated string jar_file_uris = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HCFS URIs of files to be placed in the working directory of + // each executor + repeated string file_uris = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HCFS URIs of archives to be extracted into the working directory + // of each executor. Supported file types: + // `.jar`, `.tar`, `.tar.gz`, `.tgz`, and `.zip`. + repeated string archive_uris = 6 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/clusters.proto b/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/clusters.proto new file mode 100644 index 000000000000..f1bc59a225e6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/clusters.proto @@ -0,0 +1,1791 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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.dataproc.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dataproc/v1/operations.proto"; +import "google/cloud/dataproc/v1/shared.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; +import "google/type/interval.proto"; + +option go_package = "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpb"; +option java_multiple_files = true; +option java_outer_classname = "ClustersProto"; +option java_package = "com.google.cloud.dataproc.v1"; + +// The ClusterControllerService provides methods to manage clusters +// of Compute Engine instances. +service ClusterController { + option (google.api.default_host) = "dataproc.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a cluster in a project. The returned + // [Operation.metadata][google.longrunning.Operation.metadata] will be + // [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). + rpc CreateCluster(CreateClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/projects/{project_id}/regions/{region}/clusters" + body: "cluster" + }; + option (google.api.method_signature) = "project_id,region,cluster"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "google.cloud.dataproc.v1.ClusterOperationMetadata" + }; + } + + // Updates a cluster in a project. The returned + // [Operation.metadata][google.longrunning.Operation.metadata] will be + // [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). + // The cluster must be in a + // [`RUNNING`][google.cloud.dataproc.v1.ClusterStatus.State] state or an error + // is returned. + rpc UpdateCluster(UpdateClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}" + body: "cluster" + }; + option (google.api.method_signature) = + "project_id,region,cluster_name,cluster,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "google.cloud.dataproc.v1.ClusterOperationMetadata" + }; + } + + // Stops a cluster in a project. + rpc StopCluster(StopClusterRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:stop" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "google.cloud.dataproc.v1.ClusterOperationMetadata" + }; + } + + // Starts a cluster in a project. + rpc StartCluster(StartClusterRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:start" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "google.cloud.dataproc.v1.ClusterOperationMetadata" + }; + } + + // Deletes a cluster in a project. The returned + // [Operation.metadata][google.longrunning.Operation.metadata] will be + // [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). + rpc DeleteCluster(DeleteClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}" + }; + option (google.api.method_signature) = "project_id,region,cluster_name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.dataproc.v1.ClusterOperationMetadata" + }; + } + + // Gets the resource representation for a cluster in a project. + rpc GetCluster(GetClusterRequest) returns (Cluster) { + option (google.api.http) = { + get: "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}" + }; + option (google.api.method_signature) = "project_id,region,cluster_name"; + } + + // Lists all regions/{region}/clusters in a project alphabetically. + rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) { + option (google.api.http) = { + get: "/v1/projects/{project_id}/regions/{region}/clusters" + }; + option (google.api.method_signature) = "project_id,region"; + option (google.api.method_signature) = "project_id,region,filter"; + } + + // Gets cluster diagnostic information. The returned + // [Operation.metadata][google.longrunning.Operation.metadata] will be + // [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). + // After the operation completes, + // [Operation.response][google.longrunning.Operation.response] + // contains + // [DiagnoseClusterResults](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults). + rpc DiagnoseCluster(DiagnoseClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:diagnose" + body: "*" + }; + option (google.api.method_signature) = "project_id,region,cluster_name"; + option (google.longrunning.operation_info) = { + response_type: "DiagnoseClusterResults" + metadata_type: "google.cloud.dataproc.v1.ClusterOperationMetadata" + }; + } +} + +// Describes the identifying information, config, and status of +// a Dataproc cluster +message Cluster { + // Required. The Google Cloud Platform project ID that the cluster belongs to. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The cluster name, which must be unique within a project. + // The name must start with a lowercase letter, and can contain + // up to 51 lowercase letters, numbers, and hyphens. It cannot end + // with a hyphen. The name of a deleted cluster can be reused. + string cluster_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The cluster config for a cluster of Compute Engine Instances. + // Note that Dataproc may set default values, and values may change + // when clusters are updated. + // + // Exactly one of ClusterConfig or VirtualClusterConfig must be specified. + ClusterConfig config = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The virtual cluster config is used when creating a Dataproc + // cluster that does not directly control the underlying compute resources, + // for example, when creating a [Dataproc-on-GKE + // cluster](https://cloud.google.com/dataproc/docs/guides/dpgke/dataproc-gke-overview). + // Dataproc may set default values, and values may change when + // clusters are updated. Exactly one of + // [config][google.cloud.dataproc.v1.Cluster.config] or + // [virtual_cluster_config][google.cloud.dataproc.v1.Cluster.virtual_cluster_config] + // must be specified. + VirtualClusterConfig virtual_cluster_config = 10 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The labels to associate with this cluster. + // Label **keys** must contain 1 to 63 characters, and must conform to + // [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). + // Label **values** may be empty, but, if present, must contain 1 to 63 + // characters, and must conform to [RFC + // 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be + // associated with a cluster. + map labels = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Cluster status. + ClusterStatus status = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The previous cluster status. + repeated ClusterStatus status_history = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A cluster UUID (Unique Universal Identifier). Dataproc + // generates this value when it creates the cluster. + string cluster_uuid = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Contains cluster daemon metrics such as HDFS and YARN stats. + // + // **Beta Feature**: This report is available for testing purposes only. It + // may be changed before final release. + ClusterMetrics metrics = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The cluster config. +message ClusterConfig { + // The type of the cluster. + enum ClusterType { + // Not set. + CLUSTER_TYPE_UNSPECIFIED = 0; + + // Standard dataproc cluster with a minimum of two primary workers. + STANDARD = 1; + + // https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/single-node-clusters + SINGLE_NODE = 2; + + // Clusters that can use only secondary workers and be scaled down to zero + // secondary worker nodes. + ZERO_SCALE = 3; + } + + // The cluster tier. + enum ClusterTier { + // Not set. Works the same as CLUSTER_TIER_STANDARD. + CLUSTER_TIER_UNSPECIFIED = 0; + + // Standard Dataproc cluster. + CLUSTER_TIER_STANDARD = 1; + + // Premium Dataproc cluster. + CLUSTER_TIER_PREMIUM = 2; + } + + // The cluster engine. + enum Engine { + // The engine is not specified. Works the same as ENGINE_DEFAULT. + ENGINE_UNSPECIFIED = 0; + + // The cluster is a default engine cluster. + DEFAULT = 1; + + // The cluster is a lightning engine cluster. + LIGHTNING = 2; + } + + // Optional. The type of the cluster. + ClusterType cluster_type = 27 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The cluster tier. + ClusterTier cluster_tier = 29 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The cluster engine. + Engine engine = 30 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A Cloud Storage bucket used to stage job + // dependencies, config files, and job driver console output. + // If you do not specify a staging bucket, Cloud + // Dataproc will determine a Cloud Storage location (US, + // ASIA, or EU) for your cluster's staging bucket according to the + // Compute Engine zone where your cluster is deployed, and then create + // and manage this project-level, per-location bucket (see + // [Dataproc staging and temp + // buckets](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/staging-bucket)). + // **This field requires a Cloud Storage bucket name, not a `gs://...` URI to + // a Cloud Storage bucket.** + string config_bucket = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A Cloud Storage bucket used to store ephemeral cluster and jobs + // data, such as Spark and MapReduce history files. If you do not specify a + // temp bucket, Dataproc will determine a Cloud Storage location (US, ASIA, or + // EU) for your cluster's temp bucket according to the Compute Engine zone + // where your cluster is deployed, and then create and manage this + // project-level, per-location bucket. The default bucket has a TTL of 90 + // days, but you can use any TTL (or none) if you specify a bucket (see + // [Dataproc staging and temp + // buckets](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/staging-bucket)). + // **This field requires a Cloud Storage bucket name, not a `gs://...` URI to + // a Cloud Storage bucket.** + string temp_bucket = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The shared Compute Engine config settings for + // all instances in a cluster. + GceClusterConfig gce_cluster_config = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Compute Engine config settings for + // the cluster's master instance. + InstanceGroupConfig master_config = 9 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Compute Engine config settings for + // the cluster's worker instances. + InstanceGroupConfig worker_config = 10 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Compute Engine config settings for + // a cluster's secondary worker instances + InstanceGroupConfig secondary_worker_config = 12 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The config settings for cluster software. + SoftwareConfig software_config = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Commands to execute on each node after config is + // completed. By default, executables are run on master and all worker nodes. + // You can test a node's `role` metadata to run an executable on + // a master or worker node, as shown below using `curl` (you can also use + // `wget`): + // + // ROLE=$(curl -H Metadata-Flavor:Google + // http://metadata/computeMetadata/v1/instance/attributes/dataproc-role) + // if [[ "${ROLE}" == 'Master' ]]; then + // ... master specific actions ... + // else + // ... worker specific actions ... + // fi + repeated NodeInitializationAction initialization_actions = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Encryption settings for the cluster. + EncryptionConfig encryption_config = 15 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Autoscaling config for the policy associated with the cluster. + // Cluster does not autoscale if this field is unset. + AutoscalingConfig autoscaling_config = 18 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Security settings for the cluster. + SecurityConfig security_config = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Lifecycle setting for the cluster. + LifecycleConfig lifecycle_config = 17 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Port/endpoint configuration for this cluster + EndpointConfig endpoint_config = 19 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Metastore configuration. + MetastoreConfig metastore_config = 20 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The config for Dataproc metrics. + DataprocMetricConfig dataproc_metric_config = 23 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The node group settings. + repeated AuxiliaryNodeGroup auxiliary_node_groups = 25 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The Dataproc cluster config for a cluster that does not directly control the +// underlying compute resources, such as a [Dataproc-on-GKE +// cluster](https://cloud.google.com/dataproc/docs/guides/dpgke/dataproc-gke-overview). +message VirtualClusterConfig { + // Optional. A Cloud Storage bucket used to stage job + // dependencies, config files, and job driver console output. + // If you do not specify a staging bucket, Cloud + // Dataproc will determine a Cloud Storage location (US, + // ASIA, or EU) for your cluster's staging bucket according to the + // Compute Engine zone where your cluster is deployed, and then create + // and manage this project-level, per-location bucket (see + // [Dataproc staging and temp + // buckets](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/staging-bucket)). + // **This field requires a Cloud Storage bucket name, not a `gs://...` URI to + // a Cloud Storage bucket.** + string staging_bucket = 1 [(google.api.field_behavior) = OPTIONAL]; + + oneof infrastructure_config { + // Required. The configuration for running the Dataproc cluster on + // Kubernetes. + KubernetesClusterConfig kubernetes_cluster_config = 6 + [(google.api.field_behavior) = REQUIRED]; + } + + // Optional. Configuration of auxiliary services used by this cluster. + AuxiliaryServicesConfig auxiliary_services_config = 7 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Auxiliary services configuration for a Cluster. +message AuxiliaryServicesConfig { + // Optional. The Hive Metastore configuration for this workload. + MetastoreConfig metastore_config = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Spark History Server configuration for the workload. + SparkHistoryServerConfig spark_history_server_config = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Endpoint config for this cluster +message EndpointConfig { + // Output only. The map of port descriptions to URLs. Will only be populated + // if enable_http_port_access is true. + map http_ports = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. If true, enable http access to specific ports on the cluster + // from external sources. Defaults to false. + bool enable_http_port_access = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Autoscaling Policy config associated with the cluster. +message AutoscalingConfig { + // Optional. The autoscaling policy used by the cluster. + // + // Only resource names including projectid and location (region) are valid. + // Examples: + // + // * `https://www.googleapis.com/compute/v1/projects/[project_id]/locations/[dataproc_region]/autoscalingPolicies/[policy_id]` + // * `projects/[project_id]/locations/[dataproc_region]/autoscalingPolicies/[policy_id]` + // + // Note that the policy must be in the same project and Dataproc region. + string policy_uri = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Encryption settings for the cluster. +message EncryptionConfig { + // Optional. The Cloud KMS key resource name to use for persistent disk + // encryption for all instances in the cluster. See [Use CMEK with cluster + // data] + // (https://cloud.google.com//dataproc/docs/concepts/configuring-clusters/customer-managed-encryption#use_cmek_with_cluster_data) + // for more information. + string gce_pd_kms_key_name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Cloud KMS key resource name to use for cluster persistent + // disk and job argument encryption. See [Use CMEK with cluster data] + // (https://cloud.google.com//dataproc/docs/concepts/configuring-clusters/customer-managed-encryption#use_cmek_with_cluster_data) + // for more information. + // + // When this key resource name is provided, the following job arguments of + // the following job types submitted to the cluster are encrypted using CMEK: + // + // * [FlinkJob + // args](https://cloud.google.com/dataproc/docs/reference/rest/v1/FlinkJob) + // * [HadoopJob + // args](https://cloud.google.com/dataproc/docs/reference/rest/v1/HadoopJob) + // * [SparkJob + // args](https://cloud.google.com/dataproc/docs/reference/rest/v1/SparkJob) + // * [SparkRJob + // args](https://cloud.google.com/dataproc/docs/reference/rest/v1/SparkRJob) + // * [PySparkJob + // args](https://cloud.google.com/dataproc/docs/reference/rest/v1/PySparkJob) + // * [SparkSqlJob](https://cloud.google.com/dataproc/docs/reference/rest/v1/SparkSqlJob) + // scriptVariables and queryList.queries + // * [HiveJob](https://cloud.google.com/dataproc/docs/reference/rest/v1/HiveJob) + // scriptVariables and queryList.queries + // * [PigJob](https://cloud.google.com/dataproc/docs/reference/rest/v1/PigJob) + // scriptVariables and queryList.queries + // * [PrestoJob](https://cloud.google.com/dataproc/docs/reference/rest/v1/PrestoJob) + // scriptVariables and queryList.queries + string kms_key = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; +} + +// Common config settings for resources of Compute Engine cluster +// instances, applicable to all instances in the cluster. +message GceClusterConfig { + // `PrivateIpv6GoogleAccess` controls whether and how Dataproc cluster nodes + // can communicate with Google Services through gRPC over IPv6. + // These values are directly mapped to corresponding values in the + // [Compute Engine Instance + // fields](https://cloud.google.com/compute/docs/reference/rest/v1/instances). + enum PrivateIpv6GoogleAccess { + // If unspecified, Compute Engine default behavior will apply, which + // is the same as + // [INHERIT_FROM_SUBNETWORK][google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccess.INHERIT_FROM_SUBNETWORK]. + PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED = 0; + + // Private access to and from Google Services configuration + // inherited from the subnetwork configuration. This is the + // default Compute Engine behavior. + INHERIT_FROM_SUBNETWORK = 1; + + // Enables outbound private IPv6 access to Google Services from the Dataproc + // cluster. + OUTBOUND = 2; + + // Enables bidirectional private IPv6 access between Google Services and the + // Dataproc cluster. + BIDIRECTIONAL = 3; + } + + // Optional. The Compute Engine zone where the Dataproc cluster will be + // located. If omitted, the service will pick a zone in the cluster's Compute + // Engine region. On a get request, zone will always be present. + // + // A full URL, partial URI, or short name are valid. Examples: + // + // * `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]` + // * `projects/[project_id]/zones/[zone]` + // * `[zone]` + string zone_uri = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Compute Engine network to be used for machine + // communications. Cannot be specified with subnetwork_uri. If neither + // `network_uri` nor `subnetwork_uri` is specified, the "default" network of + // the project is used, if it exists. Cannot be a "Custom Subnet Network" (see + // [Using Subnetworks](https://cloud.google.com/compute/docs/subnetworks) for + // more information). + // + // A full URL, partial URI, or short name are valid. Examples: + // + // * `https://www.googleapis.com/compute/v1/projects/[project_id]/global/networks/default` + // * `projects/[project_id]/global/networks/default` + // * `default` + string network_uri = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Compute Engine subnetwork to be used for machine + // communications. Cannot be specified with network_uri. + // + // A full URL, partial URI, or short name are valid. Examples: + // + // * `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/[region]/subnetworks/sub0` + // * `projects/[project_id]/regions/[region]/subnetworks/sub0` + // * `sub0` + string subnetwork_uri = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This setting applies to subnetwork-enabled networks. It is set to + // `true` by default in clusters created with image versions 2.2.x. + // + // When set to `true`: + // + // * All cluster VMs have internal IP addresses. + // * [Google Private Access] + // (https://cloud.google.com/vpc/docs/private-google-access) + // must be enabled to access Dataproc and other Google Cloud APIs. + // * Off-cluster dependencies must be configured to be accessible + // without external IP addresses. + // + // When set to `false`: + // + // * Cluster VMs are not restricted to internal IP addresses. + // * Ephemeral external IP addresses are assigned to each cluster VM. + optional bool internal_ip_only = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The type of IPv6 access for a cluster. + PrivateIpv6GoogleAccess private_ipv6_google_access = 12 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The [Dataproc service + // account](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/service-accounts#service_accounts_in_dataproc) + // (also see [VM Data Plane + // identity](https://cloud.google.com/dataproc/docs/concepts/iam/dataproc-principals#vm_service_account_data_plane_identity)) + // used by Dataproc cluster VM instances to access Google Cloud Platform + // services. + // + // If not specified, the + // [Compute Engine default service + // account](https://cloud.google.com/compute/docs/access/service-accounts#default_service_account) + // is used. + string service_account = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The URIs of service account scopes to be included in + // Compute Engine instances. The following base set of scopes is always + // included: + // + // * https://www.googleapis.com/auth/cloud.useraccounts.readonly + // * https://www.googleapis.com/auth/devstorage.read_write + // * https://www.googleapis.com/auth/logging.write + // + // If no scopes are specified, the following defaults are also provided: + // + // * https://www.googleapis.com/auth/bigquery + // * https://www.googleapis.com/auth/bigtable.admin.table + // * https://www.googleapis.com/auth/bigtable.data + // * https://www.googleapis.com/auth/devstorage.full_control + repeated string service_account_scopes = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // The Compute Engine network tags to add to all instances (see [Tagging + // instances](https://cloud.google.com/vpc/docs/add-remove-network-tags)). + repeated string tags = 4; + + // Optional. The Compute Engine metadata entries to add to all instances (see + // [Project and instance + // metadata](https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)). + map metadata = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Reservation Affinity for consuming Zonal reservation. + ReservationAffinity reservation_affinity = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Node Group Affinity for sole-tenant clusters. + NodeGroupAffinity node_group_affinity = 13 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Shielded Instance Config for clusters using [Compute Engine + // Shielded + // VMs](https://cloud.google.com/security/shielded-cloud/shielded-vm). + ShieldedInstanceConfig shielded_instance_config = 14 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Confidential Instance Config for clusters using [Confidential + // VMs](https://cloud.google.com/compute/confidential-vm/docs). + ConfidentialInstanceConfig confidential_instance_config = 15 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Node Group Affinity for clusters using sole-tenant node groups. +// **The Dataproc `NodeGroupAffinity` resource is not related to the +// Dataproc [NodeGroup][google.cloud.dataproc.v1.NodeGroup] resource.** +message NodeGroupAffinity { + // Required. The URI of a + // sole-tenant [node group + // resource](https://cloud.google.com/compute/docs/reference/rest/v1/nodeGroups) + // that the cluster will be created on. + // + // A full URL, partial URI, or node group name are valid. Examples: + // + // * `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]/nodeGroups/node-group-1` + // * `projects/[project_id]/zones/[zone]/nodeGroups/node-group-1` + // * `node-group-1` + string node_group_uri = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Shielded Instance Config for clusters using [Compute Engine Shielded +// VMs](https://cloud.google.com/security/shielded-cloud/shielded-vm). +message ShieldedInstanceConfig { + // Optional. Defines whether instances have Secure Boot enabled. + optional bool enable_secure_boot = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Defines whether instances have the vTPM enabled. + optional bool enable_vtpm = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Defines whether instances have integrity monitoring enabled. + optional bool enable_integrity_monitoring = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Confidential Instance Config for clusters using [Confidential +// VMs](https://cloud.google.com/compute/confidential-vm/docs) +message ConfidentialInstanceConfig { + // Optional. Defines whether the instance should have confidential compute + // enabled. + bool enable_confidential_compute = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// The config settings for Compute Engine resources in +// an instance group, such as a master or worker group. +message InstanceGroupConfig { + // Controls the use of preemptible instances within the group. + enum Preemptibility { + // Preemptibility is unspecified, the system will choose the + // appropriate setting for each instance group. + PREEMPTIBILITY_UNSPECIFIED = 0; + + // Instances are non-preemptible. + // + // This option is allowed for all instance groups and is the only valid + // value for Master and Worker instance groups. + NON_PREEMPTIBLE = 1; + + // Instances are [preemptible] + // (https://cloud.google.com/compute/docs/instances/preemptible). + // + // This option is allowed only for [secondary worker] + // (https://cloud.google.com/dataproc/docs/concepts/compute/secondary-vms) + // groups. + PREEMPTIBLE = 2; + + // Instances are [Spot VMs] + // (https://cloud.google.com/compute/docs/instances/spot). + // + // This option is allowed only for [secondary worker] + // (https://cloud.google.com/dataproc/docs/concepts/compute/secondary-vms) + // groups. Spot VMs are the latest version of [preemptible VMs] + // (https://cloud.google.com/compute/docs/instances/preemptible), and + // provide additional features. + SPOT = 3; + } + + // Optional. The number of VM instances in the instance group. + // For [HA + // cluster](/dataproc/docs/concepts/configuring-clusters/high-availability) + // [master_config](#FIELDS.master_config) groups, **must be set to 3**. + // For standard cluster [master_config](#FIELDS.master_config) groups, + // **must be set to 1**. + int32 num_instances = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The list of instance names. Dataproc derives the names + // from `cluster_name`, `num_instances`, and the instance group. + repeated string instance_names = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of references to Compute Engine instances. + repeated InstanceReference instance_references = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The Compute Engine image resource used for cluster instances. + // + // The URI can represent an image or image family. + // + // Image examples: + // + // * `https://www.googleapis.com/compute/v1/projects/[project_id]/global/images/[image-id]` + // * `projects/[project_id]/global/images/[image-id]` + // * `image-id` + // + // Image family examples. Dataproc will use the most recent + // image from the family: + // + // * `https://www.googleapis.com/compute/v1/projects/[project_id]/global/images/family/[custom-image-family-name]` + // * `projects/[project_id]/global/images/family/[custom-image-family-name]` + // + // If the URI is unspecified, it will be inferred from + // `SoftwareConfig.image_version` or the system default. + string image_uri = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Compute Engine machine type used for cluster instances. + // + // A full URL, partial URI, or short name are valid. Examples: + // + // * `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]/machineTypes/n1-standard-2` + // * `projects/[project_id]/zones/[zone]/machineTypes/n1-standard-2` + // * `n1-standard-2` + // + // **Auto Zone Exception**: If you are using the Dataproc + // [Auto Zone + // Placement](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/auto-zone#using_auto_zone_placement) + // feature, you must use the short name of the machine type + // resource, for example, `n1-standard-2`. + string machine_type_uri = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Disk option config settings. + DiskConfig disk_config = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Specifies that this instance group contains preemptible + // instances. + bool is_preemptible = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Specifies the preemptibility of the instance group. + // + // The default value for master and worker groups is + // `NON_PREEMPTIBLE`. This default cannot be changed. + // + // The default value for secondary instances is + // `PREEMPTIBLE`. + Preemptibility preemptibility = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The config for Compute Engine Instance Group + // Manager that manages this group. + // This is only used for preemptible instance groups. + ManagedGroupConfig managed_group_config = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The Compute Engine accelerator configuration for these + // instances. + repeated AcceleratorConfig accelerators = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the minimum cpu platform for the Instance Group. + // See [Dataproc -> Minimum CPU + // Platform](https://cloud.google.com/dataproc/docs/concepts/compute/dataproc-min-cpu). + string min_cpu_platform = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The minimum number of primary worker instances to create. + // If `min_num_instances` is set, cluster creation will succeed if + // the number of primary workers created is at least equal to the + // `min_num_instances` number. + // + // Example: Cluster creation request with `num_instances` = `5` and + // `min_num_instances` = `3`: + // + // * If 4 VMs are created and 1 instance fails, + // the failed VM is deleted. The cluster is + // resized to 4 instances and placed in a `RUNNING` state. + // * If 2 instances are created and 3 instances fail, + // the cluster in placed in an `ERROR` state. The failed VMs + // are not deleted. + int32 min_num_instances = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Instance flexibility Policy allowing a mixture of VM shapes and + // provisioning models. + InstanceFlexibilityPolicy instance_flexibility_policy = 13 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration to handle the startup of instances during cluster + // create and update process. + StartupConfig startup_config = 14 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration to handle the startup of instances during cluster create and +// update process. +message StartupConfig { + // Optional. The config setting to enable cluster creation/ updation to be + // successful only after required_registration_fraction of instances are up + // and running. This configuration is applicable to only secondary workers for + // now. The cluster will fail if required_registration_fraction of instances + // are not available. This will include instance creation, agent registration, + // and service registration (if enabled). + optional double required_registration_fraction = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A reference to a Compute Engine instance. +message InstanceReference { + // The user-friendly name of the Compute Engine instance. + string instance_name = 1; + + // The unique identifier of the Compute Engine instance. + string instance_id = 2; + + // The public RSA key used for sharing data with this instance. + string public_key = 3; + + // The public ECIES key used for sharing data with this instance. + string public_ecies_key = 4; +} + +// Specifies the resources used to actively manage an instance group. +message ManagedGroupConfig { + // Output only. The name of the Instance Template used for the Managed + // Instance Group. + string instance_template_name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The name of the Instance Group Manager for this group. + string instance_group_manager_name = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The partial URI to the instance group manager for this group. + // E.g. projects/my-project/regions/us-central1/instanceGroupManagers/my-igm. + string instance_group_manager_uri = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Instance flexibility Policy allowing a mixture of VM shapes and provisioning +// models. +message InstanceFlexibilityPolicy { + // Defines how Dataproc should create VMs with a mixture of provisioning + // models. + message ProvisioningModelMix { + // Optional. The base capacity that will always use Standard VMs to avoid + // risk of more preemption than the minimum capacity you need. Dataproc will + // create only standard VMs until it reaches standard_capacity_base, then it + // will start using standard_capacity_percent_above_base to mix Spot with + // Standard VMs. eg. If 15 instances are requested and + // standard_capacity_base is 5, Dataproc will create 5 standard VMs and then + // start mixing spot and standard VMs for remaining 10 instances. + optional int32 standard_capacity_base = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The percentage of target capacity that should use Standard VM. + // The remaining percentage will use Spot VMs. The percentage applies only + // to the capacity above standard_capacity_base. eg. If 15 instances are + // requested and standard_capacity_base is 5 and + // standard_capacity_percent_above_base is 30, Dataproc will create 5 + // standard VMs and then start mixing spot and standard VMs for remaining 10 + // instances. The mix will be 30% standard and 70% spot. + optional int32 standard_capacity_percent_above_base = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Defines machines types and a rank to which the machines types belong. + message InstanceSelection { + // Optional. Full machine-type names, e.g. "n1-standard-16". + repeated string machine_types = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Preference of this instance selection. Lower number means + // higher preference. Dataproc will first try to create a VM based on the + // machine-type with priority rank and fallback to next rank based on + // availability. Machine types and instance selections with the same + // priority have the same preference. + int32 rank = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Defines a mapping from machine types to the number of VMs that are created + // with each machine type. + message InstanceSelectionResult { + // Output only. Full machine-type names, e.g. "n1-standard-16". + optional string machine_type = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of VM provisioned with the machine_type. + optional int32 vm_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Optional. Defines how the Group selects the provisioning model to ensure + // required reliability. + ProvisioningModelMix provisioning_model_mix = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List of instance selection options that the group will use when + // creating new VMs. + repeated InstanceSelection instance_selection_list = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. A list of instance selection results in the group. + repeated InstanceSelectionResult instance_selection_results = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Specifies the type and number of accelerator cards attached to the instances +// of an instance. See [GPUs on Compute +// Engine](https://cloud.google.com/compute/docs/gpus/). +message AcceleratorConfig { + // Full URL, partial URI, or short name of the accelerator type resource to + // expose to this instance. See + // [Compute Engine + // AcceleratorTypes](https://cloud.google.com/compute/docs/reference/v1/acceleratorTypes). + // + // Examples: + // + // * `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]/acceleratorTypes/nvidia-tesla-t4` + // * `projects/[project_id]/zones/[zone]/acceleratorTypes/nvidia-tesla-t4` + // * `nvidia-tesla-t4` + // + // **Auto Zone Exception**: If you are using the Dataproc + // [Auto Zone + // Placement](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/auto-zone#using_auto_zone_placement) + // feature, you must use the short name of the accelerator type + // resource, for example, `nvidia-tesla-t4`. + string accelerator_type_uri = 1; + + // The number of the accelerator cards of this type exposed to this instance. + int32 accelerator_count = 2; +} + +// Specifies the config of disk options for a group of VM instances. +message DiskConfig { + // Optional. Type of the boot disk (default is "pd-standard"). + // Valid values: "pd-balanced" (Persistent Disk Balanced Solid State Drive), + // "pd-ssd" (Persistent Disk Solid State Drive), + // or "pd-standard" (Persistent Disk Hard Disk Drive). + // See [Disk types](https://cloud.google.com/compute/docs/disks#disk-types). + string boot_disk_type = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Size in GB of the boot disk (default is 500GB). + int32 boot_disk_size_gb = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Number of attached SSDs, from 0 to 8 (default is 0). + // If SSDs are not attached, the boot disk is used to store runtime logs and + // [HDFS](https://hadoop.apache.org/docs/r1.2.1/hdfs_user_guide.html) data. + // If one or more SSDs are attached, this runtime bulk + // data is spread across them, and the boot disk contains only basic + // config and installed binaries. + // + // Note: Local SSD options may vary by machine type and number of vCPUs + // selected. + int32 num_local_ssds = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Interface type of local SSDs (default is "scsi"). + // Valid values: "scsi" (Small Computer System Interface), + // "nvme" (Non-Volatile Memory Express). + // See [local SSD + // performance](https://cloud.google.com/compute/docs/disks/local-ssd#performance). + string local_ssd_interface = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates how many IOPS to provision for the disk. This sets the + // number of I/O operations per second that the disk can handle. Note: This + // field is only supported if boot_disk_type is hyperdisk-balanced. + optional int64 boot_disk_provisioned_iops = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates how much throughput to provision for the disk. This + // sets the number of throughput mb per second that the disk can handle. + // Values must be greater than or equal to 1. Note: This field is only + // supported if boot_disk_type is hyperdisk-balanced. + optional int64 boot_disk_provisioned_throughput = 6 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Node group identification and configuration information. +message AuxiliaryNodeGroup { + // Required. Node group configuration. + NodeGroup node_group = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A node group ID. Generated if not specified. + // + // The ID must contain only letters (a-z, A-Z), numbers (0-9), + // underscores (_), and hyphens (-). Cannot begin or end with underscore + // or hyphen. Must consist of from 3 to 33 characters. + string node_group_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Dataproc Node Group. +// **The Dataproc `NodeGroup` resource is not related to the +// Dataproc [NodeGroupAffinity][google.cloud.dataproc.v1.NodeGroupAffinity] +// resource.** +message NodeGroup { + option (google.api.resource) = { + type: "dataproc.googleapis.com/NodeGroup" + pattern: "projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{node_group}" + }; + + // Node pool roles. + enum Role { + // Required unspecified role. + ROLE_UNSPECIFIED = 0; + + // Job drivers run on the node pool. + DRIVER = 1; + } + + // The Node group [resource name](https://aip.dev/122). + string name = 1; + + // Required. Node group roles. + repeated Role roles = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The node group instance group configuration. + InstanceGroupConfig node_group_config = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Node group labels. + // + // * Label **keys** must consist of from 1 to 63 characters and conform to + // [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). + // * Label **values** can be empty. If specified, they must consist of from + // 1 to 63 characters and conform to [RFC 1035] + // (https://www.ietf.org/rfc/rfc1035.txt). + // * The node group must have no more than 32 labels. + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Specifies an executable to run on a fully configured node and a +// timeout period for executable completion. +message NodeInitializationAction { + // Required. Cloud Storage URI of executable file. + string executable_file = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Amount of time executable has to complete. Default is + // 10 minutes (see JSON representation of + // [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). + // + // Cluster creation fails with an explanatory error message (the + // name of the executable that caused the error and the exceeded timeout + // period) if the executable is not completed at end of the timeout period. + google.protobuf.Duration execution_timeout = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The status of a cluster and its instances. +message ClusterStatus { + // The cluster state. + enum State { + // The cluster state is unknown. + UNKNOWN = 0; + + // The cluster is being created and set up. It is not ready for use. + CREATING = 1; + + // The cluster is currently running and healthy. It is ready for use. + // + // **Note:** The cluster state changes from "creating" to "running" status + // after the master node(s), first two primary worker nodes (and the last + // primary worker node if primary workers > 2) are running. + RUNNING = 2; + + // The cluster encountered an error. It is not ready for use. + ERROR = 3; + + // The cluster has encountered an error while being updated. Jobs can + // be submitted to the cluster, but the cluster cannot be updated. + ERROR_DUE_TO_UPDATE = 9; + + // The cluster is being deleted. It cannot be used. + DELETING = 4; + + // The cluster is being updated. It continues to accept and process jobs. + UPDATING = 5; + + // The cluster is being stopped. It cannot be used. + STOPPING = 6; + + // The cluster is currently stopped. It is not ready for use. + STOPPED = 7; + + // The cluster is being started. It is not ready for use. + STARTING = 8; + + // The cluster is being repaired. It is not ready for use. + REPAIRING = 10; + } + + // The cluster substate. + enum Substate { + // The cluster substate is unknown. + UNSPECIFIED = 0; + + // The cluster is known to be in an unhealthy state + // (for example, critical daemons are not running or HDFS capacity is + // exhausted). + // + // Applies to RUNNING state. + UNHEALTHY = 1; + + // The agent-reported status is out of date (may occur if + // Dataproc loses communication with Agent). + // + // Applies to RUNNING state. + STALE_STATUS = 2; + } + + // Output only. The cluster's state. + State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Output only. Details of cluster's state. + string detail = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = OPTIONAL + ]; + + // Output only. Time when this state was entered (see JSON representation of + // [Timestamp](https://developers.google.com/protocol-buffers/docs/proto3#json)). + google.protobuf.Timestamp state_start_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Additional state information that includes + // status reported by the agent. + Substate substate = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Security related configuration, including encryption, Kerberos, etc. +message SecurityConfig { + // Optional. Kerberos related configuration. + KerberosConfig kerberos_config = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Identity related configuration, including service account based + // secure multi-tenancy user mappings. + IdentityConfig identity_config = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Specifies Kerberos related configuration. +message KerberosConfig { + // Optional. Flag to indicate whether to Kerberize the cluster (default: + // false). Set this field to true to enable Kerberos on a cluster. + bool enable_kerberos = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Cloud Storage URI of a KMS encrypted file containing the root + // principal password. + string root_principal_password_uri = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The URI of the KMS key used to encrypt sensitive + // files. + string kms_key_uri = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Cloud Storage URI of the keystore file used for SSL + // encryption. If not provided, Dataproc will provide a self-signed + // certificate. + string keystore_uri = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Cloud Storage URI of the truststore file used for SSL + // encryption. If not provided, Dataproc will provide a self-signed + // certificate. + string truststore_uri = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Cloud Storage URI of a KMS encrypted file containing the + // password to the user provided keystore. For the self-signed certificate, + // this password is generated by Dataproc. + string keystore_password_uri = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Cloud Storage URI of a KMS encrypted file containing the + // password to the user provided key. For the self-signed certificate, this + // password is generated by Dataproc. + string key_password_uri = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Cloud Storage URI of a KMS encrypted file containing the + // password to the user provided truststore. For the self-signed certificate, + // this password is generated by Dataproc. + string truststore_password_uri = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The remote realm the Dataproc on-cluster KDC will trust, should + // the user enable cross realm trust. + string cross_realm_trust_realm = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The KDC (IP or hostname) for the remote trusted realm in a cross + // realm trust relationship. + string cross_realm_trust_kdc = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The admin server (IP or hostname) for the remote trusted realm in + // a cross realm trust relationship. + string cross_realm_trust_admin_server = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Cloud Storage URI of a KMS encrypted file containing the + // shared password between the on-cluster Kerberos realm and the remote + // trusted realm, in a cross realm trust relationship. + string cross_realm_trust_shared_password_uri = 12 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Cloud Storage URI of a KMS encrypted file containing the + // master key of the KDC database. + string kdc_db_key_uri = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The lifetime of the ticket granting ticket, in hours. + // If not specified, or user specifies 0, then default value 10 + // will be used. + int32 tgt_lifetime_hours = 14 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of the on-cluster Kerberos realm. + // If not specified, the uppercased domain of hostnames will be the realm. + string realm = 15 [(google.api.field_behavior) = OPTIONAL]; +} + +// Identity related configuration, including service account based +// secure multi-tenancy user mappings. +message IdentityConfig { + // Required. Map of user to service account. + map user_service_account_mapping = 1 + [(google.api.field_behavior) = REQUIRED]; +} + +// Specifies the selection and config of software inside the cluster. +message SoftwareConfig { + // Optional. The version of software inside the cluster. It must be one of the + // supported [Dataproc + // Versions](https://cloud.google.com/dataproc/docs/concepts/versioning/dataproc-versions#supported-dataproc-image-versions), + // such as "1.2" (including a subminor version, such as "1.2.29"), or the + // ["preview" + // version](https://cloud.google.com/dataproc/docs/concepts/versioning/dataproc-versions#other_versions). + // If unspecified, it defaults to the latest Debian version. + string image_version = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The properties to set on daemon config files. + // + // Property keys are specified in `prefix:property` format, for example + // `core:hadoop.tmp.dir`. The following are supported prefixes + // and their mappings: + // + // * capacity-scheduler: `capacity-scheduler.xml` + // * core: `core-site.xml` + // * distcp: `distcp-default.xml` + // * hdfs: `hdfs-site.xml` + // * hive: `hive-site.xml` + // * mapred: `mapred-site.xml` + // * pig: `pig.properties` + // * spark: `spark-defaults.conf` + // * yarn: `yarn-site.xml` + // + // For more information, see [Cluster + // properties](https://cloud.google.com/dataproc/docs/concepts/cluster-properties). + map properties = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The set of components to activate on the cluster. + repeated Component optional_components = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Specifies the cluster auto-delete schedule configuration. +message LifecycleConfig { + // Optional. The duration to keep the cluster alive while idling (when no jobs + // are running). Passing this threshold will cause the cluster to be + // deleted. Minimum value is 5 minutes; maximum value is 14 days (see JSON + // representation of + // [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). + google.protobuf.Duration idle_delete_ttl = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Either the exact time the cluster should be deleted at or + // the cluster maximum age. + oneof ttl { + // Optional. The time when cluster will be auto-deleted (see JSON + // representation of + // [Timestamp](https://developers.google.com/protocol-buffers/docs/proto3#json)). + google.protobuf.Timestamp auto_delete_time = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The lifetime duration of cluster. The cluster will be + // auto-deleted at the end of this period. Minimum value is 10 minutes; + // maximum value is 14 days (see JSON representation of + // [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). + google.protobuf.Duration auto_delete_ttl = 3 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The duration to keep the cluster started while idling (when no + // jobs are running). Passing this threshold will cause the cluster to be + // stopped. Minimum value is 5 minutes; maximum value is 14 days (see JSON + // representation of + // [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). + google.protobuf.Duration idle_stop_ttl = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Either the exact time the cluster should be stopped at or + // the cluster maximum age. + oneof stop_ttl { + // Optional. The time when cluster will be auto-stopped (see JSON + // representation of + // [Timestamp](https://developers.google.com/protocol-buffers/docs/proto3#json)). + google.protobuf.Timestamp auto_stop_time = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The lifetime duration of the cluster. The cluster will be + // auto-stopped at the end of this period, calculated from the time of + // submission of the create or update cluster request. Minimum value is 10 + // minutes; maximum value is 14 days (see JSON representation of + // [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). + google.protobuf.Duration auto_stop_ttl = 7 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Output only. The time when cluster became idle (most recent job finished) + // and became eligible for deletion due to idleness (see JSON representation + // of + // [Timestamp](https://developers.google.com/protocol-buffers/docs/proto3#json)). + google.protobuf.Timestamp idle_start_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Specifies a Metastore configuration. +message MetastoreConfig { + // Required. Resource name of an existing Dataproc Metastore service. + // + // Example: + // + // * `projects/[project_id]/locations/[dataproc_region]/services/[service-name]` + string dataproc_metastore_service = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "metastore.googleapis.com/Service" + } + ]; +} + +// Contains cluster daemon metrics, such as HDFS and YARN stats. +// +// **Beta Feature**: This report is available for testing purposes only. It may +// be changed before final release. +message ClusterMetrics { + // The HDFS metrics. + map hdfs_metrics = 1; + + // YARN metrics. + map yarn_metrics = 2; +} + +// Dataproc metric config. +message DataprocMetricConfig { + // A source for the collection of Dataproc custom metrics (see [Custom + // metrics] + // (https://cloud.google.com//dataproc/docs/guides/dataproc-metrics#custom_metrics)). + enum MetricSource { + // Required unspecified metric source. + METRIC_SOURCE_UNSPECIFIED = 0; + + // Monitoring agent metrics. If this source is enabled, + // Dataproc enables the monitoring agent in Compute Engine, + // and collects monitoring agent metrics, which are published + // with an `agent.googleapis.com` prefix. + MONITORING_AGENT_DEFAULTS = 1; + + // HDFS metric source. + HDFS = 2; + + // Spark metric source. + SPARK = 3; + + // YARN metric source. + YARN = 4; + + // Spark History Server metric source. + SPARK_HISTORY_SERVER = 5; + + // Hiveserver2 metric source. + HIVESERVER2 = 6; + + // hivemetastore metric source + HIVEMETASTORE = 7; + + // flink metric source + FLINK = 8; + } + + // A Dataproc custom metric. + message Metric { + // Required. A standard set of metrics is collected unless `metricOverrides` + // are specified for the metric source (see [Custom metrics] + // (https://cloud.google.com/dataproc/docs/guides/dataproc-metrics#custom_metrics) + // for more information). + MetricSource metric_source = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Specify one or more [Custom metrics] + // (https://cloud.google.com/dataproc/docs/guides/dataproc-metrics#custom_metrics) + // to collect for the metric course (for the `SPARK` metric source (any + // [Spark metric] + // (https://spark.apache.org/docs/latest/monitoring.html#metrics) can be + // specified). + // + // Provide metrics in the following format: + // METRIC_SOURCE:INSTANCE:GROUP:METRIC + // Use camelcase as appropriate. + // + // Examples: + // + // ``` + // yarn:ResourceManager:QueueMetrics:AppsCompleted + // spark:driver:DAGScheduler:job.allJobs + // sparkHistoryServer:JVM:Memory:NonHeapMemoryUsage.committed + // hiveserver2:JVM:Memory:NonHeapMemoryUsage.used + // ``` + // + // Notes: + // + // * Only the specified overridden metrics are collected for the + // metric source. For example, if one or more `spark:executive` metrics + // are listed as metric overrides, other `SPARK` metrics are not + // collected. The collection of the metrics for other enabled custom + // metric sources is unaffected. For example, if both `SPARK` andd `YARN` + // metric sources are enabled, and overrides are provided for Spark + // metrics only, all YARN metrics are collected. + repeated string metric_overrides = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. Metrics sources to enable. + repeated Metric metrics = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// A request to create a cluster. +message CreateClusterRequest { + // Required. The ID of the Google Cloud Platform project that the cluster + // belongs to. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Dataproc region in which to handle the request. + string region = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The cluster to create. + Cluster cluster = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique ID used to identify the request. If the server receives + // two + // [CreateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateClusterRequest)s + // with the same id, then the second request will be ignored and the + // first [google.longrunning.Operation][google.longrunning.Operation] created + // and stored in the backend is returned. + // + // It is recommended to always set this value to a + // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + // + // The ID must contain only letters (a-z, A-Z), numbers (0-9), + // underscores (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Failure action when primary worker creation fails. + FailureAction action_on_failed_primary_workers = 5 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A request to update a cluster. +message UpdateClusterRequest { + // Required. The ID of the Google Cloud Platform project the + // cluster belongs to. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Dataproc region in which to handle the request. + string region = 5 [(google.api.field_behavior) = REQUIRED]; + + // Required. The cluster name. + string cluster_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The changes to the cluster. + Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Timeout for graceful YARN decommissioning. Graceful + // decommissioning allows removing nodes from the cluster without + // interrupting jobs in progress. Timeout specifies how long to wait for jobs + // in progress to finish before forcefully removing nodes (and potentially + // interrupting jobs). Default timeout is 0 (for forceful decommission), and + // the maximum allowed timeout is 1 day. (see JSON representation of + // [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). + // + // Only supported on Dataproc image versions 1.2 and higher. + google.protobuf.Duration graceful_decommission_timeout = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. Specifies the path, relative to `Cluster`, of + // the field to update. For example, to change the number of workers + // in a cluster to 5, the `update_mask` parameter would be + // specified as `config.worker_config.num_instances`, + // and the `PATCH` request body would specify the new value, as follows: + // + // { + // "config":{ + // "workerConfig":{ + // "numInstances":"5" + // } + // } + // } + // Similarly, to change the number of preemptible workers in a cluster to 5, + // the `update_mask` parameter would be + // `config.secondary_worker_config.num_instances`, and the `PATCH` request + // body would be set as follows: + // + // { + // "config":{ + // "secondaryWorkerConfig":{ + // "numInstances":"5" + // } + // } + // } + // Note: Currently, only the following fields can be updated: + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + //
MaskPurpose
labelsUpdate labels
config.worker_config.num_instancesResize primary worker group
config.secondary_worker_config.num_instancesResize secondary worker group
config.autoscaling_config.policy_uriUse, stop using, or + // change autoscaling policies
+ google.protobuf.FieldMask update_mask = 4 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique ID used to identify the request. If the server + // receives two + // [UpdateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.UpdateClusterRequest)s + // with the same id, then the second request will be ignored and the + // first [google.longrunning.Operation][google.longrunning.Operation] created + // and stored in the backend is returned. + // + // It is recommended to always set this value to a + // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + // + // The ID must contain only letters (a-z, A-Z), numbers (0-9), + // underscores (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// A request to stop a cluster. +message StopClusterRequest { + // Required. The ID of the Google Cloud Platform project the + // cluster belongs to. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Dataproc region in which to handle the request. + string region = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The cluster name. + string cluster_name = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Specifying the `cluster_uuid` means the RPC will fail + // (with error NOT_FOUND) if a cluster with the specified UUID does not exist. + string cluster_uuid = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A unique ID used to identify the request. If the server + // receives two + // [StopClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StopClusterRequest)s + // with the same id, then the second request will be ignored and the + // first [google.longrunning.Operation][google.longrunning.Operation] created + // and stored in the backend is returned. + // + // Recommendation: Set this value to a + // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + // + // The ID must contain only letters (a-z, A-Z), numbers (0-9), + // underscores (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// A request to start a cluster. +message StartClusterRequest { + // Required. The ID of the Google Cloud Platform project the + // cluster belongs to. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Dataproc region in which to handle the request. + string region = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The cluster name. + string cluster_name = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Specifying the `cluster_uuid` means the RPC will fail + // (with error NOT_FOUND) if a cluster with the specified UUID does not exist. + string cluster_uuid = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A unique ID used to identify the request. If the server + // receives two + // [StartClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StartClusterRequest)s + // with the same id, then the second request will be ignored and the + // first [google.longrunning.Operation][google.longrunning.Operation] created + // and stored in the backend is returned. + // + // Recommendation: Set this value to a + // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + // + // The ID must contain only letters (a-z, A-Z), numbers (0-9), + // underscores (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// A request to delete a cluster. +message DeleteClusterRequest { + // Required. The ID of the Google Cloud Platform project that the cluster + // belongs to. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Dataproc region in which to handle the request. + string region = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The cluster name. + string cluster_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Specifying the `cluster_uuid` means the RPC should fail + // (with error NOT_FOUND) if cluster with specified UUID does not exist. + string cluster_uuid = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A unique ID used to identify the request. If the server + // receives two + // [DeleteClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteClusterRequest)s + // with the same id, then the second request will be ignored and the + // first [google.longrunning.Operation][google.longrunning.Operation] created + // and stored in the backend is returned. + // + // It is recommended to always set this value to a + // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + // + // The ID must contain only letters (a-z, A-Z), numbers (0-9), + // underscores (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request to get the resource representation for a cluster in a project. +message GetClusterRequest { + // Required. The ID of the Google Cloud Platform project that the cluster + // belongs to. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Dataproc region in which to handle the request. + string region = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The cluster name. + string cluster_name = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A request to list the clusters in a project. +message ListClustersRequest { + // Required. The ID of the Google Cloud Platform project that the cluster + // belongs to. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Dataproc region in which to handle the request. + string region = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A filter constraining the clusters to list. Filters are + // case-sensitive and have the following syntax: + // + // field = value [AND [field = value]] ... + // + // where **field** is one of `status.state`, `clusterName`, or `labels.[KEY]`, + // and `[KEY]` is a label key. **value** can be `*` to match all values. + // `status.state` can be one of the following: `ACTIVE`, `INACTIVE`, + // `CREATING`, `RUNNING`, `ERROR`, `DELETING`, `UPDATING`, `STOPPING`, or + // `STOPPED`. `ACTIVE` contains the `CREATING`, `UPDATING`, and `RUNNING` + // states. `INACTIVE` contains the `DELETING`, `ERROR`, `STOPPING`, and + // `STOPPED` states. `clusterName` is the name of the cluster provided at + // creation time. Only the logical `AND` operator is supported; + // space-separated items are treated as having an implicit `AND` operator. + // + // Example filter: + // + // status.state = ACTIVE AND clusterName = mycluster + // AND labels.env = staging AND labels.starred = * + string filter = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The standard List page size. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The standard List page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The list of all clusters in a project. +message ListClustersResponse { + // Output only. The clusters in the project. + repeated Cluster clusters = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. This token is included in the response if there are more + // results to fetch. To fetch additional results, provide this value as the + // `page_token` in a subsequent `ListClustersRequest`. + string next_page_token = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A request to collect cluster diagnostic information. +message DiagnoseClusterRequest { + // Defines who has access to the diagnostic tarball + enum TarballAccess { + // Tarball Access unspecified. Falls back to default access of the bucket + TARBALL_ACCESS_UNSPECIFIED = 0; + + // Google Cloud Support group has read access to the + // diagnostic tarball + GOOGLE_CLOUD_SUPPORT = 1; + + // Google Cloud Dataproc Diagnose service account has read access to the + // diagnostic tarball + GOOGLE_DATAPROC_DIAGNOSE = 2; + } + + // Required. The ID of the Google Cloud Platform project that the cluster + // belongs to. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Dataproc region in which to handle the request. + string region = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The cluster name. + string cluster_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. (Optional) The output Cloud Storage directory for the diagnostic + // tarball. If not specified, a task-specific directory in the cluster's + // staging bucket will be used. + string tarball_gcs_dir = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. (Optional) The access type to the diagnostic tarball. If not + // specified, falls back to default access of the bucket + TarballAccess tarball_access = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Time interval in which diagnosis should be carried out on the + // cluster. + google.type.Interval diagnosis_interval = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies a list of jobs on which diagnosis is to be performed. + // Format: projects/{project}/regions/{region}/jobs/{job} + repeated string jobs = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies a list of yarn applications on which diagnosis is to be + // performed. + repeated string yarn_application_ids = 11 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The location of diagnostic output. +message DiagnoseClusterResults { + // Output only. The Cloud Storage URI of the diagnostic output. + // The output report is a plain text file with a summary of collected + // diagnostics. + string output_uri = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Reservation Affinity for consuming Zonal reservation. +message ReservationAffinity { + // Indicates whether to consume capacity from an reservation or not. + enum Type { + TYPE_UNSPECIFIED = 0; + + // Do not consume from any allocated capacity. + NO_RESERVATION = 1; + + // Consume any reservation available. + ANY_RESERVATION = 2; + + // Must consume from a specific reservation. Must specify key value fields + // for specifying the reservations. + SPECIFIC_RESERVATION = 3; + } + + // Optional. Type of reservation to consume + Type consume_reservation_type = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Corresponds to the label key of reservation resource. + string key = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Corresponds to the label values of reservation resource. + repeated string values = 3 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/jobs.proto b/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/jobs.proto new file mode 100644 index 000000000000..badfb5382b64 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/jobs.proto @@ -0,0 +1,1045 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dataproc.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpb"; +option java_multiple_files = true; +option java_outer_classname = "JobsProto"; +option java_package = "com.google.cloud.dataproc.v1"; + +// The JobController provides methods to manage jobs. +service JobController { + option (google.api.default_host) = "dataproc.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Submits a job to a cluster. + rpc SubmitJob(SubmitJobRequest) returns (Job) { + option (google.api.http) = { + post: "/v1/projects/{project_id}/regions/{region}/jobs:submit" + body: "*" + }; + option (google.api.method_signature) = "project_id,region,job"; + } + + // Submits job to a cluster. + rpc SubmitJobAsOperation(SubmitJobRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/projects/{project_id}/regions/{region}/jobs:submitAsOperation" + body: "*" + }; + option (google.api.method_signature) = "project_id, region, job"; + option (google.longrunning.operation_info) = { + response_type: "Job" + metadata_type: "JobMetadata" + }; + } + + // Gets the resource representation for a job in a project. + rpc GetJob(GetJobRequest) returns (Job) { + option (google.api.http) = { + get: "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}" + }; + option (google.api.method_signature) = "project_id,region,job_id"; + } + + // Lists regions/{region}/jobs in a project. + rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) { + option (google.api.http) = { + get: "/v1/projects/{project_id}/regions/{region}/jobs" + }; + option (google.api.method_signature) = "project_id,region"; + option (google.api.method_signature) = "project_id,region,filter"; + } + + // Updates a job in a project. + rpc UpdateJob(UpdateJobRequest) returns (Job) { + option (google.api.http) = { + patch: "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}" + body: "job" + }; + } + + // Starts a job cancellation request. To access the job resource + // after cancellation, call + // [regions/{region}/jobs.list](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/list) + // or + // [regions/{region}/jobs.get](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/get). + rpc CancelJob(CancelJobRequest) returns (Job) { + option (google.api.http) = { + post: "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}:cancel" + body: "*" + }; + option (google.api.method_signature) = "project_id,region,job_id"; + } + + // Deletes the job from the project. If the job is active, the delete fails, + // and the response returns `FAILED_PRECONDITION`. + rpc DeleteJob(DeleteJobRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}" + }; + option (google.api.method_signature) = "project_id,region,job_id"; + } +} + +// The runtime logging config of the job. +message LoggingConfig { + // The Log4j level for job execution. When running an + // [Apache Hive](https://hive.apache.org/) job, Cloud + // Dataproc configures the Hive client to an equivalent verbosity level. + enum Level { + // Level is unspecified. Use default level for log4j. + LEVEL_UNSPECIFIED = 0; + + // Use ALL level for log4j. + ALL = 1; + + // Use TRACE level for log4j. + TRACE = 2; + + // Use DEBUG level for log4j. + DEBUG = 3; + + // Use INFO level for log4j. + INFO = 4; + + // Use WARN level for log4j. + WARN = 5; + + // Use ERROR level for log4j. + ERROR = 6; + + // Use FATAL level for log4j. + FATAL = 7; + + // Turn off log4j. + OFF = 8; + } + + // The per-package log levels for the driver. This can include + // "root" package name to configure rootLogger. + // Examples: + // - 'com.google = FATAL' + // - 'root = INFO' + // - 'org.apache = DEBUG' + map driver_log_levels = 2; +} + +// A Dataproc job for running +// [Apache Hadoop +// MapReduce](https://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html) +// jobs on [Apache Hadoop +// YARN](https://hadoop.apache.org/docs/r2.7.1/hadoop-yarn/hadoop-yarn-site/YARN.html). +message HadoopJob { + // Required. Indicates the location of the driver's main class. Specify + // either the jar file that contains the main class or the main class name. + // To specify both, add the jar file to `jar_file_uris`, and then specify + // the main class name in this property. + oneof driver { + // The HCFS URI of the jar file containing the main class. + // Examples: + // 'gs://foo-bucket/analytics-binaries/extract-useful-metrics-mr.jar' + // 'hdfs:/tmp/test-samples/custom-wordcount.jar' + // 'file:///home/usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar' + string main_jar_file_uri = 1; + + // The name of the driver's main class. The jar file containing the class + // must be in the default CLASSPATH or specified in `jar_file_uris`. + string main_class = 2; + } + + // Optional. The arguments to pass to the driver. Do not + // include arguments, such as `-libjars` or `-Dfoo=bar`, that can be set as + // job properties, since a collision might occur that causes an incorrect job + // submission. + repeated string args = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Jar file URIs to add to the CLASSPATHs of the + // Hadoop driver and tasks. + repeated string jar_file_uris = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HCFS (Hadoop Compatible Filesystem) URIs of files to be copied + // to the working directory of Hadoop drivers and distributed tasks. Useful + // for naively parallel tasks. + repeated string file_uris = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HCFS URIs of archives to be extracted in the working directory of + // Hadoop drivers and tasks. Supported file types: + // .jar, .tar, .tar.gz, .tgz, or .zip. + repeated string archive_uris = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A mapping of property names to values, used to configure Hadoop. + // Properties that conflict with values set by the Dataproc API might be + // overwritten. Can include properties set in `/etc/hadoop/conf/*-site` and + // classes in user code. + map properties = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The runtime log config for job execution. + LoggingConfig logging_config = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +// A Dataproc job for running [Apache Spark](https://spark.apache.org/) +// applications on YARN. +message SparkJob { + // Required. The specification of the main method to call to drive the job. + // Specify either the jar file that contains the main class or the main class + // name. To pass both a main jar and a main class in that jar, add the jar to + // [jarFileUris][google.cloud.dataproc.v1.SparkJob.jar_file_uris], and then + // specify the main class name in + // [mainClass][google.cloud.dataproc.v1.SparkJob.main_class]. + oneof driver { + // The HCFS URI of the jar file that contains the main class. + string main_jar_file_uri = 1; + + // The name of the driver's main class. The jar file that contains the class + // must be in the default CLASSPATH or specified in + // SparkJob.jar_file_uris. + string main_class = 2; + } + + // Optional. The arguments to pass to the driver. Do not include arguments, + // such as `--conf`, that can be set as job properties, since a collision may + // occur that causes an incorrect job submission. + repeated string args = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HCFS URIs of jar files to add to the CLASSPATHs of the + // Spark driver and tasks. + repeated string jar_file_uris = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HCFS URIs of files to be placed in the working directory of + // each executor. Useful for naively parallel tasks. + repeated string file_uris = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HCFS URIs of archives to be extracted into the working directory + // of each executor. Supported file types: + // .jar, .tar, .tar.gz, .tgz, and .zip. + repeated string archive_uris = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A mapping of property names to values, used to configure Spark. + // Properties that conflict with values set by the Dataproc API might be + // overwritten. Can include properties set in + // /etc/spark/conf/spark-defaults.conf and classes in user code. + map properties = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The runtime log config for job execution. + LoggingConfig logging_config = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +// A Dataproc job for running +// [Apache +// PySpark](https://spark.apache.org/docs/0.9.0/python-programming-guide.html) +// applications on YARN. +message PySparkJob { + // Required. The HCFS URI of the main Python file to use as the driver. Must + // be a .py file. + string main_python_file_uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The arguments to pass to the driver. Do not include arguments, + // such as `--conf`, that can be set as job properties, since a collision may + // occur that causes an incorrect job submission. + repeated string args = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HCFS file URIs of Python files to pass to the PySpark + // framework. Supported file types: .py, .egg, and .zip. + repeated string python_file_uris = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HCFS URIs of jar files to add to the CLASSPATHs of the + // Python driver and tasks. + repeated string jar_file_uris = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HCFS URIs of files to be placed in the working directory of + // each executor. Useful for naively parallel tasks. + repeated string file_uris = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HCFS URIs of archives to be extracted into the working directory + // of each executor. Supported file types: + // .jar, .tar, .tar.gz, .tgz, and .zip. + repeated string archive_uris = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A mapping of property names to values, used to configure PySpark. + // Properties that conflict with values set by the Dataproc API might be + // overwritten. Can include properties set in + // /etc/spark/conf/spark-defaults.conf and classes in user code. + map properties = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The runtime log config for job execution. + LoggingConfig logging_config = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +// A list of queries to run on a cluster. +message QueryList { + // Required. The queries to execute. You do not need to end a query expression + // with a semicolon. Multiple queries can be specified in one + // string by separating each with a semicolon. Here is an example of a + // Dataproc API snippet that uses a QueryList to specify a HiveJob: + // + // "hiveJob": { + // "queryList": { + // "queries": [ + // "query1", + // "query2", + // "query3;query4", + // ] + // } + // } + repeated string queries = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// A Dataproc job for running [Apache Hive](https://hive.apache.org/) +// queries on YARN. +message HiveJob { + // Required. The sequence of Hive queries to execute, specified as either + // an HCFS file URI or a list of queries. + oneof queries { + // The HCFS URI of the script that contains Hive queries. + string query_file_uri = 1; + + // A list of queries. + QueryList query_list = 2; + } + + // Optional. Whether to continue executing queries if a query fails. + // The default value is `false`. Setting to `true` can be useful when + // executing independent parallel queries. + bool continue_on_failure = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Mapping of query variable names to values (equivalent to the + // Hive command: `SET name="value";`). + map script_variables = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A mapping of property names and values, used to configure Hive. + // Properties that conflict with values set by the Dataproc API might be + // overwritten. Can include properties set in `/etc/hadoop/conf/*-site.xml`, + // /etc/hive/conf/hive-site.xml, and classes in user code. + map properties = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HCFS URIs of jar files to add to the CLASSPATH of the + // Hive server and Hadoop MapReduce (MR) tasks. Can contain Hive SerDes + // and UDFs. + repeated string jar_file_uris = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// A Dataproc job for running [Apache Spark +// SQL](https://spark.apache.org/sql/) queries. +message SparkSqlJob { + // Required. The sequence of Spark SQL queries to execute, specified as + // either an HCFS file URI or as a list of queries. + oneof queries { + // The HCFS URI of the script that contains SQL queries. + string query_file_uri = 1; + + // A list of queries. + QueryList query_list = 2; + } + + // Optional. Mapping of query variable names to values (equivalent to the + // Spark SQL command: SET `name="value";`). + map script_variables = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A mapping of property names to values, used to configure + // Spark SQL's SparkConf. Properties that conflict with values set by the + // Dataproc API might be overwritten. + map properties = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH. + repeated string jar_file_uris = 56 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The runtime log config for job execution. + LoggingConfig logging_config = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// A Dataproc job for running [Apache Pig](https://pig.apache.org/) +// queries on YARN. +message PigJob { + // Required. The sequence of Pig queries to execute, specified as an HCFS + // file URI or a list of queries. + oneof queries { + // The HCFS URI of the script that contains the Pig queries. + string query_file_uri = 1; + + // A list of queries. + QueryList query_list = 2; + } + + // Optional. Whether to continue executing queries if a query fails. + // The default value is `false`. Setting to `true` can be useful when + // executing independent parallel queries. + bool continue_on_failure = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Mapping of query variable names to values (equivalent to the Pig + // command: `name=[value]`). + map script_variables = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A mapping of property names to values, used to configure Pig. + // Properties that conflict with values set by the Dataproc API might be + // overwritten. Can include properties set in `/etc/hadoop/conf/*-site.xml`, + // /etc/pig/conf/pig.properties, and classes in user code. + map properties = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HCFS URIs of jar files to add to the CLASSPATH of + // the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs. + repeated string jar_file_uris = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The runtime log config for job execution. + LoggingConfig logging_config = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// A Dataproc job for running +// [Apache SparkR](https://spark.apache.org/docs/latest/sparkr.html) +// applications on YARN. +message SparkRJob { + // Required. The HCFS URI of the main R file to use as the driver. + // Must be a .R file. + string main_r_file_uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The arguments to pass to the driver. Do not include arguments, + // such as `--conf`, that can be set as job properties, since a collision may + // occur that causes an incorrect job submission. + repeated string args = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HCFS URIs of files to be placed in the working directory of + // each executor. Useful for naively parallel tasks. + repeated string file_uris = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HCFS URIs of archives to be extracted into the working directory + // of each executor. Supported file types: + // .jar, .tar, .tar.gz, .tgz, and .zip. + repeated string archive_uris = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A mapping of property names to values, used to configure SparkR. + // Properties that conflict with values set by the Dataproc API might be + // overwritten. Can include properties set in + // /etc/spark/conf/spark-defaults.conf and classes in user code. + map properties = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The runtime log config for job execution. + LoggingConfig logging_config = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// A Dataproc job for running [Presto](https://prestosql.io/) queries. +// **IMPORTANT**: The [Dataproc Presto Optional +// Component](https://cloud.google.com/dataproc/docs/concepts/components/presto) +// must be enabled when the cluster is created to submit a Presto job to the +// cluster. +message PrestoJob { + // Required. The sequence of Presto queries to execute, specified as + // either an HCFS file URI or as a list of queries. + oneof queries { + // The HCFS URI of the script that contains SQL queries. + string query_file_uri = 1; + + // A list of queries. + QueryList query_list = 2; + } + + // Optional. Whether to continue executing queries if a query fails. + // The default value is `false`. Setting to `true` can be useful when + // executing independent parallel queries. + bool continue_on_failure = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The format in which query output will be displayed. See the + // Presto documentation for supported output formats + string output_format = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Presto client tags to attach to this query + repeated string client_tags = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A mapping of property names to values. Used to set Presto + // [session properties](https://prestodb.io/docs/current/sql/set-session.html) + // Equivalent to using the --session flag in the Presto CLI + map properties = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The runtime log config for job execution. + LoggingConfig logging_config = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// A Dataproc job for running [Trino](https://trino.io/) queries. +// **IMPORTANT**: The [Dataproc Trino Optional +// Component](https://cloud.google.com/dataproc/docs/concepts/components/trino) +// must be enabled when the cluster is created to submit a Trino job to the +// cluster. +message TrinoJob { + // Required. The sequence of Trino queries to execute, specified as + // either an HCFS file URI or as a list of queries. + oneof queries { + // The HCFS URI of the script that contains SQL queries. + string query_file_uri = 1; + + // A list of queries. + QueryList query_list = 2; + } + + // Optional. Whether to continue executing queries if a query fails. + // The default value is `false`. Setting to `true` can be useful when + // executing independent parallel queries. + bool continue_on_failure = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The format in which query output will be displayed. See the + // Trino documentation for supported output formats + string output_format = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Trino client tags to attach to this query + repeated string client_tags = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A mapping of property names to values. Used to set Trino + // [session properties](https://trino.io/docs/current/sql/set-session.html) + // Equivalent to using the --session flag in the Trino CLI + map properties = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The runtime log config for job execution. + LoggingConfig logging_config = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// A Dataproc job for running Apache Flink applications on YARN. +message FlinkJob { + // Required. The specification of the main method to call to drive the job. + // Specify either the jar file that contains the main class or the main class + // name. To pass both a main jar and a main class in the jar, add the jar to + // [jarFileUris][google.cloud.dataproc.v1.FlinkJob.jar_file_uris], and then + // specify the main class name in + // [mainClass][google.cloud.dataproc.v1.FlinkJob.main_class]. + oneof driver { + // The HCFS URI of the jar file that contains the main class. + string main_jar_file_uri = 1; + + // The name of the driver's main class. The jar file that contains the class + // must be in the default CLASSPATH or specified in + // [jarFileUris][google.cloud.dataproc.v1.FlinkJob.jar_file_uris]. + string main_class = 2; + } + + // Optional. The arguments to pass to the driver. Do not include arguments, + // such as `--conf`, that can be set as job properties, since a collision + // might occur that causes an incorrect job submission. + repeated string args = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HCFS URIs of jar files to add to the CLASSPATHs of the + // Flink driver and tasks. + repeated string jar_file_uris = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HCFS URI of the savepoint, which contains the last saved progress + // for starting the current job. + string savepoint_uri = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A mapping of property names to values, used to configure Flink. + // Properties that conflict with values set by the Dataproc API might be + // overwritten. Can include properties set in + // `/etc/flink/conf/flink-defaults.conf` and classes in user code. + map properties = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The runtime log config for job execution. + LoggingConfig logging_config = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +// Dataproc job config. +message JobPlacement { + // Required. The name of the cluster where the job will be submitted. + string cluster_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. A cluster UUID generated by the Dataproc service when + // the job is submitted. + string cluster_uuid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Cluster labels to identify a cluster where the job will be + // submitted. + map cluster_labels = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Dataproc job status. +message JobStatus { + // The job state. + enum State { + // The job state is unknown. + STATE_UNSPECIFIED = 0; + + // The job is pending; it has been submitted, but is not yet running. + PENDING = 1; + + // Job has been received by the service and completed initial setup; + // it will soon be submitted to the cluster. + SETUP_DONE = 8; + + // The job is running on the cluster. + RUNNING = 2; + + // A CancelJob request has been received, but is pending. + CANCEL_PENDING = 3; + + // Transient in-flight resources have been canceled, and the request to + // cancel the running job has been issued to the cluster. + CANCEL_STARTED = 7; + + // The job cancellation was successful. + CANCELLED = 4; + + // The job has completed successfully. + DONE = 5; + + // The job has completed, but encountered an error. + ERROR = 6; + + // Job attempt has failed. The detail field contains failure details for + // this attempt. + // + // Applies to restartable jobs only. + ATTEMPT_FAILURE = 9; + } + + // The job substate. + enum Substate { + // The job substate is unknown. + UNSPECIFIED = 0; + + // The Job is submitted to the agent. + // + // Applies to RUNNING state. + SUBMITTED = 1; + + // The Job has been received and is awaiting execution (it might be waiting + // for a condition to be met). See the "details" field for the reason for + // the delay. + // + // Applies to RUNNING state. + QUEUED = 2; + + // The agent-reported status is out of date, which can be caused by a + // loss of communication between the agent and Dataproc. If the + // agent does not send a timely update, the job will fail. + // + // Applies to RUNNING state. + STALE_STATUS = 3; + } + + // Output only. A state message specifying the overall job state. + State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Output only. Job state details, such as an error + // description if the state is `ERROR`. + string details = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = OPTIONAL + ]; + + // Output only. The time when this state was entered. + google.protobuf.Timestamp state_start_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Additional state information, which includes + // status reported by the agent. + Substate substate = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Encapsulates the full scoping used to reference a job. +message JobReference { + // Optional. The ID of the Google Cloud Platform project that the job belongs + // to. If specified, must match the request project ID. + string project_id = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The job ID, which must be unique within the project. + // + // The ID must contain only letters (a-z, A-Z), numbers (0-9), + // underscores (_), or hyphens (-). The maximum length is 100 characters. + // + // If not specified by the caller, the job ID will be provided by the server. + string job_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// A YARN application created by a job. Application information is a subset of +// org.apache.hadoop.yarn.proto.YarnProtos.ApplicationReportProto. +// +// **Beta Feature**: This report is available for testing purposes only. It may +// be changed before final release. +message YarnApplication { + // The application state, corresponding to + // YarnProtos.YarnApplicationStateProto. + enum State { + // Status is unspecified. + STATE_UNSPECIFIED = 0; + + // Status is NEW. + NEW = 1; + + // Status is NEW_SAVING. + NEW_SAVING = 2; + + // Status is SUBMITTED. + SUBMITTED = 3; + + // Status is ACCEPTED. + ACCEPTED = 4; + + // Status is RUNNING. + RUNNING = 5; + + // Status is FINISHED. + FINISHED = 6; + + // Status is FAILED. + FAILED = 7; + + // Status is KILLED. + KILLED = 8; + } + + // Required. The application name. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The application state. + State state = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The numerical progress of the application, from 1 to 100. + float progress = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The HTTP URL of the ApplicationMaster, HistoryServer, or + // TimelineServer that provides application-specific information. The URL uses + // the internal hostname, and requires a proxy server for resolution and, + // possibly, access. + string tracking_url = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// A Dataproc job resource. +message Job { + // Optional. The fully qualified reference to the job, which can be used to + // obtain the equivalent REST path of the job resource. If this property + // is not specified when a job is created, the server generates a + // job_id. + JobReference reference = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Job information, including how, when, and where to + // run the job. + JobPlacement placement = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The application/framework-specific portion of the job. + oneof type_job { + // Optional. Job is a Hadoop job. + HadoopJob hadoop_job = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Job is a Spark job. + SparkJob spark_job = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Job is a PySpark job. + PySparkJob pyspark_job = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Job is a Hive job. + HiveJob hive_job = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Job is a Pig job. + PigJob pig_job = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Job is a SparkR job. + SparkRJob spark_r_job = 21 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Job is a SparkSql job. + SparkSqlJob spark_sql_job = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Job is a Presto job. + PrestoJob presto_job = 23 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Job is a Trino job. + TrinoJob trino_job = 28 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Job is a Flink job. + FlinkJob flink_job = 29 [(google.api.field_behavior) = OPTIONAL]; + } + + // Output only. The job status. Additional application-specific + // status information might be contained in the type_job + // and yarn_applications fields. + JobStatus status = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The previous job status. + repeated JobStatus status_history = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The collection of YARN applications spun up by this job. + // + // **Beta** Feature: This report is available for testing purposes only. It + // might be changed before final release. + repeated YarnApplication yarn_applications = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A URI pointing to the location of the stdout of the job's + // driver program. + string driver_output_resource_uri = 17 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If present, the location of miscellaneous control files + // which can be used as part of job setup and handling. If not present, + // control files might be placed in the same location as `driver_output_uri`. + string driver_control_files_uri = 15 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The labels to associate with this job. + // Label **keys** must contain 1 to 63 characters, and must conform to + // [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). + // Label **values** can be empty, but, if present, must contain 1 to 63 + // characters, and must conform to [RFC + // 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be + // associated with a job. + map labels = 18 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Job scheduling configuration. + JobScheduling scheduling = 20 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. A UUID that uniquely identifies a job within the project + // over time. This is in contrast to a user-settable reference.job_id that + // might be reused over time. + string job_uuid = 22 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates whether the job is completed. If the value is + // `false`, the job is still in progress. If `true`, the job is completed, and + // `status.state` field will indicate if it was successful, failed, + // or cancelled. + bool done = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Driver scheduling configuration. + DriverSchedulingConfig driver_scheduling_config = 27 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Driver scheduling configuration. +message DriverSchedulingConfig { + // Required. The amount of memory in MB the driver is requesting. + int32 memory_mb = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The number of vCPUs the driver is requesting. + int32 vcores = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Job scheduling options. +message JobScheduling { + // Optional. Maximum number of times per hour a driver can be restarted as + // a result of driver exiting with non-zero code before job is + // reported failed. + // + // A job might be reported as thrashing if the driver exits with a non-zero + // code four times within a 10-minute window. + // + // Maximum value is 10. + // + // **Note:** This restartable job option is not supported in Dataproc + // [workflow templates] + // (https://cloud.google.com/dataproc/docs/concepts/workflows/using-workflows#adding_jobs_to_a_template). + int32 max_failures_per_hour = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Maximum total number of times a driver can be restarted as a + // result of the driver exiting with a non-zero code. After the maximum number + // is reached, the job will be reported as failed. + // + // Maximum value is 240. + // + // **Note:** Currently, this restartable job option is + // not supported in Dataproc + // [workflow + // templates](https://cloud.google.com/dataproc/docs/concepts/workflows/using-workflows#adding_jobs_to_a_template). + int32 max_failures_total = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// A request to submit a job. +message SubmitJobRequest { + // Required. The ID of the Google Cloud Platform project that the job + // belongs to. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Dataproc region in which to handle the request. + string region = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The job resource. + Job job = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique id used to identify the request. If the server + // receives two + // [SubmitJobRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.SubmitJobRequest)s + // with the same id, then the second request will be ignored and the + // first [Job][google.cloud.dataproc.v1.Job] created and stored in the backend + // is returned. + // + // It is recommended to always set this value to a + // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + // + // The id must contain only letters (a-z, A-Z), numbers (0-9), + // underscores (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Job Operation metadata. +message JobMetadata { + // Output only. The job id. + string job_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Most recent job status. + JobStatus status = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Operation type. + string operation_type = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Job submission time. + google.protobuf.Timestamp start_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A request to get the resource representation for a job in a project. +message GetJobRequest { + // Required. The ID of the Google Cloud Platform project that the job + // belongs to. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Dataproc region in which to handle the request. + string region = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The job ID. + string job_id = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A request to list jobs in a project. +message ListJobsRequest { + // A matcher that specifies categories of job states. + enum JobStateMatcher { + // Match all jobs, regardless of state. + ALL = 0; + + // Only match jobs in non-terminal states: PENDING, RUNNING, or + // CANCEL_PENDING. + ACTIVE = 1; + + // Only match jobs in terminal states: CANCELLED, DONE, or ERROR. + NON_ACTIVE = 2; + } + + // Required. The ID of the Google Cloud Platform project that the job + // belongs to. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Dataproc region in which to handle the request. + string region = 6 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The number of results to return in each response. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The page token, returned by a previous call, to request the + // next page of results. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set, the returned jobs list includes only jobs that were + // submitted to the named cluster. + string cluster_name = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies enumerated categories of jobs to list. + // (default = match ALL jobs). + // + // If `filter` is provided, `jobStateMatcher` will be ignored. + JobStateMatcher job_state_matcher = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A filter constraining the jobs to list. Filters are + // case-sensitive and have the following syntax: + // + // [field = value] AND [field [= value]] ... + // + // where **field** is `status.state` or `labels.[KEY]`, and `[KEY]` is a label + // key. **value** can be `*` to match all values. + // `status.state` can be either `ACTIVE` or `NON_ACTIVE`. + // Only the logical `AND` operator is supported; space-separated items are + // treated as having an implicit `AND` operator. + // + // Example filter: + // + // status.state = ACTIVE AND labels.env = staging AND labels.starred = * + string filter = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// A request to update a job. +message UpdateJobRequest { + // Required. The ID of the Google Cloud Platform project that the job + // belongs to. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Dataproc region in which to handle the request. + string region = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The job ID. + string job_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The changes to the job. + Job job = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. Specifies the path, relative to Job, of + // the field to update. For example, to update the labels of a Job the + // update_mask parameter would be specified as + // labels, and the `PATCH` request body would specify the new + // value. Note: Currently, labels is the only + // field that can be updated. + google.protobuf.FieldMask update_mask = 5 + [(google.api.field_behavior) = REQUIRED]; +} + +// A list of jobs in a project. +message ListJobsResponse { + // Output only. Jobs list. + repeated Job jobs = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. This token is included in the response if there are more results + // to fetch. To fetch additional results, provide this value as the + // `page_token` in a subsequent ListJobsRequest. + string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. List of jobs with + // [kms_key][google.cloud.dataproc.v1.EncryptionConfig.kms_key]-encrypted + // parameters that could not be decrypted. A response to a `jobs.get` request + // may indicate the reason for the decryption failure for a specific job. + repeated string unreachable = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A request to cancel a job. +message CancelJobRequest { + // Required. The ID of the Google Cloud Platform project that the job + // belongs to. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Dataproc region in which to handle the request. + string region = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The job ID. + string job_id = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A request to delete a job. +message DeleteJobRequest { + // Required. The ID of the Google Cloud Platform project that the job + // belongs to. + string project_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Dataproc region in which to handle the request. + string region = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The job ID. + string job_id = 2 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/node_groups.proto b/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/node_groups.proto new file mode 100644 index 000000000000..0b69b6c84c9e --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/node_groups.proto @@ -0,0 +1,174 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dataproc.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dataproc/v1/clusters.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpb"; +option java_multiple_files = true; +option java_outer_classname = "NodeGroupsProto"; +option java_package = "com.google.cloud.dataproc.v1"; +option (google.api.resource_definition) = { + type: "dataproc.googleapis.com/ClusterRegion" + pattern: "projects/{project}/regions/{region}/clusters/{cluster}" +}; + +// The `NodeGroupControllerService` provides methods to manage node groups +// of Compute Engine managed instances. +service NodeGroupController { + option (google.api.default_host) = "dataproc.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a node group in a cluster. The returned + // [Operation.metadata][google.longrunning.Operation.metadata] is + // [NodeGroupOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata). + rpc CreateNodeGroup(CreateNodeGroupRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/regions/*/clusters/*}/nodeGroups" + body: "node_group" + }; + option (google.api.method_signature) = "parent,node_group,node_group_id"; + option (google.longrunning.operation_info) = { + response_type: "NodeGroup" + metadata_type: "google.cloud.dataproc.v1.NodeGroupOperationMetadata" + }; + } + + // Resizes a node group in a cluster. The returned + // [Operation.metadata][google.longrunning.Operation.metadata] is + // [NodeGroupOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata). + rpc ResizeNodeGroup(ResizeNodeGroupRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/regions/*/clusters/*/nodeGroups/*}:resize" + body: "*" + }; + option (google.api.method_signature) = "name,size"; + option (google.longrunning.operation_info) = { + response_type: "NodeGroup" + metadata_type: "google.cloud.dataproc.v1.NodeGroupOperationMetadata" + }; + } + + // Gets the resource representation for a node group in a + // cluster. + rpc GetNodeGroup(GetNodeGroupRequest) returns (NodeGroup) { + option (google.api.http) = { + get: "/v1/{name=projects/*/regions/*/clusters/*/nodeGroups/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// A request to create a node group. +message CreateNodeGroupRequest { + // Required. The parent resource where this node group will be created. + // Format: `projects/{project}/regions/{region}/clusters/{cluster}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dataproc.googleapis.com/NodeGroup" + } + ]; + + // Required. The node group to create. + NodeGroup node_group = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional node group ID. Generated if not specified. + // + // The ID must contain only letters (a-z, A-Z), numbers (0-9), + // underscores (_), and hyphens (-). Cannot begin or end with underscore + // or hyphen. Must consist of from 3 to 33 characters. + string node_group_id = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A unique ID used to identify the request. If the server receives + // two + // [CreateNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateNodeGroupRequests) + // with the same ID, the second request is ignored and the + // first [google.longrunning.Operation][google.longrunning.Operation] created + // and stored in the backend is returned. + // + // Recommendation: Set this value to a + // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + // + // The ID must contain only letters (a-z, A-Z), numbers (0-9), + // underscores (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// A request to resize a node group. +message ResizeNodeGroupRequest { + // Required. The name of the node group to resize. + // Format: + // `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The number of running instances for the node group to maintain. + // The group adds or removes instances to maintain the number of instances + // specified by this parameter. + int32 size = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique ID used to identify the request. If the server receives + // two + // [ResizeNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.ResizeNodeGroupRequests) + // with the same ID, the second request is ignored and the + // first [google.longrunning.Operation][google.longrunning.Operation] created + // and stored in the backend is returned. + // + // Recommendation: Set this value to a + // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + // + // The ID must contain only letters (a-z, A-Z), numbers (0-9), + // underscores (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Timeout for graceful YARN decommissioning. [Graceful + // decommissioning] + // (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/scaling-clusters#graceful_decommissioning) + // allows the removal of nodes from the Compute Engine node group + // without interrupting jobs in progress. This timeout specifies how long to + // wait for jobs in progress to finish before forcefully removing nodes (and + // potentially interrupting jobs). Default timeout is 0 (for forceful + // decommission), and the maximum allowed timeout is 1 day. (see JSON + // representation of + // [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). + // + // Only supported on Dataproc image versions 1.2 and higher. + google.protobuf.Duration graceful_decommission_timeout = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A request to get a node group . +message GetNodeGroupRequest { + // Required. The name of the node group to retrieve. + // Format: + // `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataproc.googleapis.com/NodeGroup" + } + ]; +} diff --git a/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/operations.proto b/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/operations.proto new file mode 100644 index 000000000000..02b26897e413 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/operations.proto @@ -0,0 +1,212 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dataproc.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpb"; +option java_multiple_files = true; +option java_outer_classname = "OperationsProto"; +option java_package = "com.google.cloud.dataproc.v1"; + +// Metadata describing the Batch operation. +message BatchOperationMetadata { + // Operation type for Batch resources + enum BatchOperationType { + // Batch operation type is unknown. + BATCH_OPERATION_TYPE_UNSPECIFIED = 0; + + // Batch operation type. + BATCH = 1; + } + + // Name of the batch for the operation. + string batch = 1; + + // Batch UUID for the operation. + string batch_uuid = 2; + + // The time when the operation was created. + google.protobuf.Timestamp create_time = 3; + + // The time when the operation finished. + google.protobuf.Timestamp done_time = 4; + + // The operation type. + BatchOperationType operation_type = 6; + + // Short description of the operation. + string description = 7; + + // Labels associated with the operation. + map labels = 8; + + // Warnings encountered during operation execution. + repeated string warnings = 9; +} + +// Metadata describing the Session operation. +message SessionOperationMetadata { + // Operation type for Session resources + enum SessionOperationType { + // Session operation type is unknown. + SESSION_OPERATION_TYPE_UNSPECIFIED = 0; + + // Create Session operation type. + CREATE = 1; + + // Terminate Session operation type. + TERMINATE = 2; + + // Delete Session operation type. + DELETE = 3; + } + + // Name of the session for the operation. + string session = 1; + + // Session UUID for the operation. + string session_uuid = 2; + + // The time when the operation was created. + google.protobuf.Timestamp create_time = 3; + + // The time when the operation was finished. + google.protobuf.Timestamp done_time = 4; + + // The operation type. + SessionOperationType operation_type = 6; + + // Short description of the operation. + string description = 7; + + // Labels associated with the operation. + map labels = 8; + + // Warnings encountered during operation execution. + repeated string warnings = 9; +} + +// The status of the operation. +message ClusterOperationStatus { + // The operation state. + enum State { + // Unused. + UNKNOWN = 0; + + // The operation has been created. + PENDING = 1; + + // The operation is running. + RUNNING = 2; + + // The operation is done; either cancelled or completed. + DONE = 3; + } + + // Output only. A message containing the operation state. + State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A message containing the detailed operation state. + string inner_state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A message containing any operation metadata details. + string details = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time this state was entered. + google.protobuf.Timestamp state_start_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Metadata describing the operation. +message ClusterOperationMetadata { + // Output only. Name of the cluster for the operation. + string cluster_name = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Cluster UUID for the operation. + string cluster_uuid = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Current operation status. + ClusterOperationStatus status = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The previous operation status. + repeated ClusterOperationStatus status_history = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The operation type. + string operation_type = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Short description of operation. + string description = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Labels associated with the operation + map labels = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Errors encountered during operation execution. + repeated string warnings = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Child operation ids + repeated string child_operation_ids = 15 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Metadata describing the node group operation. +message NodeGroupOperationMetadata { + // Operation type for node group resources. + enum NodeGroupOperationType { + // Node group operation type is unknown. + NODE_GROUP_OPERATION_TYPE_UNSPECIFIED = 0; + + // Create node group operation type. + CREATE = 1; + + // Update node group operation type. + UPDATE = 2; + + // Delete node group operation type. + DELETE = 3; + + // Resize node group operation type. + RESIZE = 4; + } + + // Output only. Node group ID for the operation. + string node_group_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Cluster UUID associated with the node group operation. + string cluster_uuid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Current operation status. + ClusterOperationStatus status = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The previous operation status. + repeated ClusterOperationStatus status_history = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The operation type. + NodeGroupOperationType operation_type = 5; + + // Output only. Short description of operation. + string description = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Labels associated with the operation. + map labels = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Errors encountered during operation execution. + repeated string warnings = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/session_templates.proto b/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/session_templates.proto new file mode 100644 index 000000000000..a5bbeb6f3f1c --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/session_templates.proto @@ -0,0 +1,217 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dataproc.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dataproc/v1/sessions.proto"; +import "google/cloud/dataproc/v1/shared.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpb"; +option java_multiple_files = true; +option java_outer_classname = "SessionTemplatesProto"; +option java_package = "com.google.cloud.dataproc.v1"; + +// The SessionTemplateController provides methods to manage session templates. +service SessionTemplateController { + option (google.api.default_host) = "dataproc.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Create a session template synchronously. + rpc CreateSessionTemplate(CreateSessionTemplateRequest) + returns (SessionTemplate) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/sessionTemplates" + body: "session_template" + }; + option (google.api.method_signature) = "parent,session_template"; + } + + // Updates the session template synchronously. + rpc UpdateSessionTemplate(UpdateSessionTemplateRequest) + returns (SessionTemplate) { + option (google.api.http) = { + patch: "/v1/{session_template.name=projects/*/locations/*/sessionTemplates/*}" + body: "session_template" + }; + option (google.api.method_signature) = "session_template"; + } + + // Gets the resource representation for a session template. + rpc GetSessionTemplate(GetSessionTemplateRequest) returns (SessionTemplate) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/sessionTemplates/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists session templates. + rpc ListSessionTemplates(ListSessionTemplatesRequest) + returns (ListSessionTemplatesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/sessionTemplates" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a session template. + rpc DeleteSessionTemplate(DeleteSessionTemplateRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/sessionTemplates/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// A request to create a session template. +message CreateSessionTemplateRequest { + // Required. The parent resource where this session template will be created. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dataproc.googleapis.com/SessionTemplate" + } + ]; + + // Required. The session template to create. + SessionTemplate session_template = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// A request to update a session template. +message UpdateSessionTemplateRequest { + // Required. The updated session template. + SessionTemplate session_template = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// A request to get the resource representation for a session template. +message GetSessionTemplateRequest { + // Required. The name of the session template to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataproc.googleapis.com/SessionTemplate" + } + ]; +} + +// A request to list session templates in a project. +message ListSessionTemplatesRequest { + // Required. The parent that owns this collection of session templates. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dataproc.googleapis.com/SessionTemplate" + } + ]; + + // Optional. The maximum number of sessions to return in each response. + // The service may return fewer than this value. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token received from a previous `ListSessions` call. + // Provide this token to retrieve the subsequent page. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A filter for the session templates to return in the response. + // Filters are case sensitive and have the following syntax: + // + // [field = value] AND [field [= value]] ... + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// A list of session templates. +message ListSessionTemplatesResponse { + // Output only. Session template list + repeated SessionTemplate session_templates = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// A request to delete a session template. +message DeleteSessionTemplateRequest { + // Required. The name of the session template resource to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataproc.googleapis.com/SessionTemplate" + } + ]; +} + +// A representation of a session template. +message SessionTemplate { + option (google.api.resource) = { + type: "dataproc.googleapis.com/SessionTemplate" + pattern: "projects/{project}/locations/{location}/sessionTemplates/{template}" + }; + + // Required. The resource name of the session template. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Brief description of the template. + string description = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The time when the template was created. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The session configuration. + oneof session_config { + // Optional. Jupyter session config. + JupyterConfig jupyter_session = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Spark Connect session config. + SparkConnectConfig spark_connect_session = 11 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Output only. The email address of the user who created the template. + string creator = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Labels to associate with sessions created using this template. + // Label **keys** must contain 1 to 63 characters, and must conform to + // [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). + // Label **values** can be empty, but, if present, must contain 1 to 63 + // characters and conform to [RFC + // 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be + // associated with a session. + map labels = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Runtime configuration for session execution. + RuntimeConfig runtime_config = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Environment configuration for session execution. + EnvironmentConfig environment_config = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The time the template was last updated. + google.protobuf.Timestamp update_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A session template UUID (Unique Universal Identifier). The + // service generates this value when it creates the session template. + string uuid = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/sessions.proto b/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/sessions.proto new file mode 100644 index 000000000000..aed66dc8d7c0 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/sessions.proto @@ -0,0 +1,379 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dataproc.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dataproc/v1/shared.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpb"; +option java_multiple_files = true; +option java_outer_classname = "SessionsProto"; +option java_package = "com.google.cloud.dataproc.v1"; + +// The `SessionController` provides methods to manage interactive sessions. +service SessionController { + option (google.api.default_host) = "dataproc.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Create an interactive session asynchronously. + rpc CreateSession(CreateSessionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/sessions" + body: "session" + }; + option (google.api.method_signature) = "parent,session,session_id"; + option (google.longrunning.operation_info) = { + response_type: "Session" + metadata_type: "google.cloud.dataproc.v1.SessionOperationMetadata" + }; + } + + // Gets the resource representation for an interactive session. + rpc GetSession(GetSessionRequest) returns (Session) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/sessions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists interactive sessions. + rpc ListSessions(ListSessionsRequest) returns (ListSessionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/sessions" + }; + option (google.api.method_signature) = "parent"; + } + + // Terminates the interactive session. + rpc TerminateSession(TerminateSessionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/sessions/*}:terminate" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Session" + metadata_type: "google.cloud.dataproc.v1.SessionOperationMetadata" + }; + } + + // Deletes the interactive session resource. If the session is not in terminal + // state, it is terminated, and then deleted. + rpc DeleteSession(DeleteSessionRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/sessions/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Session" + metadata_type: "google.cloud.dataproc.v1.SessionOperationMetadata" + }; + } +} + +// A request to create a session. +message CreateSessionRequest { + // Required. The parent resource where this session will be created. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dataproc.googleapis.com/Session" + } + ]; + + // Required. The interactive session to create. + Session session = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the session, which becomes the final component + // of the session's resource name. + // + // This value must be 4-63 characters. Valid characters + // are /[a-z][0-9]-/. + string session_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A unique ID used to identify the request. If the service + // receives two + // [CreateSessionRequests](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateSessionRequest)s + // with the same ID, the second request is ignored, and the + // first [Session][google.cloud.dataproc.v1.Session] is created and stored in + // the backend. + // + // Recommendation: Set this value to a + // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + // + // The value must contain only letters (a-z, A-Z), numbers (0-9), + // underscores (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// A request to get the resource representation for a session. +message GetSessionRequest { + // Required. The name of the session to retrieve. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataproc.googleapis.com/Session" + } + ]; +} + +// A request to list sessions in a project. +message ListSessionsRequest { + // Required. The parent, which owns this collection of sessions. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dataproc.googleapis.com/Session" + } + ]; + + // Optional. The maximum number of sessions to return in each response. + // The service may return fewer than this value. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token received from a previous `ListSessions` call. + // Provide this token to retrieve the subsequent page. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A filter for the sessions to return in the response. + // + // A filter is a logical expression constraining the values of various fields + // in each session resource. Filters are case sensitive, and may contain + // multiple clauses combined with logical operators (AND, OR). + // Supported fields are `session_id`, `session_uuid`, `state`, `create_time`, + // and `labels`. + // + // Example: `state = ACTIVE and create_time < "2023-01-01T00:00:00Z"` + // is a filter for sessions in an ACTIVE state that were created before + // 2023-01-01. `state = ACTIVE and labels.environment=production` is a filter + // for sessions in an ACTIVE state that have a production environment label. + // + // See https://google.aip.dev/assets/misc/ebnf-filtering.txt for a detailed + // description of the filter syntax and a list of supported comparators. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// A list of interactive sessions. +message ListSessionsResponse { + // Output only. The sessions from the specified collection. + repeated Session sessions = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A token, which can be sent as `page_token`, to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// A request to terminate an interactive session. +message TerminateSessionRequest { + // Required. The name of the session resource to terminate. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataproc.googleapis.com/Session" + } + ]; + + // Optional. A unique ID used to identify the request. If the service + // receives two + // [TerminateSessionRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.TerminateSessionRequest)s + // with the same ID, the second request is ignored. + // + // Recommendation: Set this value to a + // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + // + // The value must contain only letters (a-z, A-Z), numbers (0-9), + // underscores (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// A request to delete a session. +message DeleteSessionRequest { + // Required. The name of the session resource to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataproc.googleapis.com/Session" + } + ]; + + // Optional. A unique ID used to identify the request. If the service + // receives two + // [DeleteSessionRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteSessionRequest)s + // with the same ID, the second request is ignored. + // + // Recommendation: Set this value to a + // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + // + // The value must contain only letters (a-z, A-Z), numbers (0-9), + // underscores (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// A representation of a session. +message Session { + option (google.api.resource) = { + type: "dataproc.googleapis.com/Session" + pattern: "projects/{project}/locations/{location}/sessions/{session}" + }; + + // The session state. + enum State { + // The session state is unknown. + STATE_UNSPECIFIED = 0; + + // The session is created prior to running. + CREATING = 1; + + // The session is running. + ACTIVE = 2; + + // The session is terminating. + TERMINATING = 3; + + // The session is terminated successfully. + TERMINATED = 4; + + // The session is no longer running due to an error. + FAILED = 5; + } + + // Historical state information. + message SessionStateHistory { + // Output only. The state of the session at this point in the session + // history. + State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Details about the state at this point in the session + // history. + string state_message = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the session entered the historical state. + google.protobuf.Timestamp state_start_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Required. The resource name of the session. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. A session UUID (Unique Universal Identifier). The service + // generates this value when it creates the session. + string uuid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the session was created. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The session configuration. + oneof session_config { + // Optional. Jupyter session config. + JupyterConfig jupyter_session = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Spark Connect session config. + SparkConnectConfig spark_connect_session = 17 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Output only. Runtime information about session execution. + RuntimeInfo runtime_info = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A state of the session. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Session state details, such as the failure + // description if the state is `FAILED`. + string state_message = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the session entered the current state. + google.protobuf.Timestamp state_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The email address of the user who created the session. + string creator = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The labels to associate with the session. + // Label **keys** must contain 1 to 63 characters, and must conform to + // [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). + // Label **values** may be empty, but, if present, must contain 1 to 63 + // characters, and must conform to [RFC + // 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be + // associated with a session. + map labels = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Runtime configuration for the session execution. + RuntimeConfig runtime_config = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Environment configuration for the session execution. + EnvironmentConfig environment_config = 13 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The email address of the user who owns the session. + string user = 14 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Historical state information for the session. + repeated SessionStateHistory state_history = 15 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The session template used by the session. + // + // Only resource names, including project ID and location, are valid. + // + // Example: + // * `https://www.googleapis.com/compute/v1/projects/[project_id]/locations/[dataproc_region]/sessionTemplates/[template_id]` + // * `projects/[project_id]/locations/[dataproc_region]/sessionTemplates/[template_id]` + // + // The template must be in the same project and Dataproc region as the + // session. + string session_template = 16 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "dataproc.googleapis.com/SessionTemplate" + } + ]; +} + +// Jupyter configuration for an interactive session. +message JupyterConfig { + // Jupyter kernel types. + enum Kernel { + // The kernel is unknown. + KERNEL_UNSPECIFIED = 0; + + // Python kernel. + PYTHON = 1; + + // Scala kernel. + SCALA = 2; + } + + // Optional. Kernel + Kernel kernel = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Display name, shown in the Jupyter kernelspec card. + string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Spark Connect configuration for an interactive session. +message SparkConnectConfig {} diff --git a/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/shared.proto b/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/shared.proto new file mode 100644 index 000000000000..33fb9aff3cae --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/shared.proto @@ -0,0 +1,627 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dataproc.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpb"; +option java_multiple_files = true; +option java_outer_classname = "SharedProto"; +option java_package = "com.google.cloud.dataproc.v1"; +option (google.api.resource_definition) = { + type: "container.googleapis.com/Cluster" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}" +}; +option (google.api.resource_definition) = { + type: "metastore.googleapis.com/Service" + pattern: "projects/{project}/locations/{location}/services/{service}" +}; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKey" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" +}; + +// Runtime configuration for a workload. +message RuntimeConfig { + // Optional. Version of the batch runtime. + string version = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Optional custom container image for the job runtime environment. + // If not specified, a default container image will be used. + string container_image = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A mapping of property names to values, which are used to + // configure workload execution. + map properties = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Dependency repository configuration. + RepositoryConfig repository_config = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Autotuning configuration of the workload. + AutotuningConfig autotuning_config = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Cohort identifier. Identifies families of the workloads having + // the same shape, e.g. daily ETL jobs. + string cohort = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// Environment configuration for a workload. +message EnvironmentConfig { + // Optional. Execution configuration for a workload. + ExecutionConfig execution_config = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Peripherals configuration that workload has access to. + PeripheralsConfig peripherals_config = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Execution configuration for a workload. +message ExecutionConfig { + // Optional. Service account that used to execute workload. + string service_account = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Network configuration for workload execution. + oneof network { + // Optional. Network URI to connect workload to. + string network_uri = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Subnetwork URI to connect workload to. + string subnetwork_uri = 5 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Tags used for network traffic control. + repeated string network_tags = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Cloud KMS key to use for encryption. + string kms_key = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Applies to sessions only. The duration to keep the session alive + // while it's idling. Exceeding this threshold causes the session to + // terminate. This field cannot be set on a batch workload. Minimum value is + // 10 minutes; maximum value is 14 days (see JSON representation of + // [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). + // Defaults to 1 hour if not set. + // If both `ttl` and `idle_ttl` are specified for an interactive session, + // the conditions are treated as `OR` conditions: the workload will be + // terminated when it has been idle for `idle_ttl` or when `ttl` has been + // exceeded, whichever occurs first. + google.protobuf.Duration idle_ttl = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The duration after which the workload will be terminated, + // specified as the JSON representation for + // [Duration](https://protobuf.dev/programming-guides/proto3/#json). + // When the workload exceeds this duration, it will be unconditionally + // terminated without waiting for ongoing work to finish. If `ttl` is not + // specified for a batch workload, the workload will be allowed to run until + // it exits naturally (or run forever without exiting). If `ttl` is not + // specified for an interactive session, it defaults to 24 hours. If `ttl` is + // not specified for a batch that uses 2.1+ runtime version, it defaults to 4 + // hours. Minimum value is 10 minutes; maximum value is 14 days. If both `ttl` + // and `idle_ttl` are specified (for an interactive session), the conditions + // are treated as `OR` conditions: the workload will be terminated when it has + // been idle for `idle_ttl` or when `ttl` has been exceeded, whichever occurs + // first. + google.protobuf.Duration ttl = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A Cloud Storage bucket used to stage workload dependencies, + // config files, and store workload output and other ephemeral data, such as + // Spark history files. If you do not specify a staging bucket, Cloud Dataproc + // will determine a Cloud Storage location according to the region where your + // workload is running, and then create and manage project-level, per-location + // staging and temporary buckets. + // **This field requires a Cloud Storage bucket name, not a `gs://...` URI to + // a Cloud Storage bucket.** + string staging_bucket = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Authentication configuration used to set the default identity for + // the workload execution. The config specifies the type of identity + // (service account or user) that will be used by workloads to access + // resources on the project(s). + AuthenticationConfig authentication_config = 11 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Spark History Server configuration for the workload. +message SparkHistoryServerConfig { + // Optional. Resource name of an existing Dataproc Cluster to act as a Spark + // History Server for the workload. + // + // Example: + // + // * `projects/[project_id]/regions/[region]/clusters/[cluster_name]` + string dataproc_cluster = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Auxiliary services configuration for a workload. +message PeripheralsConfig { + // Optional. Resource name of an existing Dataproc Metastore service. + // + // Example: + // + // * `projects/[project_id]/locations/[region]/services/[service_id]` + string metastore_service = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "metastore.googleapis.com/Service" + } + ]; + + // Optional. The Spark History Server configuration for the workload. + SparkHistoryServerConfig spark_history_server_config = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Runtime information about workload execution. +message RuntimeInfo { + // Output only. Map of remote access endpoints (such as web interfaces and + // APIs) to their URIs. + map endpoints = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A URI pointing to the location of the stdout and stderr of the + // workload. + string output_uri = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A URI pointing to the location of the diagnostics tarball. + string diagnostic_output_uri = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Approximate workload resource usage, calculated when + // the workload completes (see [Dataproc Serverless pricing] + // (https://cloud.google.com/dataproc-serverless/pricing)). + // + // **Note:** This metric calculation may change in the future, for + // example, to capture cumulative workload resource + // consumption during workload execution (see the + // [Dataproc Serverless release notes] + // (https://cloud.google.com/dataproc-serverless/docs/release-notes) + // for announcements, changes, fixes + // and other Dataproc developments). + UsageMetrics approximate_usage = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Snapshot of current workload resource usage. + UsageSnapshot current_usage = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Usage metrics represent approximate total resources consumed by a workload. +message UsageMetrics { + // Optional. DCU (Dataproc Compute Units) usage in (`milliDCU` x `seconds`) + // (see [Dataproc Serverless pricing] + // (https://cloud.google.com/dataproc-serverless/pricing)). + int64 milli_dcu_seconds = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Shuffle storage usage in (`GB` x `seconds`) (see + // [Dataproc Serverless pricing] + // (https://cloud.google.com/dataproc-serverless/pricing)). + int64 shuffle_storage_gb_seconds = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Accelerator usage in (`milliAccelerator` x `seconds`) (see + // [Dataproc Serverless pricing] + // (https://cloud.google.com/dataproc-serverless/pricing)). + int64 milli_accelerator_seconds = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Accelerator type being used, if any + string accelerator_type = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The usage snapshot represents the resources consumed by a workload at a +// specified time. +message UsageSnapshot { + // Optional. Milli (one-thousandth) Dataproc Compute Units (DCUs) (see + // [Dataproc Serverless pricing] + // (https://cloud.google.com/dataproc-serverless/pricing)). + int64 milli_dcu = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Shuffle Storage in gigabytes (GB). (see [Dataproc Serverless + // pricing] (https://cloud.google.com/dataproc-serverless/pricing)) + int64 shuffle_storage_gb = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Milli (one-thousandth) Dataproc Compute Units (DCUs) charged at + // premium tier (see [Dataproc Serverless pricing] + // (https://cloud.google.com/dataproc-serverless/pricing)). + int64 milli_dcu_premium = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Shuffle Storage in gigabytes (GB) charged at premium tier. (see + // [Dataproc Serverless pricing] + // (https://cloud.google.com/dataproc-serverless/pricing)) + int64 shuffle_storage_gb_premium = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Milli (one-thousandth) accelerator. (see [Dataproc + // Serverless pricing] (https://cloud.google.com/dataproc-serverless/pricing)) + int64 milli_accelerator = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Accelerator type being used, if any + string accelerator_type = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The timestamp of the usage snapshot. + google.protobuf.Timestamp snapshot_time = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The cluster's GKE config. +message GkeClusterConfig { + // Optional. A target GKE cluster to deploy to. It must be in the same project + // and region as the Dataproc cluster (the GKE cluster can be zonal or + // regional). Format: + // 'projects/{project}/locations/{location}/clusters/{cluster_id}' + string gke_cluster_target = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "container.googleapis.com/Cluster" + } + ]; + + // Optional. GKE node pools where workloads will be scheduled. At least one + // node pool must be assigned the `DEFAULT` + // [GkeNodePoolTarget.Role][google.cloud.dataproc.v1.GkeNodePoolTarget.Role]. + // If a `GkeNodePoolTarget` is not specified, Dataproc constructs a `DEFAULT` + // `GkeNodePoolTarget`. Each role can be given to only one + // `GkeNodePoolTarget`. All node pools must have the same location settings. + repeated GkeNodePoolTarget node_pool_target = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The configuration for running the Dataproc cluster on Kubernetes. +message KubernetesClusterConfig { + // Optional. A namespace within the Kubernetes cluster to deploy into. If this + // namespace does not exist, it is created. If it exists, Dataproc verifies + // that another Dataproc VirtualCluster is not installed into it. If not + // specified, the name of the Dataproc Cluster is used. + string kubernetes_namespace = 1 [(google.api.field_behavior) = OPTIONAL]; + + oneof config { + // Required. The configuration for running the Dataproc cluster on GKE. + GkeClusterConfig gke_cluster_config = 2 + [(google.api.field_behavior) = REQUIRED]; + } + + // Optional. The software configuration for this Dataproc cluster running on + // Kubernetes. + KubernetesSoftwareConfig kubernetes_software_config = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The software configuration for this Dataproc cluster running on Kubernetes. +message KubernetesSoftwareConfig { + // The components that should be installed in this Dataproc cluster. The key + // must be a string from the KubernetesComponent enumeration. The value is + // the version of the software to be installed. + // At least one entry must be specified. + map component_version = 1; + + // The properties to set on daemon config files. + // + // Property keys are specified in `prefix:property` format, for example + // `spark:spark.kubernetes.container.image`. The following are supported + // prefixes and their mappings: + // + // * spark: `spark-defaults.conf` + // + // For more information, see [Cluster + // properties](https://cloud.google.com/dataproc/docs/concepts/cluster-properties). + map properties = 2; +} + +// GKE node pools that Dataproc workloads run on. +message GkeNodePoolTarget { + // `Role` specifies the tasks that will run on the node pool. Roles can be + // specific to workloads. Exactly one + // [GkeNodePoolTarget][google.cloud.dataproc.v1.GkeNodePoolTarget] within the + // virtual cluster must have the `DEFAULT` role, which is used to run all + // workloads that are not associated with a node pool. + enum Role { + // Role is unspecified. + ROLE_UNSPECIFIED = 0; + + // At least one node pool must have the `DEFAULT` role. + // Work assigned to a role that is not associated with a node pool + // is assigned to the node pool with the `DEFAULT` role. For example, + // work assigned to the `CONTROLLER` role will be assigned to the node pool + // with the `DEFAULT` role if no node pool has the `CONTROLLER` role. + DEFAULT = 1; + + // Run work associated with the Dataproc control plane (for example, + // controllers and webhooks). Very low resource requirements. + CONTROLLER = 2; + + // Run work associated with a Spark driver of a job. + SPARK_DRIVER = 3; + + // Run work associated with a Spark executor of a job. + SPARK_EXECUTOR = 4; + } + + // Required. The target GKE node pool. + // Format: + // 'projects/{project}/locations/{location}/clusters/{cluster}/nodePools/{node_pool}' + string node_pool = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The roles associated with the GKE node pool. + repeated Role roles = 2 [(google.api.field_behavior) = REQUIRED]; + + // Input only. The configuration for the GKE node pool. + // + // If specified, Dataproc attempts to create a node pool with the + // specified shape. If one with the same name already exists, it is + // verified against all specified fields. If a field differs, the + // virtual cluster creation will fail. + // + // If omitted, any node pool with the specified name is used. If a + // node pool with the specified name does not exist, Dataproc create a + // node pool with default values. + // + // This is an input only field. It will not be returned by the API. + GkeNodePoolConfig node_pool_config = 3 + [(google.api.field_behavior) = INPUT_ONLY]; +} + +// The configuration of a GKE node pool used by a [Dataproc-on-GKE +// cluster](https://cloud.google.com/dataproc/docs/concepts/jobs/dataproc-gke#create-a-dataproc-on-gke-cluster). +message GkeNodePoolConfig { + // Parameters that describe cluster nodes. + message GkeNodeConfig { + // Optional. The name of a Compute Engine [machine + // type](https://cloud.google.com/compute/docs/machine-types). + string machine_type = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The number of local SSD disks to attach to the node, which is + // limited by the maximum number of disks allowable per zone (see [Adding + // Local SSDs](https://cloud.google.com/compute/docs/disks/local-ssd)). + int32 local_ssd_count = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether the nodes are created as legacy [preemptible VM + // instances] (https://cloud.google.com/compute/docs/instances/preemptible). + // Also see + // [Spot][google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.spot] + // VMs, preemptible VM instances without a maximum lifetime. Legacy and Spot + // preemptible nodes cannot be used in a node pool with the `CONTROLLER` + // [role] + // (/dataproc/docs/reference/rest/v1/projects.regions.clusters#role) + // or in the DEFAULT node pool if the CONTROLLER role is not assigned (the + // DEFAULT node pool will assume the CONTROLLER role). + bool preemptible = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of [hardware + // accelerators](https://cloud.google.com/compute/docs/gpus) to attach to + // each node. + repeated GkeNodePoolAcceleratorConfig accelerators = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. [Minimum CPU + // platform](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform) + // to be used by this instance. The instance may be scheduled on the + // specified or a newer CPU platform. Specify the friendly names of CPU + // platforms, such as "Intel Haswell"` or Intel Sandy Bridge". + string min_cpu_platform = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The [Customer Managed Encryption Key (CMEK)] + // (https://cloud.google.com/kubernetes-engine/docs/how-to/using-cmek) + // used to encrypt the boot disk attached to each node in the node pool. + // Specify the key using the following format: + // projects/KEY_PROJECT_ID/locations/LOCATION/keyRings/RING_NAME/cryptoKeys/KEY_NAME. + string boot_disk_kms_key = 23 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether the nodes are created as [Spot VM instances] + // (https://cloud.google.com/compute/docs/instances/spot). + // Spot VMs are the latest update to legacy + // [preemptible + // VMs][google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.preemptible]. + // Spot VMs do not have a maximum lifetime. Legacy and Spot preemptible + // nodes cannot be used in a node pool with the `CONTROLLER` + // [role](/dataproc/docs/reference/rest/v1/projects.regions.clusters#role) + // or in the DEFAULT node pool if the CONTROLLER role is not assigned (the + // DEFAULT node pool will assume the CONTROLLER role). + bool spot = 32 [(google.api.field_behavior) = OPTIONAL]; + } + + // A GkeNodeConfigAcceleratorConfig represents a Hardware Accelerator request + // for a node pool. + message GkeNodePoolAcceleratorConfig { + // The number of accelerator cards exposed to an instance. + int64 accelerator_count = 1; + + // The accelerator type resource namename (see GPUs on Compute Engine). + string accelerator_type = 2; + + // Size of partitions to create on the GPU. Valid values are described in + // the NVIDIA [mig user + // guide](https://docs.nvidia.com/datacenter/tesla/mig-user-guide/#partitioning). + string gpu_partition_size = 3; + } + + // GkeNodePoolAutoscaling contains information the cluster autoscaler needs to + // adjust the size of the node pool to the current cluster usage. + message GkeNodePoolAutoscalingConfig { + // The minimum number of nodes in the node pool. Must be >= 0 and <= + // max_node_count. + int32 min_node_count = 2; + + // The maximum number of nodes in the node pool. Must be >= min_node_count, + // and must be > 0. + // **Note:** Quota must be sufficient to scale up the cluster. + int32 max_node_count = 3; + } + + // Optional. The node pool configuration. + GkeNodeConfig config = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The list of Compute Engine + // [zones](https://cloud.google.com/compute/docs/zones#available) where + // node pool nodes associated with a Dataproc on GKE virtual cluster + // will be located. + // + // **Note:** All node pools associated with a virtual cluster + // must be located in the same region as the virtual cluster, and they must + // be located in the same zone within that region. + // + // If a location is not specified during node pool creation, Dataproc on GKE + // will choose the zone. + repeated string locations = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The autoscaler configuration for this node pool. The autoscaler + // is enabled only when a valid configuration is present. + GkeNodePoolAutoscalingConfig autoscaling = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Authentication configuration for a workload is used to set the default +// identity for the workload execution. +// The config specifies the type of identity (service account or user) that +// will be used by workloads to access resources on the project(s). +message AuthenticationConfig { + // Authentication types for workload execution. + enum AuthenticationType { + // If AuthenticationType is unspecified then END_USER_CREDENTIALS is used + // for 3.0 and newer runtimes, and SERVICE_ACCOUNT is used for older + // runtimes. + AUTHENTICATION_TYPE_UNSPECIFIED = 0; + + // Use service account credentials for authenticating to other services. + SERVICE_ACCOUNT = 1; + + // Use OAuth credentials associated with the workload creator/user for + // authenticating to other services. + END_USER_CREDENTIALS = 2; + } + + // Optional. Authentication type for the user workload running in containers. + AuthenticationType user_workload_authentication_type = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Autotuning configuration of the workload. +message AutotuningConfig { + // Scenario represents a specific goal that autotuning will attempt to achieve + // by modifying workloads. + enum Scenario { + // Default value. + SCENARIO_UNSPECIFIED = 0; + + // Scaling recommendations such as initialExecutors. + SCALING = 2; + + // Adding hints for potential relation broadcasts. + BROADCAST_HASH_JOIN = 3; + + // Memory management for workloads. + MEMORY = 4; + + // No autotuning. + NONE = 5; + + // Automatic selection of scenarios. + AUTO = 6; + } + + // Optional. Scenarios for which tunings are applied. + repeated Scenario scenarios = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration for dependency repositories +message RepositoryConfig { + // Optional. Configuration for PyPi repository. + PyPiRepositoryConfig pypi_repository_config = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration for PyPi repository +message PyPiRepositoryConfig { + // Optional. PyPi repository address + string pypi_repository = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Cluster components that can be activated. +enum Component { + // Unspecified component. Specifying this will cause Cluster creation to fail. + COMPONENT_UNSPECIFIED = 0; + + // The Anaconda component is no longer supported or applicable to + // [supported Dataproc on Compute Engine image versions] + // (https://cloud.google.com/dataproc/docs/concepts/versioning/dataproc-version-clusters#supported-dataproc-image-versions). + // It cannot be activated on clusters created with supported Dataproc on + // Compute Engine image versions. + ANACONDA = 5; + + // Delta Lake. + DELTA = 20; + + // Docker + DOCKER = 13; + + // The Druid query engine. (alpha) + DRUID = 9; + + // Flink + FLINK = 14; + + // HBase. (beta) + HBASE = 11; + + // The Hive Web HCatalog (the REST service for accessing HCatalog). + HIVE_WEBHCAT = 3; + + // Hudi. + HUDI = 18; + + // Iceberg. + ICEBERG = 19; + + // The Jupyter Notebook. + JUPYTER = 1; + + // The Jupyter Kernel Gateway. + JUPYTER_KERNEL_GATEWAY = 22; + + // The Pig component. + PIG = 21; + + // The Presto query engine. + PRESTO = 6; + + // The Trino query engine. + TRINO = 17; + + // The Ranger service. + RANGER = 12; + + // The Solr service. + SOLR = 10; + + // The Zeppelin notebook. + ZEPPELIN = 4; + + // The Zookeeper service. + ZOOKEEPER = 8; +} + +// Actions in response to failure of a resource associated with a cluster. +enum FailureAction { + // When FailureAction is unspecified, failure action defaults to NO_ACTION. + FAILURE_ACTION_UNSPECIFIED = 0; + + // Take no action on failure to create a cluster resource. NO_ACTION is the + // default. + NO_ACTION = 1; + + // Delete the failed cluster resource. + DELETE = 2; +} diff --git a/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/workflow_templates.proto b/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/workflow_templates.proto new file mode 100644 index 000000000000..4c5774913b11 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/workflow_templates.proto @@ -0,0 +1,890 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dataproc.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dataproc/v1/clusters.proto"; +import "google/cloud/dataproc/v1/jobs.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpb"; +option java_multiple_files = true; +option java_outer_classname = "WorkflowTemplatesProto"; +option java_package = "com.google.cloud.dataproc.v1"; + +// The API interface for managing Workflow Templates in the +// Dataproc API. +service WorkflowTemplateService { + option (google.api.default_host) = "dataproc.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates new workflow template. + rpc CreateWorkflowTemplate(CreateWorkflowTemplateRequest) + returns (WorkflowTemplate) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/workflowTemplates" + body: "template" + additional_bindings { + post: "/v1/{parent=projects/*/regions/*}/workflowTemplates" + body: "template" + } + }; + option (google.api.method_signature) = "parent,template"; + } + + // Retrieves the latest workflow template. + // + // Can retrieve previously instantiated template by specifying optional + // version parameter. + rpc GetWorkflowTemplate(GetWorkflowTemplateRequest) + returns (WorkflowTemplate) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/workflowTemplates/*}" + additional_bindings { + get: "/v1/{name=projects/*/regions/*/workflowTemplates/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Instantiates a template and begins execution. + // + // The returned Operation can be used to track execution of + // workflow by polling + // [operations.get][google.longrunning.Operations.GetOperation]. + // The Operation will complete when entire workflow is finished. + // + // The running workflow can be aborted via + // [operations.cancel][google.longrunning.Operations.CancelOperation]. + // This will cause any inflight jobs to be cancelled and workflow-owned + // clusters to be deleted. + // + // The [Operation.metadata][google.longrunning.Operation.metadata] will be + // [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). + // Also see [Using + // WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). + // + // On successful completion, + // [Operation.response][google.longrunning.Operation.response] will be + // [Empty][google.protobuf.Empty]. + rpc InstantiateWorkflowTemplate(InstantiateWorkflowTemplateRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/workflowTemplates/*}:instantiate" + body: "*" + additional_bindings { + post: "/v1/{name=projects/*/regions/*/workflowTemplates/*}:instantiate" + body: "*" + } + }; + option (google.api.method_signature) = "name"; + option (google.api.method_signature) = "name,parameters"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "WorkflowMetadata" + }; + } + + // Instantiates a template and begins execution. + // + // This method is equivalent to executing the sequence + // [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate], + // [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate], + // [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate]. + // + // The returned Operation can be used to track execution of + // workflow by polling + // [operations.get][google.longrunning.Operations.GetOperation]. + // The Operation will complete when entire workflow is finished. + // + // The running workflow can be aborted via + // [operations.cancel][google.longrunning.Operations.CancelOperation]. + // This will cause any inflight jobs to be cancelled and workflow-owned + // clusters to be deleted. + // + // The [Operation.metadata][google.longrunning.Operation.metadata] will be + // [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). + // Also see [Using + // WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). + // + // On successful completion, + // [Operation.response][google.longrunning.Operation.response] will be + // [Empty][google.protobuf.Empty]. + rpc InstantiateInlineWorkflowTemplate( + InstantiateInlineWorkflowTemplateRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/workflowTemplates:instantiateInline" + body: "template" + additional_bindings { + post: "/v1/{parent=projects/*/regions/*}/workflowTemplates:instantiateInline" + body: "template" + } + }; + option (google.api.method_signature) = "parent,template"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "WorkflowMetadata" + }; + } + + // Updates (replaces) workflow template. The updated template + // must contain version that matches the current server version. + rpc UpdateWorkflowTemplate(UpdateWorkflowTemplateRequest) + returns (WorkflowTemplate) { + option (google.api.http) = { + put: "/v1/{template.name=projects/*/locations/*/workflowTemplates/*}" + body: "template" + additional_bindings { + put: "/v1/{template.name=projects/*/regions/*/workflowTemplates/*}" + body: "template" + } + }; + option (google.api.method_signature) = "template"; + } + + // Lists workflows that match the specified filter in the request. + rpc ListWorkflowTemplates(ListWorkflowTemplatesRequest) + returns (ListWorkflowTemplatesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/workflowTemplates" + additional_bindings { + get: "/v1/{parent=projects/*/regions/*}/workflowTemplates" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a workflow template. It does not cancel in-progress workflows. + rpc DeleteWorkflowTemplate(DeleteWorkflowTemplateRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/workflowTemplates/*}" + additional_bindings { + delete: "/v1/{name=projects/*/regions/*/workflowTemplates/*}" + } + }; + option (google.api.method_signature) = "name"; + } +} + +// A Dataproc workflow template resource. +message WorkflowTemplate { + option (google.api.resource) = { + type: "dataproc.googleapis.com/WorkflowTemplate" + pattern: "projects/{project}/regions/{region}/workflowTemplates/{workflow_template}" + pattern: "projects/{project}/locations/{location}/workflowTemplates/{workflow_template}" + history: ORIGINALLY_SINGLE_PATTERN + }; + + // Encryption settings for encrypting workflow template job arguments. + message EncryptionConfig { + // Optional. The Cloud KMS key name to use for encrypting + // workflow template job arguments. + // + // When this this key is provided, the following workflow template + // [job arguments] + // (https://cloud.google.com/dataproc/docs/concepts/workflows/use-workflows#adding_jobs_to_a_template), + // if present, are + // [CMEK + // encrypted](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/customer-managed-encryption#use_cmek_with_workflow_template_data): + // + // * [FlinkJob + // args](https://cloud.google.com/dataproc/docs/reference/rest/v1/FlinkJob) + // * [HadoopJob + // args](https://cloud.google.com/dataproc/docs/reference/rest/v1/HadoopJob) + // * [SparkJob + // args](https://cloud.google.com/dataproc/docs/reference/rest/v1/SparkJob) + // * [SparkRJob + // args](https://cloud.google.com/dataproc/docs/reference/rest/v1/SparkRJob) + // * [PySparkJob + // args](https://cloud.google.com/dataproc/docs/reference/rest/v1/PySparkJob) + // * [SparkSqlJob](https://cloud.google.com/dataproc/docs/reference/rest/v1/SparkSqlJob) + // scriptVariables and queryList.queries + // * [HiveJob](https://cloud.google.com/dataproc/docs/reference/rest/v1/HiveJob) + // scriptVariables and queryList.queries + // * [PigJob](https://cloud.google.com/dataproc/docs/reference/rest/v1/PigJob) + // scriptVariables and queryList.queries + // * [PrestoJob](https://cloud.google.com/dataproc/docs/reference/rest/v1/PrestoJob) + // scriptVariables and queryList.queries + string kms_key = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; + } + + string id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The resource name of the workflow template, as described + // in https://cloud.google.com/apis/design/resource_names. + // + // * For `projects.regions.workflowTemplates`, the resource name of the + // template has the following format: + // `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` + // + // * For `projects.locations.workflowTemplates`, the resource name of the + // template has the following format: + // `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Used to perform a consistent read-modify-write. + // + // This field should be left blank for a `CreateWorkflowTemplate` request. It + // is required for an `UpdateWorkflowTemplate` request, and must match the + // current server version. A typical update template flow would fetch the + // current template with a `GetWorkflowTemplate` request, which will return + // the current template with the `version` field filled in with the + // current server version. The user updates other fields in the template, + // then returns it as part of the `UpdateWorkflowTemplate` request. + int32 version = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The time template was created. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time template was last updated. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The labels to associate with this template. These labels + // will be propagated to all jobs and clusters created by the workflow + // instance. + // + // Label **keys** must contain 1 to 63 characters, and must conform to + // [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). + // + // Label **values** may be empty, but, if present, must contain 1 to 63 + // characters, and must conform to + // [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). + // + // No more than 32 labels can be associated with a template. + map labels = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Required. WorkflowTemplate scheduling information. + WorkflowTemplatePlacement placement = 7 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The Directed Acyclic Graph of Jobs to submit. + repeated OrderedJob jobs = 8 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Template parameters whose values are substituted into the + // template. Values for parameters must be provided when the template is + // instantiated. + repeated TemplateParameter parameters = 9 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Timeout duration for the DAG of jobs, expressed in seconds (see + // [JSON representation of + // duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). + // The timeout duration must be from 10 minutes ("600s") to 24 hours + // ("86400s"). The timer begins when the first job is submitted. If the + // workflow is running at the end of the timeout period, any remaining jobs + // are cancelled, the workflow is ended, and if the workflow was running on a + // [managed + // cluster](/dataproc/docs/concepts/workflows/using-workflows#configuring_or_selecting_a_cluster), + // the cluster is deleted. + google.protobuf.Duration dag_timeout = 10 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Encryption settings for encrypting workflow template job + // arguments. + EncryptionConfig encryption_config = 11 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Specifies workflow execution target. +// +// Either `managed_cluster` or `cluster_selector` is required. +message WorkflowTemplatePlacement { + // Required. Specifies where workflow executes; either on a managed + // cluster or an existing cluster chosen by labels. + oneof placement { + // A cluster that is managed by the workflow. + ManagedCluster managed_cluster = 1; + + // Optional. A selector that chooses target cluster for jobs based + // on metadata. + // + // The selector is evaluated at the time each job is submitted. + ClusterSelector cluster_selector = 2; + } +} + +// Cluster that is managed by the workflow. +message ManagedCluster { + // Required. The cluster name prefix. A unique cluster name will be formed by + // appending a random suffix. + // + // The name must contain only lower-case letters (a-z), numbers (0-9), + // and hyphens (-). Must begin with a letter. Cannot begin or end with + // hyphen. Must consist of between 2 and 35 characters. + string cluster_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The cluster configuration. + ClusterConfig config = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The labels to associate with this cluster. + // + // Label keys must be between 1 and 63 characters long, and must conform to + // the following PCRE regular expression: + // [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62} + // + // Label values must be between 1 and 63 characters long, and must conform to + // the following PCRE regular expression: [\p{Ll}\p{Lo}\p{N}_-]{0,63} + // + // No more than 32 labels can be associated with a given cluster. + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// A selector that chooses target cluster for jobs based on metadata. +message ClusterSelector { + // Optional. The zone where workflow process executes. This parameter does not + // affect the selection of the cluster. + // + // If unspecified, the zone of the first cluster matching the selector + // is used. + string zone = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The cluster labels. Cluster must have all labels + // to match. + map cluster_labels = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// A job executed by the workflow. +message OrderedJob { + // Required. The step id. The id must be unique among all jobs + // within the template. + // + // The step id is used as prefix for job id, as job + // `goog-dataproc-workflow-step-id` label, and in + // [prerequisiteStepIds][google.cloud.dataproc.v1.OrderedJob.prerequisite_step_ids] + // field from other steps. + // + // The id must contain only letters (a-z, A-Z), numbers (0-9), + // underscores (_), and hyphens (-). Cannot begin or end with underscore + // or hyphen. Must consist of between 3 and 50 characters. + string step_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The job definition. + oneof job_type { + // Optional. Job is a Hadoop job. + HadoopJob hadoop_job = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Job is a Spark job. + SparkJob spark_job = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Job is a PySpark job. + PySparkJob pyspark_job = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Job is a Hive job. + HiveJob hive_job = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Job is a Pig job. + PigJob pig_job = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Job is a SparkR job. + SparkRJob spark_r_job = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Job is a SparkSql job. + SparkSqlJob spark_sql_job = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Job is a Presto job. + PrestoJob presto_job = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Job is a Trino job. + TrinoJob trino_job = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Job is a Flink job. + FlinkJob flink_job = 14 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The labels to associate with this job. + // + // Label keys must be between 1 and 63 characters long, and must conform to + // the following regular expression: + // [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62} + // + // Label values must be between 1 and 63 characters long, and must conform to + // the following regular expression: [\p{Ll}\p{Lo}\p{N}_-]{0,63} + // + // No more than 32 labels can be associated with a given job. + map labels = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Job scheduling configuration. + JobScheduling scheduling = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The optional list of prerequisite job step_ids. + // If not specified, the job will start at the beginning of workflow. + repeated string prerequisite_step_ids = 10 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A configurable parameter that replaces one or more fields in the template. +// Parameterizable fields: +// - Labels +// - File uris +// - Job properties +// - Job arguments +// - Script variables +// - Main class (in HadoopJob and SparkJob) +// - Zone (in ClusterSelector) +message TemplateParameter { + // Required. Parameter name. + // The parameter name is used as the key, and paired with the + // parameter value, which are passed to the template when the template + // is instantiated. + // The name must contain only capital letters (A-Z), numbers (0-9), and + // underscores (_), and must not start with a number. The maximum length is + // 40 characters. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Paths to all fields that the parameter replaces. + // A field is allowed to appear in at most one parameter's list of field + // paths. + // + // A field path is similar in syntax to a + // [google.protobuf.FieldMask][google.protobuf.FieldMask]. For example, a + // field path that references the zone field of a workflow template's cluster + // selector would be specified as `placement.clusterSelector.zone`. + // + // Also, field paths can reference fields using the following syntax: + // + // * Values in maps can be referenced by key: + // * labels['key'] + // * placement.clusterSelector.clusterLabels['key'] + // * placement.managedCluster.labels['key'] + // * placement.clusterSelector.clusterLabels['key'] + // * jobs['step-id'].labels['key'] + // + // * Jobs in the jobs list can be referenced by step-id: + // * jobs['step-id'].hadoopJob.mainJarFileUri + // * jobs['step-id'].hiveJob.queryFileUri + // * jobs['step-id'].pySparkJob.mainPythonFileUri + // * jobs['step-id'].hadoopJob.jarFileUris[0] + // * jobs['step-id'].hadoopJob.archiveUris[0] + // * jobs['step-id'].hadoopJob.fileUris[0] + // * jobs['step-id'].pySparkJob.pythonFileUris[0] + // + // * Items in repeated fields can be referenced by a zero-based index: + // * jobs['step-id'].sparkJob.args[0] + // + // * Other examples: + // * jobs['step-id'].hadoopJob.properties['key'] + // * jobs['step-id'].hadoopJob.args[0] + // * jobs['step-id'].hiveJob.scriptVariables['key'] + // * jobs['step-id'].hadoopJob.mainJarFileUri + // * placement.clusterSelector.zone + // + // It may not be possible to parameterize maps and repeated fields in their + // entirety since only individual map values and individual items in repeated + // fields can be referenced. For example, the following field paths are + // invalid: + // + // - placement.clusterSelector.clusterLabels + // - jobs['step-id'].sparkJob.args + repeated string fields = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Brief description of the parameter. + // Must not exceed 1024 characters. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Validation rules to be applied to this parameter's value. + ParameterValidation validation = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration for parameter validation. +message ParameterValidation { + // Required. The type of validation to be performed. + oneof validation_type { + // Validation based on regular expressions. + RegexValidation regex = 1; + + // Validation based on a list of allowed values. + ValueValidation values = 2; + } +} + +// Validation based on regular expressions. +message RegexValidation { + // Required. RE2 regular expressions used to validate the parameter's value. + // The value must match the regex in its entirety (substring + // matches are not sufficient). + repeated string regexes = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Validation based on a list of allowed values. +message ValueValidation { + // Required. List of allowed values for the parameter. + repeated string values = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// A Dataproc workflow template resource. +message WorkflowMetadata { + // The operation state. + enum State { + // Unused. + UNKNOWN = 0; + + // The operation has been created. + PENDING = 1; + + // The operation is running. + RUNNING = 2; + + // The operation is done; either cancelled or completed. + DONE = 3; + } + + // Output only. The resource name of the workflow template as described + // in https://cloud.google.com/apis/design/resource_names. + // + // * For `projects.regions.workflowTemplates`, the resource name of the + // template has the following format: + // `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` + // + // * For `projects.locations.workflowTemplates`, the resource name of the + // template has the following format: + // `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` + string template = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The version of template at the time of + // workflow instantiation. + int32 version = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The create cluster operation metadata. + ClusterOperation create_cluster = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The workflow graph. + WorkflowGraph graph = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The delete cluster operation metadata. + ClusterOperation delete_cluster = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The workflow state. + State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The name of the target cluster. + string cluster_name = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Map from parameter names to values that were used for those parameters. + map parameters = 8; + + // Output only. Workflow start time. + google.protobuf.Timestamp start_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Workflow end time. + google.protobuf.Timestamp end_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The UUID of target cluster. + string cluster_uuid = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timeout duration for the DAG of jobs, expressed in seconds + // (see [JSON representation of + // duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). + google.protobuf.Duration dag_timeout = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. DAG start time, only set for workflows with + // [dag_timeout][google.cloud.dataproc.v1.WorkflowMetadata.dag_timeout] when + // DAG begins. + google.protobuf.Timestamp dag_start_time = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. DAG end time, only set for workflows with + // [dag_timeout][google.cloud.dataproc.v1.WorkflowMetadata.dag_timeout] when + // DAG ends. + google.protobuf.Timestamp dag_end_time = 14 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The cluster operation triggered by a workflow. +message ClusterOperation { + // Output only. The id of the cluster operation. + string operation_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Error, if operation failed. + string error = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates the operation is done. + bool done = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The workflow graph. +message WorkflowGraph { + // Output only. The workflow nodes. + repeated WorkflowNode nodes = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The workflow node. +message WorkflowNode { + // The workflow node state. + enum NodeState { + // State is unspecified. + NODE_STATE_UNSPECIFIED = 0; + + // The node is awaiting prerequisite node to finish. + BLOCKED = 1; + + // The node is runnable but not running. + RUNNABLE = 2; + + // The node is running. + RUNNING = 3; + + // The node completed successfully. + COMPLETED = 4; + + // The node failed. A node can be marked FAILED because + // its ancestor or peer failed. + FAILED = 5; + } + + // Output only. The name of the node. + string step_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Node's prerequisite nodes. + repeated string prerequisite_step_ids = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The job id; populated after the node enters RUNNING state. + string job_id = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The node state. + NodeState state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The error detail. + string error = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A request to create a workflow template. +message CreateWorkflowTemplateRequest { + // Required. The resource name of the region or location, as described + // in https://cloud.google.com/apis/design/resource_names. + // + // * For `projects.regions.workflowTemplates.create`, the resource name of the + // region has the following format: + // `projects/{project_id}/regions/{region}` + // + // * For `projects.locations.workflowTemplates.create`, the resource name of + // the location has the following format: + // `projects/{project_id}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dataproc.googleapis.com/WorkflowTemplate" + } + ]; + + // Required. The Dataproc workflow template to create. + WorkflowTemplate template = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A request to fetch a workflow template. +message GetWorkflowTemplateRequest { + // Required. The resource name of the workflow template, as described + // in https://cloud.google.com/apis/design/resource_names. + // + // * For `projects.regions.workflowTemplates.get`, the resource name of the + // template has the following format: + // `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` + // + // * For `projects.locations.workflowTemplates.get`, the resource name of the + // template has the following format: + // `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataproc.googleapis.com/WorkflowTemplate" + } + ]; + + // Optional. The version of workflow template to retrieve. Only previously + // instantiated versions can be retrieved. + // + // If unspecified, retrieves the current version. + int32 version = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// A request to instantiate a workflow template. +message InstantiateWorkflowTemplateRequest { + // Required. The resource name of the workflow template, as described + // in https://cloud.google.com/apis/design/resource_names. + // + // * For `projects.regions.workflowTemplates.instantiate`, the resource name + // of the template has the following format: + // `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` + // + // * For `projects.locations.workflowTemplates.instantiate`, the resource name + // of the template has the following format: + // `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataproc.googleapis.com/WorkflowTemplate" + } + ]; + + // Optional. The version of workflow template to instantiate. If specified, + // the workflow will be instantiated only if the current version of + // the workflow template has the supplied version. + // + // This option cannot be used to instantiate a previous version of + // workflow template. + int32 version = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A tag that prevents multiple concurrent workflow + // instances with the same tag from running. This mitigates risk of + // concurrent instances started due to retries. + // + // It is recommended to always set this value to a + // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + // + // The tag must contain only letters (a-z, A-Z), numbers (0-9), + // underscores (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Map from parameter names to values that should be used for those + // parameters. Values may not exceed 1000 characters. + map parameters = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// A request to instantiate an inline workflow template. +message InstantiateInlineWorkflowTemplateRequest { + // Required. The resource name of the region or location, as described + // in https://cloud.google.com/apis/design/resource_names. + // + // * For `projects.regions.workflowTemplates,instantiateinline`, the resource + // name of the region has the following format: + // `projects/{project_id}/regions/{region}` + // + // * For `projects.locations.workflowTemplates.instantiateinline`, the + // resource name of the location has the following format: + // `projects/{project_id}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dataproc.googleapis.com/WorkflowTemplate" + } + ]; + + // Required. The workflow template to instantiate. + WorkflowTemplate template = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A tag that prevents multiple concurrent workflow + // instances with the same tag from running. This mitigates risk of + // concurrent instances started due to retries. + // + // It is recommended to always set this value to a + // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + // + // The tag must contain only letters (a-z, A-Z), numbers (0-9), + // underscores (_), and hyphens (-). The maximum length is 40 characters. + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// A request to update a workflow template. +message UpdateWorkflowTemplateRequest { + // Required. The updated workflow template. + // + // The `template.version` field must match the current version. + WorkflowTemplate template = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// A request to list workflow templates in a project. +message ListWorkflowTemplatesRequest { + // Required. The resource name of the region or location, as described + // in https://cloud.google.com/apis/design/resource_names. + // + // * For `projects.regions.workflowTemplates,list`, the resource + // name of the region has the following format: + // `projects/{project_id}/regions/{region}` + // + // * For `projects.locations.workflowTemplates.list`, the + // resource name of the location has the following format: + // `projects/{project_id}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dataproc.googleapis.com/WorkflowTemplate" + } + ]; + + // Optional. The maximum number of results to return in each response. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The page token, returned by a previous call, to request the + // next page of results. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// A response to a request to list workflow templates in a project. +message ListWorkflowTemplatesResponse { + // Output only. WorkflowTemplates list. + repeated WorkflowTemplate templates = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. This token is included in the response if there are more + // results to fetch. To fetch additional results, provide this value as the + // page_token in a subsequent ListWorkflowTemplatesRequest. + string next_page_token = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of workflow templates that could not be included in the + // response. Attempting to get one of these resources may indicate why it was + // not included in the list response. + repeated string unreachable = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A request to delete a workflow template. +// +// Currently started workflows will remain running. +message DeleteWorkflowTemplateRequest { + // Required. The resource name of the workflow template, as described + // in https://cloud.google.com/apis/design/resource_names. + // + // * For `projects.regions.workflowTemplates.delete`, the resource name + // of the template has the following format: + // `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` + // + // * For `projects.locations.workflowTemplates.instantiate`, the resource name + // of the template has the following format: + // `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dataproc.googleapis.com/WorkflowTemplate" + } + ]; + + // Optional. The version of workflow template to delete. If specified, + // will only delete the template if the current server version matches + // specified version. + int32 version = 2 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-dataproc/protos/protos.d.ts b/owl-bot-staging/google-cloud-dataproc/protos/protos.d.ts new file mode 100644 index 000000000000..0f88e851d408 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/protos/protos.d.ts @@ -0,0 +1,29074 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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 dataproc. */ + namespace dataproc { + + /** Namespace v1. */ + namespace v1 { + + /** Represents an AutoscalingPolicyService */ + class AutoscalingPolicyService extends $protobuf.rpc.Service { + + /** + * Constructs a new AutoscalingPolicyService 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 AutoscalingPolicyService 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): AutoscalingPolicyService; + + /** + * Calls CreateAutoscalingPolicy. + * @param request CreateAutoscalingPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AutoscalingPolicy + */ + public createAutoscalingPolicy(request: google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest, callback: google.cloud.dataproc.v1.AutoscalingPolicyService.CreateAutoscalingPolicyCallback): void; + + /** + * Calls CreateAutoscalingPolicy. + * @param request CreateAutoscalingPolicyRequest message or plain object + * @returns Promise + */ + public createAutoscalingPolicy(request: google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest): Promise; + + /** + * Calls UpdateAutoscalingPolicy. + * @param request UpdateAutoscalingPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AutoscalingPolicy + */ + public updateAutoscalingPolicy(request: google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest, callback: google.cloud.dataproc.v1.AutoscalingPolicyService.UpdateAutoscalingPolicyCallback): void; + + /** + * Calls UpdateAutoscalingPolicy. + * @param request UpdateAutoscalingPolicyRequest message or plain object + * @returns Promise + */ + public updateAutoscalingPolicy(request: google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest): Promise; + + /** + * Calls GetAutoscalingPolicy. + * @param request GetAutoscalingPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AutoscalingPolicy + */ + public getAutoscalingPolicy(request: google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest, callback: google.cloud.dataproc.v1.AutoscalingPolicyService.GetAutoscalingPolicyCallback): void; + + /** + * Calls GetAutoscalingPolicy. + * @param request GetAutoscalingPolicyRequest message or plain object + * @returns Promise + */ + public getAutoscalingPolicy(request: google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest): Promise; + + /** + * Calls ListAutoscalingPolicies. + * @param request ListAutoscalingPoliciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAutoscalingPoliciesResponse + */ + public listAutoscalingPolicies(request: google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest, callback: google.cloud.dataproc.v1.AutoscalingPolicyService.ListAutoscalingPoliciesCallback): void; + + /** + * Calls ListAutoscalingPolicies. + * @param request ListAutoscalingPoliciesRequest message or plain object + * @returns Promise + */ + public listAutoscalingPolicies(request: google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest): Promise; + + /** + * Calls DeleteAutoscalingPolicy. + * @param request DeleteAutoscalingPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteAutoscalingPolicy(request: google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest, callback: google.cloud.dataproc.v1.AutoscalingPolicyService.DeleteAutoscalingPolicyCallback): void; + + /** + * Calls DeleteAutoscalingPolicy. + * @param request DeleteAutoscalingPolicyRequest message or plain object + * @returns Promise + */ + public deleteAutoscalingPolicy(request: google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest): Promise; + } + + namespace AutoscalingPolicyService { + + /** + * Callback as used by {@link google.cloud.dataproc.v1.AutoscalingPolicyService|createAutoscalingPolicy}. + * @param error Error, if any + * @param [response] AutoscalingPolicy + */ + type CreateAutoscalingPolicyCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.AutoscalingPolicy) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.AutoscalingPolicyService|updateAutoscalingPolicy}. + * @param error Error, if any + * @param [response] AutoscalingPolicy + */ + type UpdateAutoscalingPolicyCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.AutoscalingPolicy) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.AutoscalingPolicyService|getAutoscalingPolicy}. + * @param error Error, if any + * @param [response] AutoscalingPolicy + */ + type GetAutoscalingPolicyCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.AutoscalingPolicy) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.AutoscalingPolicyService|listAutoscalingPolicies}. + * @param error Error, if any + * @param [response] ListAutoscalingPoliciesResponse + */ + type ListAutoscalingPoliciesCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.AutoscalingPolicyService|deleteAutoscalingPolicy}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteAutoscalingPolicyCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of an AutoscalingPolicy. */ + interface IAutoscalingPolicy { + + /** AutoscalingPolicy id */ + id?: (string|null); + + /** AutoscalingPolicy name */ + name?: (string|null); + + /** AutoscalingPolicy basicAlgorithm */ + basicAlgorithm?: (google.cloud.dataproc.v1.IBasicAutoscalingAlgorithm|null); + + /** AutoscalingPolicy workerConfig */ + workerConfig?: (google.cloud.dataproc.v1.IInstanceGroupAutoscalingPolicyConfig|null); + + /** AutoscalingPolicy secondaryWorkerConfig */ + secondaryWorkerConfig?: (google.cloud.dataproc.v1.IInstanceGroupAutoscalingPolicyConfig|null); + + /** AutoscalingPolicy labels */ + labels?: ({ [k: string]: string }|null); + + /** AutoscalingPolicy clusterType */ + clusterType?: (google.cloud.dataproc.v1.AutoscalingPolicy.ClusterType|keyof typeof google.cloud.dataproc.v1.AutoscalingPolicy.ClusterType|null); + } + + /** Represents an AutoscalingPolicy. */ + class AutoscalingPolicy implements IAutoscalingPolicy { + + /** + * Constructs a new AutoscalingPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IAutoscalingPolicy); + + /** AutoscalingPolicy id. */ + public id: string; + + /** AutoscalingPolicy name. */ + public name: string; + + /** AutoscalingPolicy basicAlgorithm. */ + public basicAlgorithm?: (google.cloud.dataproc.v1.IBasicAutoscalingAlgorithm|null); + + /** AutoscalingPolicy workerConfig. */ + public workerConfig?: (google.cloud.dataproc.v1.IInstanceGroupAutoscalingPolicyConfig|null); + + /** AutoscalingPolicy secondaryWorkerConfig. */ + public secondaryWorkerConfig?: (google.cloud.dataproc.v1.IInstanceGroupAutoscalingPolicyConfig|null); + + /** AutoscalingPolicy labels. */ + public labels: { [k: string]: string }; + + /** AutoscalingPolicy clusterType. */ + public clusterType: (google.cloud.dataproc.v1.AutoscalingPolicy.ClusterType|keyof typeof google.cloud.dataproc.v1.AutoscalingPolicy.ClusterType); + + /** AutoscalingPolicy algorithm. */ + public algorithm?: "basicAlgorithm"; + + /** + * Creates a new AutoscalingPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoscalingPolicy instance + */ + public static create(properties?: google.cloud.dataproc.v1.IAutoscalingPolicy): google.cloud.dataproc.v1.AutoscalingPolicy; + + /** + * Encodes the specified AutoscalingPolicy message. Does not implicitly {@link google.cloud.dataproc.v1.AutoscalingPolicy.verify|verify} messages. + * @param message AutoscalingPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IAutoscalingPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoscalingPolicy message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.AutoscalingPolicy.verify|verify} messages. + * @param message AutoscalingPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IAutoscalingPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoscalingPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoscalingPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.AutoscalingPolicy; + + /** + * Decodes an AutoscalingPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoscalingPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.AutoscalingPolicy; + + /** + * Verifies an AutoscalingPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoscalingPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoscalingPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.AutoscalingPolicy; + + /** + * Creates a plain object from an AutoscalingPolicy message. Also converts values to other types if specified. + * @param message AutoscalingPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.AutoscalingPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoscalingPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoscalingPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AutoscalingPolicy { + + /** ClusterType enum. */ + enum ClusterType { + CLUSTER_TYPE_UNSPECIFIED = 0, + STANDARD = 1, + ZERO_SCALE = 2 + } + } + + /** Properties of a BasicAutoscalingAlgorithm. */ + interface IBasicAutoscalingAlgorithm { + + /** BasicAutoscalingAlgorithm yarnConfig */ + yarnConfig?: (google.cloud.dataproc.v1.IBasicYarnAutoscalingConfig|null); + + /** BasicAutoscalingAlgorithm cooldownPeriod */ + cooldownPeriod?: (google.protobuf.IDuration|null); + } + + /** Represents a BasicAutoscalingAlgorithm. */ + class BasicAutoscalingAlgorithm implements IBasicAutoscalingAlgorithm { + + /** + * Constructs a new BasicAutoscalingAlgorithm. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IBasicAutoscalingAlgorithm); + + /** BasicAutoscalingAlgorithm yarnConfig. */ + public yarnConfig?: (google.cloud.dataproc.v1.IBasicYarnAutoscalingConfig|null); + + /** BasicAutoscalingAlgorithm cooldownPeriod. */ + public cooldownPeriod?: (google.protobuf.IDuration|null); + + /** BasicAutoscalingAlgorithm config. */ + public config?: "yarnConfig"; + + /** + * Creates a new BasicAutoscalingAlgorithm instance using the specified properties. + * @param [properties] Properties to set + * @returns BasicAutoscalingAlgorithm instance + */ + public static create(properties?: google.cloud.dataproc.v1.IBasicAutoscalingAlgorithm): google.cloud.dataproc.v1.BasicAutoscalingAlgorithm; + + /** + * Encodes the specified BasicAutoscalingAlgorithm message. Does not implicitly {@link google.cloud.dataproc.v1.BasicAutoscalingAlgorithm.verify|verify} messages. + * @param message BasicAutoscalingAlgorithm message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IBasicAutoscalingAlgorithm, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BasicAutoscalingAlgorithm message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.BasicAutoscalingAlgorithm.verify|verify} messages. + * @param message BasicAutoscalingAlgorithm message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IBasicAutoscalingAlgorithm, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BasicAutoscalingAlgorithm message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BasicAutoscalingAlgorithm + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.BasicAutoscalingAlgorithm; + + /** + * Decodes a BasicAutoscalingAlgorithm message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BasicAutoscalingAlgorithm + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.BasicAutoscalingAlgorithm; + + /** + * Verifies a BasicAutoscalingAlgorithm message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BasicAutoscalingAlgorithm message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BasicAutoscalingAlgorithm + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.BasicAutoscalingAlgorithm; + + /** + * Creates a plain object from a BasicAutoscalingAlgorithm message. Also converts values to other types if specified. + * @param message BasicAutoscalingAlgorithm + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.BasicAutoscalingAlgorithm, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BasicAutoscalingAlgorithm to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BasicAutoscalingAlgorithm + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BasicYarnAutoscalingConfig. */ + interface IBasicYarnAutoscalingConfig { + + /** BasicYarnAutoscalingConfig gracefulDecommissionTimeout */ + gracefulDecommissionTimeout?: (google.protobuf.IDuration|null); + + /** BasicYarnAutoscalingConfig scaleUpFactor */ + scaleUpFactor?: (number|null); + + /** BasicYarnAutoscalingConfig scaleDownFactor */ + scaleDownFactor?: (number|null); + + /** BasicYarnAutoscalingConfig scaleUpMinWorkerFraction */ + scaleUpMinWorkerFraction?: (number|null); + + /** BasicYarnAutoscalingConfig scaleDownMinWorkerFraction */ + scaleDownMinWorkerFraction?: (number|null); + } + + /** Represents a BasicYarnAutoscalingConfig. */ + class BasicYarnAutoscalingConfig implements IBasicYarnAutoscalingConfig { + + /** + * Constructs a new BasicYarnAutoscalingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IBasicYarnAutoscalingConfig); + + /** BasicYarnAutoscalingConfig gracefulDecommissionTimeout. */ + public gracefulDecommissionTimeout?: (google.protobuf.IDuration|null); + + /** BasicYarnAutoscalingConfig scaleUpFactor. */ + public scaleUpFactor: number; + + /** BasicYarnAutoscalingConfig scaleDownFactor. */ + public scaleDownFactor: number; + + /** BasicYarnAutoscalingConfig scaleUpMinWorkerFraction. */ + public scaleUpMinWorkerFraction: number; + + /** BasicYarnAutoscalingConfig scaleDownMinWorkerFraction. */ + public scaleDownMinWorkerFraction: number; + + /** + * Creates a new BasicYarnAutoscalingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BasicYarnAutoscalingConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IBasicYarnAutoscalingConfig): google.cloud.dataproc.v1.BasicYarnAutoscalingConfig; + + /** + * Encodes the specified BasicYarnAutoscalingConfig message. Does not implicitly {@link google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.verify|verify} messages. + * @param message BasicYarnAutoscalingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IBasicYarnAutoscalingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BasicYarnAutoscalingConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.verify|verify} messages. + * @param message BasicYarnAutoscalingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IBasicYarnAutoscalingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BasicYarnAutoscalingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BasicYarnAutoscalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.BasicYarnAutoscalingConfig; + + /** + * Decodes a BasicYarnAutoscalingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BasicYarnAutoscalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.BasicYarnAutoscalingConfig; + + /** + * Verifies a BasicYarnAutoscalingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BasicYarnAutoscalingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BasicYarnAutoscalingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.BasicYarnAutoscalingConfig; + + /** + * Creates a plain object from a BasicYarnAutoscalingConfig message. Also converts values to other types if specified. + * @param message BasicYarnAutoscalingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.BasicYarnAutoscalingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BasicYarnAutoscalingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BasicYarnAutoscalingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InstanceGroupAutoscalingPolicyConfig. */ + interface IInstanceGroupAutoscalingPolicyConfig { + + /** InstanceGroupAutoscalingPolicyConfig minInstances */ + minInstances?: (number|null); + + /** InstanceGroupAutoscalingPolicyConfig maxInstances */ + maxInstances?: (number|null); + + /** InstanceGroupAutoscalingPolicyConfig weight */ + weight?: (number|null); + } + + /** Represents an InstanceGroupAutoscalingPolicyConfig. */ + class InstanceGroupAutoscalingPolicyConfig implements IInstanceGroupAutoscalingPolicyConfig { + + /** + * Constructs a new InstanceGroupAutoscalingPolicyConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IInstanceGroupAutoscalingPolicyConfig); + + /** InstanceGroupAutoscalingPolicyConfig minInstances. */ + public minInstances: number; + + /** InstanceGroupAutoscalingPolicyConfig maxInstances. */ + public maxInstances: number; + + /** InstanceGroupAutoscalingPolicyConfig weight. */ + public weight: number; + + /** + * Creates a new InstanceGroupAutoscalingPolicyConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroupAutoscalingPolicyConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IInstanceGroupAutoscalingPolicyConfig): google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig; + + /** + * Encodes the specified InstanceGroupAutoscalingPolicyConfig message. Does not implicitly {@link google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig.verify|verify} messages. + * @param message InstanceGroupAutoscalingPolicyConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IInstanceGroupAutoscalingPolicyConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroupAutoscalingPolicyConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig.verify|verify} messages. + * @param message InstanceGroupAutoscalingPolicyConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IInstanceGroupAutoscalingPolicyConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroupAutoscalingPolicyConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroupAutoscalingPolicyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig; + + /** + * Decodes an InstanceGroupAutoscalingPolicyConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroupAutoscalingPolicyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig; + + /** + * Verifies an InstanceGroupAutoscalingPolicyConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroupAutoscalingPolicyConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroupAutoscalingPolicyConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig; + + /** + * Creates a plain object from an InstanceGroupAutoscalingPolicyConfig message. Also converts values to other types if specified. + * @param message InstanceGroupAutoscalingPolicyConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroupAutoscalingPolicyConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstanceGroupAutoscalingPolicyConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateAutoscalingPolicyRequest. */ + interface ICreateAutoscalingPolicyRequest { + + /** CreateAutoscalingPolicyRequest parent */ + parent?: (string|null); + + /** CreateAutoscalingPolicyRequest policy */ + policy?: (google.cloud.dataproc.v1.IAutoscalingPolicy|null); + } + + /** Represents a CreateAutoscalingPolicyRequest. */ + class CreateAutoscalingPolicyRequest implements ICreateAutoscalingPolicyRequest { + + /** + * Constructs a new CreateAutoscalingPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest); + + /** CreateAutoscalingPolicyRequest parent. */ + public parent: string; + + /** CreateAutoscalingPolicyRequest policy. */ + public policy?: (google.cloud.dataproc.v1.IAutoscalingPolicy|null); + + /** + * Creates a new CreateAutoscalingPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateAutoscalingPolicyRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest): google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest; + + /** + * Encodes the specified CreateAutoscalingPolicyRequest message. Does not implicitly {@link google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest.verify|verify} messages. + * @param message CreateAutoscalingPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateAutoscalingPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest.verify|verify} messages. + * @param message CreateAutoscalingPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateAutoscalingPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateAutoscalingPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest; + + /** + * Decodes a CreateAutoscalingPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateAutoscalingPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest; + + /** + * Verifies a CreateAutoscalingPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateAutoscalingPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateAutoscalingPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest; + + /** + * Creates a plain object from a CreateAutoscalingPolicyRequest message. Also converts values to other types if specified. + * @param message CreateAutoscalingPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateAutoscalingPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateAutoscalingPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetAutoscalingPolicyRequest. */ + interface IGetAutoscalingPolicyRequest { + + /** GetAutoscalingPolicyRequest name */ + name?: (string|null); + } + + /** Represents a GetAutoscalingPolicyRequest. */ + class GetAutoscalingPolicyRequest implements IGetAutoscalingPolicyRequest { + + /** + * Constructs a new GetAutoscalingPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest); + + /** GetAutoscalingPolicyRequest name. */ + public name: string; + + /** + * Creates a new GetAutoscalingPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAutoscalingPolicyRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest): google.cloud.dataproc.v1.GetAutoscalingPolicyRequest; + + /** + * Encodes the specified GetAutoscalingPolicyRequest message. Does not implicitly {@link google.cloud.dataproc.v1.GetAutoscalingPolicyRequest.verify|verify} messages. + * @param message GetAutoscalingPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAutoscalingPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GetAutoscalingPolicyRequest.verify|verify} messages. + * @param message GetAutoscalingPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAutoscalingPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAutoscalingPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.GetAutoscalingPolicyRequest; + + /** + * Decodes a GetAutoscalingPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAutoscalingPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.GetAutoscalingPolicyRequest; + + /** + * Verifies a GetAutoscalingPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAutoscalingPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAutoscalingPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.GetAutoscalingPolicyRequest; + + /** + * Creates a plain object from a GetAutoscalingPolicyRequest message. Also converts values to other types if specified. + * @param message GetAutoscalingPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.GetAutoscalingPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAutoscalingPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetAutoscalingPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateAutoscalingPolicyRequest. */ + interface IUpdateAutoscalingPolicyRequest { + + /** UpdateAutoscalingPolicyRequest policy */ + policy?: (google.cloud.dataproc.v1.IAutoscalingPolicy|null); + } + + /** Represents an UpdateAutoscalingPolicyRequest. */ + class UpdateAutoscalingPolicyRequest implements IUpdateAutoscalingPolicyRequest { + + /** + * Constructs a new UpdateAutoscalingPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest); + + /** UpdateAutoscalingPolicyRequest policy. */ + public policy?: (google.cloud.dataproc.v1.IAutoscalingPolicy|null); + + /** + * Creates a new UpdateAutoscalingPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAutoscalingPolicyRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest): google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest; + + /** + * Encodes the specified UpdateAutoscalingPolicyRequest message. Does not implicitly {@link google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest.verify|verify} messages. + * @param message UpdateAutoscalingPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAutoscalingPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest.verify|verify} messages. + * @param message UpdateAutoscalingPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAutoscalingPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAutoscalingPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest; + + /** + * Decodes an UpdateAutoscalingPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAutoscalingPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest; + + /** + * Verifies an UpdateAutoscalingPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateAutoscalingPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAutoscalingPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest; + + /** + * Creates a plain object from an UpdateAutoscalingPolicyRequest message. Also converts values to other types if specified. + * @param message UpdateAutoscalingPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAutoscalingPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateAutoscalingPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteAutoscalingPolicyRequest. */ + interface IDeleteAutoscalingPolicyRequest { + + /** DeleteAutoscalingPolicyRequest name */ + name?: (string|null); + } + + /** Represents a DeleteAutoscalingPolicyRequest. */ + class DeleteAutoscalingPolicyRequest implements IDeleteAutoscalingPolicyRequest { + + /** + * Constructs a new DeleteAutoscalingPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest); + + /** DeleteAutoscalingPolicyRequest name. */ + public name: string; + + /** + * Creates a new DeleteAutoscalingPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAutoscalingPolicyRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest): google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest; + + /** + * Encodes the specified DeleteAutoscalingPolicyRequest message. Does not implicitly {@link google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest.verify|verify} messages. + * @param message DeleteAutoscalingPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAutoscalingPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest.verify|verify} messages. + * @param message DeleteAutoscalingPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAutoscalingPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAutoscalingPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest; + + /** + * Decodes a DeleteAutoscalingPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAutoscalingPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest; + + /** + * Verifies a DeleteAutoscalingPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteAutoscalingPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAutoscalingPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest; + + /** + * Creates a plain object from a DeleteAutoscalingPolicyRequest message. Also converts values to other types if specified. + * @param message DeleteAutoscalingPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAutoscalingPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteAutoscalingPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAutoscalingPoliciesRequest. */ + interface IListAutoscalingPoliciesRequest { + + /** ListAutoscalingPoliciesRequest parent */ + parent?: (string|null); + + /** ListAutoscalingPoliciesRequest pageSize */ + pageSize?: (number|null); + + /** ListAutoscalingPoliciesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListAutoscalingPoliciesRequest. */ + class ListAutoscalingPoliciesRequest implements IListAutoscalingPoliciesRequest { + + /** + * Constructs a new ListAutoscalingPoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest); + + /** ListAutoscalingPoliciesRequest parent. */ + public parent: string; + + /** ListAutoscalingPoliciesRequest pageSize. */ + public pageSize: number; + + /** ListAutoscalingPoliciesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListAutoscalingPoliciesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAutoscalingPoliciesRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest): google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest; + + /** + * Encodes the specified ListAutoscalingPoliciesRequest message. Does not implicitly {@link google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest.verify|verify} messages. + * @param message ListAutoscalingPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAutoscalingPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest.verify|verify} messages. + * @param message ListAutoscalingPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAutoscalingPoliciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAutoscalingPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest; + + /** + * Decodes a ListAutoscalingPoliciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAutoscalingPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest; + + /** + * Verifies a ListAutoscalingPoliciesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAutoscalingPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAutoscalingPoliciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest; + + /** + * Creates a plain object from a ListAutoscalingPoliciesRequest message. Also converts values to other types if specified. + * @param message ListAutoscalingPoliciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAutoscalingPoliciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAutoscalingPoliciesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAutoscalingPoliciesResponse. */ + interface IListAutoscalingPoliciesResponse { + + /** ListAutoscalingPoliciesResponse policies */ + policies?: (google.cloud.dataproc.v1.IAutoscalingPolicy[]|null); + + /** ListAutoscalingPoliciesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAutoscalingPoliciesResponse. */ + class ListAutoscalingPoliciesResponse implements IListAutoscalingPoliciesResponse { + + /** + * Constructs a new ListAutoscalingPoliciesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse); + + /** ListAutoscalingPoliciesResponse policies. */ + public policies: google.cloud.dataproc.v1.IAutoscalingPolicy[]; + + /** ListAutoscalingPoliciesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAutoscalingPoliciesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAutoscalingPoliciesResponse instance + */ + public static create(properties?: google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse): google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse; + + /** + * Encodes the specified ListAutoscalingPoliciesResponse message. Does not implicitly {@link google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse.verify|verify} messages. + * @param message ListAutoscalingPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAutoscalingPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse.verify|verify} messages. + * @param message ListAutoscalingPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAutoscalingPoliciesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAutoscalingPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse; + + /** + * Decodes a ListAutoscalingPoliciesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAutoscalingPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse; + + /** + * Verifies a ListAutoscalingPoliciesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAutoscalingPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAutoscalingPoliciesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse; + + /** + * Creates a plain object from a ListAutoscalingPoliciesResponse message. Also converts values to other types if specified. + * @param message ListAutoscalingPoliciesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAutoscalingPoliciesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAutoscalingPoliciesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a BatchController */ + class BatchController extends $protobuf.rpc.Service { + + /** + * Constructs a new BatchController 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 BatchController 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): BatchController; + + /** + * Calls CreateBatch. + * @param request CreateBatchRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createBatch(request: google.cloud.dataproc.v1.ICreateBatchRequest, callback: google.cloud.dataproc.v1.BatchController.CreateBatchCallback): void; + + /** + * Calls CreateBatch. + * @param request CreateBatchRequest message or plain object + * @returns Promise + */ + public createBatch(request: google.cloud.dataproc.v1.ICreateBatchRequest): Promise; + + /** + * Calls GetBatch. + * @param request GetBatchRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Batch + */ + public getBatch(request: google.cloud.dataproc.v1.IGetBatchRequest, callback: google.cloud.dataproc.v1.BatchController.GetBatchCallback): void; + + /** + * Calls GetBatch. + * @param request GetBatchRequest message or plain object + * @returns Promise + */ + public getBatch(request: google.cloud.dataproc.v1.IGetBatchRequest): Promise; + + /** + * Calls ListBatches. + * @param request ListBatchesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBatchesResponse + */ + public listBatches(request: google.cloud.dataproc.v1.IListBatchesRequest, callback: google.cloud.dataproc.v1.BatchController.ListBatchesCallback): void; + + /** + * Calls ListBatches. + * @param request ListBatchesRequest message or plain object + * @returns Promise + */ + public listBatches(request: google.cloud.dataproc.v1.IListBatchesRequest): Promise; + + /** + * Calls DeleteBatch. + * @param request DeleteBatchRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteBatch(request: google.cloud.dataproc.v1.IDeleteBatchRequest, callback: google.cloud.dataproc.v1.BatchController.DeleteBatchCallback): void; + + /** + * Calls DeleteBatch. + * @param request DeleteBatchRequest message or plain object + * @returns Promise + */ + public deleteBatch(request: google.cloud.dataproc.v1.IDeleteBatchRequest): Promise; + } + + namespace BatchController { + + /** + * Callback as used by {@link google.cloud.dataproc.v1.BatchController|createBatch}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateBatchCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.BatchController|getBatch}. + * @param error Error, if any + * @param [response] Batch + */ + type GetBatchCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.Batch) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.BatchController|listBatches}. + * @param error Error, if any + * @param [response] ListBatchesResponse + */ + type ListBatchesCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.ListBatchesResponse) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.BatchController|deleteBatch}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteBatchCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a CreateBatchRequest. */ + interface ICreateBatchRequest { + + /** CreateBatchRequest parent */ + parent?: (string|null); + + /** CreateBatchRequest batch */ + batch?: (google.cloud.dataproc.v1.IBatch|null); + + /** CreateBatchRequest batchId */ + batchId?: (string|null); + + /** CreateBatchRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateBatchRequest. */ + class CreateBatchRequest implements ICreateBatchRequest { + + /** + * Constructs a new CreateBatchRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.ICreateBatchRequest); + + /** CreateBatchRequest parent. */ + public parent: string; + + /** CreateBatchRequest batch. */ + public batch?: (google.cloud.dataproc.v1.IBatch|null); + + /** CreateBatchRequest batchId. */ + public batchId: string; + + /** CreateBatchRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateBatchRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBatchRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.ICreateBatchRequest): google.cloud.dataproc.v1.CreateBatchRequest; + + /** + * Encodes the specified CreateBatchRequest message. Does not implicitly {@link google.cloud.dataproc.v1.CreateBatchRequest.verify|verify} messages. + * @param message CreateBatchRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.ICreateBatchRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBatchRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.CreateBatchRequest.verify|verify} messages. + * @param message CreateBatchRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.ICreateBatchRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateBatchRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateBatchRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.CreateBatchRequest; + + /** + * Decodes a CreateBatchRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateBatchRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.CreateBatchRequest; + + /** + * Verifies a CreateBatchRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateBatchRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBatchRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.CreateBatchRequest; + + /** + * Creates a plain object from a CreateBatchRequest message. Also converts values to other types if specified. + * @param message CreateBatchRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.CreateBatchRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBatchRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBatchRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBatchRequest. */ + interface IGetBatchRequest { + + /** GetBatchRequest name */ + name?: (string|null); + } + + /** Represents a GetBatchRequest. */ + class GetBatchRequest implements IGetBatchRequest { + + /** + * Constructs a new GetBatchRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IGetBatchRequest); + + /** GetBatchRequest name. */ + public name: string; + + /** + * Creates a new GetBatchRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBatchRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.IGetBatchRequest): google.cloud.dataproc.v1.GetBatchRequest; + + /** + * Encodes the specified GetBatchRequest message. Does not implicitly {@link google.cloud.dataproc.v1.GetBatchRequest.verify|verify} messages. + * @param message GetBatchRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IGetBatchRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBatchRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GetBatchRequest.verify|verify} messages. + * @param message GetBatchRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IGetBatchRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBatchRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBatchRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.GetBatchRequest; + + /** + * Decodes a GetBatchRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBatchRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.GetBatchRequest; + + /** + * Verifies a GetBatchRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetBatchRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBatchRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.GetBatchRequest; + + /** + * Creates a plain object from a GetBatchRequest message. Also converts values to other types if specified. + * @param message GetBatchRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.GetBatchRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBatchRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBatchRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBatchesRequest. */ + interface IListBatchesRequest { + + /** ListBatchesRequest parent */ + parent?: (string|null); + + /** ListBatchesRequest pageSize */ + pageSize?: (number|null); + + /** ListBatchesRequest pageToken */ + pageToken?: (string|null); + + /** ListBatchesRequest filter */ + filter?: (string|null); + + /** ListBatchesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListBatchesRequest. */ + class ListBatchesRequest implements IListBatchesRequest { + + /** + * Constructs a new ListBatchesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IListBatchesRequest); + + /** ListBatchesRequest parent. */ + public parent: string; + + /** ListBatchesRequest pageSize. */ + public pageSize: number; + + /** ListBatchesRequest pageToken. */ + public pageToken: string; + + /** ListBatchesRequest filter. */ + public filter: string; + + /** ListBatchesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListBatchesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBatchesRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.IListBatchesRequest): google.cloud.dataproc.v1.ListBatchesRequest; + + /** + * Encodes the specified ListBatchesRequest message. Does not implicitly {@link google.cloud.dataproc.v1.ListBatchesRequest.verify|verify} messages. + * @param message ListBatchesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IListBatchesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBatchesRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListBatchesRequest.verify|verify} messages. + * @param message ListBatchesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IListBatchesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBatchesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBatchesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ListBatchesRequest; + + /** + * Decodes a ListBatchesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBatchesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ListBatchesRequest; + + /** + * Verifies a ListBatchesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBatchesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBatchesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ListBatchesRequest; + + /** + * Creates a plain object from a ListBatchesRequest message. Also converts values to other types if specified. + * @param message ListBatchesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.ListBatchesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBatchesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBatchesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBatchesResponse. */ + interface IListBatchesResponse { + + /** ListBatchesResponse batches */ + batches?: (google.cloud.dataproc.v1.IBatch[]|null); + + /** ListBatchesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListBatchesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListBatchesResponse. */ + class ListBatchesResponse implements IListBatchesResponse { + + /** + * Constructs a new ListBatchesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IListBatchesResponse); + + /** ListBatchesResponse batches. */ + public batches: google.cloud.dataproc.v1.IBatch[]; + + /** ListBatchesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListBatchesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListBatchesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBatchesResponse instance + */ + public static create(properties?: google.cloud.dataproc.v1.IListBatchesResponse): google.cloud.dataproc.v1.ListBatchesResponse; + + /** + * Encodes the specified ListBatchesResponse message. Does not implicitly {@link google.cloud.dataproc.v1.ListBatchesResponse.verify|verify} messages. + * @param message ListBatchesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IListBatchesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBatchesResponse message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListBatchesResponse.verify|verify} messages. + * @param message ListBatchesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IListBatchesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBatchesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBatchesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ListBatchesResponse; + + /** + * Decodes a ListBatchesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBatchesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ListBatchesResponse; + + /** + * Verifies a ListBatchesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBatchesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBatchesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ListBatchesResponse; + + /** + * Creates a plain object from a ListBatchesResponse message. Also converts values to other types if specified. + * @param message ListBatchesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.ListBatchesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBatchesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBatchesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteBatchRequest. */ + interface IDeleteBatchRequest { + + /** DeleteBatchRequest name */ + name?: (string|null); + } + + /** Represents a DeleteBatchRequest. */ + class DeleteBatchRequest implements IDeleteBatchRequest { + + /** + * Constructs a new DeleteBatchRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IDeleteBatchRequest); + + /** DeleteBatchRequest name. */ + public name: string; + + /** + * Creates a new DeleteBatchRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteBatchRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.IDeleteBatchRequest): google.cloud.dataproc.v1.DeleteBatchRequest; + + /** + * Encodes the specified DeleteBatchRequest message. Does not implicitly {@link google.cloud.dataproc.v1.DeleteBatchRequest.verify|verify} messages. + * @param message DeleteBatchRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IDeleteBatchRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBatchRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DeleteBatchRequest.verify|verify} messages. + * @param message DeleteBatchRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IDeleteBatchRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteBatchRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteBatchRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.DeleteBatchRequest; + + /** + * Decodes a DeleteBatchRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteBatchRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.DeleteBatchRequest; + + /** + * Verifies a DeleteBatchRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteBatchRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteBatchRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.DeleteBatchRequest; + + /** + * Creates a plain object from a DeleteBatchRequest message. Also converts values to other types if specified. + * @param message DeleteBatchRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.DeleteBatchRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteBatchRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteBatchRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Batch. */ + interface IBatch { + + /** Batch name */ + name?: (string|null); + + /** Batch uuid */ + uuid?: (string|null); + + /** Batch createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Batch pysparkBatch */ + pysparkBatch?: (google.cloud.dataproc.v1.IPySparkBatch|null); + + /** Batch sparkBatch */ + sparkBatch?: (google.cloud.dataproc.v1.ISparkBatch|null); + + /** Batch sparkRBatch */ + sparkRBatch?: (google.cloud.dataproc.v1.ISparkRBatch|null); + + /** Batch sparkSqlBatch */ + sparkSqlBatch?: (google.cloud.dataproc.v1.ISparkSqlBatch|null); + + /** Batch pysparkNotebookBatch */ + pysparkNotebookBatch?: (google.cloud.dataproc.v1.IPySparkNotebookBatch|null); + + /** Batch runtimeInfo */ + runtimeInfo?: (google.cloud.dataproc.v1.IRuntimeInfo|null); + + /** Batch state */ + state?: (google.cloud.dataproc.v1.Batch.State|keyof typeof google.cloud.dataproc.v1.Batch.State|null); + + /** Batch stateMessage */ + stateMessage?: (string|null); + + /** Batch stateTime */ + stateTime?: (google.protobuf.ITimestamp|null); + + /** Batch creator */ + creator?: (string|null); + + /** Batch labels */ + labels?: ({ [k: string]: string }|null); + + /** Batch runtimeConfig */ + runtimeConfig?: (google.cloud.dataproc.v1.IRuntimeConfig|null); + + /** Batch environmentConfig */ + environmentConfig?: (google.cloud.dataproc.v1.IEnvironmentConfig|null); + + /** Batch operation */ + operation?: (string|null); + + /** Batch stateHistory */ + stateHistory?: (google.cloud.dataproc.v1.Batch.IStateHistory[]|null); + } + + /** Represents a Batch. */ + class Batch implements IBatch { + + /** + * Constructs a new Batch. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IBatch); + + /** Batch name. */ + public name: string; + + /** Batch uuid. */ + public uuid: string; + + /** Batch createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Batch pysparkBatch. */ + public pysparkBatch?: (google.cloud.dataproc.v1.IPySparkBatch|null); + + /** Batch sparkBatch. */ + public sparkBatch?: (google.cloud.dataproc.v1.ISparkBatch|null); + + /** Batch sparkRBatch. */ + public sparkRBatch?: (google.cloud.dataproc.v1.ISparkRBatch|null); + + /** Batch sparkSqlBatch. */ + public sparkSqlBatch?: (google.cloud.dataproc.v1.ISparkSqlBatch|null); + + /** Batch pysparkNotebookBatch. */ + public pysparkNotebookBatch?: (google.cloud.dataproc.v1.IPySparkNotebookBatch|null); + + /** Batch runtimeInfo. */ + public runtimeInfo?: (google.cloud.dataproc.v1.IRuntimeInfo|null); + + /** Batch state. */ + public state: (google.cloud.dataproc.v1.Batch.State|keyof typeof google.cloud.dataproc.v1.Batch.State); + + /** Batch stateMessage. */ + public stateMessage: string; + + /** Batch stateTime. */ + public stateTime?: (google.protobuf.ITimestamp|null); + + /** Batch creator. */ + public creator: string; + + /** Batch labels. */ + public labels: { [k: string]: string }; + + /** Batch runtimeConfig. */ + public runtimeConfig?: (google.cloud.dataproc.v1.IRuntimeConfig|null); + + /** Batch environmentConfig. */ + public environmentConfig?: (google.cloud.dataproc.v1.IEnvironmentConfig|null); + + /** Batch operation. */ + public operation: string; + + /** Batch stateHistory. */ + public stateHistory: google.cloud.dataproc.v1.Batch.IStateHistory[]; + + /** Batch batchConfig. */ + public batchConfig?: ("pysparkBatch"|"sparkBatch"|"sparkRBatch"|"sparkSqlBatch"|"pysparkNotebookBatch"); + + /** + * Creates a new Batch instance using the specified properties. + * @param [properties] Properties to set + * @returns Batch instance + */ + public static create(properties?: google.cloud.dataproc.v1.IBatch): google.cloud.dataproc.v1.Batch; + + /** + * Encodes the specified Batch message. Does not implicitly {@link google.cloud.dataproc.v1.Batch.verify|verify} messages. + * @param message Batch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IBatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Batch message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.Batch.verify|verify} messages. + * @param message Batch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IBatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Batch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Batch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.Batch; + + /** + * Decodes a Batch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Batch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.Batch; + + /** + * Verifies a Batch message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Batch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Batch + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.Batch; + + /** + * Creates a plain object from a Batch message. Also converts values to other types if specified. + * @param message Batch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.Batch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Batch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Batch + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Batch { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PENDING = 1, + RUNNING = 2, + CANCELLING = 3, + CANCELLED = 4, + SUCCEEDED = 5, + FAILED = 6 + } + + /** Properties of a StateHistory. */ + interface IStateHistory { + + /** StateHistory state */ + state?: (google.cloud.dataproc.v1.Batch.State|keyof typeof google.cloud.dataproc.v1.Batch.State|null); + + /** StateHistory stateMessage */ + stateMessage?: (string|null); + + /** StateHistory stateStartTime */ + stateStartTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a StateHistory. */ + class StateHistory implements IStateHistory { + + /** + * Constructs a new StateHistory. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.Batch.IStateHistory); + + /** StateHistory state. */ + public state: (google.cloud.dataproc.v1.Batch.State|keyof typeof google.cloud.dataproc.v1.Batch.State); + + /** StateHistory stateMessage. */ + public stateMessage: string; + + /** StateHistory stateStartTime. */ + public stateStartTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new StateHistory instance using the specified properties. + * @param [properties] Properties to set + * @returns StateHistory instance + */ + public static create(properties?: google.cloud.dataproc.v1.Batch.IStateHistory): google.cloud.dataproc.v1.Batch.StateHistory; + + /** + * Encodes the specified StateHistory message. Does not implicitly {@link google.cloud.dataproc.v1.Batch.StateHistory.verify|verify} messages. + * @param message StateHistory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.Batch.IStateHistory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StateHistory message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.Batch.StateHistory.verify|verify} messages. + * @param message StateHistory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.Batch.IStateHistory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StateHistory message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StateHistory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.Batch.StateHistory; + + /** + * Decodes a StateHistory message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StateHistory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.Batch.StateHistory; + + /** + * Verifies a StateHistory message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StateHistory message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StateHistory + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.Batch.StateHistory; + + /** + * Creates a plain object from a StateHistory message. Also converts values to other types if specified. + * @param message StateHistory + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.Batch.StateHistory, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StateHistory to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StateHistory + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a PySparkBatch. */ + interface IPySparkBatch { + + /** PySparkBatch mainPythonFileUri */ + mainPythonFileUri?: (string|null); + + /** PySparkBatch args */ + args?: (string[]|null); + + /** PySparkBatch pythonFileUris */ + pythonFileUris?: (string[]|null); + + /** PySparkBatch jarFileUris */ + jarFileUris?: (string[]|null); + + /** PySparkBatch fileUris */ + fileUris?: (string[]|null); + + /** PySparkBatch archiveUris */ + archiveUris?: (string[]|null); + } + + /** Represents a PySparkBatch. */ + class PySparkBatch implements IPySparkBatch { + + /** + * Constructs a new PySparkBatch. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IPySparkBatch); + + /** PySparkBatch mainPythonFileUri. */ + public mainPythonFileUri: string; + + /** PySparkBatch args. */ + public args: string[]; + + /** PySparkBatch pythonFileUris. */ + public pythonFileUris: string[]; + + /** PySparkBatch jarFileUris. */ + public jarFileUris: string[]; + + /** PySparkBatch fileUris. */ + public fileUris: string[]; + + /** PySparkBatch archiveUris. */ + public archiveUris: string[]; + + /** + * Creates a new PySparkBatch instance using the specified properties. + * @param [properties] Properties to set + * @returns PySparkBatch instance + */ + public static create(properties?: google.cloud.dataproc.v1.IPySparkBatch): google.cloud.dataproc.v1.PySparkBatch; + + /** + * Encodes the specified PySparkBatch message. Does not implicitly {@link google.cloud.dataproc.v1.PySparkBatch.verify|verify} messages. + * @param message PySparkBatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IPySparkBatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PySparkBatch message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.PySparkBatch.verify|verify} messages. + * @param message PySparkBatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IPySparkBatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PySparkBatch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PySparkBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.PySparkBatch; + + /** + * Decodes a PySparkBatch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PySparkBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.PySparkBatch; + + /** + * Verifies a PySparkBatch message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PySparkBatch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PySparkBatch + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.PySparkBatch; + + /** + * Creates a plain object from a PySparkBatch message. Also converts values to other types if specified. + * @param message PySparkBatch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.PySparkBatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PySparkBatch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PySparkBatch + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SparkBatch. */ + interface ISparkBatch { + + /** SparkBatch mainJarFileUri */ + mainJarFileUri?: (string|null); + + /** SparkBatch mainClass */ + mainClass?: (string|null); + + /** SparkBatch args */ + args?: (string[]|null); + + /** SparkBatch jarFileUris */ + jarFileUris?: (string[]|null); + + /** SparkBatch fileUris */ + fileUris?: (string[]|null); + + /** SparkBatch archiveUris */ + archiveUris?: (string[]|null); + } + + /** Represents a SparkBatch. */ + class SparkBatch implements ISparkBatch { + + /** + * Constructs a new SparkBatch. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.ISparkBatch); + + /** SparkBatch mainJarFileUri. */ + public mainJarFileUri?: (string|null); + + /** SparkBatch mainClass. */ + public mainClass?: (string|null); + + /** SparkBatch args. */ + public args: string[]; + + /** SparkBatch jarFileUris. */ + public jarFileUris: string[]; + + /** SparkBatch fileUris. */ + public fileUris: string[]; + + /** SparkBatch archiveUris. */ + public archiveUris: string[]; + + /** SparkBatch driver. */ + public driver?: ("mainJarFileUri"|"mainClass"); + + /** + * Creates a new SparkBatch instance using the specified properties. + * @param [properties] Properties to set + * @returns SparkBatch instance + */ + public static create(properties?: google.cloud.dataproc.v1.ISparkBatch): google.cloud.dataproc.v1.SparkBatch; + + /** + * Encodes the specified SparkBatch message. Does not implicitly {@link google.cloud.dataproc.v1.SparkBatch.verify|verify} messages. + * @param message SparkBatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.ISparkBatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SparkBatch message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SparkBatch.verify|verify} messages. + * @param message SparkBatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.ISparkBatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SparkBatch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SparkBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.SparkBatch; + + /** + * Decodes a SparkBatch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SparkBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.SparkBatch; + + /** + * Verifies a SparkBatch message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SparkBatch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SparkBatch + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.SparkBatch; + + /** + * Creates a plain object from a SparkBatch message. Also converts values to other types if specified. + * @param message SparkBatch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.SparkBatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SparkBatch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SparkBatch + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SparkRBatch. */ + interface ISparkRBatch { + + /** SparkRBatch mainRFileUri */ + mainRFileUri?: (string|null); + + /** SparkRBatch args */ + args?: (string[]|null); + + /** SparkRBatch fileUris */ + fileUris?: (string[]|null); + + /** SparkRBatch archiveUris */ + archiveUris?: (string[]|null); + } + + /** Represents a SparkRBatch. */ + class SparkRBatch implements ISparkRBatch { + + /** + * Constructs a new SparkRBatch. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.ISparkRBatch); + + /** SparkRBatch mainRFileUri. */ + public mainRFileUri: string; + + /** SparkRBatch args. */ + public args: string[]; + + /** SparkRBatch fileUris. */ + public fileUris: string[]; + + /** SparkRBatch archiveUris. */ + public archiveUris: string[]; + + /** + * Creates a new SparkRBatch instance using the specified properties. + * @param [properties] Properties to set + * @returns SparkRBatch instance + */ + public static create(properties?: google.cloud.dataproc.v1.ISparkRBatch): google.cloud.dataproc.v1.SparkRBatch; + + /** + * Encodes the specified SparkRBatch message. Does not implicitly {@link google.cloud.dataproc.v1.SparkRBatch.verify|verify} messages. + * @param message SparkRBatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.ISparkRBatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SparkRBatch message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SparkRBatch.verify|verify} messages. + * @param message SparkRBatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.ISparkRBatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SparkRBatch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SparkRBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.SparkRBatch; + + /** + * Decodes a SparkRBatch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SparkRBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.SparkRBatch; + + /** + * Verifies a SparkRBatch message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SparkRBatch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SparkRBatch + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.SparkRBatch; + + /** + * Creates a plain object from a SparkRBatch message. Also converts values to other types if specified. + * @param message SparkRBatch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.SparkRBatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SparkRBatch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SparkRBatch + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SparkSqlBatch. */ + interface ISparkSqlBatch { + + /** SparkSqlBatch queryFileUri */ + queryFileUri?: (string|null); + + /** SparkSqlBatch queryVariables */ + queryVariables?: ({ [k: string]: string }|null); + + /** SparkSqlBatch jarFileUris */ + jarFileUris?: (string[]|null); + } + + /** Represents a SparkSqlBatch. */ + class SparkSqlBatch implements ISparkSqlBatch { + + /** + * Constructs a new SparkSqlBatch. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.ISparkSqlBatch); + + /** SparkSqlBatch queryFileUri. */ + public queryFileUri: string; + + /** SparkSqlBatch queryVariables. */ + public queryVariables: { [k: string]: string }; + + /** SparkSqlBatch jarFileUris. */ + public jarFileUris: string[]; + + /** + * Creates a new SparkSqlBatch instance using the specified properties. + * @param [properties] Properties to set + * @returns SparkSqlBatch instance + */ + public static create(properties?: google.cloud.dataproc.v1.ISparkSqlBatch): google.cloud.dataproc.v1.SparkSqlBatch; + + /** + * Encodes the specified SparkSqlBatch message. Does not implicitly {@link google.cloud.dataproc.v1.SparkSqlBatch.verify|verify} messages. + * @param message SparkSqlBatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.ISparkSqlBatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SparkSqlBatch message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SparkSqlBatch.verify|verify} messages. + * @param message SparkSqlBatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.ISparkSqlBatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SparkSqlBatch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SparkSqlBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.SparkSqlBatch; + + /** + * Decodes a SparkSqlBatch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SparkSqlBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.SparkSqlBatch; + + /** + * Verifies a SparkSqlBatch message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SparkSqlBatch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SparkSqlBatch + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.SparkSqlBatch; + + /** + * Creates a plain object from a SparkSqlBatch message. Also converts values to other types if specified. + * @param message SparkSqlBatch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.SparkSqlBatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SparkSqlBatch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SparkSqlBatch + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PySparkNotebookBatch. */ + interface IPySparkNotebookBatch { + + /** PySparkNotebookBatch notebookFileUri */ + notebookFileUri?: (string|null); + + /** PySparkNotebookBatch params */ + params?: ({ [k: string]: string }|null); + + /** PySparkNotebookBatch pythonFileUris */ + pythonFileUris?: (string[]|null); + + /** PySparkNotebookBatch jarFileUris */ + jarFileUris?: (string[]|null); + + /** PySparkNotebookBatch fileUris */ + fileUris?: (string[]|null); + + /** PySparkNotebookBatch archiveUris */ + archiveUris?: (string[]|null); + } + + /** Represents a PySparkNotebookBatch. */ + class PySparkNotebookBatch implements IPySparkNotebookBatch { + + /** + * Constructs a new PySparkNotebookBatch. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IPySparkNotebookBatch); + + /** PySparkNotebookBatch notebookFileUri. */ + public notebookFileUri: string; + + /** PySparkNotebookBatch params. */ + public params: { [k: string]: string }; + + /** PySparkNotebookBatch pythonFileUris. */ + public pythonFileUris: string[]; + + /** PySparkNotebookBatch jarFileUris. */ + public jarFileUris: string[]; + + /** PySparkNotebookBatch fileUris. */ + public fileUris: string[]; + + /** PySparkNotebookBatch archiveUris. */ + public archiveUris: string[]; + + /** + * Creates a new PySparkNotebookBatch instance using the specified properties. + * @param [properties] Properties to set + * @returns PySparkNotebookBatch instance + */ + public static create(properties?: google.cloud.dataproc.v1.IPySparkNotebookBatch): google.cloud.dataproc.v1.PySparkNotebookBatch; + + /** + * Encodes the specified PySparkNotebookBatch message. Does not implicitly {@link google.cloud.dataproc.v1.PySparkNotebookBatch.verify|verify} messages. + * @param message PySparkNotebookBatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IPySparkNotebookBatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PySparkNotebookBatch message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.PySparkNotebookBatch.verify|verify} messages. + * @param message PySparkNotebookBatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IPySparkNotebookBatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PySparkNotebookBatch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PySparkNotebookBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.PySparkNotebookBatch; + + /** + * Decodes a PySparkNotebookBatch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PySparkNotebookBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.PySparkNotebookBatch; + + /** + * Verifies a PySparkNotebookBatch message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PySparkNotebookBatch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PySparkNotebookBatch + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.PySparkNotebookBatch; + + /** + * Creates a plain object from a PySparkNotebookBatch message. Also converts values to other types if specified. + * @param message PySparkNotebookBatch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.PySparkNotebookBatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PySparkNotebookBatch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PySparkNotebookBatch + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RuntimeConfig. */ + interface IRuntimeConfig { + + /** RuntimeConfig version */ + version?: (string|null); + + /** RuntimeConfig containerImage */ + containerImage?: (string|null); + + /** RuntimeConfig properties */ + properties?: ({ [k: string]: string }|null); + + /** RuntimeConfig repositoryConfig */ + repositoryConfig?: (google.cloud.dataproc.v1.IRepositoryConfig|null); + + /** RuntimeConfig autotuningConfig */ + autotuningConfig?: (google.cloud.dataproc.v1.IAutotuningConfig|null); + + /** RuntimeConfig cohort */ + cohort?: (string|null); + } + + /** Represents a RuntimeConfig. */ + class RuntimeConfig implements IRuntimeConfig { + + /** + * Constructs a new RuntimeConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IRuntimeConfig); + + /** RuntimeConfig version. */ + public version: string; + + /** RuntimeConfig containerImage. */ + public containerImage: string; + + /** RuntimeConfig properties. */ + public properties: { [k: string]: string }; + + /** RuntimeConfig repositoryConfig. */ + public repositoryConfig?: (google.cloud.dataproc.v1.IRepositoryConfig|null); + + /** RuntimeConfig autotuningConfig. */ + public autotuningConfig?: (google.cloud.dataproc.v1.IAutotuningConfig|null); + + /** RuntimeConfig cohort. */ + public cohort: string; + + /** + * Creates a new RuntimeConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RuntimeConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IRuntimeConfig): google.cloud.dataproc.v1.RuntimeConfig; + + /** + * Encodes the specified RuntimeConfig message. Does not implicitly {@link google.cloud.dataproc.v1.RuntimeConfig.verify|verify} messages. + * @param message RuntimeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IRuntimeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RuntimeConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.RuntimeConfig.verify|verify} messages. + * @param message RuntimeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IRuntimeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RuntimeConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RuntimeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.RuntimeConfig; + + /** + * Decodes a RuntimeConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RuntimeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.RuntimeConfig; + + /** + * Verifies a RuntimeConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RuntimeConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RuntimeConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.RuntimeConfig; + + /** + * Creates a plain object from a RuntimeConfig message. Also converts values to other types if specified. + * @param message RuntimeConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.RuntimeConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RuntimeConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RuntimeConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnvironmentConfig. */ + interface IEnvironmentConfig { + + /** EnvironmentConfig executionConfig */ + executionConfig?: (google.cloud.dataproc.v1.IExecutionConfig|null); + + /** EnvironmentConfig peripheralsConfig */ + peripheralsConfig?: (google.cloud.dataproc.v1.IPeripheralsConfig|null); + } + + /** Represents an EnvironmentConfig. */ + class EnvironmentConfig implements IEnvironmentConfig { + + /** + * Constructs a new EnvironmentConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IEnvironmentConfig); + + /** EnvironmentConfig executionConfig. */ + public executionConfig?: (google.cloud.dataproc.v1.IExecutionConfig|null); + + /** EnvironmentConfig peripheralsConfig. */ + public peripheralsConfig?: (google.cloud.dataproc.v1.IPeripheralsConfig|null); + + /** + * Creates a new EnvironmentConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns EnvironmentConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IEnvironmentConfig): google.cloud.dataproc.v1.EnvironmentConfig; + + /** + * Encodes the specified EnvironmentConfig message. Does not implicitly {@link google.cloud.dataproc.v1.EnvironmentConfig.verify|verify} messages. + * @param message EnvironmentConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IEnvironmentConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnvironmentConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.EnvironmentConfig.verify|verify} messages. + * @param message EnvironmentConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IEnvironmentConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnvironmentConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnvironmentConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.EnvironmentConfig; + + /** + * Decodes an EnvironmentConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnvironmentConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.EnvironmentConfig; + + /** + * Verifies an EnvironmentConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnvironmentConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnvironmentConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.EnvironmentConfig; + + /** + * Creates a plain object from an EnvironmentConfig message. Also converts values to other types if specified. + * @param message EnvironmentConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.EnvironmentConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnvironmentConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnvironmentConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExecutionConfig. */ + interface IExecutionConfig { + + /** ExecutionConfig serviceAccount */ + serviceAccount?: (string|null); + + /** ExecutionConfig networkUri */ + networkUri?: (string|null); + + /** ExecutionConfig subnetworkUri */ + subnetworkUri?: (string|null); + + /** ExecutionConfig networkTags */ + networkTags?: (string[]|null); + + /** ExecutionConfig kmsKey */ + kmsKey?: (string|null); + + /** ExecutionConfig idleTtl */ + idleTtl?: (google.protobuf.IDuration|null); + + /** ExecutionConfig ttl */ + ttl?: (google.protobuf.IDuration|null); + + /** ExecutionConfig stagingBucket */ + stagingBucket?: (string|null); + + /** ExecutionConfig authenticationConfig */ + authenticationConfig?: (google.cloud.dataproc.v1.IAuthenticationConfig|null); + } + + /** Represents an ExecutionConfig. */ + class ExecutionConfig implements IExecutionConfig { + + /** + * Constructs a new ExecutionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IExecutionConfig); + + /** ExecutionConfig serviceAccount. */ + public serviceAccount: string; + + /** ExecutionConfig networkUri. */ + public networkUri?: (string|null); + + /** ExecutionConfig subnetworkUri. */ + public subnetworkUri?: (string|null); + + /** ExecutionConfig networkTags. */ + public networkTags: string[]; + + /** ExecutionConfig kmsKey. */ + public kmsKey: string; + + /** ExecutionConfig idleTtl. */ + public idleTtl?: (google.protobuf.IDuration|null); + + /** ExecutionConfig ttl. */ + public ttl?: (google.protobuf.IDuration|null); + + /** ExecutionConfig stagingBucket. */ + public stagingBucket: string; + + /** ExecutionConfig authenticationConfig. */ + public authenticationConfig?: (google.cloud.dataproc.v1.IAuthenticationConfig|null); + + /** ExecutionConfig network. */ + public network?: ("networkUri"|"subnetworkUri"); + + /** + * Creates a new ExecutionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ExecutionConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IExecutionConfig): google.cloud.dataproc.v1.ExecutionConfig; + + /** + * Encodes the specified ExecutionConfig message. Does not implicitly {@link google.cloud.dataproc.v1.ExecutionConfig.verify|verify} messages. + * @param message ExecutionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IExecutionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecutionConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ExecutionConfig.verify|verify} messages. + * @param message ExecutionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IExecutionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExecutionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExecutionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ExecutionConfig; + + /** + * Decodes an ExecutionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExecutionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ExecutionConfig; + + /** + * Verifies an ExecutionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExecutionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExecutionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ExecutionConfig; + + /** + * Creates a plain object from an ExecutionConfig message. Also converts values to other types if specified. + * @param message ExecutionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.ExecutionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExecutionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExecutionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SparkHistoryServerConfig. */ + interface ISparkHistoryServerConfig { + + /** SparkHistoryServerConfig dataprocCluster */ + dataprocCluster?: (string|null); + } + + /** Represents a SparkHistoryServerConfig. */ + class SparkHistoryServerConfig implements ISparkHistoryServerConfig { + + /** + * Constructs a new SparkHistoryServerConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.ISparkHistoryServerConfig); + + /** SparkHistoryServerConfig dataprocCluster. */ + public dataprocCluster: string; + + /** + * Creates a new SparkHistoryServerConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SparkHistoryServerConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.ISparkHistoryServerConfig): google.cloud.dataproc.v1.SparkHistoryServerConfig; + + /** + * Encodes the specified SparkHistoryServerConfig message. Does not implicitly {@link google.cloud.dataproc.v1.SparkHistoryServerConfig.verify|verify} messages. + * @param message SparkHistoryServerConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.ISparkHistoryServerConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SparkHistoryServerConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SparkHistoryServerConfig.verify|verify} messages. + * @param message SparkHistoryServerConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.ISparkHistoryServerConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SparkHistoryServerConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SparkHistoryServerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.SparkHistoryServerConfig; + + /** + * Decodes a SparkHistoryServerConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SparkHistoryServerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.SparkHistoryServerConfig; + + /** + * Verifies a SparkHistoryServerConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SparkHistoryServerConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SparkHistoryServerConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.SparkHistoryServerConfig; + + /** + * Creates a plain object from a SparkHistoryServerConfig message. Also converts values to other types if specified. + * @param message SparkHistoryServerConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.SparkHistoryServerConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SparkHistoryServerConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SparkHistoryServerConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PeripheralsConfig. */ + interface IPeripheralsConfig { + + /** PeripheralsConfig metastoreService */ + metastoreService?: (string|null); + + /** PeripheralsConfig sparkHistoryServerConfig */ + sparkHistoryServerConfig?: (google.cloud.dataproc.v1.ISparkHistoryServerConfig|null); + } + + /** Represents a PeripheralsConfig. */ + class PeripheralsConfig implements IPeripheralsConfig { + + /** + * Constructs a new PeripheralsConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IPeripheralsConfig); + + /** PeripheralsConfig metastoreService. */ + public metastoreService: string; + + /** PeripheralsConfig sparkHistoryServerConfig. */ + public sparkHistoryServerConfig?: (google.cloud.dataproc.v1.ISparkHistoryServerConfig|null); + + /** + * Creates a new PeripheralsConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PeripheralsConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IPeripheralsConfig): google.cloud.dataproc.v1.PeripheralsConfig; + + /** + * Encodes the specified PeripheralsConfig message. Does not implicitly {@link google.cloud.dataproc.v1.PeripheralsConfig.verify|verify} messages. + * @param message PeripheralsConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IPeripheralsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PeripheralsConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.PeripheralsConfig.verify|verify} messages. + * @param message PeripheralsConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IPeripheralsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PeripheralsConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PeripheralsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.PeripheralsConfig; + + /** + * Decodes a PeripheralsConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PeripheralsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.PeripheralsConfig; + + /** + * Verifies a PeripheralsConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PeripheralsConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PeripheralsConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.PeripheralsConfig; + + /** + * Creates a plain object from a PeripheralsConfig message. Also converts values to other types if specified. + * @param message PeripheralsConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.PeripheralsConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PeripheralsConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PeripheralsConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RuntimeInfo. */ + interface IRuntimeInfo { + + /** RuntimeInfo endpoints */ + endpoints?: ({ [k: string]: string }|null); + + /** RuntimeInfo outputUri */ + outputUri?: (string|null); + + /** RuntimeInfo diagnosticOutputUri */ + diagnosticOutputUri?: (string|null); + + /** RuntimeInfo approximateUsage */ + approximateUsage?: (google.cloud.dataproc.v1.IUsageMetrics|null); + + /** RuntimeInfo currentUsage */ + currentUsage?: (google.cloud.dataproc.v1.IUsageSnapshot|null); + } + + /** Represents a RuntimeInfo. */ + class RuntimeInfo implements IRuntimeInfo { + + /** + * Constructs a new RuntimeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IRuntimeInfo); + + /** RuntimeInfo endpoints. */ + public endpoints: { [k: string]: string }; + + /** RuntimeInfo outputUri. */ + public outputUri: string; + + /** RuntimeInfo diagnosticOutputUri. */ + public diagnosticOutputUri: string; + + /** RuntimeInfo approximateUsage. */ + public approximateUsage?: (google.cloud.dataproc.v1.IUsageMetrics|null); + + /** RuntimeInfo currentUsage. */ + public currentUsage?: (google.cloud.dataproc.v1.IUsageSnapshot|null); + + /** + * Creates a new RuntimeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns RuntimeInfo instance + */ + public static create(properties?: google.cloud.dataproc.v1.IRuntimeInfo): google.cloud.dataproc.v1.RuntimeInfo; + + /** + * Encodes the specified RuntimeInfo message. Does not implicitly {@link google.cloud.dataproc.v1.RuntimeInfo.verify|verify} messages. + * @param message RuntimeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IRuntimeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RuntimeInfo message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.RuntimeInfo.verify|verify} messages. + * @param message RuntimeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IRuntimeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RuntimeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RuntimeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.RuntimeInfo; + + /** + * Decodes a RuntimeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RuntimeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.RuntimeInfo; + + /** + * Verifies a RuntimeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RuntimeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RuntimeInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.RuntimeInfo; + + /** + * Creates a plain object from a RuntimeInfo message. Also converts values to other types if specified. + * @param message RuntimeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.RuntimeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RuntimeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RuntimeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UsageMetrics. */ + interface IUsageMetrics { + + /** UsageMetrics milliDcuSeconds */ + milliDcuSeconds?: (number|Long|string|null); + + /** UsageMetrics shuffleStorageGbSeconds */ + shuffleStorageGbSeconds?: (number|Long|string|null); + + /** UsageMetrics milliAcceleratorSeconds */ + milliAcceleratorSeconds?: (number|Long|string|null); + + /** UsageMetrics acceleratorType */ + acceleratorType?: (string|null); + } + + /** Represents a UsageMetrics. */ + class UsageMetrics implements IUsageMetrics { + + /** + * Constructs a new UsageMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IUsageMetrics); + + /** UsageMetrics milliDcuSeconds. */ + public milliDcuSeconds: (number|Long|string); + + /** UsageMetrics shuffleStorageGbSeconds. */ + public shuffleStorageGbSeconds: (number|Long|string); + + /** UsageMetrics milliAcceleratorSeconds. */ + public milliAcceleratorSeconds: (number|Long|string); + + /** UsageMetrics acceleratorType. */ + public acceleratorType: string; + + /** + * Creates a new UsageMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns UsageMetrics instance + */ + public static create(properties?: google.cloud.dataproc.v1.IUsageMetrics): google.cloud.dataproc.v1.UsageMetrics; + + /** + * Encodes the specified UsageMetrics message. Does not implicitly {@link google.cloud.dataproc.v1.UsageMetrics.verify|verify} messages. + * @param message UsageMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IUsageMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UsageMetrics message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.UsageMetrics.verify|verify} messages. + * @param message UsageMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IUsageMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UsageMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UsageMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.UsageMetrics; + + /** + * Decodes a UsageMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UsageMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.UsageMetrics; + + /** + * Verifies a UsageMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UsageMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UsageMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.UsageMetrics; + + /** + * Creates a plain object from a UsageMetrics message. Also converts values to other types if specified. + * @param message UsageMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.UsageMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UsageMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UsageMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UsageSnapshot. */ + interface IUsageSnapshot { + + /** UsageSnapshot milliDcu */ + milliDcu?: (number|Long|string|null); + + /** UsageSnapshot shuffleStorageGb */ + shuffleStorageGb?: (number|Long|string|null); + + /** UsageSnapshot milliDcuPremium */ + milliDcuPremium?: (number|Long|string|null); + + /** UsageSnapshot shuffleStorageGbPremium */ + shuffleStorageGbPremium?: (number|Long|string|null); + + /** UsageSnapshot milliAccelerator */ + milliAccelerator?: (number|Long|string|null); + + /** UsageSnapshot acceleratorType */ + acceleratorType?: (string|null); + + /** UsageSnapshot snapshotTime */ + snapshotTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a UsageSnapshot. */ + class UsageSnapshot implements IUsageSnapshot { + + /** + * Constructs a new UsageSnapshot. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IUsageSnapshot); + + /** UsageSnapshot milliDcu. */ + public milliDcu: (number|Long|string); + + /** UsageSnapshot shuffleStorageGb. */ + public shuffleStorageGb: (number|Long|string); + + /** UsageSnapshot milliDcuPremium. */ + public milliDcuPremium: (number|Long|string); + + /** UsageSnapshot shuffleStorageGbPremium. */ + public shuffleStorageGbPremium: (number|Long|string); + + /** UsageSnapshot milliAccelerator. */ + public milliAccelerator: (number|Long|string); + + /** UsageSnapshot acceleratorType. */ + public acceleratorType: string; + + /** UsageSnapshot snapshotTime. */ + public snapshotTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UsageSnapshot instance using the specified properties. + * @param [properties] Properties to set + * @returns UsageSnapshot instance + */ + public static create(properties?: google.cloud.dataproc.v1.IUsageSnapshot): google.cloud.dataproc.v1.UsageSnapshot; + + /** + * Encodes the specified UsageSnapshot message. Does not implicitly {@link google.cloud.dataproc.v1.UsageSnapshot.verify|verify} messages. + * @param message UsageSnapshot message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IUsageSnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UsageSnapshot message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.UsageSnapshot.verify|verify} messages. + * @param message UsageSnapshot message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IUsageSnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UsageSnapshot message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UsageSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.UsageSnapshot; + + /** + * Decodes a UsageSnapshot message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UsageSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.UsageSnapshot; + + /** + * Verifies a UsageSnapshot message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UsageSnapshot message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UsageSnapshot + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.UsageSnapshot; + + /** + * Creates a plain object from a UsageSnapshot message. Also converts values to other types if specified. + * @param message UsageSnapshot + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.UsageSnapshot, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UsageSnapshot to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UsageSnapshot + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GkeClusterConfig. */ + interface IGkeClusterConfig { + + /** GkeClusterConfig gkeClusterTarget */ + gkeClusterTarget?: (string|null); + + /** GkeClusterConfig nodePoolTarget */ + nodePoolTarget?: (google.cloud.dataproc.v1.IGkeNodePoolTarget[]|null); + } + + /** Represents a GkeClusterConfig. */ + class GkeClusterConfig implements IGkeClusterConfig { + + /** + * Constructs a new GkeClusterConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IGkeClusterConfig); + + /** GkeClusterConfig gkeClusterTarget. */ + public gkeClusterTarget: string; + + /** GkeClusterConfig nodePoolTarget. */ + public nodePoolTarget: google.cloud.dataproc.v1.IGkeNodePoolTarget[]; + + /** + * Creates a new GkeClusterConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GkeClusterConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IGkeClusterConfig): google.cloud.dataproc.v1.GkeClusterConfig; + + /** + * Encodes the specified GkeClusterConfig message. Does not implicitly {@link google.cloud.dataproc.v1.GkeClusterConfig.verify|verify} messages. + * @param message GkeClusterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IGkeClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GkeClusterConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GkeClusterConfig.verify|verify} messages. + * @param message GkeClusterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IGkeClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GkeClusterConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GkeClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.GkeClusterConfig; + + /** + * Decodes a GkeClusterConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GkeClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.GkeClusterConfig; + + /** + * Verifies a GkeClusterConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GkeClusterConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GkeClusterConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.GkeClusterConfig; + + /** + * Creates a plain object from a GkeClusterConfig message. Also converts values to other types if specified. + * @param message GkeClusterConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.GkeClusterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GkeClusterConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GkeClusterConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KubernetesClusterConfig. */ + interface IKubernetesClusterConfig { + + /** KubernetesClusterConfig kubernetesNamespace */ + kubernetesNamespace?: (string|null); + + /** KubernetesClusterConfig gkeClusterConfig */ + gkeClusterConfig?: (google.cloud.dataproc.v1.IGkeClusterConfig|null); + + /** KubernetesClusterConfig kubernetesSoftwareConfig */ + kubernetesSoftwareConfig?: (google.cloud.dataproc.v1.IKubernetesSoftwareConfig|null); + } + + /** Represents a KubernetesClusterConfig. */ + class KubernetesClusterConfig implements IKubernetesClusterConfig { + + /** + * Constructs a new KubernetesClusterConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IKubernetesClusterConfig); + + /** KubernetesClusterConfig kubernetesNamespace. */ + public kubernetesNamespace: string; + + /** KubernetesClusterConfig gkeClusterConfig. */ + public gkeClusterConfig?: (google.cloud.dataproc.v1.IGkeClusterConfig|null); + + /** KubernetesClusterConfig kubernetesSoftwareConfig. */ + public kubernetesSoftwareConfig?: (google.cloud.dataproc.v1.IKubernetesSoftwareConfig|null); + + /** KubernetesClusterConfig config. */ + public config?: "gkeClusterConfig"; + + /** + * Creates a new KubernetesClusterConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns KubernetesClusterConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IKubernetesClusterConfig): google.cloud.dataproc.v1.KubernetesClusterConfig; + + /** + * Encodes the specified KubernetesClusterConfig message. Does not implicitly {@link google.cloud.dataproc.v1.KubernetesClusterConfig.verify|verify} messages. + * @param message KubernetesClusterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IKubernetesClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KubernetesClusterConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.KubernetesClusterConfig.verify|verify} messages. + * @param message KubernetesClusterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IKubernetesClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KubernetesClusterConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KubernetesClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.KubernetesClusterConfig; + + /** + * Decodes a KubernetesClusterConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KubernetesClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.KubernetesClusterConfig; + + /** + * Verifies a KubernetesClusterConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a KubernetesClusterConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KubernetesClusterConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.KubernetesClusterConfig; + + /** + * Creates a plain object from a KubernetesClusterConfig message. Also converts values to other types if specified. + * @param message KubernetesClusterConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.KubernetesClusterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KubernetesClusterConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KubernetesClusterConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KubernetesSoftwareConfig. */ + interface IKubernetesSoftwareConfig { + + /** KubernetesSoftwareConfig componentVersion */ + componentVersion?: ({ [k: string]: string }|null); + + /** KubernetesSoftwareConfig properties */ + properties?: ({ [k: string]: string }|null); + } + + /** Represents a KubernetesSoftwareConfig. */ + class KubernetesSoftwareConfig implements IKubernetesSoftwareConfig { + + /** + * Constructs a new KubernetesSoftwareConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IKubernetesSoftwareConfig); + + /** KubernetesSoftwareConfig componentVersion. */ + public componentVersion: { [k: string]: string }; + + /** KubernetesSoftwareConfig properties. */ + public properties: { [k: string]: string }; + + /** + * Creates a new KubernetesSoftwareConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns KubernetesSoftwareConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IKubernetesSoftwareConfig): google.cloud.dataproc.v1.KubernetesSoftwareConfig; + + /** + * Encodes the specified KubernetesSoftwareConfig message. Does not implicitly {@link google.cloud.dataproc.v1.KubernetesSoftwareConfig.verify|verify} messages. + * @param message KubernetesSoftwareConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IKubernetesSoftwareConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KubernetesSoftwareConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.KubernetesSoftwareConfig.verify|verify} messages. + * @param message KubernetesSoftwareConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IKubernetesSoftwareConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KubernetesSoftwareConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KubernetesSoftwareConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.KubernetesSoftwareConfig; + + /** + * Decodes a KubernetesSoftwareConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KubernetesSoftwareConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.KubernetesSoftwareConfig; + + /** + * Verifies a KubernetesSoftwareConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a KubernetesSoftwareConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KubernetesSoftwareConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.KubernetesSoftwareConfig; + + /** + * Creates a plain object from a KubernetesSoftwareConfig message. Also converts values to other types if specified. + * @param message KubernetesSoftwareConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.KubernetesSoftwareConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KubernetesSoftwareConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KubernetesSoftwareConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GkeNodePoolTarget. */ + interface IGkeNodePoolTarget { + + /** GkeNodePoolTarget nodePool */ + nodePool?: (string|null); + + /** GkeNodePoolTarget roles */ + roles?: (google.cloud.dataproc.v1.GkeNodePoolTarget.Role[]|null); + + /** GkeNodePoolTarget nodePoolConfig */ + nodePoolConfig?: (google.cloud.dataproc.v1.IGkeNodePoolConfig|null); + } + + /** Represents a GkeNodePoolTarget. */ + class GkeNodePoolTarget implements IGkeNodePoolTarget { + + /** + * Constructs a new GkeNodePoolTarget. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IGkeNodePoolTarget); + + /** GkeNodePoolTarget nodePool. */ + public nodePool: string; + + /** GkeNodePoolTarget roles. */ + public roles: google.cloud.dataproc.v1.GkeNodePoolTarget.Role[]; + + /** GkeNodePoolTarget nodePoolConfig. */ + public nodePoolConfig?: (google.cloud.dataproc.v1.IGkeNodePoolConfig|null); + + /** + * Creates a new GkeNodePoolTarget instance using the specified properties. + * @param [properties] Properties to set + * @returns GkeNodePoolTarget instance + */ + public static create(properties?: google.cloud.dataproc.v1.IGkeNodePoolTarget): google.cloud.dataproc.v1.GkeNodePoolTarget; + + /** + * Encodes the specified GkeNodePoolTarget message. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolTarget.verify|verify} messages. + * @param message GkeNodePoolTarget message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IGkeNodePoolTarget, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GkeNodePoolTarget message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolTarget.verify|verify} messages. + * @param message GkeNodePoolTarget message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IGkeNodePoolTarget, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GkeNodePoolTarget message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GkeNodePoolTarget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.GkeNodePoolTarget; + + /** + * Decodes a GkeNodePoolTarget message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GkeNodePoolTarget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.GkeNodePoolTarget; + + /** + * Verifies a GkeNodePoolTarget message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GkeNodePoolTarget message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GkeNodePoolTarget + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.GkeNodePoolTarget; + + /** + * Creates a plain object from a GkeNodePoolTarget message. Also converts values to other types if specified. + * @param message GkeNodePoolTarget + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.GkeNodePoolTarget, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GkeNodePoolTarget to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GkeNodePoolTarget + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GkeNodePoolTarget { + + /** Role enum. */ + enum Role { + ROLE_UNSPECIFIED = 0, + DEFAULT = 1, + CONTROLLER = 2, + SPARK_DRIVER = 3, + SPARK_EXECUTOR = 4 + } + } + + /** Properties of a GkeNodePoolConfig. */ + interface IGkeNodePoolConfig { + + /** GkeNodePoolConfig config */ + config?: (google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodeConfig|null); + + /** GkeNodePoolConfig locations */ + locations?: (string[]|null); + + /** GkeNodePoolConfig autoscaling */ + autoscaling?: (google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAutoscalingConfig|null); + } + + /** Represents a GkeNodePoolConfig. */ + class GkeNodePoolConfig implements IGkeNodePoolConfig { + + /** + * Constructs a new GkeNodePoolConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IGkeNodePoolConfig); + + /** GkeNodePoolConfig config. */ + public config?: (google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodeConfig|null); + + /** GkeNodePoolConfig locations. */ + public locations: string[]; + + /** GkeNodePoolConfig autoscaling. */ + public autoscaling?: (google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAutoscalingConfig|null); + + /** + * Creates a new GkeNodePoolConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GkeNodePoolConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IGkeNodePoolConfig): google.cloud.dataproc.v1.GkeNodePoolConfig; + + /** + * Encodes the specified GkeNodePoolConfig message. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolConfig.verify|verify} messages. + * @param message GkeNodePoolConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IGkeNodePoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GkeNodePoolConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolConfig.verify|verify} messages. + * @param message GkeNodePoolConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IGkeNodePoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GkeNodePoolConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GkeNodePoolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.GkeNodePoolConfig; + + /** + * Decodes a GkeNodePoolConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GkeNodePoolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.GkeNodePoolConfig; + + /** + * Verifies a GkeNodePoolConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GkeNodePoolConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GkeNodePoolConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.GkeNodePoolConfig; + + /** + * Creates a plain object from a GkeNodePoolConfig message. Also converts values to other types if specified. + * @param message GkeNodePoolConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.GkeNodePoolConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GkeNodePoolConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GkeNodePoolConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GkeNodePoolConfig { + + /** Properties of a GkeNodeConfig. */ + interface IGkeNodeConfig { + + /** GkeNodeConfig machineType */ + machineType?: (string|null); + + /** GkeNodeConfig localSsdCount */ + localSsdCount?: (number|null); + + /** GkeNodeConfig preemptible */ + preemptible?: (boolean|null); + + /** GkeNodeConfig accelerators */ + accelerators?: (google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAcceleratorConfig[]|null); + + /** GkeNodeConfig minCpuPlatform */ + minCpuPlatform?: (string|null); + + /** GkeNodeConfig bootDiskKmsKey */ + bootDiskKmsKey?: (string|null); + + /** GkeNodeConfig spot */ + spot?: (boolean|null); + } + + /** Represents a GkeNodeConfig. */ + class GkeNodeConfig implements IGkeNodeConfig { + + /** + * Constructs a new GkeNodeConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodeConfig); + + /** GkeNodeConfig machineType. */ + public machineType: string; + + /** GkeNodeConfig localSsdCount. */ + public localSsdCount: number; + + /** GkeNodeConfig preemptible. */ + public preemptible: boolean; + + /** GkeNodeConfig accelerators. */ + public accelerators: google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAcceleratorConfig[]; + + /** GkeNodeConfig minCpuPlatform. */ + public minCpuPlatform: string; + + /** GkeNodeConfig bootDiskKmsKey. */ + public bootDiskKmsKey: string; + + /** GkeNodeConfig spot. */ + public spot: boolean; + + /** + * Creates a new GkeNodeConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GkeNodeConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodeConfig): google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig; + + /** + * Encodes the specified GkeNodeConfig message. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.verify|verify} messages. + * @param message GkeNodeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GkeNodeConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.verify|verify} messages. + * @param message GkeNodeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GkeNodeConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GkeNodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig; + + /** + * Decodes a GkeNodeConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GkeNodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig; + + /** + * Verifies a GkeNodeConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GkeNodeConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GkeNodeConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig; + + /** + * Creates a plain object from a GkeNodeConfig message. Also converts values to other types if specified. + * @param message GkeNodeConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GkeNodeConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GkeNodeConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GkeNodePoolAcceleratorConfig. */ + interface IGkeNodePoolAcceleratorConfig { + + /** GkeNodePoolAcceleratorConfig acceleratorCount */ + acceleratorCount?: (number|Long|string|null); + + /** GkeNodePoolAcceleratorConfig acceleratorType */ + acceleratorType?: (string|null); + + /** GkeNodePoolAcceleratorConfig gpuPartitionSize */ + gpuPartitionSize?: (string|null); + } + + /** Represents a GkeNodePoolAcceleratorConfig. */ + class GkeNodePoolAcceleratorConfig implements IGkeNodePoolAcceleratorConfig { + + /** + * Constructs a new GkeNodePoolAcceleratorConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAcceleratorConfig); + + /** GkeNodePoolAcceleratorConfig acceleratorCount. */ + public acceleratorCount: (number|Long|string); + + /** GkeNodePoolAcceleratorConfig acceleratorType. */ + public acceleratorType: string; + + /** GkeNodePoolAcceleratorConfig gpuPartitionSize. */ + public gpuPartitionSize: string; + + /** + * Creates a new GkeNodePoolAcceleratorConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GkeNodePoolAcceleratorConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAcceleratorConfig): google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig; + + /** + * Encodes the specified GkeNodePoolAcceleratorConfig message. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig.verify|verify} messages. + * @param message GkeNodePoolAcceleratorConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAcceleratorConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GkeNodePoolAcceleratorConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig.verify|verify} messages. + * @param message GkeNodePoolAcceleratorConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAcceleratorConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GkeNodePoolAcceleratorConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GkeNodePoolAcceleratorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig; + + /** + * Decodes a GkeNodePoolAcceleratorConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GkeNodePoolAcceleratorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig; + + /** + * Verifies a GkeNodePoolAcceleratorConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GkeNodePoolAcceleratorConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GkeNodePoolAcceleratorConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig; + + /** + * Creates a plain object from a GkeNodePoolAcceleratorConfig message. Also converts values to other types if specified. + * @param message GkeNodePoolAcceleratorConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GkeNodePoolAcceleratorConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GkeNodePoolAcceleratorConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GkeNodePoolAutoscalingConfig. */ + interface IGkeNodePoolAutoscalingConfig { + + /** GkeNodePoolAutoscalingConfig minNodeCount */ + minNodeCount?: (number|null); + + /** GkeNodePoolAutoscalingConfig maxNodeCount */ + maxNodeCount?: (number|null); + } + + /** Represents a GkeNodePoolAutoscalingConfig. */ + class GkeNodePoolAutoscalingConfig implements IGkeNodePoolAutoscalingConfig { + + /** + * Constructs a new GkeNodePoolAutoscalingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAutoscalingConfig); + + /** GkeNodePoolAutoscalingConfig minNodeCount. */ + public minNodeCount: number; + + /** GkeNodePoolAutoscalingConfig maxNodeCount. */ + public maxNodeCount: number; + + /** + * Creates a new GkeNodePoolAutoscalingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GkeNodePoolAutoscalingConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAutoscalingConfig): google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig; + + /** + * Encodes the specified GkeNodePoolAutoscalingConfig message. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig.verify|verify} messages. + * @param message GkeNodePoolAutoscalingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAutoscalingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GkeNodePoolAutoscalingConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig.verify|verify} messages. + * @param message GkeNodePoolAutoscalingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAutoscalingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GkeNodePoolAutoscalingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GkeNodePoolAutoscalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig; + + /** + * Decodes a GkeNodePoolAutoscalingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GkeNodePoolAutoscalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig; + + /** + * Verifies a GkeNodePoolAutoscalingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GkeNodePoolAutoscalingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GkeNodePoolAutoscalingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig; + + /** + * Creates a plain object from a GkeNodePoolAutoscalingConfig message. Also converts values to other types if specified. + * @param message GkeNodePoolAutoscalingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GkeNodePoolAutoscalingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GkeNodePoolAutoscalingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an AuthenticationConfig. */ + interface IAuthenticationConfig { + + /** AuthenticationConfig userWorkloadAuthenticationType */ + userWorkloadAuthenticationType?: (google.cloud.dataproc.v1.AuthenticationConfig.AuthenticationType|keyof typeof google.cloud.dataproc.v1.AuthenticationConfig.AuthenticationType|null); + } + + /** Represents an AuthenticationConfig. */ + class AuthenticationConfig implements IAuthenticationConfig { + + /** + * Constructs a new AuthenticationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IAuthenticationConfig); + + /** AuthenticationConfig userWorkloadAuthenticationType. */ + public userWorkloadAuthenticationType: (google.cloud.dataproc.v1.AuthenticationConfig.AuthenticationType|keyof typeof google.cloud.dataproc.v1.AuthenticationConfig.AuthenticationType); + + /** + * Creates a new AuthenticationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuthenticationConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IAuthenticationConfig): google.cloud.dataproc.v1.AuthenticationConfig; + + /** + * Encodes the specified AuthenticationConfig message. Does not implicitly {@link google.cloud.dataproc.v1.AuthenticationConfig.verify|verify} messages. + * @param message AuthenticationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IAuthenticationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuthenticationConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.AuthenticationConfig.verify|verify} messages. + * @param message AuthenticationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IAuthenticationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuthenticationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuthenticationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.AuthenticationConfig; + + /** + * Decodes an AuthenticationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuthenticationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.AuthenticationConfig; + + /** + * Verifies an AuthenticationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuthenticationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuthenticationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.AuthenticationConfig; + + /** + * Creates a plain object from an AuthenticationConfig message. Also converts values to other types if specified. + * @param message AuthenticationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.AuthenticationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuthenticationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuthenticationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuthenticationConfig { + + /** AuthenticationType enum. */ + enum AuthenticationType { + AUTHENTICATION_TYPE_UNSPECIFIED = 0, + SERVICE_ACCOUNT = 1, + END_USER_CREDENTIALS = 2 + } + } + + /** Properties of an AutotuningConfig. */ + interface IAutotuningConfig { + + /** AutotuningConfig scenarios */ + scenarios?: (google.cloud.dataproc.v1.AutotuningConfig.Scenario[]|null); + } + + /** Represents an AutotuningConfig. */ + class AutotuningConfig implements IAutotuningConfig { + + /** + * Constructs a new AutotuningConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IAutotuningConfig); + + /** AutotuningConfig scenarios. */ + public scenarios: google.cloud.dataproc.v1.AutotuningConfig.Scenario[]; + + /** + * Creates a new AutotuningConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AutotuningConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IAutotuningConfig): google.cloud.dataproc.v1.AutotuningConfig; + + /** + * Encodes the specified AutotuningConfig message. Does not implicitly {@link google.cloud.dataproc.v1.AutotuningConfig.verify|verify} messages. + * @param message AutotuningConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IAutotuningConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutotuningConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.AutotuningConfig.verify|verify} messages. + * @param message AutotuningConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IAutotuningConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutotuningConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutotuningConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.AutotuningConfig; + + /** + * Decodes an AutotuningConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutotuningConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.AutotuningConfig; + + /** + * Verifies an AutotuningConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutotuningConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutotuningConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.AutotuningConfig; + + /** + * Creates a plain object from an AutotuningConfig message. Also converts values to other types if specified. + * @param message AutotuningConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.AutotuningConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutotuningConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutotuningConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AutotuningConfig { + + /** Scenario enum. */ + enum Scenario { + SCENARIO_UNSPECIFIED = 0, + SCALING = 2, + BROADCAST_HASH_JOIN = 3, + MEMORY = 4, + NONE = 5, + AUTO = 6 + } + } + + /** Properties of a RepositoryConfig. */ + interface IRepositoryConfig { + + /** RepositoryConfig pypiRepositoryConfig */ + pypiRepositoryConfig?: (google.cloud.dataproc.v1.IPyPiRepositoryConfig|null); + } + + /** Represents a RepositoryConfig. */ + class RepositoryConfig implements IRepositoryConfig { + + /** + * Constructs a new RepositoryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IRepositoryConfig); + + /** RepositoryConfig pypiRepositoryConfig. */ + public pypiRepositoryConfig?: (google.cloud.dataproc.v1.IPyPiRepositoryConfig|null); + + /** + * Creates a new RepositoryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RepositoryConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IRepositoryConfig): google.cloud.dataproc.v1.RepositoryConfig; + + /** + * Encodes the specified RepositoryConfig message. Does not implicitly {@link google.cloud.dataproc.v1.RepositoryConfig.verify|verify} messages. + * @param message RepositoryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IRepositoryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RepositoryConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.RepositoryConfig.verify|verify} messages. + * @param message RepositoryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IRepositoryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RepositoryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RepositoryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.RepositoryConfig; + + /** + * Decodes a RepositoryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RepositoryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.RepositoryConfig; + + /** + * Verifies a RepositoryConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RepositoryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RepositoryConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.RepositoryConfig; + + /** + * Creates a plain object from a RepositoryConfig message. Also converts values to other types if specified. + * @param message RepositoryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.RepositoryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RepositoryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RepositoryConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PyPiRepositoryConfig. */ + interface IPyPiRepositoryConfig { + + /** PyPiRepositoryConfig pypiRepository */ + pypiRepository?: (string|null); + } + + /** Represents a PyPiRepositoryConfig. */ + class PyPiRepositoryConfig implements IPyPiRepositoryConfig { + + /** + * Constructs a new PyPiRepositoryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IPyPiRepositoryConfig); + + /** PyPiRepositoryConfig pypiRepository. */ + public pypiRepository: string; + + /** + * Creates a new PyPiRepositoryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PyPiRepositoryConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IPyPiRepositoryConfig): google.cloud.dataproc.v1.PyPiRepositoryConfig; + + /** + * Encodes the specified PyPiRepositoryConfig message. Does not implicitly {@link google.cloud.dataproc.v1.PyPiRepositoryConfig.verify|verify} messages. + * @param message PyPiRepositoryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IPyPiRepositoryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PyPiRepositoryConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.PyPiRepositoryConfig.verify|verify} messages. + * @param message PyPiRepositoryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IPyPiRepositoryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PyPiRepositoryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PyPiRepositoryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.PyPiRepositoryConfig; + + /** + * Decodes a PyPiRepositoryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PyPiRepositoryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.PyPiRepositoryConfig; + + /** + * Verifies a PyPiRepositoryConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PyPiRepositoryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PyPiRepositoryConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.PyPiRepositoryConfig; + + /** + * Creates a plain object from a PyPiRepositoryConfig message. Also converts values to other types if specified. + * @param message PyPiRepositoryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.PyPiRepositoryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PyPiRepositoryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PyPiRepositoryConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Component enum. */ + enum Component { + COMPONENT_UNSPECIFIED = 0, + ANACONDA = 5, + DELTA = 20, + DOCKER = 13, + DRUID = 9, + FLINK = 14, + HBASE = 11, + HIVE_WEBHCAT = 3, + HUDI = 18, + ICEBERG = 19, + JUPYTER = 1, + JUPYTER_KERNEL_GATEWAY = 22, + PIG = 21, + PRESTO = 6, + TRINO = 17, + RANGER = 12, + SOLR = 10, + ZEPPELIN = 4, + ZOOKEEPER = 8 + } + + /** FailureAction enum. */ + enum FailureAction { + FAILURE_ACTION_UNSPECIFIED = 0, + NO_ACTION = 1, + DELETE = 2 + } + + /** Represents a ClusterController */ + class ClusterController extends $protobuf.rpc.Service { + + /** + * Constructs a new ClusterController 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 ClusterController 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): ClusterController; + + /** + * Calls CreateCluster. + * @param request CreateClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createCluster(request: google.cloud.dataproc.v1.ICreateClusterRequest, callback: google.cloud.dataproc.v1.ClusterController.CreateClusterCallback): void; + + /** + * Calls CreateCluster. + * @param request CreateClusterRequest message or plain object + * @returns Promise + */ + public createCluster(request: google.cloud.dataproc.v1.ICreateClusterRequest): Promise; + + /** + * Calls UpdateCluster. + * @param request UpdateClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateCluster(request: google.cloud.dataproc.v1.IUpdateClusterRequest, callback: google.cloud.dataproc.v1.ClusterController.UpdateClusterCallback): void; + + /** + * Calls UpdateCluster. + * @param request UpdateClusterRequest message or plain object + * @returns Promise + */ + public updateCluster(request: google.cloud.dataproc.v1.IUpdateClusterRequest): Promise; + + /** + * Calls StopCluster. + * @param request StopClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public stopCluster(request: google.cloud.dataproc.v1.IStopClusterRequest, callback: google.cloud.dataproc.v1.ClusterController.StopClusterCallback): void; + + /** + * Calls StopCluster. + * @param request StopClusterRequest message or plain object + * @returns Promise + */ + public stopCluster(request: google.cloud.dataproc.v1.IStopClusterRequest): Promise; + + /** + * Calls StartCluster. + * @param request StartClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public startCluster(request: google.cloud.dataproc.v1.IStartClusterRequest, callback: google.cloud.dataproc.v1.ClusterController.StartClusterCallback): void; + + /** + * Calls StartCluster. + * @param request StartClusterRequest message or plain object + * @returns Promise + */ + public startCluster(request: google.cloud.dataproc.v1.IStartClusterRequest): Promise; + + /** + * Calls DeleteCluster. + * @param request DeleteClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteCluster(request: google.cloud.dataproc.v1.IDeleteClusterRequest, callback: google.cloud.dataproc.v1.ClusterController.DeleteClusterCallback): void; + + /** + * Calls DeleteCluster. + * @param request DeleteClusterRequest message or plain object + * @returns Promise + */ + public deleteCluster(request: google.cloud.dataproc.v1.IDeleteClusterRequest): Promise; + + /** + * Calls GetCluster. + * @param request GetClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Cluster + */ + public getCluster(request: google.cloud.dataproc.v1.IGetClusterRequest, callback: google.cloud.dataproc.v1.ClusterController.GetClusterCallback): void; + + /** + * Calls GetCluster. + * @param request GetClusterRequest message or plain object + * @returns Promise + */ + public getCluster(request: google.cloud.dataproc.v1.IGetClusterRequest): Promise; + + /** + * Calls ListClusters. + * @param request ListClustersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListClustersResponse + */ + public listClusters(request: google.cloud.dataproc.v1.IListClustersRequest, callback: google.cloud.dataproc.v1.ClusterController.ListClustersCallback): void; + + /** + * Calls ListClusters. + * @param request ListClustersRequest message or plain object + * @returns Promise + */ + public listClusters(request: google.cloud.dataproc.v1.IListClustersRequest): Promise; + + /** + * Calls DiagnoseCluster. + * @param request DiagnoseClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public diagnoseCluster(request: google.cloud.dataproc.v1.IDiagnoseClusterRequest, callback: google.cloud.dataproc.v1.ClusterController.DiagnoseClusterCallback): void; + + /** + * Calls DiagnoseCluster. + * @param request DiagnoseClusterRequest message or plain object + * @returns Promise + */ + public diagnoseCluster(request: google.cloud.dataproc.v1.IDiagnoseClusterRequest): Promise; + } + + namespace ClusterController { + + /** + * Callback as used by {@link google.cloud.dataproc.v1.ClusterController|createCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.ClusterController|updateCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.ClusterController|stopCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type StopClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.ClusterController|startCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type StartClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.ClusterController|deleteCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.ClusterController|getCluster}. + * @param error Error, if any + * @param [response] Cluster + */ + type GetClusterCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.Cluster) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.ClusterController|listClusters}. + * @param error Error, if any + * @param [response] ListClustersResponse + */ + type ListClustersCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.ListClustersResponse) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.ClusterController|diagnoseCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type DiagnoseClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a Cluster. */ + interface ICluster { + + /** Cluster projectId */ + projectId?: (string|null); + + /** Cluster clusterName */ + clusterName?: (string|null); + + /** Cluster config */ + config?: (google.cloud.dataproc.v1.IClusterConfig|null); + + /** Cluster virtualClusterConfig */ + virtualClusterConfig?: (google.cloud.dataproc.v1.IVirtualClusterConfig|null); + + /** Cluster labels */ + labels?: ({ [k: string]: string }|null); + + /** Cluster status */ + status?: (google.cloud.dataproc.v1.IClusterStatus|null); + + /** Cluster statusHistory */ + statusHistory?: (google.cloud.dataproc.v1.IClusterStatus[]|null); + + /** Cluster clusterUuid */ + clusterUuid?: (string|null); + + /** Cluster metrics */ + metrics?: (google.cloud.dataproc.v1.IClusterMetrics|null); + } + + /** Represents a Cluster. */ + class Cluster implements ICluster { + + /** + * Constructs a new Cluster. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.ICluster); + + /** Cluster projectId. */ + public projectId: string; + + /** Cluster clusterName. */ + public clusterName: string; + + /** Cluster config. */ + public config?: (google.cloud.dataproc.v1.IClusterConfig|null); + + /** Cluster virtualClusterConfig. */ + public virtualClusterConfig?: (google.cloud.dataproc.v1.IVirtualClusterConfig|null); + + /** Cluster labels. */ + public labels: { [k: string]: string }; + + /** Cluster status. */ + public status?: (google.cloud.dataproc.v1.IClusterStatus|null); + + /** Cluster statusHistory. */ + public statusHistory: google.cloud.dataproc.v1.IClusterStatus[]; + + /** Cluster clusterUuid. */ + public clusterUuid: string; + + /** Cluster metrics. */ + public metrics?: (google.cloud.dataproc.v1.IClusterMetrics|null); + + /** + * Creates a new Cluster instance using the specified properties. + * @param [properties] Properties to set + * @returns Cluster instance + */ + public static create(properties?: google.cloud.dataproc.v1.ICluster): google.cloud.dataproc.v1.Cluster; + + /** + * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.dataproc.v1.Cluster.verify|verify} messages. + * @param message Cluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.Cluster.verify|verify} messages. + * @param message Cluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Cluster message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.Cluster; + + /** + * Decodes a Cluster message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.Cluster; + + /** + * Verifies a Cluster message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Cluster message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Cluster + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.Cluster; + + /** + * Creates a plain object from a Cluster message. Also converts values to other types if specified. + * @param message Cluster + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.Cluster, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Cluster to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Cluster + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClusterConfig. */ + interface IClusterConfig { + + /** ClusterConfig clusterType */ + clusterType?: (google.cloud.dataproc.v1.ClusterConfig.ClusterType|keyof typeof google.cloud.dataproc.v1.ClusterConfig.ClusterType|null); + + /** ClusterConfig clusterTier */ + clusterTier?: (google.cloud.dataproc.v1.ClusterConfig.ClusterTier|keyof typeof google.cloud.dataproc.v1.ClusterConfig.ClusterTier|null); + + /** ClusterConfig engine */ + engine?: (google.cloud.dataproc.v1.ClusterConfig.Engine|keyof typeof google.cloud.dataproc.v1.ClusterConfig.Engine|null); + + /** ClusterConfig configBucket */ + configBucket?: (string|null); + + /** ClusterConfig tempBucket */ + tempBucket?: (string|null); + + /** ClusterConfig gceClusterConfig */ + gceClusterConfig?: (google.cloud.dataproc.v1.IGceClusterConfig|null); + + /** ClusterConfig masterConfig */ + masterConfig?: (google.cloud.dataproc.v1.IInstanceGroupConfig|null); + + /** ClusterConfig workerConfig */ + workerConfig?: (google.cloud.dataproc.v1.IInstanceGroupConfig|null); + + /** ClusterConfig secondaryWorkerConfig */ + secondaryWorkerConfig?: (google.cloud.dataproc.v1.IInstanceGroupConfig|null); + + /** ClusterConfig softwareConfig */ + softwareConfig?: (google.cloud.dataproc.v1.ISoftwareConfig|null); + + /** ClusterConfig initializationActions */ + initializationActions?: (google.cloud.dataproc.v1.INodeInitializationAction[]|null); + + /** ClusterConfig encryptionConfig */ + encryptionConfig?: (google.cloud.dataproc.v1.IEncryptionConfig|null); + + /** ClusterConfig autoscalingConfig */ + autoscalingConfig?: (google.cloud.dataproc.v1.IAutoscalingConfig|null); + + /** ClusterConfig securityConfig */ + securityConfig?: (google.cloud.dataproc.v1.ISecurityConfig|null); + + /** ClusterConfig lifecycleConfig */ + lifecycleConfig?: (google.cloud.dataproc.v1.ILifecycleConfig|null); + + /** ClusterConfig endpointConfig */ + endpointConfig?: (google.cloud.dataproc.v1.IEndpointConfig|null); + + /** ClusterConfig metastoreConfig */ + metastoreConfig?: (google.cloud.dataproc.v1.IMetastoreConfig|null); + + /** ClusterConfig dataprocMetricConfig */ + dataprocMetricConfig?: (google.cloud.dataproc.v1.IDataprocMetricConfig|null); + + /** ClusterConfig auxiliaryNodeGroups */ + auxiliaryNodeGroups?: (google.cloud.dataproc.v1.IAuxiliaryNodeGroup[]|null); + } + + /** Represents a ClusterConfig. */ + class ClusterConfig implements IClusterConfig { + + /** + * Constructs a new ClusterConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IClusterConfig); + + /** ClusterConfig clusterType. */ + public clusterType: (google.cloud.dataproc.v1.ClusterConfig.ClusterType|keyof typeof google.cloud.dataproc.v1.ClusterConfig.ClusterType); + + /** ClusterConfig clusterTier. */ + public clusterTier: (google.cloud.dataproc.v1.ClusterConfig.ClusterTier|keyof typeof google.cloud.dataproc.v1.ClusterConfig.ClusterTier); + + /** ClusterConfig engine. */ + public engine: (google.cloud.dataproc.v1.ClusterConfig.Engine|keyof typeof google.cloud.dataproc.v1.ClusterConfig.Engine); + + /** ClusterConfig configBucket. */ + public configBucket: string; + + /** ClusterConfig tempBucket. */ + public tempBucket: string; + + /** ClusterConfig gceClusterConfig. */ + public gceClusterConfig?: (google.cloud.dataproc.v1.IGceClusterConfig|null); + + /** ClusterConfig masterConfig. */ + public masterConfig?: (google.cloud.dataproc.v1.IInstanceGroupConfig|null); + + /** ClusterConfig workerConfig. */ + public workerConfig?: (google.cloud.dataproc.v1.IInstanceGroupConfig|null); + + /** ClusterConfig secondaryWorkerConfig. */ + public secondaryWorkerConfig?: (google.cloud.dataproc.v1.IInstanceGroupConfig|null); + + /** ClusterConfig softwareConfig. */ + public softwareConfig?: (google.cloud.dataproc.v1.ISoftwareConfig|null); + + /** ClusterConfig initializationActions. */ + public initializationActions: google.cloud.dataproc.v1.INodeInitializationAction[]; + + /** ClusterConfig encryptionConfig. */ + public encryptionConfig?: (google.cloud.dataproc.v1.IEncryptionConfig|null); + + /** ClusterConfig autoscalingConfig. */ + public autoscalingConfig?: (google.cloud.dataproc.v1.IAutoscalingConfig|null); + + /** ClusterConfig securityConfig. */ + public securityConfig?: (google.cloud.dataproc.v1.ISecurityConfig|null); + + /** ClusterConfig lifecycleConfig. */ + public lifecycleConfig?: (google.cloud.dataproc.v1.ILifecycleConfig|null); + + /** ClusterConfig endpointConfig. */ + public endpointConfig?: (google.cloud.dataproc.v1.IEndpointConfig|null); + + /** ClusterConfig metastoreConfig. */ + public metastoreConfig?: (google.cloud.dataproc.v1.IMetastoreConfig|null); + + /** ClusterConfig dataprocMetricConfig. */ + public dataprocMetricConfig?: (google.cloud.dataproc.v1.IDataprocMetricConfig|null); + + /** ClusterConfig auxiliaryNodeGroups. */ + public auxiliaryNodeGroups: google.cloud.dataproc.v1.IAuxiliaryNodeGroup[]; + + /** + * Creates a new ClusterConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ClusterConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IClusterConfig): google.cloud.dataproc.v1.ClusterConfig; + + /** + * Encodes the specified ClusterConfig message. Does not implicitly {@link google.cloud.dataproc.v1.ClusterConfig.verify|verify} messages. + * @param message ClusterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClusterConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ClusterConfig.verify|verify} messages. + * @param message ClusterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClusterConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ClusterConfig; + + /** + * Decodes a ClusterConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ClusterConfig; + + /** + * Verifies a ClusterConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClusterConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClusterConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ClusterConfig; + + /** + * Creates a plain object from a ClusterConfig message. Also converts values to other types if specified. + * @param message ClusterConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.ClusterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClusterConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClusterConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ClusterConfig { + + /** ClusterType enum. */ + enum ClusterType { + CLUSTER_TYPE_UNSPECIFIED = 0, + STANDARD = 1, + SINGLE_NODE = 2, + ZERO_SCALE = 3 + } + + /** ClusterTier enum. */ + enum ClusterTier { + CLUSTER_TIER_UNSPECIFIED = 0, + CLUSTER_TIER_STANDARD = 1, + CLUSTER_TIER_PREMIUM = 2 + } + + /** Engine enum. */ + enum Engine { + ENGINE_UNSPECIFIED = 0, + DEFAULT = 1, + LIGHTNING = 2 + } + } + + /** Properties of a VirtualClusterConfig. */ + interface IVirtualClusterConfig { + + /** VirtualClusterConfig stagingBucket */ + stagingBucket?: (string|null); + + /** VirtualClusterConfig kubernetesClusterConfig */ + kubernetesClusterConfig?: (google.cloud.dataproc.v1.IKubernetesClusterConfig|null); + + /** VirtualClusterConfig auxiliaryServicesConfig */ + auxiliaryServicesConfig?: (google.cloud.dataproc.v1.IAuxiliaryServicesConfig|null); + } + + /** Represents a VirtualClusterConfig. */ + class VirtualClusterConfig implements IVirtualClusterConfig { + + /** + * Constructs a new VirtualClusterConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IVirtualClusterConfig); + + /** VirtualClusterConfig stagingBucket. */ + public stagingBucket: string; + + /** VirtualClusterConfig kubernetesClusterConfig. */ + public kubernetesClusterConfig?: (google.cloud.dataproc.v1.IKubernetesClusterConfig|null); + + /** VirtualClusterConfig auxiliaryServicesConfig. */ + public auxiliaryServicesConfig?: (google.cloud.dataproc.v1.IAuxiliaryServicesConfig|null); + + /** VirtualClusterConfig infrastructureConfig. */ + public infrastructureConfig?: "kubernetesClusterConfig"; + + /** + * Creates a new VirtualClusterConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns VirtualClusterConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IVirtualClusterConfig): google.cloud.dataproc.v1.VirtualClusterConfig; + + /** + * Encodes the specified VirtualClusterConfig message. Does not implicitly {@link google.cloud.dataproc.v1.VirtualClusterConfig.verify|verify} messages. + * @param message VirtualClusterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IVirtualClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VirtualClusterConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.VirtualClusterConfig.verify|verify} messages. + * @param message VirtualClusterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IVirtualClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VirtualClusterConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VirtualClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.VirtualClusterConfig; + + /** + * Decodes a VirtualClusterConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VirtualClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.VirtualClusterConfig; + + /** + * Verifies a VirtualClusterConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VirtualClusterConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VirtualClusterConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.VirtualClusterConfig; + + /** + * Creates a plain object from a VirtualClusterConfig message. Also converts values to other types if specified. + * @param message VirtualClusterConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.VirtualClusterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VirtualClusterConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VirtualClusterConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuxiliaryServicesConfig. */ + interface IAuxiliaryServicesConfig { + + /** AuxiliaryServicesConfig metastoreConfig */ + metastoreConfig?: (google.cloud.dataproc.v1.IMetastoreConfig|null); + + /** AuxiliaryServicesConfig sparkHistoryServerConfig */ + sparkHistoryServerConfig?: (google.cloud.dataproc.v1.ISparkHistoryServerConfig|null); + } + + /** Represents an AuxiliaryServicesConfig. */ + class AuxiliaryServicesConfig implements IAuxiliaryServicesConfig { + + /** + * Constructs a new AuxiliaryServicesConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IAuxiliaryServicesConfig); + + /** AuxiliaryServicesConfig metastoreConfig. */ + public metastoreConfig?: (google.cloud.dataproc.v1.IMetastoreConfig|null); + + /** AuxiliaryServicesConfig sparkHistoryServerConfig. */ + public sparkHistoryServerConfig?: (google.cloud.dataproc.v1.ISparkHistoryServerConfig|null); + + /** + * Creates a new AuxiliaryServicesConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuxiliaryServicesConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IAuxiliaryServicesConfig): google.cloud.dataproc.v1.AuxiliaryServicesConfig; + + /** + * Encodes the specified AuxiliaryServicesConfig message. Does not implicitly {@link google.cloud.dataproc.v1.AuxiliaryServicesConfig.verify|verify} messages. + * @param message AuxiliaryServicesConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IAuxiliaryServicesConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuxiliaryServicesConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.AuxiliaryServicesConfig.verify|verify} messages. + * @param message AuxiliaryServicesConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IAuxiliaryServicesConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuxiliaryServicesConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuxiliaryServicesConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.AuxiliaryServicesConfig; + + /** + * Decodes an AuxiliaryServicesConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuxiliaryServicesConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.AuxiliaryServicesConfig; + + /** + * Verifies an AuxiliaryServicesConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuxiliaryServicesConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuxiliaryServicesConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.AuxiliaryServicesConfig; + + /** + * Creates a plain object from an AuxiliaryServicesConfig message. Also converts values to other types if specified. + * @param message AuxiliaryServicesConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.AuxiliaryServicesConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuxiliaryServicesConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuxiliaryServicesConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EndpointConfig. */ + interface IEndpointConfig { + + /** EndpointConfig httpPorts */ + httpPorts?: ({ [k: string]: string }|null); + + /** EndpointConfig enableHttpPortAccess */ + enableHttpPortAccess?: (boolean|null); + } + + /** Represents an EndpointConfig. */ + class EndpointConfig implements IEndpointConfig { + + /** + * Constructs a new EndpointConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IEndpointConfig); + + /** EndpointConfig httpPorts. */ + public httpPorts: { [k: string]: string }; + + /** EndpointConfig enableHttpPortAccess. */ + public enableHttpPortAccess: boolean; + + /** + * Creates a new EndpointConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns EndpointConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IEndpointConfig): google.cloud.dataproc.v1.EndpointConfig; + + /** + * Encodes the specified EndpointConfig message. Does not implicitly {@link google.cloud.dataproc.v1.EndpointConfig.verify|verify} messages. + * @param message EndpointConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IEndpointConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EndpointConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.EndpointConfig.verify|verify} messages. + * @param message EndpointConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IEndpointConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EndpointConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EndpointConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.EndpointConfig; + + /** + * Decodes an EndpointConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EndpointConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.EndpointConfig; + + /** + * Verifies an EndpointConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EndpointConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EndpointConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.EndpointConfig; + + /** + * Creates a plain object from an EndpointConfig message. Also converts values to other types if specified. + * @param message EndpointConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.EndpointConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EndpointConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EndpointConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AutoscalingConfig. */ + interface IAutoscalingConfig { + + /** AutoscalingConfig policyUri */ + policyUri?: (string|null); + } + + /** Represents an AutoscalingConfig. */ + class AutoscalingConfig implements IAutoscalingConfig { + + /** + * Constructs a new AutoscalingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IAutoscalingConfig); + + /** AutoscalingConfig policyUri. */ + public policyUri: string; + + /** + * Creates a new AutoscalingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoscalingConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IAutoscalingConfig): google.cloud.dataproc.v1.AutoscalingConfig; + + /** + * Encodes the specified AutoscalingConfig message. Does not implicitly {@link google.cloud.dataproc.v1.AutoscalingConfig.verify|verify} messages. + * @param message AutoscalingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IAutoscalingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoscalingConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.AutoscalingConfig.verify|verify} messages. + * @param message AutoscalingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IAutoscalingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoscalingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoscalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.AutoscalingConfig; + + /** + * Decodes an AutoscalingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoscalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.AutoscalingConfig; + + /** + * Verifies an AutoscalingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoscalingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoscalingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.AutoscalingConfig; + + /** + * Creates a plain object from an AutoscalingConfig message. Also converts values to other types if specified. + * @param message AutoscalingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.AutoscalingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoscalingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoscalingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EncryptionConfig. */ + interface IEncryptionConfig { + + /** EncryptionConfig gcePdKmsKeyName */ + gcePdKmsKeyName?: (string|null); + + /** EncryptionConfig kmsKey */ + kmsKey?: (string|null); + } + + /** Represents an EncryptionConfig. */ + class EncryptionConfig implements IEncryptionConfig { + + /** + * Constructs a new EncryptionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IEncryptionConfig); + + /** EncryptionConfig gcePdKmsKeyName. */ + public gcePdKmsKeyName: string; + + /** EncryptionConfig kmsKey. */ + public kmsKey: string; + + /** + * Creates a new EncryptionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns EncryptionConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IEncryptionConfig): google.cloud.dataproc.v1.EncryptionConfig; + + /** + * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.dataproc.v1.EncryptionConfig.verify|verify} messages. + * @param message EncryptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.EncryptionConfig.verify|verify} messages. + * @param message EncryptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.EncryptionConfig; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.EncryptionConfig; + + /** + * Verifies an EncryptionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EncryptionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.EncryptionConfig; + + /** + * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. + * @param message EncryptionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.EncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EncryptionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EncryptionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GceClusterConfig. */ + interface IGceClusterConfig { + + /** GceClusterConfig zoneUri */ + zoneUri?: (string|null); + + /** GceClusterConfig networkUri */ + networkUri?: (string|null); + + /** GceClusterConfig subnetworkUri */ + subnetworkUri?: (string|null); + + /** GceClusterConfig internalIpOnly */ + internalIpOnly?: (boolean|null); + + /** GceClusterConfig privateIpv6GoogleAccess */ + privateIpv6GoogleAccess?: (google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccess|keyof typeof google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccess|null); + + /** GceClusterConfig serviceAccount */ + serviceAccount?: (string|null); + + /** GceClusterConfig serviceAccountScopes */ + serviceAccountScopes?: (string[]|null); + + /** GceClusterConfig tags */ + tags?: (string[]|null); + + /** GceClusterConfig metadata */ + metadata?: ({ [k: string]: string }|null); + + /** GceClusterConfig reservationAffinity */ + reservationAffinity?: (google.cloud.dataproc.v1.IReservationAffinity|null); + + /** GceClusterConfig nodeGroupAffinity */ + nodeGroupAffinity?: (google.cloud.dataproc.v1.INodeGroupAffinity|null); + + /** GceClusterConfig shieldedInstanceConfig */ + shieldedInstanceConfig?: (google.cloud.dataproc.v1.IShieldedInstanceConfig|null); + + /** GceClusterConfig confidentialInstanceConfig */ + confidentialInstanceConfig?: (google.cloud.dataproc.v1.IConfidentialInstanceConfig|null); + } + + /** Represents a GceClusterConfig. */ + class GceClusterConfig implements IGceClusterConfig { + + /** + * Constructs a new GceClusterConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IGceClusterConfig); + + /** GceClusterConfig zoneUri. */ + public zoneUri: string; + + /** GceClusterConfig networkUri. */ + public networkUri: string; + + /** GceClusterConfig subnetworkUri. */ + public subnetworkUri: string; + + /** GceClusterConfig internalIpOnly. */ + public internalIpOnly?: (boolean|null); + + /** GceClusterConfig privateIpv6GoogleAccess. */ + public privateIpv6GoogleAccess: (google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccess|keyof typeof google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccess); + + /** GceClusterConfig serviceAccount. */ + public serviceAccount: string; + + /** GceClusterConfig serviceAccountScopes. */ + public serviceAccountScopes: string[]; + + /** GceClusterConfig tags. */ + public tags: string[]; + + /** GceClusterConfig metadata. */ + public metadata: { [k: string]: string }; + + /** GceClusterConfig reservationAffinity. */ + public reservationAffinity?: (google.cloud.dataproc.v1.IReservationAffinity|null); + + /** GceClusterConfig nodeGroupAffinity. */ + public nodeGroupAffinity?: (google.cloud.dataproc.v1.INodeGroupAffinity|null); + + /** GceClusterConfig shieldedInstanceConfig. */ + public shieldedInstanceConfig?: (google.cloud.dataproc.v1.IShieldedInstanceConfig|null); + + /** GceClusterConfig confidentialInstanceConfig. */ + public confidentialInstanceConfig?: (google.cloud.dataproc.v1.IConfidentialInstanceConfig|null); + + /** + * Creates a new GceClusterConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GceClusterConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IGceClusterConfig): google.cloud.dataproc.v1.GceClusterConfig; + + /** + * Encodes the specified GceClusterConfig message. Does not implicitly {@link google.cloud.dataproc.v1.GceClusterConfig.verify|verify} messages. + * @param message GceClusterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IGceClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GceClusterConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GceClusterConfig.verify|verify} messages. + * @param message GceClusterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IGceClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GceClusterConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GceClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.GceClusterConfig; + + /** + * Decodes a GceClusterConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GceClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.GceClusterConfig; + + /** + * Verifies a GceClusterConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GceClusterConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GceClusterConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.GceClusterConfig; + + /** + * Creates a plain object from a GceClusterConfig message. Also converts values to other types if specified. + * @param message GceClusterConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.GceClusterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GceClusterConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GceClusterConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GceClusterConfig { + + /** PrivateIpv6GoogleAccess enum. */ + enum PrivateIpv6GoogleAccess { + PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED = 0, + INHERIT_FROM_SUBNETWORK = 1, + OUTBOUND = 2, + BIDIRECTIONAL = 3 + } + } + + /** Properties of a NodeGroupAffinity. */ + interface INodeGroupAffinity { + + /** NodeGroupAffinity nodeGroupUri */ + nodeGroupUri?: (string|null); + } + + /** Represents a NodeGroupAffinity. */ + class NodeGroupAffinity implements INodeGroupAffinity { + + /** + * Constructs a new NodeGroupAffinity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.INodeGroupAffinity); + + /** NodeGroupAffinity nodeGroupUri. */ + public nodeGroupUri: string; + + /** + * Creates a new NodeGroupAffinity instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeGroupAffinity instance + */ + public static create(properties?: google.cloud.dataproc.v1.INodeGroupAffinity): google.cloud.dataproc.v1.NodeGroupAffinity; + + /** + * Encodes the specified NodeGroupAffinity message. Does not implicitly {@link google.cloud.dataproc.v1.NodeGroupAffinity.verify|verify} messages. + * @param message NodeGroupAffinity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.INodeGroupAffinity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeGroupAffinity message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.NodeGroupAffinity.verify|verify} messages. + * @param message NodeGroupAffinity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.INodeGroupAffinity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeGroupAffinity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeGroupAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.NodeGroupAffinity; + + /** + * Decodes a NodeGroupAffinity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeGroupAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.NodeGroupAffinity; + + /** + * Verifies a NodeGroupAffinity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeGroupAffinity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeGroupAffinity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.NodeGroupAffinity; + + /** + * Creates a plain object from a NodeGroupAffinity message. Also converts values to other types if specified. + * @param message NodeGroupAffinity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.NodeGroupAffinity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeGroupAffinity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeGroupAffinity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShieldedInstanceConfig. */ + interface IShieldedInstanceConfig { + + /** ShieldedInstanceConfig enableSecureBoot */ + enableSecureBoot?: (boolean|null); + + /** ShieldedInstanceConfig enableVtpm */ + enableVtpm?: (boolean|null); + + /** ShieldedInstanceConfig enableIntegrityMonitoring */ + enableIntegrityMonitoring?: (boolean|null); + } + + /** Represents a ShieldedInstanceConfig. */ + class ShieldedInstanceConfig implements IShieldedInstanceConfig { + + /** + * Constructs a new ShieldedInstanceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IShieldedInstanceConfig); + + /** ShieldedInstanceConfig enableSecureBoot. */ + public enableSecureBoot?: (boolean|null); + + /** ShieldedInstanceConfig enableVtpm. */ + public enableVtpm?: (boolean|null); + + /** ShieldedInstanceConfig enableIntegrityMonitoring. */ + public enableIntegrityMonitoring?: (boolean|null); + + /** + * Creates a new ShieldedInstanceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ShieldedInstanceConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IShieldedInstanceConfig): google.cloud.dataproc.v1.ShieldedInstanceConfig; + + /** + * Encodes the specified ShieldedInstanceConfig message. Does not implicitly {@link google.cloud.dataproc.v1.ShieldedInstanceConfig.verify|verify} messages. + * @param message ShieldedInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IShieldedInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ShieldedInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ShieldedInstanceConfig.verify|verify} messages. + * @param message ShieldedInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IShieldedInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShieldedInstanceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ShieldedInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ShieldedInstanceConfig; + + /** + * Decodes a ShieldedInstanceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ShieldedInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ShieldedInstanceConfig; + + /** + * Verifies a ShieldedInstanceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ShieldedInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ShieldedInstanceConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ShieldedInstanceConfig; + + /** + * Creates a plain object from a ShieldedInstanceConfig message. Also converts values to other types if specified. + * @param message ShieldedInstanceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.ShieldedInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ShieldedInstanceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ShieldedInstanceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConfidentialInstanceConfig. */ + interface IConfidentialInstanceConfig { + + /** ConfidentialInstanceConfig enableConfidentialCompute */ + enableConfidentialCompute?: (boolean|null); + } + + /** Represents a ConfidentialInstanceConfig. */ + class ConfidentialInstanceConfig implements IConfidentialInstanceConfig { + + /** + * Constructs a new ConfidentialInstanceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IConfidentialInstanceConfig); + + /** ConfidentialInstanceConfig enableConfidentialCompute. */ + public enableConfidentialCompute: boolean; + + /** + * Creates a new ConfidentialInstanceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfidentialInstanceConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IConfidentialInstanceConfig): google.cloud.dataproc.v1.ConfidentialInstanceConfig; + + /** + * Encodes the specified ConfidentialInstanceConfig message. Does not implicitly {@link google.cloud.dataproc.v1.ConfidentialInstanceConfig.verify|verify} messages. + * @param message ConfidentialInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IConfidentialInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfidentialInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ConfidentialInstanceConfig.verify|verify} messages. + * @param message ConfidentialInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IConfidentialInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfidentialInstanceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfidentialInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ConfidentialInstanceConfig; + + /** + * Decodes a ConfidentialInstanceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfidentialInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ConfidentialInstanceConfig; + + /** + * Verifies a ConfidentialInstanceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConfidentialInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfidentialInstanceConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ConfidentialInstanceConfig; + + /** + * Creates a plain object from a ConfidentialInstanceConfig message. Also converts values to other types if specified. + * @param message ConfidentialInstanceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.ConfidentialInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConfidentialInstanceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConfidentialInstanceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InstanceGroupConfig. */ + interface IInstanceGroupConfig { + + /** InstanceGroupConfig numInstances */ + numInstances?: (number|null); + + /** InstanceGroupConfig instanceNames */ + instanceNames?: (string[]|null); + + /** InstanceGroupConfig instanceReferences */ + instanceReferences?: (google.cloud.dataproc.v1.IInstanceReference[]|null); + + /** InstanceGroupConfig imageUri */ + imageUri?: (string|null); + + /** InstanceGroupConfig machineTypeUri */ + machineTypeUri?: (string|null); + + /** InstanceGroupConfig diskConfig */ + diskConfig?: (google.cloud.dataproc.v1.IDiskConfig|null); + + /** InstanceGroupConfig isPreemptible */ + isPreemptible?: (boolean|null); + + /** InstanceGroupConfig preemptibility */ + preemptibility?: (google.cloud.dataproc.v1.InstanceGroupConfig.Preemptibility|keyof typeof google.cloud.dataproc.v1.InstanceGroupConfig.Preemptibility|null); + + /** InstanceGroupConfig managedGroupConfig */ + managedGroupConfig?: (google.cloud.dataproc.v1.IManagedGroupConfig|null); + + /** InstanceGroupConfig accelerators */ + accelerators?: (google.cloud.dataproc.v1.IAcceleratorConfig[]|null); + + /** InstanceGroupConfig minCpuPlatform */ + minCpuPlatform?: (string|null); + + /** InstanceGroupConfig minNumInstances */ + minNumInstances?: (number|null); + + /** InstanceGroupConfig instanceFlexibilityPolicy */ + instanceFlexibilityPolicy?: (google.cloud.dataproc.v1.IInstanceFlexibilityPolicy|null); + + /** InstanceGroupConfig startupConfig */ + startupConfig?: (google.cloud.dataproc.v1.IStartupConfig|null); + } + + /** Represents an InstanceGroupConfig. */ + class InstanceGroupConfig implements IInstanceGroupConfig { + + /** + * Constructs a new InstanceGroupConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IInstanceGroupConfig); + + /** InstanceGroupConfig numInstances. */ + public numInstances: number; + + /** InstanceGroupConfig instanceNames. */ + public instanceNames: string[]; + + /** InstanceGroupConfig instanceReferences. */ + public instanceReferences: google.cloud.dataproc.v1.IInstanceReference[]; + + /** InstanceGroupConfig imageUri. */ + public imageUri: string; + + /** InstanceGroupConfig machineTypeUri. */ + public machineTypeUri: string; + + /** InstanceGroupConfig diskConfig. */ + public diskConfig?: (google.cloud.dataproc.v1.IDiskConfig|null); + + /** InstanceGroupConfig isPreemptible. */ + public isPreemptible: boolean; + + /** InstanceGroupConfig preemptibility. */ + public preemptibility: (google.cloud.dataproc.v1.InstanceGroupConfig.Preemptibility|keyof typeof google.cloud.dataproc.v1.InstanceGroupConfig.Preemptibility); + + /** InstanceGroupConfig managedGroupConfig. */ + public managedGroupConfig?: (google.cloud.dataproc.v1.IManagedGroupConfig|null); + + /** InstanceGroupConfig accelerators. */ + public accelerators: google.cloud.dataproc.v1.IAcceleratorConfig[]; + + /** InstanceGroupConfig minCpuPlatform. */ + public minCpuPlatform: string; + + /** InstanceGroupConfig minNumInstances. */ + public minNumInstances: number; + + /** InstanceGroupConfig instanceFlexibilityPolicy. */ + public instanceFlexibilityPolicy?: (google.cloud.dataproc.v1.IInstanceFlexibilityPolicy|null); + + /** InstanceGroupConfig startupConfig. */ + public startupConfig?: (google.cloud.dataproc.v1.IStartupConfig|null); + + /** + * Creates a new InstanceGroupConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceGroupConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IInstanceGroupConfig): google.cloud.dataproc.v1.InstanceGroupConfig; + + /** + * Encodes the specified InstanceGroupConfig message. Does not implicitly {@link google.cloud.dataproc.v1.InstanceGroupConfig.verify|verify} messages. + * @param message InstanceGroupConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IInstanceGroupConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceGroupConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstanceGroupConfig.verify|verify} messages. + * @param message InstanceGroupConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IInstanceGroupConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceGroupConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceGroupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.InstanceGroupConfig; + + /** + * Decodes an InstanceGroupConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceGroupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.InstanceGroupConfig; + + /** + * Verifies an InstanceGroupConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceGroupConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceGroupConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.InstanceGroupConfig; + + /** + * Creates a plain object from an InstanceGroupConfig message. Also converts values to other types if specified. + * @param message InstanceGroupConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.InstanceGroupConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceGroupConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstanceGroupConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace InstanceGroupConfig { + + /** Preemptibility enum. */ + enum Preemptibility { + PREEMPTIBILITY_UNSPECIFIED = 0, + NON_PREEMPTIBLE = 1, + PREEMPTIBLE = 2, + SPOT = 3 + } + } + + /** Properties of a StartupConfig. */ + interface IStartupConfig { + + /** StartupConfig requiredRegistrationFraction */ + requiredRegistrationFraction?: (number|null); + } + + /** Represents a StartupConfig. */ + class StartupConfig implements IStartupConfig { + + /** + * Constructs a new StartupConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IStartupConfig); + + /** StartupConfig requiredRegistrationFraction. */ + public requiredRegistrationFraction?: (number|null); + + /** + * Creates a new StartupConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns StartupConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IStartupConfig): google.cloud.dataproc.v1.StartupConfig; + + /** + * Encodes the specified StartupConfig message. Does not implicitly {@link google.cloud.dataproc.v1.StartupConfig.verify|verify} messages. + * @param message StartupConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IStartupConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StartupConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.StartupConfig.verify|verify} messages. + * @param message StartupConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IStartupConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StartupConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StartupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.StartupConfig; + + /** + * Decodes a StartupConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StartupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.StartupConfig; + + /** + * Verifies a StartupConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StartupConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StartupConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.StartupConfig; + + /** + * Creates a plain object from a StartupConfig message. Also converts values to other types if specified. + * @param message StartupConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.StartupConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StartupConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StartupConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InstanceReference. */ + interface IInstanceReference { + + /** InstanceReference instanceName */ + instanceName?: (string|null); + + /** InstanceReference instanceId */ + instanceId?: (string|null); + + /** InstanceReference publicKey */ + publicKey?: (string|null); + + /** InstanceReference publicEciesKey */ + publicEciesKey?: (string|null); + } + + /** Represents an InstanceReference. */ + class InstanceReference implements IInstanceReference { + + /** + * Constructs a new InstanceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IInstanceReference); + + /** InstanceReference instanceName. */ + public instanceName: string; + + /** InstanceReference instanceId. */ + public instanceId: string; + + /** InstanceReference publicKey. */ + public publicKey: string; + + /** InstanceReference publicEciesKey. */ + public publicEciesKey: string; + + /** + * Creates a new InstanceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceReference instance + */ + public static create(properties?: google.cloud.dataproc.v1.IInstanceReference): google.cloud.dataproc.v1.InstanceReference; + + /** + * Encodes the specified InstanceReference message. Does not implicitly {@link google.cloud.dataproc.v1.InstanceReference.verify|verify} messages. + * @param message InstanceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IInstanceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceReference message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstanceReference.verify|verify} messages. + * @param message InstanceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IInstanceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.InstanceReference; + + /** + * Decodes an InstanceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.InstanceReference; + + /** + * Verifies an InstanceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.InstanceReference; + + /** + * Creates a plain object from an InstanceReference message. Also converts values to other types if specified. + * @param message InstanceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.InstanceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstanceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ManagedGroupConfig. */ + interface IManagedGroupConfig { + + /** ManagedGroupConfig instanceTemplateName */ + instanceTemplateName?: (string|null); + + /** ManagedGroupConfig instanceGroupManagerName */ + instanceGroupManagerName?: (string|null); + + /** ManagedGroupConfig instanceGroupManagerUri */ + instanceGroupManagerUri?: (string|null); + } + + /** Represents a ManagedGroupConfig. */ + class ManagedGroupConfig implements IManagedGroupConfig { + + /** + * Constructs a new ManagedGroupConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IManagedGroupConfig); + + /** ManagedGroupConfig instanceTemplateName. */ + public instanceTemplateName: string; + + /** ManagedGroupConfig instanceGroupManagerName. */ + public instanceGroupManagerName: string; + + /** ManagedGroupConfig instanceGroupManagerUri. */ + public instanceGroupManagerUri: string; + + /** + * Creates a new ManagedGroupConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ManagedGroupConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IManagedGroupConfig): google.cloud.dataproc.v1.ManagedGroupConfig; + + /** + * Encodes the specified ManagedGroupConfig message. Does not implicitly {@link google.cloud.dataproc.v1.ManagedGroupConfig.verify|verify} messages. + * @param message ManagedGroupConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IManagedGroupConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ManagedGroupConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ManagedGroupConfig.verify|verify} messages. + * @param message ManagedGroupConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IManagedGroupConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ManagedGroupConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ManagedGroupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ManagedGroupConfig; + + /** + * Decodes a ManagedGroupConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ManagedGroupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ManagedGroupConfig; + + /** + * Verifies a ManagedGroupConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ManagedGroupConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ManagedGroupConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ManagedGroupConfig; + + /** + * Creates a plain object from a ManagedGroupConfig message. Also converts values to other types if specified. + * @param message ManagedGroupConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.ManagedGroupConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ManagedGroupConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ManagedGroupConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InstanceFlexibilityPolicy. */ + interface IInstanceFlexibilityPolicy { + + /** InstanceFlexibilityPolicy provisioningModelMix */ + provisioningModelMix?: (google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IProvisioningModelMix|null); + + /** InstanceFlexibilityPolicy instanceSelectionList */ + instanceSelectionList?: (google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelection[]|null); + + /** InstanceFlexibilityPolicy instanceSelectionResults */ + instanceSelectionResults?: (google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelectionResult[]|null); + } + + /** Represents an InstanceFlexibilityPolicy. */ + class InstanceFlexibilityPolicy implements IInstanceFlexibilityPolicy { + + /** + * Constructs a new InstanceFlexibilityPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IInstanceFlexibilityPolicy); + + /** InstanceFlexibilityPolicy provisioningModelMix. */ + public provisioningModelMix?: (google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IProvisioningModelMix|null); + + /** InstanceFlexibilityPolicy instanceSelectionList. */ + public instanceSelectionList: google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelection[]; + + /** InstanceFlexibilityPolicy instanceSelectionResults. */ + public instanceSelectionResults: google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelectionResult[]; + + /** + * Creates a new InstanceFlexibilityPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceFlexibilityPolicy instance + */ + public static create(properties?: google.cloud.dataproc.v1.IInstanceFlexibilityPolicy): google.cloud.dataproc.v1.InstanceFlexibilityPolicy; + + /** + * Encodes the specified InstanceFlexibilityPolicy message. Does not implicitly {@link google.cloud.dataproc.v1.InstanceFlexibilityPolicy.verify|verify} messages. + * @param message InstanceFlexibilityPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IInstanceFlexibilityPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceFlexibilityPolicy message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstanceFlexibilityPolicy.verify|verify} messages. + * @param message InstanceFlexibilityPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IInstanceFlexibilityPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceFlexibilityPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceFlexibilityPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.InstanceFlexibilityPolicy; + + /** + * Decodes an InstanceFlexibilityPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceFlexibilityPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.InstanceFlexibilityPolicy; + + /** + * Verifies an InstanceFlexibilityPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceFlexibilityPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceFlexibilityPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.InstanceFlexibilityPolicy; + + /** + * Creates a plain object from an InstanceFlexibilityPolicy message. Also converts values to other types if specified. + * @param message InstanceFlexibilityPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.InstanceFlexibilityPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceFlexibilityPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstanceFlexibilityPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace InstanceFlexibilityPolicy { + + /** Properties of a ProvisioningModelMix. */ + interface IProvisioningModelMix { + + /** ProvisioningModelMix standardCapacityBase */ + standardCapacityBase?: (number|null); + + /** ProvisioningModelMix standardCapacityPercentAboveBase */ + standardCapacityPercentAboveBase?: (number|null); + } + + /** Represents a ProvisioningModelMix. */ + class ProvisioningModelMix implements IProvisioningModelMix { + + /** + * Constructs a new ProvisioningModelMix. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IProvisioningModelMix); + + /** ProvisioningModelMix standardCapacityBase. */ + public standardCapacityBase?: (number|null); + + /** ProvisioningModelMix standardCapacityPercentAboveBase. */ + public standardCapacityPercentAboveBase?: (number|null); + + /** + * Creates a new ProvisioningModelMix instance using the specified properties. + * @param [properties] Properties to set + * @returns ProvisioningModelMix instance + */ + public static create(properties?: google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IProvisioningModelMix): google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix; + + /** + * Encodes the specified ProvisioningModelMix message. Does not implicitly {@link google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix.verify|verify} messages. + * @param message ProvisioningModelMix message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IProvisioningModelMix, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProvisioningModelMix message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix.verify|verify} messages. + * @param message ProvisioningModelMix message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IProvisioningModelMix, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProvisioningModelMix message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProvisioningModelMix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix; + + /** + * Decodes a ProvisioningModelMix message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProvisioningModelMix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix; + + /** + * Verifies a ProvisioningModelMix message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProvisioningModelMix message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProvisioningModelMix + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix; + + /** + * Creates a plain object from a ProvisioningModelMix message. Also converts values to other types if specified. + * @param message ProvisioningModelMix + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProvisioningModelMix to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ProvisioningModelMix + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InstanceSelection. */ + interface IInstanceSelection { + + /** InstanceSelection machineTypes */ + machineTypes?: (string[]|null); + + /** InstanceSelection rank */ + rank?: (number|null); + } + + /** Represents an InstanceSelection. */ + class InstanceSelection implements IInstanceSelection { + + /** + * Constructs a new InstanceSelection. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelection); + + /** InstanceSelection machineTypes. */ + public machineTypes: string[]; + + /** InstanceSelection rank. */ + public rank: number; + + /** + * Creates a new InstanceSelection instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceSelection instance + */ + public static create(properties?: google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelection): google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection; + + /** + * Encodes the specified InstanceSelection message. Does not implicitly {@link google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection.verify|verify} messages. + * @param message InstanceSelection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceSelection message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection.verify|verify} messages. + * @param message InstanceSelection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceSelection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceSelection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection; + + /** + * Decodes an InstanceSelection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceSelection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection; + + /** + * Verifies an InstanceSelection message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceSelection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceSelection + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection; + + /** + * Creates a plain object from an InstanceSelection message. Also converts values to other types if specified. + * @param message InstanceSelection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceSelection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstanceSelection + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InstanceSelectionResult. */ + interface IInstanceSelectionResult { + + /** InstanceSelectionResult machineType */ + machineType?: (string|null); + + /** InstanceSelectionResult vmCount */ + vmCount?: (number|null); + } + + /** Represents an InstanceSelectionResult. */ + class InstanceSelectionResult implements IInstanceSelectionResult { + + /** + * Constructs a new InstanceSelectionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelectionResult); + + /** InstanceSelectionResult machineType. */ + public machineType?: (string|null); + + /** InstanceSelectionResult vmCount. */ + public vmCount?: (number|null); + + /** + * Creates a new InstanceSelectionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceSelectionResult instance + */ + public static create(properties?: google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelectionResult): google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult; + + /** + * Encodes the specified InstanceSelectionResult message. Does not implicitly {@link google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult.verify|verify} messages. + * @param message InstanceSelectionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelectionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceSelectionResult message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult.verify|verify} messages. + * @param message InstanceSelectionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelectionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceSelectionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceSelectionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult; + + /** + * Decodes an InstanceSelectionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceSelectionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult; + + /** + * Verifies an InstanceSelectionResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceSelectionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceSelectionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult; + + /** + * Creates a plain object from an InstanceSelectionResult message. Also converts values to other types if specified. + * @param message InstanceSelectionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceSelectionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstanceSelectionResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an AcceleratorConfig. */ + interface IAcceleratorConfig { + + /** AcceleratorConfig acceleratorTypeUri */ + acceleratorTypeUri?: (string|null); + + /** AcceleratorConfig acceleratorCount */ + acceleratorCount?: (number|null); + } + + /** Represents an AcceleratorConfig. */ + class AcceleratorConfig implements IAcceleratorConfig { + + /** + * Constructs a new AcceleratorConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IAcceleratorConfig); + + /** AcceleratorConfig acceleratorTypeUri. */ + public acceleratorTypeUri: string; + + /** AcceleratorConfig acceleratorCount. */ + public acceleratorCount: number; + + /** + * Creates a new AcceleratorConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AcceleratorConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IAcceleratorConfig): google.cloud.dataproc.v1.AcceleratorConfig; + + /** + * Encodes the specified AcceleratorConfig message. Does not implicitly {@link google.cloud.dataproc.v1.AcceleratorConfig.verify|verify} messages. + * @param message AcceleratorConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IAcceleratorConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AcceleratorConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.AcceleratorConfig.verify|verify} messages. + * @param message AcceleratorConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IAcceleratorConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AcceleratorConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AcceleratorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.AcceleratorConfig; + + /** + * Decodes an AcceleratorConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AcceleratorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.AcceleratorConfig; + + /** + * Verifies an AcceleratorConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AcceleratorConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AcceleratorConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.AcceleratorConfig; + + /** + * Creates a plain object from an AcceleratorConfig message. Also converts values to other types if specified. + * @param message AcceleratorConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.AcceleratorConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AcceleratorConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AcceleratorConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DiskConfig. */ + interface IDiskConfig { + + /** DiskConfig bootDiskType */ + bootDiskType?: (string|null); + + /** DiskConfig bootDiskSizeGb */ + bootDiskSizeGb?: (number|null); + + /** DiskConfig numLocalSsds */ + numLocalSsds?: (number|null); + + /** DiskConfig localSsdInterface */ + localSsdInterface?: (string|null); + + /** DiskConfig bootDiskProvisionedIops */ + bootDiskProvisionedIops?: (number|Long|string|null); + + /** DiskConfig bootDiskProvisionedThroughput */ + bootDiskProvisionedThroughput?: (number|Long|string|null); + } + + /** Represents a DiskConfig. */ + class DiskConfig implements IDiskConfig { + + /** + * Constructs a new DiskConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IDiskConfig); + + /** DiskConfig bootDiskType. */ + public bootDiskType: string; + + /** DiskConfig bootDiskSizeGb. */ + public bootDiskSizeGb: number; + + /** DiskConfig numLocalSsds. */ + public numLocalSsds: number; + + /** DiskConfig localSsdInterface. */ + public localSsdInterface: string; + + /** DiskConfig bootDiskProvisionedIops. */ + public bootDiskProvisionedIops?: (number|Long|string|null); + + /** DiskConfig bootDiskProvisionedThroughput. */ + public bootDiskProvisionedThroughput?: (number|Long|string|null); + + /** + * Creates a new DiskConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns DiskConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IDiskConfig): google.cloud.dataproc.v1.DiskConfig; + + /** + * Encodes the specified DiskConfig message. Does not implicitly {@link google.cloud.dataproc.v1.DiskConfig.verify|verify} messages. + * @param message DiskConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IDiskConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DiskConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DiskConfig.verify|verify} messages. + * @param message DiskConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IDiskConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DiskConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DiskConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.DiskConfig; + + /** + * Decodes a DiskConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DiskConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.DiskConfig; + + /** + * Verifies a DiskConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DiskConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DiskConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.DiskConfig; + + /** + * Creates a plain object from a DiskConfig message. Also converts values to other types if specified. + * @param message DiskConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.DiskConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DiskConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DiskConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuxiliaryNodeGroup. */ + interface IAuxiliaryNodeGroup { + + /** AuxiliaryNodeGroup nodeGroup */ + nodeGroup?: (google.cloud.dataproc.v1.INodeGroup|null); + + /** AuxiliaryNodeGroup nodeGroupId */ + nodeGroupId?: (string|null); + } + + /** Represents an AuxiliaryNodeGroup. */ + class AuxiliaryNodeGroup implements IAuxiliaryNodeGroup { + + /** + * Constructs a new AuxiliaryNodeGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IAuxiliaryNodeGroup); + + /** AuxiliaryNodeGroup nodeGroup. */ + public nodeGroup?: (google.cloud.dataproc.v1.INodeGroup|null); + + /** AuxiliaryNodeGroup nodeGroupId. */ + public nodeGroupId: string; + + /** + * Creates a new AuxiliaryNodeGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns AuxiliaryNodeGroup instance + */ + public static create(properties?: google.cloud.dataproc.v1.IAuxiliaryNodeGroup): google.cloud.dataproc.v1.AuxiliaryNodeGroup; + + /** + * Encodes the specified AuxiliaryNodeGroup message. Does not implicitly {@link google.cloud.dataproc.v1.AuxiliaryNodeGroup.verify|verify} messages. + * @param message AuxiliaryNodeGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IAuxiliaryNodeGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuxiliaryNodeGroup message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.AuxiliaryNodeGroup.verify|verify} messages. + * @param message AuxiliaryNodeGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IAuxiliaryNodeGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuxiliaryNodeGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuxiliaryNodeGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.AuxiliaryNodeGroup; + + /** + * Decodes an AuxiliaryNodeGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuxiliaryNodeGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.AuxiliaryNodeGroup; + + /** + * Verifies an AuxiliaryNodeGroup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AuxiliaryNodeGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuxiliaryNodeGroup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.AuxiliaryNodeGroup; + + /** + * Creates a plain object from an AuxiliaryNodeGroup message. Also converts values to other types if specified. + * @param message AuxiliaryNodeGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.AuxiliaryNodeGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuxiliaryNodeGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuxiliaryNodeGroup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeGroup. */ + interface INodeGroup { + + /** NodeGroup name */ + name?: (string|null); + + /** NodeGroup roles */ + roles?: (google.cloud.dataproc.v1.NodeGroup.Role[]|null); + + /** NodeGroup nodeGroupConfig */ + nodeGroupConfig?: (google.cloud.dataproc.v1.IInstanceGroupConfig|null); + + /** NodeGroup labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a NodeGroup. */ + class NodeGroup implements INodeGroup { + + /** + * Constructs a new NodeGroup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.INodeGroup); + + /** NodeGroup name. */ + public name: string; + + /** NodeGroup roles. */ + public roles: google.cloud.dataproc.v1.NodeGroup.Role[]; + + /** NodeGroup nodeGroupConfig. */ + public nodeGroupConfig?: (google.cloud.dataproc.v1.IInstanceGroupConfig|null); + + /** NodeGroup labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new NodeGroup instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeGroup instance + */ + public static create(properties?: google.cloud.dataproc.v1.INodeGroup): google.cloud.dataproc.v1.NodeGroup; + + /** + * Encodes the specified NodeGroup message. Does not implicitly {@link google.cloud.dataproc.v1.NodeGroup.verify|verify} messages. + * @param message NodeGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.INodeGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeGroup message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.NodeGroup.verify|verify} messages. + * @param message NodeGroup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.INodeGroup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeGroup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.NodeGroup; + + /** + * Decodes a NodeGroup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.NodeGroup; + + /** + * Verifies a NodeGroup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeGroup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeGroup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.NodeGroup; + + /** + * Creates a plain object from a NodeGroup message. Also converts values to other types if specified. + * @param message NodeGroup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.NodeGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeGroup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeGroup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace NodeGroup { + + /** Role enum. */ + enum Role { + ROLE_UNSPECIFIED = 0, + DRIVER = 1 + } + } + + /** Properties of a NodeInitializationAction. */ + interface INodeInitializationAction { + + /** NodeInitializationAction executableFile */ + executableFile?: (string|null); + + /** NodeInitializationAction executionTimeout */ + executionTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a NodeInitializationAction. */ + class NodeInitializationAction implements INodeInitializationAction { + + /** + * Constructs a new NodeInitializationAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.INodeInitializationAction); + + /** NodeInitializationAction executableFile. */ + public executableFile: string; + + /** NodeInitializationAction executionTimeout. */ + public executionTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new NodeInitializationAction instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeInitializationAction instance + */ + public static create(properties?: google.cloud.dataproc.v1.INodeInitializationAction): google.cloud.dataproc.v1.NodeInitializationAction; + + /** + * Encodes the specified NodeInitializationAction message. Does not implicitly {@link google.cloud.dataproc.v1.NodeInitializationAction.verify|verify} messages. + * @param message NodeInitializationAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.INodeInitializationAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeInitializationAction message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.NodeInitializationAction.verify|verify} messages. + * @param message NodeInitializationAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.INodeInitializationAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeInitializationAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeInitializationAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.NodeInitializationAction; + + /** + * Decodes a NodeInitializationAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeInitializationAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.NodeInitializationAction; + + /** + * Verifies a NodeInitializationAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeInitializationAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeInitializationAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.NodeInitializationAction; + + /** + * Creates a plain object from a NodeInitializationAction message. Also converts values to other types if specified. + * @param message NodeInitializationAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.NodeInitializationAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeInitializationAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeInitializationAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClusterStatus. */ + interface IClusterStatus { + + /** ClusterStatus state */ + state?: (google.cloud.dataproc.v1.ClusterStatus.State|keyof typeof google.cloud.dataproc.v1.ClusterStatus.State|null); + + /** ClusterStatus detail */ + detail?: (string|null); + + /** ClusterStatus stateStartTime */ + stateStartTime?: (google.protobuf.ITimestamp|null); + + /** ClusterStatus substate */ + substate?: (google.cloud.dataproc.v1.ClusterStatus.Substate|keyof typeof google.cloud.dataproc.v1.ClusterStatus.Substate|null); + } + + /** Represents a ClusterStatus. */ + class ClusterStatus implements IClusterStatus { + + /** + * Constructs a new ClusterStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IClusterStatus); + + /** ClusterStatus state. */ + public state: (google.cloud.dataproc.v1.ClusterStatus.State|keyof typeof google.cloud.dataproc.v1.ClusterStatus.State); + + /** ClusterStatus detail. */ + public detail: string; + + /** ClusterStatus stateStartTime. */ + public stateStartTime?: (google.protobuf.ITimestamp|null); + + /** ClusterStatus substate. */ + public substate: (google.cloud.dataproc.v1.ClusterStatus.Substate|keyof typeof google.cloud.dataproc.v1.ClusterStatus.Substate); + + /** + * Creates a new ClusterStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns ClusterStatus instance + */ + public static create(properties?: google.cloud.dataproc.v1.IClusterStatus): google.cloud.dataproc.v1.ClusterStatus; + + /** + * Encodes the specified ClusterStatus message. Does not implicitly {@link google.cloud.dataproc.v1.ClusterStatus.verify|verify} messages. + * @param message ClusterStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IClusterStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClusterStatus message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ClusterStatus.verify|verify} messages. + * @param message ClusterStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IClusterStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClusterStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClusterStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ClusterStatus; + + /** + * Decodes a ClusterStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClusterStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ClusterStatus; + + /** + * Verifies a ClusterStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClusterStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClusterStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ClusterStatus; + + /** + * Creates a plain object from a ClusterStatus message. Also converts values to other types if specified. + * @param message ClusterStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.ClusterStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClusterStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClusterStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ClusterStatus { + + /** State enum. */ + enum State { + UNKNOWN = 0, + CREATING = 1, + RUNNING = 2, + ERROR = 3, + ERROR_DUE_TO_UPDATE = 9, + DELETING = 4, + UPDATING = 5, + STOPPING = 6, + STOPPED = 7, + STARTING = 8, + REPAIRING = 10 + } + + /** Substate enum. */ + enum Substate { + UNSPECIFIED = 0, + UNHEALTHY = 1, + STALE_STATUS = 2 + } + } + + /** Properties of a SecurityConfig. */ + interface ISecurityConfig { + + /** SecurityConfig kerberosConfig */ + kerberosConfig?: (google.cloud.dataproc.v1.IKerberosConfig|null); + + /** SecurityConfig identityConfig */ + identityConfig?: (google.cloud.dataproc.v1.IIdentityConfig|null); + } + + /** Represents a SecurityConfig. */ + class SecurityConfig implements ISecurityConfig { + + /** + * Constructs a new SecurityConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.ISecurityConfig); + + /** SecurityConfig kerberosConfig. */ + public kerberosConfig?: (google.cloud.dataproc.v1.IKerberosConfig|null); + + /** SecurityConfig identityConfig. */ + public identityConfig?: (google.cloud.dataproc.v1.IIdentityConfig|null); + + /** + * Creates a new SecurityConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SecurityConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.ISecurityConfig): google.cloud.dataproc.v1.SecurityConfig; + + /** + * Encodes the specified SecurityConfig message. Does not implicitly {@link google.cloud.dataproc.v1.SecurityConfig.verify|verify} messages. + * @param message SecurityConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.ISecurityConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SecurityConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SecurityConfig.verify|verify} messages. + * @param message SecurityConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.ISecurityConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SecurityConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SecurityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.SecurityConfig; + + /** + * Decodes a SecurityConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SecurityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.SecurityConfig; + + /** + * Verifies a SecurityConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SecurityConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SecurityConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.SecurityConfig; + + /** + * Creates a plain object from a SecurityConfig message. Also converts values to other types if specified. + * @param message SecurityConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.SecurityConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SecurityConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SecurityConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KerberosConfig. */ + interface IKerberosConfig { + + /** KerberosConfig enableKerberos */ + enableKerberos?: (boolean|null); + + /** KerberosConfig rootPrincipalPasswordUri */ + rootPrincipalPasswordUri?: (string|null); + + /** KerberosConfig kmsKeyUri */ + kmsKeyUri?: (string|null); + + /** KerberosConfig keystoreUri */ + keystoreUri?: (string|null); + + /** KerberosConfig truststoreUri */ + truststoreUri?: (string|null); + + /** KerberosConfig keystorePasswordUri */ + keystorePasswordUri?: (string|null); + + /** KerberosConfig keyPasswordUri */ + keyPasswordUri?: (string|null); + + /** KerberosConfig truststorePasswordUri */ + truststorePasswordUri?: (string|null); + + /** KerberosConfig crossRealmTrustRealm */ + crossRealmTrustRealm?: (string|null); + + /** KerberosConfig crossRealmTrustKdc */ + crossRealmTrustKdc?: (string|null); + + /** KerberosConfig crossRealmTrustAdminServer */ + crossRealmTrustAdminServer?: (string|null); + + /** KerberosConfig crossRealmTrustSharedPasswordUri */ + crossRealmTrustSharedPasswordUri?: (string|null); + + /** KerberosConfig kdcDbKeyUri */ + kdcDbKeyUri?: (string|null); + + /** KerberosConfig tgtLifetimeHours */ + tgtLifetimeHours?: (number|null); + + /** KerberosConfig realm */ + realm?: (string|null); + } + + /** Represents a KerberosConfig. */ + class KerberosConfig implements IKerberosConfig { + + /** + * Constructs a new KerberosConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IKerberosConfig); + + /** KerberosConfig enableKerberos. */ + public enableKerberos: boolean; + + /** KerberosConfig rootPrincipalPasswordUri. */ + public rootPrincipalPasswordUri: string; + + /** KerberosConfig kmsKeyUri. */ + public kmsKeyUri: string; + + /** KerberosConfig keystoreUri. */ + public keystoreUri: string; + + /** KerberosConfig truststoreUri. */ + public truststoreUri: string; + + /** KerberosConfig keystorePasswordUri. */ + public keystorePasswordUri: string; + + /** KerberosConfig keyPasswordUri. */ + public keyPasswordUri: string; + + /** KerberosConfig truststorePasswordUri. */ + public truststorePasswordUri: string; + + /** KerberosConfig crossRealmTrustRealm. */ + public crossRealmTrustRealm: string; + + /** KerberosConfig crossRealmTrustKdc. */ + public crossRealmTrustKdc: string; + + /** KerberosConfig crossRealmTrustAdminServer. */ + public crossRealmTrustAdminServer: string; + + /** KerberosConfig crossRealmTrustSharedPasswordUri. */ + public crossRealmTrustSharedPasswordUri: string; + + /** KerberosConfig kdcDbKeyUri. */ + public kdcDbKeyUri: string; + + /** KerberosConfig tgtLifetimeHours. */ + public tgtLifetimeHours: number; + + /** KerberosConfig realm. */ + public realm: string; + + /** + * Creates a new KerberosConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns KerberosConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IKerberosConfig): google.cloud.dataproc.v1.KerberosConfig; + + /** + * Encodes the specified KerberosConfig message. Does not implicitly {@link google.cloud.dataproc.v1.KerberosConfig.verify|verify} messages. + * @param message KerberosConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IKerberosConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KerberosConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.KerberosConfig.verify|verify} messages. + * @param message KerberosConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IKerberosConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KerberosConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KerberosConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.KerberosConfig; + + /** + * Decodes a KerberosConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KerberosConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.KerberosConfig; + + /** + * Verifies a KerberosConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a KerberosConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KerberosConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.KerberosConfig; + + /** + * Creates a plain object from a KerberosConfig message. Also converts values to other types if specified. + * @param message KerberosConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.KerberosConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KerberosConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KerberosConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IdentityConfig. */ + interface IIdentityConfig { + + /** IdentityConfig userServiceAccountMapping */ + userServiceAccountMapping?: ({ [k: string]: string }|null); + } + + /** Represents an IdentityConfig. */ + class IdentityConfig implements IIdentityConfig { + + /** + * Constructs a new IdentityConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IIdentityConfig); + + /** IdentityConfig userServiceAccountMapping. */ + public userServiceAccountMapping: { [k: string]: string }; + + /** + * Creates a new IdentityConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns IdentityConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IIdentityConfig): google.cloud.dataproc.v1.IdentityConfig; + + /** + * Encodes the specified IdentityConfig message. Does not implicitly {@link google.cloud.dataproc.v1.IdentityConfig.verify|verify} messages. + * @param message IdentityConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IIdentityConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IdentityConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.IdentityConfig.verify|verify} messages. + * @param message IdentityConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IIdentityConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IdentityConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IdentityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.IdentityConfig; + + /** + * Decodes an IdentityConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IdentityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.IdentityConfig; + + /** + * Verifies an IdentityConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IdentityConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IdentityConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.IdentityConfig; + + /** + * Creates a plain object from an IdentityConfig message. Also converts values to other types if specified. + * @param message IdentityConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.IdentityConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IdentityConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IdentityConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SoftwareConfig. */ + interface ISoftwareConfig { + + /** SoftwareConfig imageVersion */ + imageVersion?: (string|null); + + /** SoftwareConfig properties */ + properties?: ({ [k: string]: string }|null); + + /** SoftwareConfig optionalComponents */ + optionalComponents?: (google.cloud.dataproc.v1.Component[]|null); + } + + /** Represents a SoftwareConfig. */ + class SoftwareConfig implements ISoftwareConfig { + + /** + * Constructs a new SoftwareConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.ISoftwareConfig); + + /** SoftwareConfig imageVersion. */ + public imageVersion: string; + + /** SoftwareConfig properties. */ + public properties: { [k: string]: string }; + + /** SoftwareConfig optionalComponents. */ + public optionalComponents: google.cloud.dataproc.v1.Component[]; + + /** + * Creates a new SoftwareConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SoftwareConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.ISoftwareConfig): google.cloud.dataproc.v1.SoftwareConfig; + + /** + * Encodes the specified SoftwareConfig message. Does not implicitly {@link google.cloud.dataproc.v1.SoftwareConfig.verify|verify} messages. + * @param message SoftwareConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.ISoftwareConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SoftwareConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SoftwareConfig.verify|verify} messages. + * @param message SoftwareConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.ISoftwareConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SoftwareConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SoftwareConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.SoftwareConfig; + + /** + * Decodes a SoftwareConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SoftwareConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.SoftwareConfig; + + /** + * Verifies a SoftwareConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SoftwareConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SoftwareConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.SoftwareConfig; + + /** + * Creates a plain object from a SoftwareConfig message. Also converts values to other types if specified. + * @param message SoftwareConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.SoftwareConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SoftwareConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SoftwareConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LifecycleConfig. */ + interface ILifecycleConfig { + + /** LifecycleConfig idleDeleteTtl */ + idleDeleteTtl?: (google.protobuf.IDuration|null); + + /** LifecycleConfig autoDeleteTime */ + autoDeleteTime?: (google.protobuf.ITimestamp|null); + + /** LifecycleConfig autoDeleteTtl */ + autoDeleteTtl?: (google.protobuf.IDuration|null); + + /** LifecycleConfig idleStopTtl */ + idleStopTtl?: (google.protobuf.IDuration|null); + + /** LifecycleConfig autoStopTime */ + autoStopTime?: (google.protobuf.ITimestamp|null); + + /** LifecycleConfig autoStopTtl */ + autoStopTtl?: (google.protobuf.IDuration|null); + + /** LifecycleConfig idleStartTime */ + idleStartTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a LifecycleConfig. */ + class LifecycleConfig implements ILifecycleConfig { + + /** + * Constructs a new LifecycleConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.ILifecycleConfig); + + /** LifecycleConfig idleDeleteTtl. */ + public idleDeleteTtl?: (google.protobuf.IDuration|null); + + /** LifecycleConfig autoDeleteTime. */ + public autoDeleteTime?: (google.protobuf.ITimestamp|null); + + /** LifecycleConfig autoDeleteTtl. */ + public autoDeleteTtl?: (google.protobuf.IDuration|null); + + /** LifecycleConfig idleStopTtl. */ + public idleStopTtl?: (google.protobuf.IDuration|null); + + /** LifecycleConfig autoStopTime. */ + public autoStopTime?: (google.protobuf.ITimestamp|null); + + /** LifecycleConfig autoStopTtl. */ + public autoStopTtl?: (google.protobuf.IDuration|null); + + /** LifecycleConfig idleStartTime. */ + public idleStartTime?: (google.protobuf.ITimestamp|null); + + /** LifecycleConfig ttl. */ + public ttl?: ("autoDeleteTime"|"autoDeleteTtl"); + + /** LifecycleConfig stopTtl. */ + public stopTtl?: ("autoStopTime"|"autoStopTtl"); + + /** + * Creates a new LifecycleConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns LifecycleConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.ILifecycleConfig): google.cloud.dataproc.v1.LifecycleConfig; + + /** + * Encodes the specified LifecycleConfig message. Does not implicitly {@link google.cloud.dataproc.v1.LifecycleConfig.verify|verify} messages. + * @param message LifecycleConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.ILifecycleConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LifecycleConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.LifecycleConfig.verify|verify} messages. + * @param message LifecycleConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.ILifecycleConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LifecycleConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LifecycleConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.LifecycleConfig; + + /** + * Decodes a LifecycleConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LifecycleConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.LifecycleConfig; + + /** + * Verifies a LifecycleConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LifecycleConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LifecycleConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.LifecycleConfig; + + /** + * Creates a plain object from a LifecycleConfig message. Also converts values to other types if specified. + * @param message LifecycleConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.LifecycleConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LifecycleConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LifecycleConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MetastoreConfig. */ + interface IMetastoreConfig { + + /** MetastoreConfig dataprocMetastoreService */ + dataprocMetastoreService?: (string|null); + } + + /** Represents a MetastoreConfig. */ + class MetastoreConfig implements IMetastoreConfig { + + /** + * Constructs a new MetastoreConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IMetastoreConfig); + + /** MetastoreConfig dataprocMetastoreService. */ + public dataprocMetastoreService: string; + + /** + * Creates a new MetastoreConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns MetastoreConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IMetastoreConfig): google.cloud.dataproc.v1.MetastoreConfig; + + /** + * Encodes the specified MetastoreConfig message. Does not implicitly {@link google.cloud.dataproc.v1.MetastoreConfig.verify|verify} messages. + * @param message MetastoreConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IMetastoreConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetastoreConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.MetastoreConfig.verify|verify} messages. + * @param message MetastoreConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IMetastoreConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetastoreConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetastoreConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.MetastoreConfig; + + /** + * Decodes a MetastoreConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetastoreConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.MetastoreConfig; + + /** + * Verifies a MetastoreConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MetastoreConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetastoreConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.MetastoreConfig; + + /** + * Creates a plain object from a MetastoreConfig message. Also converts values to other types if specified. + * @param message MetastoreConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.MetastoreConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetastoreConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MetastoreConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClusterMetrics. */ + interface IClusterMetrics { + + /** ClusterMetrics hdfsMetrics */ + hdfsMetrics?: ({ [k: string]: (number|Long|string) }|null); + + /** ClusterMetrics yarnMetrics */ + yarnMetrics?: ({ [k: string]: (number|Long|string) }|null); + } + + /** Represents a ClusterMetrics. */ + class ClusterMetrics implements IClusterMetrics { + + /** + * Constructs a new ClusterMetrics. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IClusterMetrics); + + /** ClusterMetrics hdfsMetrics. */ + public hdfsMetrics: { [k: string]: (number|Long|string) }; + + /** ClusterMetrics yarnMetrics. */ + public yarnMetrics: { [k: string]: (number|Long|string) }; + + /** + * Creates a new ClusterMetrics instance using the specified properties. + * @param [properties] Properties to set + * @returns ClusterMetrics instance + */ + public static create(properties?: google.cloud.dataproc.v1.IClusterMetrics): google.cloud.dataproc.v1.ClusterMetrics; + + /** + * Encodes the specified ClusterMetrics message. Does not implicitly {@link google.cloud.dataproc.v1.ClusterMetrics.verify|verify} messages. + * @param message ClusterMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IClusterMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClusterMetrics message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ClusterMetrics.verify|verify} messages. + * @param message ClusterMetrics message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IClusterMetrics, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClusterMetrics message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClusterMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ClusterMetrics; + + /** + * Decodes a ClusterMetrics message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClusterMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ClusterMetrics; + + /** + * Verifies a ClusterMetrics message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClusterMetrics message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClusterMetrics + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ClusterMetrics; + + /** + * Creates a plain object from a ClusterMetrics message. Also converts values to other types if specified. + * @param message ClusterMetrics + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.ClusterMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClusterMetrics to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClusterMetrics + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataprocMetricConfig. */ + interface IDataprocMetricConfig { + + /** DataprocMetricConfig metrics */ + metrics?: (google.cloud.dataproc.v1.DataprocMetricConfig.IMetric[]|null); + } + + /** Represents a DataprocMetricConfig. */ + class DataprocMetricConfig implements IDataprocMetricConfig { + + /** + * Constructs a new DataprocMetricConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IDataprocMetricConfig); + + /** DataprocMetricConfig metrics. */ + public metrics: google.cloud.dataproc.v1.DataprocMetricConfig.IMetric[]; + + /** + * Creates a new DataprocMetricConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns DataprocMetricConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IDataprocMetricConfig): google.cloud.dataproc.v1.DataprocMetricConfig; + + /** + * Encodes the specified DataprocMetricConfig message. Does not implicitly {@link google.cloud.dataproc.v1.DataprocMetricConfig.verify|verify} messages. + * @param message DataprocMetricConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IDataprocMetricConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataprocMetricConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DataprocMetricConfig.verify|verify} messages. + * @param message DataprocMetricConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IDataprocMetricConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataprocMetricConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataprocMetricConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.DataprocMetricConfig; + + /** + * Decodes a DataprocMetricConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataprocMetricConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.DataprocMetricConfig; + + /** + * Verifies a DataprocMetricConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataprocMetricConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataprocMetricConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.DataprocMetricConfig; + + /** + * Creates a plain object from a DataprocMetricConfig message. Also converts values to other types if specified. + * @param message DataprocMetricConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.DataprocMetricConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataprocMetricConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataprocMetricConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DataprocMetricConfig { + + /** MetricSource enum. */ + enum MetricSource { + METRIC_SOURCE_UNSPECIFIED = 0, + MONITORING_AGENT_DEFAULTS = 1, + HDFS = 2, + SPARK = 3, + YARN = 4, + SPARK_HISTORY_SERVER = 5, + HIVESERVER2 = 6, + HIVEMETASTORE = 7, + FLINK = 8 + } + + /** Properties of a Metric. */ + interface IMetric { + + /** Metric metricSource */ + metricSource?: (google.cloud.dataproc.v1.DataprocMetricConfig.MetricSource|keyof typeof google.cloud.dataproc.v1.DataprocMetricConfig.MetricSource|null); + + /** Metric metricOverrides */ + metricOverrides?: (string[]|null); + } + + /** Represents a Metric. */ + class Metric implements IMetric { + + /** + * Constructs a new Metric. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.DataprocMetricConfig.IMetric); + + /** Metric metricSource. */ + public metricSource: (google.cloud.dataproc.v1.DataprocMetricConfig.MetricSource|keyof typeof google.cloud.dataproc.v1.DataprocMetricConfig.MetricSource); + + /** Metric metricOverrides. */ + public metricOverrides: string[]; + + /** + * Creates a new Metric instance using the specified properties. + * @param [properties] Properties to set + * @returns Metric instance + */ + public static create(properties?: google.cloud.dataproc.v1.DataprocMetricConfig.IMetric): google.cloud.dataproc.v1.DataprocMetricConfig.Metric; + + /** + * Encodes the specified Metric message. Does not implicitly {@link google.cloud.dataproc.v1.DataprocMetricConfig.Metric.verify|verify} messages. + * @param message Metric message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.DataprocMetricConfig.IMetric, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Metric message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DataprocMetricConfig.Metric.verify|verify} messages. + * @param message Metric message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.DataprocMetricConfig.IMetric, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Metric message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Metric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.DataprocMetricConfig.Metric; + + /** + * Decodes a Metric message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Metric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.DataprocMetricConfig.Metric; + + /** + * Verifies a Metric message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Metric message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Metric + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.DataprocMetricConfig.Metric; + + /** + * Creates a plain object from a Metric message. Also converts values to other types if specified. + * @param message Metric + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.DataprocMetricConfig.Metric, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Metric to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Metric + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a CreateClusterRequest. */ + interface ICreateClusterRequest { + + /** CreateClusterRequest projectId */ + projectId?: (string|null); + + /** CreateClusterRequest region */ + region?: (string|null); + + /** CreateClusterRequest cluster */ + cluster?: (google.cloud.dataproc.v1.ICluster|null); + + /** CreateClusterRequest requestId */ + requestId?: (string|null); + + /** CreateClusterRequest actionOnFailedPrimaryWorkers */ + actionOnFailedPrimaryWorkers?: (google.cloud.dataproc.v1.FailureAction|keyof typeof google.cloud.dataproc.v1.FailureAction|null); + } + + /** Represents a CreateClusterRequest. */ + class CreateClusterRequest implements ICreateClusterRequest { + + /** + * Constructs a new CreateClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.ICreateClusterRequest); + + /** CreateClusterRequest projectId. */ + public projectId: string; + + /** CreateClusterRequest region. */ + public region: string; + + /** CreateClusterRequest cluster. */ + public cluster?: (google.cloud.dataproc.v1.ICluster|null); + + /** CreateClusterRequest requestId. */ + public requestId: string; + + /** CreateClusterRequest actionOnFailedPrimaryWorkers. */ + public actionOnFailedPrimaryWorkers: (google.cloud.dataproc.v1.FailureAction|keyof typeof google.cloud.dataproc.v1.FailureAction); + + /** + * Creates a new CreateClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateClusterRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.ICreateClusterRequest): google.cloud.dataproc.v1.CreateClusterRequest; + + /** + * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.cloud.dataproc.v1.CreateClusterRequest.verify|verify} messages. + * @param message CreateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.CreateClusterRequest.verify|verify} messages. + * @param message CreateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.CreateClusterRequest; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.CreateClusterRequest; + + /** + * Verifies a CreateClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.CreateClusterRequest; + + /** + * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. + * @param message CreateClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.CreateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateClusterRequest. */ + interface IUpdateClusterRequest { + + /** UpdateClusterRequest projectId */ + projectId?: (string|null); + + /** UpdateClusterRequest region */ + region?: (string|null); + + /** UpdateClusterRequest clusterName */ + clusterName?: (string|null); + + /** UpdateClusterRequest cluster */ + cluster?: (google.cloud.dataproc.v1.ICluster|null); + + /** UpdateClusterRequest gracefulDecommissionTimeout */ + gracefulDecommissionTimeout?: (google.protobuf.IDuration|null); + + /** UpdateClusterRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateClusterRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateClusterRequest. */ + class UpdateClusterRequest implements IUpdateClusterRequest { + + /** + * Constructs a new UpdateClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IUpdateClusterRequest); + + /** UpdateClusterRequest projectId. */ + public projectId: string; + + /** UpdateClusterRequest region. */ + public region: string; + + /** UpdateClusterRequest clusterName. */ + public clusterName: string; + + /** UpdateClusterRequest cluster. */ + public cluster?: (google.cloud.dataproc.v1.ICluster|null); + + /** UpdateClusterRequest gracefulDecommissionTimeout. */ + public gracefulDecommissionTimeout?: (google.protobuf.IDuration|null); + + /** UpdateClusterRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateClusterRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateClusterRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.IUpdateClusterRequest): google.cloud.dataproc.v1.UpdateClusterRequest; + + /** + * Encodes the specified UpdateClusterRequest message. Does not implicitly {@link google.cloud.dataproc.v1.UpdateClusterRequest.verify|verify} messages. + * @param message UpdateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IUpdateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.UpdateClusterRequest.verify|verify} messages. + * @param message UpdateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IUpdateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.UpdateClusterRequest; + + /** + * Decodes an UpdateClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.UpdateClusterRequest; + + /** + * Verifies an UpdateClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.UpdateClusterRequest; + + /** + * Creates a plain object from an UpdateClusterRequest message. Also converts values to other types if specified. + * @param message UpdateClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.UpdateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StopClusterRequest. */ + interface IStopClusterRequest { + + /** StopClusterRequest projectId */ + projectId?: (string|null); + + /** StopClusterRequest region */ + region?: (string|null); + + /** StopClusterRequest clusterName */ + clusterName?: (string|null); + + /** StopClusterRequest clusterUuid */ + clusterUuid?: (string|null); + + /** StopClusterRequest requestId */ + requestId?: (string|null); + } + + /** Represents a StopClusterRequest. */ + class StopClusterRequest implements IStopClusterRequest { + + /** + * Constructs a new StopClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IStopClusterRequest); + + /** StopClusterRequest projectId. */ + public projectId: string; + + /** StopClusterRequest region. */ + public region: string; + + /** StopClusterRequest clusterName. */ + public clusterName: string; + + /** StopClusterRequest clusterUuid. */ + public clusterUuid: string; + + /** StopClusterRequest requestId. */ + public requestId: string; + + /** + * Creates a new StopClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StopClusterRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.IStopClusterRequest): google.cloud.dataproc.v1.StopClusterRequest; + + /** + * Encodes the specified StopClusterRequest message. Does not implicitly {@link google.cloud.dataproc.v1.StopClusterRequest.verify|verify} messages. + * @param message StopClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IStopClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StopClusterRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.StopClusterRequest.verify|verify} messages. + * @param message StopClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IStopClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StopClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StopClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.StopClusterRequest; + + /** + * Decodes a StopClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StopClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.StopClusterRequest; + + /** + * Verifies a StopClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StopClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StopClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.StopClusterRequest; + + /** + * Creates a plain object from a StopClusterRequest message. Also converts values to other types if specified. + * @param message StopClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.StopClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StopClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StopClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StartClusterRequest. */ + interface IStartClusterRequest { + + /** StartClusterRequest projectId */ + projectId?: (string|null); + + /** StartClusterRequest region */ + region?: (string|null); + + /** StartClusterRequest clusterName */ + clusterName?: (string|null); + + /** StartClusterRequest clusterUuid */ + clusterUuid?: (string|null); + + /** StartClusterRequest requestId */ + requestId?: (string|null); + } + + /** Represents a StartClusterRequest. */ + class StartClusterRequest implements IStartClusterRequest { + + /** + * Constructs a new StartClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IStartClusterRequest); + + /** StartClusterRequest projectId. */ + public projectId: string; + + /** StartClusterRequest region. */ + public region: string; + + /** StartClusterRequest clusterName. */ + public clusterName: string; + + /** StartClusterRequest clusterUuid. */ + public clusterUuid: string; + + /** StartClusterRequest requestId. */ + public requestId: string; + + /** + * Creates a new StartClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StartClusterRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.IStartClusterRequest): google.cloud.dataproc.v1.StartClusterRequest; + + /** + * Encodes the specified StartClusterRequest message. Does not implicitly {@link google.cloud.dataproc.v1.StartClusterRequest.verify|verify} messages. + * @param message StartClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IStartClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StartClusterRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.StartClusterRequest.verify|verify} messages. + * @param message StartClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IStartClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StartClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StartClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.StartClusterRequest; + + /** + * Decodes a StartClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StartClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.StartClusterRequest; + + /** + * Verifies a StartClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StartClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StartClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.StartClusterRequest; + + /** + * Creates a plain object from a StartClusterRequest message. Also converts values to other types if specified. + * @param message StartClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.StartClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StartClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StartClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteClusterRequest. */ + interface IDeleteClusterRequest { + + /** DeleteClusterRequest projectId */ + projectId?: (string|null); + + /** DeleteClusterRequest region */ + region?: (string|null); + + /** DeleteClusterRequest clusterName */ + clusterName?: (string|null); + + /** DeleteClusterRequest clusterUuid */ + clusterUuid?: (string|null); + + /** DeleteClusterRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteClusterRequest. */ + class DeleteClusterRequest implements IDeleteClusterRequest { + + /** + * Constructs a new DeleteClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IDeleteClusterRequest); + + /** DeleteClusterRequest projectId. */ + public projectId: string; + + /** DeleteClusterRequest region. */ + public region: string; + + /** DeleteClusterRequest clusterName. */ + public clusterName: string; + + /** DeleteClusterRequest clusterUuid. */ + public clusterUuid: string; + + /** DeleteClusterRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteClusterRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.IDeleteClusterRequest): google.cloud.dataproc.v1.DeleteClusterRequest; + + /** + * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.cloud.dataproc.v1.DeleteClusterRequest.verify|verify} messages. + * @param message DeleteClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DeleteClusterRequest.verify|verify} messages. + * @param message DeleteClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.DeleteClusterRequest; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.DeleteClusterRequest; + + /** + * Verifies a DeleteClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.DeleteClusterRequest; + + /** + * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. + * @param message DeleteClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.DeleteClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetClusterRequest. */ + interface IGetClusterRequest { + + /** GetClusterRequest projectId */ + projectId?: (string|null); + + /** GetClusterRequest region */ + region?: (string|null); + + /** GetClusterRequest clusterName */ + clusterName?: (string|null); + } + + /** Represents a GetClusterRequest. */ + class GetClusterRequest implements IGetClusterRequest { + + /** + * Constructs a new GetClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IGetClusterRequest); + + /** GetClusterRequest projectId. */ + public projectId: string; + + /** GetClusterRequest region. */ + public region: string; + + /** GetClusterRequest clusterName. */ + public clusterName: string; + + /** + * Creates a new GetClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetClusterRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.IGetClusterRequest): google.cloud.dataproc.v1.GetClusterRequest; + + /** + * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.cloud.dataproc.v1.GetClusterRequest.verify|verify} messages. + * @param message GetClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetClusterRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GetClusterRequest.verify|verify} messages. + * @param message GetClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.GetClusterRequest; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.GetClusterRequest; + + /** + * Verifies a GetClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.GetClusterRequest; + + /** + * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. + * @param message GetClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.GetClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListClustersRequest. */ + interface IListClustersRequest { + + /** ListClustersRequest projectId */ + projectId?: (string|null); + + /** ListClustersRequest region */ + region?: (string|null); + + /** ListClustersRequest filter */ + filter?: (string|null); + + /** ListClustersRequest pageSize */ + pageSize?: (number|null); + + /** ListClustersRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListClustersRequest. */ + class ListClustersRequest implements IListClustersRequest { + + /** + * Constructs a new ListClustersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IListClustersRequest); + + /** ListClustersRequest projectId. */ + public projectId: string; + + /** ListClustersRequest region. */ + public region: string; + + /** ListClustersRequest filter. */ + public filter: string; + + /** ListClustersRequest pageSize. */ + public pageSize: number; + + /** ListClustersRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListClustersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListClustersRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.IListClustersRequest): google.cloud.dataproc.v1.ListClustersRequest; + + /** + * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.cloud.dataproc.v1.ListClustersRequest.verify|verify} messages. + * @param message ListClustersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListClustersRequest.verify|verify} messages. + * @param message ListClustersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ListClustersRequest; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ListClustersRequest; + + /** + * Verifies a ListClustersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListClustersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ListClustersRequest; + + /** + * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. + * @param message ListClustersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.ListClustersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListClustersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListClustersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListClustersResponse. */ + interface IListClustersResponse { + + /** ListClustersResponse clusters */ + clusters?: (google.cloud.dataproc.v1.ICluster[]|null); + + /** ListClustersResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListClustersResponse. */ + class ListClustersResponse implements IListClustersResponse { + + /** + * Constructs a new ListClustersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IListClustersResponse); + + /** ListClustersResponse clusters. */ + public clusters: google.cloud.dataproc.v1.ICluster[]; + + /** ListClustersResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListClustersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListClustersResponse instance + */ + public static create(properties?: google.cloud.dataproc.v1.IListClustersResponse): google.cloud.dataproc.v1.ListClustersResponse; + + /** + * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.cloud.dataproc.v1.ListClustersResponse.verify|verify} messages. + * @param message ListClustersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListClustersResponse message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListClustersResponse.verify|verify} messages. + * @param message ListClustersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ListClustersResponse; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ListClustersResponse; + + /** + * Verifies a ListClustersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListClustersResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ListClustersResponse; + + /** + * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. + * @param message ListClustersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.ListClustersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListClustersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListClustersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DiagnoseClusterRequest. */ + interface IDiagnoseClusterRequest { + + /** DiagnoseClusterRequest projectId */ + projectId?: (string|null); + + /** DiagnoseClusterRequest region */ + region?: (string|null); + + /** DiagnoseClusterRequest clusterName */ + clusterName?: (string|null); + + /** DiagnoseClusterRequest tarballGcsDir */ + tarballGcsDir?: (string|null); + + /** DiagnoseClusterRequest tarballAccess */ + tarballAccess?: (google.cloud.dataproc.v1.DiagnoseClusterRequest.TarballAccess|keyof typeof google.cloud.dataproc.v1.DiagnoseClusterRequest.TarballAccess|null); + + /** DiagnoseClusterRequest diagnosisInterval */ + diagnosisInterval?: (google.type.IInterval|null); + + /** DiagnoseClusterRequest jobs */ + jobs?: (string[]|null); + + /** DiagnoseClusterRequest yarnApplicationIds */ + yarnApplicationIds?: (string[]|null); + } + + /** Represents a DiagnoseClusterRequest. */ + class DiagnoseClusterRequest implements IDiagnoseClusterRequest { + + /** + * Constructs a new DiagnoseClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IDiagnoseClusterRequest); + + /** DiagnoseClusterRequest projectId. */ + public projectId: string; + + /** DiagnoseClusterRequest region. */ + public region: string; + + /** DiagnoseClusterRequest clusterName. */ + public clusterName: string; + + /** DiagnoseClusterRequest tarballGcsDir. */ + public tarballGcsDir: string; + + /** DiagnoseClusterRequest tarballAccess. */ + public tarballAccess: (google.cloud.dataproc.v1.DiagnoseClusterRequest.TarballAccess|keyof typeof google.cloud.dataproc.v1.DiagnoseClusterRequest.TarballAccess); + + /** DiagnoseClusterRequest diagnosisInterval. */ + public diagnosisInterval?: (google.type.IInterval|null); + + /** DiagnoseClusterRequest jobs. */ + public jobs: string[]; + + /** DiagnoseClusterRequest yarnApplicationIds. */ + public yarnApplicationIds: string[]; + + /** + * Creates a new DiagnoseClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DiagnoseClusterRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.IDiagnoseClusterRequest): google.cloud.dataproc.v1.DiagnoseClusterRequest; + + /** + * Encodes the specified DiagnoseClusterRequest message. Does not implicitly {@link google.cloud.dataproc.v1.DiagnoseClusterRequest.verify|verify} messages. + * @param message DiagnoseClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IDiagnoseClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DiagnoseClusterRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DiagnoseClusterRequest.verify|verify} messages. + * @param message DiagnoseClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IDiagnoseClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DiagnoseClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DiagnoseClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.DiagnoseClusterRequest; + + /** + * Decodes a DiagnoseClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DiagnoseClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.DiagnoseClusterRequest; + + /** + * Verifies a DiagnoseClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DiagnoseClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DiagnoseClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.DiagnoseClusterRequest; + + /** + * Creates a plain object from a DiagnoseClusterRequest message. Also converts values to other types if specified. + * @param message DiagnoseClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.DiagnoseClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DiagnoseClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DiagnoseClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DiagnoseClusterRequest { + + /** TarballAccess enum. */ + enum TarballAccess { + TARBALL_ACCESS_UNSPECIFIED = 0, + GOOGLE_CLOUD_SUPPORT = 1, + GOOGLE_DATAPROC_DIAGNOSE = 2 + } + } + + /** Properties of a DiagnoseClusterResults. */ + interface IDiagnoseClusterResults { + + /** DiagnoseClusterResults outputUri */ + outputUri?: (string|null); + } + + /** Represents a DiagnoseClusterResults. */ + class DiagnoseClusterResults implements IDiagnoseClusterResults { + + /** + * Constructs a new DiagnoseClusterResults. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IDiagnoseClusterResults); + + /** DiagnoseClusterResults outputUri. */ + public outputUri: string; + + /** + * Creates a new DiagnoseClusterResults instance using the specified properties. + * @param [properties] Properties to set + * @returns DiagnoseClusterResults instance + */ + public static create(properties?: google.cloud.dataproc.v1.IDiagnoseClusterResults): google.cloud.dataproc.v1.DiagnoseClusterResults; + + /** + * Encodes the specified DiagnoseClusterResults message. Does not implicitly {@link google.cloud.dataproc.v1.DiagnoseClusterResults.verify|verify} messages. + * @param message DiagnoseClusterResults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IDiagnoseClusterResults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DiagnoseClusterResults message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DiagnoseClusterResults.verify|verify} messages. + * @param message DiagnoseClusterResults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IDiagnoseClusterResults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DiagnoseClusterResults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DiagnoseClusterResults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.DiagnoseClusterResults; + + /** + * Decodes a DiagnoseClusterResults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DiagnoseClusterResults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.DiagnoseClusterResults; + + /** + * Verifies a DiagnoseClusterResults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DiagnoseClusterResults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DiagnoseClusterResults + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.DiagnoseClusterResults; + + /** + * Creates a plain object from a DiagnoseClusterResults message. Also converts values to other types if specified. + * @param message DiagnoseClusterResults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.DiagnoseClusterResults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DiagnoseClusterResults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DiagnoseClusterResults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservationAffinity. */ + interface IReservationAffinity { + + /** ReservationAffinity consumeReservationType */ + consumeReservationType?: (google.cloud.dataproc.v1.ReservationAffinity.Type|keyof typeof google.cloud.dataproc.v1.ReservationAffinity.Type|null); + + /** ReservationAffinity key */ + key?: (string|null); + + /** ReservationAffinity values */ + values?: (string[]|null); + } + + /** Represents a ReservationAffinity. */ + class ReservationAffinity implements IReservationAffinity { + + /** + * Constructs a new ReservationAffinity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IReservationAffinity); + + /** ReservationAffinity consumeReservationType. */ + public consumeReservationType: (google.cloud.dataproc.v1.ReservationAffinity.Type|keyof typeof google.cloud.dataproc.v1.ReservationAffinity.Type); + + /** ReservationAffinity key. */ + public key: string; + + /** ReservationAffinity values. */ + public values: string[]; + + /** + * Creates a new ReservationAffinity instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservationAffinity instance + */ + public static create(properties?: google.cloud.dataproc.v1.IReservationAffinity): google.cloud.dataproc.v1.ReservationAffinity; + + /** + * Encodes the specified ReservationAffinity message. Does not implicitly {@link google.cloud.dataproc.v1.ReservationAffinity.verify|verify} messages. + * @param message ReservationAffinity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IReservationAffinity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservationAffinity message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ReservationAffinity.verify|verify} messages. + * @param message ReservationAffinity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IReservationAffinity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservationAffinity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservationAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ReservationAffinity; + + /** + * Decodes a ReservationAffinity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservationAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ReservationAffinity; + + /** + * Verifies a ReservationAffinity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservationAffinity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservationAffinity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ReservationAffinity; + + /** + * Creates a plain object from a ReservationAffinity message. Also converts values to other types if specified. + * @param message ReservationAffinity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.ReservationAffinity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservationAffinity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservationAffinity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ReservationAffinity { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + NO_RESERVATION = 1, + ANY_RESERVATION = 2, + SPECIFIC_RESERVATION = 3 + } + } + + /** Properties of a BatchOperationMetadata. */ + interface IBatchOperationMetadata { + + /** BatchOperationMetadata batch */ + batch?: (string|null); + + /** BatchOperationMetadata batchUuid */ + batchUuid?: (string|null); + + /** BatchOperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** BatchOperationMetadata doneTime */ + doneTime?: (google.protobuf.ITimestamp|null); + + /** BatchOperationMetadata operationType */ + operationType?: (google.cloud.dataproc.v1.BatchOperationMetadata.BatchOperationType|keyof typeof google.cloud.dataproc.v1.BatchOperationMetadata.BatchOperationType|null); + + /** BatchOperationMetadata description */ + description?: (string|null); + + /** BatchOperationMetadata labels */ + labels?: ({ [k: string]: string }|null); + + /** BatchOperationMetadata warnings */ + warnings?: (string[]|null); + } + + /** Represents a BatchOperationMetadata. */ + class BatchOperationMetadata implements IBatchOperationMetadata { + + /** + * Constructs a new BatchOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IBatchOperationMetadata); + + /** BatchOperationMetadata batch. */ + public batch: string; + + /** BatchOperationMetadata batchUuid. */ + public batchUuid: string; + + /** BatchOperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** BatchOperationMetadata doneTime. */ + public doneTime?: (google.protobuf.ITimestamp|null); + + /** BatchOperationMetadata operationType. */ + public operationType: (google.cloud.dataproc.v1.BatchOperationMetadata.BatchOperationType|keyof typeof google.cloud.dataproc.v1.BatchOperationMetadata.BatchOperationType); + + /** BatchOperationMetadata description. */ + public description: string; + + /** BatchOperationMetadata labels. */ + public labels: { [k: string]: string }; + + /** BatchOperationMetadata warnings. */ + public warnings: string[]; + + /** + * Creates a new BatchOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchOperationMetadata instance + */ + public static create(properties?: google.cloud.dataproc.v1.IBatchOperationMetadata): google.cloud.dataproc.v1.BatchOperationMetadata; + + /** + * Encodes the specified BatchOperationMetadata message. Does not implicitly {@link google.cloud.dataproc.v1.BatchOperationMetadata.verify|verify} messages. + * @param message BatchOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IBatchOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.BatchOperationMetadata.verify|verify} messages. + * @param message BatchOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IBatchOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.BatchOperationMetadata; + + /** + * Decodes a BatchOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.BatchOperationMetadata; + + /** + * Verifies a BatchOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.BatchOperationMetadata; + + /** + * Creates a plain object from a BatchOperationMetadata message. Also converts values to other types if specified. + * @param message BatchOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.BatchOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BatchOperationMetadata { + + /** BatchOperationType enum. */ + enum BatchOperationType { + BATCH_OPERATION_TYPE_UNSPECIFIED = 0, + BATCH = 1 + } + } + + /** Properties of a SessionOperationMetadata. */ + interface ISessionOperationMetadata { + + /** SessionOperationMetadata session */ + session?: (string|null); + + /** SessionOperationMetadata sessionUuid */ + sessionUuid?: (string|null); + + /** SessionOperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** SessionOperationMetadata doneTime */ + doneTime?: (google.protobuf.ITimestamp|null); + + /** SessionOperationMetadata operationType */ + operationType?: (google.cloud.dataproc.v1.SessionOperationMetadata.SessionOperationType|keyof typeof google.cloud.dataproc.v1.SessionOperationMetadata.SessionOperationType|null); + + /** SessionOperationMetadata description */ + description?: (string|null); + + /** SessionOperationMetadata labels */ + labels?: ({ [k: string]: string }|null); + + /** SessionOperationMetadata warnings */ + warnings?: (string[]|null); + } + + /** Represents a SessionOperationMetadata. */ + class SessionOperationMetadata implements ISessionOperationMetadata { + + /** + * Constructs a new SessionOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.ISessionOperationMetadata); + + /** SessionOperationMetadata session. */ + public session: string; + + /** SessionOperationMetadata sessionUuid. */ + public sessionUuid: string; + + /** SessionOperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** SessionOperationMetadata doneTime. */ + public doneTime?: (google.protobuf.ITimestamp|null); + + /** SessionOperationMetadata operationType. */ + public operationType: (google.cloud.dataproc.v1.SessionOperationMetadata.SessionOperationType|keyof typeof google.cloud.dataproc.v1.SessionOperationMetadata.SessionOperationType); + + /** SessionOperationMetadata description. */ + public description: string; + + /** SessionOperationMetadata labels. */ + public labels: { [k: string]: string }; + + /** SessionOperationMetadata warnings. */ + public warnings: string[]; + + /** + * Creates a new SessionOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns SessionOperationMetadata instance + */ + public static create(properties?: google.cloud.dataproc.v1.ISessionOperationMetadata): google.cloud.dataproc.v1.SessionOperationMetadata; + + /** + * Encodes the specified SessionOperationMetadata message. Does not implicitly {@link google.cloud.dataproc.v1.SessionOperationMetadata.verify|verify} messages. + * @param message SessionOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.ISessionOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SessionOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SessionOperationMetadata.verify|verify} messages. + * @param message SessionOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.ISessionOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SessionOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SessionOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.SessionOperationMetadata; + + /** + * Decodes a SessionOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SessionOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.SessionOperationMetadata; + + /** + * Verifies a SessionOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SessionOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SessionOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.SessionOperationMetadata; + + /** + * Creates a plain object from a SessionOperationMetadata message. Also converts values to other types if specified. + * @param message SessionOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.SessionOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SessionOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SessionOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SessionOperationMetadata { + + /** SessionOperationType enum. */ + enum SessionOperationType { + SESSION_OPERATION_TYPE_UNSPECIFIED = 0, + CREATE = 1, + TERMINATE = 2, + DELETE = 3 + } + } + + /** Properties of a ClusterOperationStatus. */ + interface IClusterOperationStatus { + + /** ClusterOperationStatus state */ + state?: (google.cloud.dataproc.v1.ClusterOperationStatus.State|keyof typeof google.cloud.dataproc.v1.ClusterOperationStatus.State|null); + + /** ClusterOperationStatus innerState */ + innerState?: (string|null); + + /** ClusterOperationStatus details */ + details?: (string|null); + + /** ClusterOperationStatus stateStartTime */ + stateStartTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ClusterOperationStatus. */ + class ClusterOperationStatus implements IClusterOperationStatus { + + /** + * Constructs a new ClusterOperationStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IClusterOperationStatus); + + /** ClusterOperationStatus state. */ + public state: (google.cloud.dataproc.v1.ClusterOperationStatus.State|keyof typeof google.cloud.dataproc.v1.ClusterOperationStatus.State); + + /** ClusterOperationStatus innerState. */ + public innerState: string; + + /** ClusterOperationStatus details. */ + public details: string; + + /** ClusterOperationStatus stateStartTime. */ + public stateStartTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ClusterOperationStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns ClusterOperationStatus instance + */ + public static create(properties?: google.cloud.dataproc.v1.IClusterOperationStatus): google.cloud.dataproc.v1.ClusterOperationStatus; + + /** + * Encodes the specified ClusterOperationStatus message. Does not implicitly {@link google.cloud.dataproc.v1.ClusterOperationStatus.verify|verify} messages. + * @param message ClusterOperationStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IClusterOperationStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClusterOperationStatus message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ClusterOperationStatus.verify|verify} messages. + * @param message ClusterOperationStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IClusterOperationStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClusterOperationStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClusterOperationStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ClusterOperationStatus; + + /** + * Decodes a ClusterOperationStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClusterOperationStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ClusterOperationStatus; + + /** + * Verifies a ClusterOperationStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClusterOperationStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClusterOperationStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ClusterOperationStatus; + + /** + * Creates a plain object from a ClusterOperationStatus message. Also converts values to other types if specified. + * @param message ClusterOperationStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.ClusterOperationStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClusterOperationStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClusterOperationStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ClusterOperationStatus { + + /** State enum. */ + enum State { + UNKNOWN = 0, + PENDING = 1, + RUNNING = 2, + DONE = 3 + } + } + + /** Properties of a ClusterOperationMetadata. */ + interface IClusterOperationMetadata { + + /** ClusterOperationMetadata clusterName */ + clusterName?: (string|null); + + /** ClusterOperationMetadata clusterUuid */ + clusterUuid?: (string|null); + + /** ClusterOperationMetadata status */ + status?: (google.cloud.dataproc.v1.IClusterOperationStatus|null); + + /** ClusterOperationMetadata statusHistory */ + statusHistory?: (google.cloud.dataproc.v1.IClusterOperationStatus[]|null); + + /** ClusterOperationMetadata operationType */ + operationType?: (string|null); + + /** ClusterOperationMetadata description */ + description?: (string|null); + + /** ClusterOperationMetadata labels */ + labels?: ({ [k: string]: string }|null); + + /** ClusterOperationMetadata warnings */ + warnings?: (string[]|null); + + /** ClusterOperationMetadata childOperationIds */ + childOperationIds?: (string[]|null); + } + + /** Represents a ClusterOperationMetadata. */ + class ClusterOperationMetadata implements IClusterOperationMetadata { + + /** + * Constructs a new ClusterOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IClusterOperationMetadata); + + /** ClusterOperationMetadata clusterName. */ + public clusterName: string; + + /** ClusterOperationMetadata clusterUuid. */ + public clusterUuid: string; + + /** ClusterOperationMetadata status. */ + public status?: (google.cloud.dataproc.v1.IClusterOperationStatus|null); + + /** ClusterOperationMetadata statusHistory. */ + public statusHistory: google.cloud.dataproc.v1.IClusterOperationStatus[]; + + /** ClusterOperationMetadata operationType. */ + public operationType: string; + + /** ClusterOperationMetadata description. */ + public description: string; + + /** ClusterOperationMetadata labels. */ + public labels: { [k: string]: string }; + + /** ClusterOperationMetadata warnings. */ + public warnings: string[]; + + /** ClusterOperationMetadata childOperationIds. */ + public childOperationIds: string[]; + + /** + * Creates a new ClusterOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ClusterOperationMetadata instance + */ + public static create(properties?: google.cloud.dataproc.v1.IClusterOperationMetadata): google.cloud.dataproc.v1.ClusterOperationMetadata; + + /** + * Encodes the specified ClusterOperationMetadata message. Does not implicitly {@link google.cloud.dataproc.v1.ClusterOperationMetadata.verify|verify} messages. + * @param message ClusterOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IClusterOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClusterOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ClusterOperationMetadata.verify|verify} messages. + * @param message ClusterOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IClusterOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClusterOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClusterOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ClusterOperationMetadata; + + /** + * Decodes a ClusterOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClusterOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ClusterOperationMetadata; + + /** + * Verifies a ClusterOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClusterOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClusterOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ClusterOperationMetadata; + + /** + * Creates a plain object from a ClusterOperationMetadata message. Also converts values to other types if specified. + * @param message ClusterOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.ClusterOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClusterOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClusterOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeGroupOperationMetadata. */ + interface INodeGroupOperationMetadata { + + /** NodeGroupOperationMetadata nodeGroupId */ + nodeGroupId?: (string|null); + + /** NodeGroupOperationMetadata clusterUuid */ + clusterUuid?: (string|null); + + /** NodeGroupOperationMetadata status */ + status?: (google.cloud.dataproc.v1.IClusterOperationStatus|null); + + /** NodeGroupOperationMetadata statusHistory */ + statusHistory?: (google.cloud.dataproc.v1.IClusterOperationStatus[]|null); + + /** NodeGroupOperationMetadata operationType */ + operationType?: (google.cloud.dataproc.v1.NodeGroupOperationMetadata.NodeGroupOperationType|keyof typeof google.cloud.dataproc.v1.NodeGroupOperationMetadata.NodeGroupOperationType|null); + + /** NodeGroupOperationMetadata description */ + description?: (string|null); + + /** NodeGroupOperationMetadata labels */ + labels?: ({ [k: string]: string }|null); + + /** NodeGroupOperationMetadata warnings */ + warnings?: (string[]|null); + } + + /** Represents a NodeGroupOperationMetadata. */ + class NodeGroupOperationMetadata implements INodeGroupOperationMetadata { + + /** + * Constructs a new NodeGroupOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.INodeGroupOperationMetadata); + + /** NodeGroupOperationMetadata nodeGroupId. */ + public nodeGroupId: string; + + /** NodeGroupOperationMetadata clusterUuid. */ + public clusterUuid: string; + + /** NodeGroupOperationMetadata status. */ + public status?: (google.cloud.dataproc.v1.IClusterOperationStatus|null); + + /** NodeGroupOperationMetadata statusHistory. */ + public statusHistory: google.cloud.dataproc.v1.IClusterOperationStatus[]; + + /** NodeGroupOperationMetadata operationType. */ + public operationType: (google.cloud.dataproc.v1.NodeGroupOperationMetadata.NodeGroupOperationType|keyof typeof google.cloud.dataproc.v1.NodeGroupOperationMetadata.NodeGroupOperationType); + + /** NodeGroupOperationMetadata description. */ + public description: string; + + /** NodeGroupOperationMetadata labels. */ + public labels: { [k: string]: string }; + + /** NodeGroupOperationMetadata warnings. */ + public warnings: string[]; + + /** + * Creates a new NodeGroupOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeGroupOperationMetadata instance + */ + public static create(properties?: google.cloud.dataproc.v1.INodeGroupOperationMetadata): google.cloud.dataproc.v1.NodeGroupOperationMetadata; + + /** + * Encodes the specified NodeGroupOperationMetadata message. Does not implicitly {@link google.cloud.dataproc.v1.NodeGroupOperationMetadata.verify|verify} messages. + * @param message NodeGroupOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.INodeGroupOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeGroupOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.NodeGroupOperationMetadata.verify|verify} messages. + * @param message NodeGroupOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.INodeGroupOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeGroupOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeGroupOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.NodeGroupOperationMetadata; + + /** + * Decodes a NodeGroupOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeGroupOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.NodeGroupOperationMetadata; + + /** + * Verifies a NodeGroupOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeGroupOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeGroupOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.NodeGroupOperationMetadata; + + /** + * Creates a plain object from a NodeGroupOperationMetadata message. Also converts values to other types if specified. + * @param message NodeGroupOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.NodeGroupOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeGroupOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeGroupOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace NodeGroupOperationMetadata { + + /** NodeGroupOperationType enum. */ + enum NodeGroupOperationType { + NODE_GROUP_OPERATION_TYPE_UNSPECIFIED = 0, + CREATE = 1, + UPDATE = 2, + DELETE = 3, + RESIZE = 4 + } + } + + /** Represents a JobController */ + class JobController extends $protobuf.rpc.Service { + + /** + * Constructs a new JobController 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 JobController 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): JobController; + + /** + * Calls SubmitJob. + * @param request SubmitJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Job + */ + public submitJob(request: google.cloud.dataproc.v1.ISubmitJobRequest, callback: google.cloud.dataproc.v1.JobController.SubmitJobCallback): void; + + /** + * Calls SubmitJob. + * @param request SubmitJobRequest message or plain object + * @returns Promise + */ + public submitJob(request: google.cloud.dataproc.v1.ISubmitJobRequest): Promise; + + /** + * Calls SubmitJobAsOperation. + * @param request SubmitJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public submitJobAsOperation(request: google.cloud.dataproc.v1.ISubmitJobRequest, callback: google.cloud.dataproc.v1.JobController.SubmitJobAsOperationCallback): void; + + /** + * Calls SubmitJobAsOperation. + * @param request SubmitJobRequest message or plain object + * @returns Promise + */ + public submitJobAsOperation(request: google.cloud.dataproc.v1.ISubmitJobRequest): 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.dataproc.v1.IGetJobRequest, callback: google.cloud.dataproc.v1.JobController.GetJobCallback): void; + + /** + * Calls GetJob. + * @param request GetJobRequest message or plain object + * @returns Promise + */ + public getJob(request: google.cloud.dataproc.v1.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.dataproc.v1.IListJobsRequest, callback: google.cloud.dataproc.v1.JobController.ListJobsCallback): void; + + /** + * Calls ListJobs. + * @param request ListJobsRequest message or plain object + * @returns Promise + */ + public listJobs(request: google.cloud.dataproc.v1.IListJobsRequest): Promise; + + /** + * Calls UpdateJob. + * @param request UpdateJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Job + */ + public updateJob(request: google.cloud.dataproc.v1.IUpdateJobRequest, callback: google.cloud.dataproc.v1.JobController.UpdateJobCallback): void; + + /** + * Calls UpdateJob. + * @param request UpdateJobRequest message or plain object + * @returns Promise + */ + public updateJob(request: google.cloud.dataproc.v1.IUpdateJobRequest): Promise; + + /** + * Calls CancelJob. + * @param request CancelJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Job + */ + public cancelJob(request: google.cloud.dataproc.v1.ICancelJobRequest, callback: google.cloud.dataproc.v1.JobController.CancelJobCallback): void; + + /** + * Calls CancelJob. + * @param request CancelJobRequest message or plain object + * @returns Promise + */ + public cancelJob(request: google.cloud.dataproc.v1.ICancelJobRequest): Promise; + + /** + * Calls DeleteJob. + * @param request DeleteJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteJob(request: google.cloud.dataproc.v1.IDeleteJobRequest, callback: google.cloud.dataproc.v1.JobController.DeleteJobCallback): void; + + /** + * Calls DeleteJob. + * @param request DeleteJobRequest message or plain object + * @returns Promise + */ + public deleteJob(request: google.cloud.dataproc.v1.IDeleteJobRequest): Promise; + } + + namespace JobController { + + /** + * Callback as used by {@link google.cloud.dataproc.v1.JobController|submitJob}. + * @param error Error, if any + * @param [response] Job + */ + type SubmitJobCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.Job) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.JobController|submitJobAsOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type SubmitJobAsOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.JobController|getJob}. + * @param error Error, if any + * @param [response] Job + */ + type GetJobCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.Job) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.JobController|listJobs}. + * @param error Error, if any + * @param [response] ListJobsResponse + */ + type ListJobsCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.ListJobsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.JobController|updateJob}. + * @param error Error, if any + * @param [response] Job + */ + type UpdateJobCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.Job) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.JobController|cancelJob}. + * @param error Error, if any + * @param [response] Job + */ + type CancelJobCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.Job) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.JobController|deleteJob}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteJobCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a LoggingConfig. */ + interface ILoggingConfig { + + /** LoggingConfig driverLogLevels */ + driverLogLevels?: ({ [k: string]: google.cloud.dataproc.v1.LoggingConfig.Level }|null); + } + + /** Represents a LoggingConfig. */ + class LoggingConfig implements ILoggingConfig { + + /** + * Constructs a new LoggingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.ILoggingConfig); + + /** LoggingConfig driverLogLevels. */ + public driverLogLevels: { [k: string]: google.cloud.dataproc.v1.LoggingConfig.Level }; + + /** + * Creates a new LoggingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns LoggingConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.ILoggingConfig): google.cloud.dataproc.v1.LoggingConfig; + + /** + * Encodes the specified LoggingConfig message. Does not implicitly {@link google.cloud.dataproc.v1.LoggingConfig.verify|verify} messages. + * @param message LoggingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.ILoggingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LoggingConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.LoggingConfig.verify|verify} messages. + * @param message LoggingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.ILoggingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LoggingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LoggingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.LoggingConfig; + + /** + * Decodes a LoggingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LoggingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.LoggingConfig; + + /** + * Verifies a LoggingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LoggingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LoggingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.LoggingConfig; + + /** + * Creates a plain object from a LoggingConfig message. Also converts values to other types if specified. + * @param message LoggingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.LoggingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LoggingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LoggingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LoggingConfig { + + /** Level enum. */ + enum Level { + LEVEL_UNSPECIFIED = 0, + ALL = 1, + TRACE = 2, + DEBUG = 3, + INFO = 4, + WARN = 5, + ERROR = 6, + FATAL = 7, + OFF = 8 + } + } + + /** Properties of a HadoopJob. */ + interface IHadoopJob { + + /** HadoopJob mainJarFileUri */ + mainJarFileUri?: (string|null); + + /** HadoopJob mainClass */ + mainClass?: (string|null); + + /** HadoopJob args */ + args?: (string[]|null); + + /** HadoopJob jarFileUris */ + jarFileUris?: (string[]|null); + + /** HadoopJob fileUris */ + fileUris?: (string[]|null); + + /** HadoopJob archiveUris */ + archiveUris?: (string[]|null); + + /** HadoopJob properties */ + properties?: ({ [k: string]: string }|null); + + /** HadoopJob loggingConfig */ + loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); + } + + /** Represents a HadoopJob. */ + class HadoopJob implements IHadoopJob { + + /** + * Constructs a new HadoopJob. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IHadoopJob); + + /** HadoopJob mainJarFileUri. */ + public mainJarFileUri?: (string|null); + + /** HadoopJob mainClass. */ + public mainClass?: (string|null); + + /** HadoopJob args. */ + public args: string[]; + + /** HadoopJob jarFileUris. */ + public jarFileUris: string[]; + + /** HadoopJob fileUris. */ + public fileUris: string[]; + + /** HadoopJob archiveUris. */ + public archiveUris: string[]; + + /** HadoopJob properties. */ + public properties: { [k: string]: string }; + + /** HadoopJob loggingConfig. */ + public loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); + + /** HadoopJob driver. */ + public driver?: ("mainJarFileUri"|"mainClass"); + + /** + * Creates a new HadoopJob instance using the specified properties. + * @param [properties] Properties to set + * @returns HadoopJob instance + */ + public static create(properties?: google.cloud.dataproc.v1.IHadoopJob): google.cloud.dataproc.v1.HadoopJob; + + /** + * Encodes the specified HadoopJob message. Does not implicitly {@link google.cloud.dataproc.v1.HadoopJob.verify|verify} messages. + * @param message HadoopJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IHadoopJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HadoopJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.HadoopJob.verify|verify} messages. + * @param message HadoopJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IHadoopJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HadoopJob message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HadoopJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.HadoopJob; + + /** + * Decodes a HadoopJob message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HadoopJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.HadoopJob; + + /** + * Verifies a HadoopJob message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HadoopJob message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HadoopJob + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.HadoopJob; + + /** + * Creates a plain object from a HadoopJob message. Also converts values to other types if specified. + * @param message HadoopJob + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.HadoopJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HadoopJob to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HadoopJob + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SparkJob. */ + interface ISparkJob { + + /** SparkJob mainJarFileUri */ + mainJarFileUri?: (string|null); + + /** SparkJob mainClass */ + mainClass?: (string|null); + + /** SparkJob args */ + args?: (string[]|null); + + /** SparkJob jarFileUris */ + jarFileUris?: (string[]|null); + + /** SparkJob fileUris */ + fileUris?: (string[]|null); + + /** SparkJob archiveUris */ + archiveUris?: (string[]|null); + + /** SparkJob properties */ + properties?: ({ [k: string]: string }|null); + + /** SparkJob loggingConfig */ + loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); + } + + /** Represents a SparkJob. */ + class SparkJob implements ISparkJob { + + /** + * Constructs a new SparkJob. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.ISparkJob); + + /** SparkJob mainJarFileUri. */ + public mainJarFileUri?: (string|null); + + /** SparkJob mainClass. */ + public mainClass?: (string|null); + + /** SparkJob args. */ + public args: string[]; + + /** SparkJob jarFileUris. */ + public jarFileUris: string[]; + + /** SparkJob fileUris. */ + public fileUris: string[]; + + /** SparkJob archiveUris. */ + public archiveUris: string[]; + + /** SparkJob properties. */ + public properties: { [k: string]: string }; + + /** SparkJob loggingConfig. */ + public loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); + + /** SparkJob driver. */ + public driver?: ("mainJarFileUri"|"mainClass"); + + /** + * Creates a new SparkJob instance using the specified properties. + * @param [properties] Properties to set + * @returns SparkJob instance + */ + public static create(properties?: google.cloud.dataproc.v1.ISparkJob): google.cloud.dataproc.v1.SparkJob; + + /** + * Encodes the specified SparkJob message. Does not implicitly {@link google.cloud.dataproc.v1.SparkJob.verify|verify} messages. + * @param message SparkJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.ISparkJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SparkJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SparkJob.verify|verify} messages. + * @param message SparkJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.ISparkJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SparkJob message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SparkJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.SparkJob; + + /** + * Decodes a SparkJob message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SparkJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.SparkJob; + + /** + * Verifies a SparkJob message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SparkJob message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SparkJob + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.SparkJob; + + /** + * Creates a plain object from a SparkJob message. Also converts values to other types if specified. + * @param message SparkJob + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.SparkJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SparkJob to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SparkJob + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PySparkJob. */ + interface IPySparkJob { + + /** PySparkJob mainPythonFileUri */ + mainPythonFileUri?: (string|null); + + /** PySparkJob args */ + args?: (string[]|null); + + /** PySparkJob pythonFileUris */ + pythonFileUris?: (string[]|null); + + /** PySparkJob jarFileUris */ + jarFileUris?: (string[]|null); + + /** PySparkJob fileUris */ + fileUris?: (string[]|null); + + /** PySparkJob archiveUris */ + archiveUris?: (string[]|null); + + /** PySparkJob properties */ + properties?: ({ [k: string]: string }|null); + + /** PySparkJob loggingConfig */ + loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); + } + + /** Represents a PySparkJob. */ + class PySparkJob implements IPySparkJob { + + /** + * Constructs a new PySparkJob. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IPySparkJob); + + /** PySparkJob mainPythonFileUri. */ + public mainPythonFileUri: string; + + /** PySparkJob args. */ + public args: string[]; + + /** PySparkJob pythonFileUris. */ + public pythonFileUris: string[]; + + /** PySparkJob jarFileUris. */ + public jarFileUris: string[]; + + /** PySparkJob fileUris. */ + public fileUris: string[]; + + /** PySparkJob archiveUris. */ + public archiveUris: string[]; + + /** PySparkJob properties. */ + public properties: { [k: string]: string }; + + /** PySparkJob loggingConfig. */ + public loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); + + /** + * Creates a new PySparkJob instance using the specified properties. + * @param [properties] Properties to set + * @returns PySparkJob instance + */ + public static create(properties?: google.cloud.dataproc.v1.IPySparkJob): google.cloud.dataproc.v1.PySparkJob; + + /** + * Encodes the specified PySparkJob message. Does not implicitly {@link google.cloud.dataproc.v1.PySparkJob.verify|verify} messages. + * @param message PySparkJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IPySparkJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PySparkJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.PySparkJob.verify|verify} messages. + * @param message PySparkJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IPySparkJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PySparkJob message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PySparkJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.PySparkJob; + + /** + * Decodes a PySparkJob message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PySparkJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.PySparkJob; + + /** + * Verifies a PySparkJob message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PySparkJob message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PySparkJob + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.PySparkJob; + + /** + * Creates a plain object from a PySparkJob message. Also converts values to other types if specified. + * @param message PySparkJob + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.PySparkJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PySparkJob to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PySparkJob + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QueryList. */ + interface IQueryList { + + /** QueryList queries */ + queries?: (string[]|null); + } + + /** Represents a QueryList. */ + class QueryList implements IQueryList { + + /** + * Constructs a new QueryList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IQueryList); + + /** QueryList queries. */ + public queries: string[]; + + /** + * Creates a new QueryList instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryList instance + */ + public static create(properties?: google.cloud.dataproc.v1.IQueryList): google.cloud.dataproc.v1.QueryList; + + /** + * Encodes the specified QueryList message. Does not implicitly {@link google.cloud.dataproc.v1.QueryList.verify|verify} messages. + * @param message QueryList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IQueryList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryList message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.QueryList.verify|verify} messages. + * @param message QueryList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IQueryList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.QueryList; + + /** + * Decodes a QueryList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.QueryList; + + /** + * Verifies a QueryList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.QueryList; + + /** + * Creates a plain object from a QueryList message. Also converts values to other types if specified. + * @param message QueryList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.QueryList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HiveJob. */ + interface IHiveJob { + + /** HiveJob queryFileUri */ + queryFileUri?: (string|null); + + /** HiveJob queryList */ + queryList?: (google.cloud.dataproc.v1.IQueryList|null); + + /** HiveJob continueOnFailure */ + continueOnFailure?: (boolean|null); + + /** HiveJob scriptVariables */ + scriptVariables?: ({ [k: string]: string }|null); + + /** HiveJob properties */ + properties?: ({ [k: string]: string }|null); + + /** HiveJob jarFileUris */ + jarFileUris?: (string[]|null); + } + + /** Represents a HiveJob. */ + class HiveJob implements IHiveJob { + + /** + * Constructs a new HiveJob. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IHiveJob); + + /** HiveJob queryFileUri. */ + public queryFileUri?: (string|null); + + /** HiveJob queryList. */ + public queryList?: (google.cloud.dataproc.v1.IQueryList|null); + + /** HiveJob continueOnFailure. */ + public continueOnFailure: boolean; + + /** HiveJob scriptVariables. */ + public scriptVariables: { [k: string]: string }; + + /** HiveJob properties. */ + public properties: { [k: string]: string }; + + /** HiveJob jarFileUris. */ + public jarFileUris: string[]; + + /** HiveJob queries. */ + public queries?: ("queryFileUri"|"queryList"); + + /** + * Creates a new HiveJob instance using the specified properties. + * @param [properties] Properties to set + * @returns HiveJob instance + */ + public static create(properties?: google.cloud.dataproc.v1.IHiveJob): google.cloud.dataproc.v1.HiveJob; + + /** + * Encodes the specified HiveJob message. Does not implicitly {@link google.cloud.dataproc.v1.HiveJob.verify|verify} messages. + * @param message HiveJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IHiveJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HiveJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.HiveJob.verify|verify} messages. + * @param message HiveJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IHiveJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HiveJob message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HiveJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.HiveJob; + + /** + * Decodes a HiveJob message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HiveJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.HiveJob; + + /** + * Verifies a HiveJob message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HiveJob message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HiveJob + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.HiveJob; + + /** + * Creates a plain object from a HiveJob message. Also converts values to other types if specified. + * @param message HiveJob + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.HiveJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HiveJob to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HiveJob + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SparkSqlJob. */ + interface ISparkSqlJob { + + /** SparkSqlJob queryFileUri */ + queryFileUri?: (string|null); + + /** SparkSqlJob queryList */ + queryList?: (google.cloud.dataproc.v1.IQueryList|null); + + /** SparkSqlJob scriptVariables */ + scriptVariables?: ({ [k: string]: string }|null); + + /** SparkSqlJob properties */ + properties?: ({ [k: string]: string }|null); + + /** SparkSqlJob jarFileUris */ + jarFileUris?: (string[]|null); + + /** SparkSqlJob loggingConfig */ + loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); + } + + /** Represents a SparkSqlJob. */ + class SparkSqlJob implements ISparkSqlJob { + + /** + * Constructs a new SparkSqlJob. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.ISparkSqlJob); + + /** SparkSqlJob queryFileUri. */ + public queryFileUri?: (string|null); + + /** SparkSqlJob queryList. */ + public queryList?: (google.cloud.dataproc.v1.IQueryList|null); + + /** SparkSqlJob scriptVariables. */ + public scriptVariables: { [k: string]: string }; + + /** SparkSqlJob properties. */ + public properties: { [k: string]: string }; + + /** SparkSqlJob jarFileUris. */ + public jarFileUris: string[]; + + /** SparkSqlJob loggingConfig. */ + public loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); + + /** SparkSqlJob queries. */ + public queries?: ("queryFileUri"|"queryList"); + + /** + * Creates a new SparkSqlJob instance using the specified properties. + * @param [properties] Properties to set + * @returns SparkSqlJob instance + */ + public static create(properties?: google.cloud.dataproc.v1.ISparkSqlJob): google.cloud.dataproc.v1.SparkSqlJob; + + /** + * Encodes the specified SparkSqlJob message. Does not implicitly {@link google.cloud.dataproc.v1.SparkSqlJob.verify|verify} messages. + * @param message SparkSqlJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.ISparkSqlJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SparkSqlJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SparkSqlJob.verify|verify} messages. + * @param message SparkSqlJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.ISparkSqlJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SparkSqlJob message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SparkSqlJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.SparkSqlJob; + + /** + * Decodes a SparkSqlJob message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SparkSqlJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.SparkSqlJob; + + /** + * Verifies a SparkSqlJob message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SparkSqlJob message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SparkSqlJob + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.SparkSqlJob; + + /** + * Creates a plain object from a SparkSqlJob message. Also converts values to other types if specified. + * @param message SparkSqlJob + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.SparkSqlJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SparkSqlJob to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SparkSqlJob + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PigJob. */ + interface IPigJob { + + /** PigJob queryFileUri */ + queryFileUri?: (string|null); + + /** PigJob queryList */ + queryList?: (google.cloud.dataproc.v1.IQueryList|null); + + /** PigJob continueOnFailure */ + continueOnFailure?: (boolean|null); + + /** PigJob scriptVariables */ + scriptVariables?: ({ [k: string]: string }|null); + + /** PigJob properties */ + properties?: ({ [k: string]: string }|null); + + /** PigJob jarFileUris */ + jarFileUris?: (string[]|null); + + /** PigJob loggingConfig */ + loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); + } + + /** Represents a PigJob. */ + class PigJob implements IPigJob { + + /** + * Constructs a new PigJob. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IPigJob); + + /** PigJob queryFileUri. */ + public queryFileUri?: (string|null); + + /** PigJob queryList. */ + public queryList?: (google.cloud.dataproc.v1.IQueryList|null); + + /** PigJob continueOnFailure. */ + public continueOnFailure: boolean; + + /** PigJob scriptVariables. */ + public scriptVariables: { [k: string]: string }; + + /** PigJob properties. */ + public properties: { [k: string]: string }; + + /** PigJob jarFileUris. */ + public jarFileUris: string[]; + + /** PigJob loggingConfig. */ + public loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); + + /** PigJob queries. */ + public queries?: ("queryFileUri"|"queryList"); + + /** + * Creates a new PigJob instance using the specified properties. + * @param [properties] Properties to set + * @returns PigJob instance + */ + public static create(properties?: google.cloud.dataproc.v1.IPigJob): google.cloud.dataproc.v1.PigJob; + + /** + * Encodes the specified PigJob message. Does not implicitly {@link google.cloud.dataproc.v1.PigJob.verify|verify} messages. + * @param message PigJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IPigJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PigJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.PigJob.verify|verify} messages. + * @param message PigJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IPigJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PigJob message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PigJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.PigJob; + + /** + * Decodes a PigJob message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PigJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.PigJob; + + /** + * Verifies a PigJob message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PigJob message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PigJob + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.PigJob; + + /** + * Creates a plain object from a PigJob message. Also converts values to other types if specified. + * @param message PigJob + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.PigJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PigJob to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PigJob + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SparkRJob. */ + interface ISparkRJob { + + /** SparkRJob mainRFileUri */ + mainRFileUri?: (string|null); + + /** SparkRJob args */ + args?: (string[]|null); + + /** SparkRJob fileUris */ + fileUris?: (string[]|null); + + /** SparkRJob archiveUris */ + archiveUris?: (string[]|null); + + /** SparkRJob properties */ + properties?: ({ [k: string]: string }|null); + + /** SparkRJob loggingConfig */ + loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); + } + + /** Represents a SparkRJob. */ + class SparkRJob implements ISparkRJob { + + /** + * Constructs a new SparkRJob. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.ISparkRJob); + + /** SparkRJob mainRFileUri. */ + public mainRFileUri: string; + + /** SparkRJob args. */ + public args: string[]; + + /** SparkRJob fileUris. */ + public fileUris: string[]; + + /** SparkRJob archiveUris. */ + public archiveUris: string[]; + + /** SparkRJob properties. */ + public properties: { [k: string]: string }; + + /** SparkRJob loggingConfig. */ + public loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); + + /** + * Creates a new SparkRJob instance using the specified properties. + * @param [properties] Properties to set + * @returns SparkRJob instance + */ + public static create(properties?: google.cloud.dataproc.v1.ISparkRJob): google.cloud.dataproc.v1.SparkRJob; + + /** + * Encodes the specified SparkRJob message. Does not implicitly {@link google.cloud.dataproc.v1.SparkRJob.verify|verify} messages. + * @param message SparkRJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.ISparkRJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SparkRJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SparkRJob.verify|verify} messages. + * @param message SparkRJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.ISparkRJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SparkRJob message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SparkRJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.SparkRJob; + + /** + * Decodes a SparkRJob message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SparkRJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.SparkRJob; + + /** + * Verifies a SparkRJob message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SparkRJob message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SparkRJob + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.SparkRJob; + + /** + * Creates a plain object from a SparkRJob message. Also converts values to other types if specified. + * @param message SparkRJob + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.SparkRJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SparkRJob to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SparkRJob + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PrestoJob. */ + interface IPrestoJob { + + /** PrestoJob queryFileUri */ + queryFileUri?: (string|null); + + /** PrestoJob queryList */ + queryList?: (google.cloud.dataproc.v1.IQueryList|null); + + /** PrestoJob continueOnFailure */ + continueOnFailure?: (boolean|null); + + /** PrestoJob outputFormat */ + outputFormat?: (string|null); + + /** PrestoJob clientTags */ + clientTags?: (string[]|null); + + /** PrestoJob properties */ + properties?: ({ [k: string]: string }|null); + + /** PrestoJob loggingConfig */ + loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); + } + + /** Represents a PrestoJob. */ + class PrestoJob implements IPrestoJob { + + /** + * Constructs a new PrestoJob. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IPrestoJob); + + /** PrestoJob queryFileUri. */ + public queryFileUri?: (string|null); + + /** PrestoJob queryList. */ + public queryList?: (google.cloud.dataproc.v1.IQueryList|null); + + /** PrestoJob continueOnFailure. */ + public continueOnFailure: boolean; + + /** PrestoJob outputFormat. */ + public outputFormat: string; + + /** PrestoJob clientTags. */ + public clientTags: string[]; + + /** PrestoJob properties. */ + public properties: { [k: string]: string }; + + /** PrestoJob loggingConfig. */ + public loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); + + /** PrestoJob queries. */ + public queries?: ("queryFileUri"|"queryList"); + + /** + * Creates a new PrestoJob instance using the specified properties. + * @param [properties] Properties to set + * @returns PrestoJob instance + */ + public static create(properties?: google.cloud.dataproc.v1.IPrestoJob): google.cloud.dataproc.v1.PrestoJob; + + /** + * Encodes the specified PrestoJob message. Does not implicitly {@link google.cloud.dataproc.v1.PrestoJob.verify|verify} messages. + * @param message PrestoJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IPrestoJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PrestoJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.PrestoJob.verify|verify} messages. + * @param message PrestoJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IPrestoJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PrestoJob message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrestoJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.PrestoJob; + + /** + * Decodes a PrestoJob message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrestoJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.PrestoJob; + + /** + * Verifies a PrestoJob message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PrestoJob message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrestoJob + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.PrestoJob; + + /** + * Creates a plain object from a PrestoJob message. Also converts values to other types if specified. + * @param message PrestoJob + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.PrestoJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PrestoJob to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PrestoJob + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TrinoJob. */ + interface ITrinoJob { + + /** TrinoJob queryFileUri */ + queryFileUri?: (string|null); + + /** TrinoJob queryList */ + queryList?: (google.cloud.dataproc.v1.IQueryList|null); + + /** TrinoJob continueOnFailure */ + continueOnFailure?: (boolean|null); + + /** TrinoJob outputFormat */ + outputFormat?: (string|null); + + /** TrinoJob clientTags */ + clientTags?: (string[]|null); + + /** TrinoJob properties */ + properties?: ({ [k: string]: string }|null); + + /** TrinoJob loggingConfig */ + loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); + } + + /** Represents a TrinoJob. */ + class TrinoJob implements ITrinoJob { + + /** + * Constructs a new TrinoJob. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.ITrinoJob); + + /** TrinoJob queryFileUri. */ + public queryFileUri?: (string|null); + + /** TrinoJob queryList. */ + public queryList?: (google.cloud.dataproc.v1.IQueryList|null); + + /** TrinoJob continueOnFailure. */ + public continueOnFailure: boolean; + + /** TrinoJob outputFormat. */ + public outputFormat: string; + + /** TrinoJob clientTags. */ + public clientTags: string[]; + + /** TrinoJob properties. */ + public properties: { [k: string]: string }; + + /** TrinoJob loggingConfig. */ + public loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); + + /** TrinoJob queries. */ + public queries?: ("queryFileUri"|"queryList"); + + /** + * Creates a new TrinoJob instance using the specified properties. + * @param [properties] Properties to set + * @returns TrinoJob instance + */ + public static create(properties?: google.cloud.dataproc.v1.ITrinoJob): google.cloud.dataproc.v1.TrinoJob; + + /** + * Encodes the specified TrinoJob message. Does not implicitly {@link google.cloud.dataproc.v1.TrinoJob.verify|verify} messages. + * @param message TrinoJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.ITrinoJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TrinoJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.TrinoJob.verify|verify} messages. + * @param message TrinoJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.ITrinoJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TrinoJob message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TrinoJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.TrinoJob; + + /** + * Decodes a TrinoJob message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TrinoJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.TrinoJob; + + /** + * Verifies a TrinoJob message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TrinoJob message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TrinoJob + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.TrinoJob; + + /** + * Creates a plain object from a TrinoJob message. Also converts values to other types if specified. + * @param message TrinoJob + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.TrinoJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TrinoJob to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TrinoJob + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FlinkJob. */ + interface IFlinkJob { + + /** FlinkJob mainJarFileUri */ + mainJarFileUri?: (string|null); + + /** FlinkJob mainClass */ + mainClass?: (string|null); + + /** FlinkJob args */ + args?: (string[]|null); + + /** FlinkJob jarFileUris */ + jarFileUris?: (string[]|null); + + /** FlinkJob savepointUri */ + savepointUri?: (string|null); + + /** FlinkJob properties */ + properties?: ({ [k: string]: string }|null); + + /** FlinkJob loggingConfig */ + loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); + } + + /** Represents a FlinkJob. */ + class FlinkJob implements IFlinkJob { + + /** + * Constructs a new FlinkJob. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IFlinkJob); + + /** FlinkJob mainJarFileUri. */ + public mainJarFileUri?: (string|null); + + /** FlinkJob mainClass. */ + public mainClass?: (string|null); + + /** FlinkJob args. */ + public args: string[]; + + /** FlinkJob jarFileUris. */ + public jarFileUris: string[]; + + /** FlinkJob savepointUri. */ + public savepointUri: string; + + /** FlinkJob properties. */ + public properties: { [k: string]: string }; + + /** FlinkJob loggingConfig. */ + public loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); + + /** FlinkJob driver. */ + public driver?: ("mainJarFileUri"|"mainClass"); + + /** + * Creates a new FlinkJob instance using the specified properties. + * @param [properties] Properties to set + * @returns FlinkJob instance + */ + public static create(properties?: google.cloud.dataproc.v1.IFlinkJob): google.cloud.dataproc.v1.FlinkJob; + + /** + * Encodes the specified FlinkJob message. Does not implicitly {@link google.cloud.dataproc.v1.FlinkJob.verify|verify} messages. + * @param message FlinkJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IFlinkJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FlinkJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.FlinkJob.verify|verify} messages. + * @param message FlinkJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IFlinkJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FlinkJob message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FlinkJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.FlinkJob; + + /** + * Decodes a FlinkJob message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FlinkJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.FlinkJob; + + /** + * Verifies a FlinkJob message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FlinkJob message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FlinkJob + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.FlinkJob; + + /** + * Creates a plain object from a FlinkJob message. Also converts values to other types if specified. + * @param message FlinkJob + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.FlinkJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FlinkJob to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FlinkJob + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JobPlacement. */ + interface IJobPlacement { + + /** JobPlacement clusterName */ + clusterName?: (string|null); + + /** JobPlacement clusterUuid */ + clusterUuid?: (string|null); + + /** JobPlacement clusterLabels */ + clusterLabels?: ({ [k: string]: string }|null); + } + + /** Represents a JobPlacement. */ + class JobPlacement implements IJobPlacement { + + /** + * Constructs a new JobPlacement. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IJobPlacement); + + /** JobPlacement clusterName. */ + public clusterName: string; + + /** JobPlacement clusterUuid. */ + public clusterUuid: string; + + /** JobPlacement clusterLabels. */ + public clusterLabels: { [k: string]: string }; + + /** + * Creates a new JobPlacement instance using the specified properties. + * @param [properties] Properties to set + * @returns JobPlacement instance + */ + public static create(properties?: google.cloud.dataproc.v1.IJobPlacement): google.cloud.dataproc.v1.JobPlacement; + + /** + * Encodes the specified JobPlacement message. Does not implicitly {@link google.cloud.dataproc.v1.JobPlacement.verify|verify} messages. + * @param message JobPlacement message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IJobPlacement, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobPlacement message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.JobPlacement.verify|verify} messages. + * @param message JobPlacement message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IJobPlacement, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobPlacement message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobPlacement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.JobPlacement; + + /** + * Decodes a JobPlacement message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobPlacement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.JobPlacement; + + /** + * Verifies a JobPlacement message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobPlacement message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobPlacement + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.JobPlacement; + + /** + * Creates a plain object from a JobPlacement message. Also converts values to other types if specified. + * @param message JobPlacement + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.JobPlacement, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobPlacement to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobPlacement + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JobStatus. */ + interface IJobStatus { + + /** JobStatus state */ + state?: (google.cloud.dataproc.v1.JobStatus.State|keyof typeof google.cloud.dataproc.v1.JobStatus.State|null); + + /** JobStatus details */ + details?: (string|null); + + /** JobStatus stateStartTime */ + stateStartTime?: (google.protobuf.ITimestamp|null); + + /** JobStatus substate */ + substate?: (google.cloud.dataproc.v1.JobStatus.Substate|keyof typeof google.cloud.dataproc.v1.JobStatus.Substate|null); + } + + /** Represents a JobStatus. */ + class JobStatus implements IJobStatus { + + /** + * Constructs a new JobStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IJobStatus); + + /** JobStatus state. */ + public state: (google.cloud.dataproc.v1.JobStatus.State|keyof typeof google.cloud.dataproc.v1.JobStatus.State); + + /** JobStatus details. */ + public details: string; + + /** JobStatus stateStartTime. */ + public stateStartTime?: (google.protobuf.ITimestamp|null); + + /** JobStatus substate. */ + public substate: (google.cloud.dataproc.v1.JobStatus.Substate|keyof typeof google.cloud.dataproc.v1.JobStatus.Substate); + + /** + * Creates a new JobStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns JobStatus instance + */ + public static create(properties?: google.cloud.dataproc.v1.IJobStatus): google.cloud.dataproc.v1.JobStatus; + + /** + * Encodes the specified JobStatus message. Does not implicitly {@link google.cloud.dataproc.v1.JobStatus.verify|verify} messages. + * @param message JobStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IJobStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobStatus message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.JobStatus.verify|verify} messages. + * @param message JobStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IJobStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.JobStatus; + + /** + * Decodes a JobStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.JobStatus; + + /** + * Verifies a JobStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.JobStatus; + + /** + * Creates a plain object from a JobStatus message. Also converts values to other types if specified. + * @param message JobStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.JobStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace JobStatus { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PENDING = 1, + SETUP_DONE = 8, + RUNNING = 2, + CANCEL_PENDING = 3, + CANCEL_STARTED = 7, + CANCELLED = 4, + DONE = 5, + ERROR = 6, + ATTEMPT_FAILURE = 9 + } + + /** Substate enum. */ + enum Substate { + UNSPECIFIED = 0, + SUBMITTED = 1, + QUEUED = 2, + STALE_STATUS = 3 + } + } + + /** Properties of a JobReference. */ + interface IJobReference { + + /** JobReference projectId */ + projectId?: (string|null); + + /** JobReference jobId */ + jobId?: (string|null); + } + + /** Represents a JobReference. */ + class JobReference implements IJobReference { + + /** + * Constructs a new JobReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IJobReference); + + /** JobReference projectId. */ + public projectId: string; + + /** JobReference jobId. */ + public jobId: string; + + /** + * Creates a new JobReference instance using the specified properties. + * @param [properties] Properties to set + * @returns JobReference instance + */ + public static create(properties?: google.cloud.dataproc.v1.IJobReference): google.cloud.dataproc.v1.JobReference; + + /** + * Encodes the specified JobReference message. Does not implicitly {@link google.cloud.dataproc.v1.JobReference.verify|verify} messages. + * @param message JobReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IJobReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobReference message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.JobReference.verify|verify} messages. + * @param message JobReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IJobReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.JobReference; + + /** + * Decodes a JobReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.JobReference; + + /** + * Verifies a JobReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.JobReference; + + /** + * Creates a plain object from a JobReference message. Also converts values to other types if specified. + * @param message JobReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.JobReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a YarnApplication. */ + interface IYarnApplication { + + /** YarnApplication name */ + name?: (string|null); + + /** YarnApplication state */ + state?: (google.cloud.dataproc.v1.YarnApplication.State|keyof typeof google.cloud.dataproc.v1.YarnApplication.State|null); + + /** YarnApplication progress */ + progress?: (number|null); + + /** YarnApplication trackingUrl */ + trackingUrl?: (string|null); + } + + /** Represents a YarnApplication. */ + class YarnApplication implements IYarnApplication { + + /** + * Constructs a new YarnApplication. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IYarnApplication); + + /** YarnApplication name. */ + public name: string; + + /** YarnApplication state. */ + public state: (google.cloud.dataproc.v1.YarnApplication.State|keyof typeof google.cloud.dataproc.v1.YarnApplication.State); + + /** YarnApplication progress. */ + public progress: number; + + /** YarnApplication trackingUrl. */ + public trackingUrl: string; + + /** + * Creates a new YarnApplication instance using the specified properties. + * @param [properties] Properties to set + * @returns YarnApplication instance + */ + public static create(properties?: google.cloud.dataproc.v1.IYarnApplication): google.cloud.dataproc.v1.YarnApplication; + + /** + * Encodes the specified YarnApplication message. Does not implicitly {@link google.cloud.dataproc.v1.YarnApplication.verify|verify} messages. + * @param message YarnApplication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IYarnApplication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified YarnApplication message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.YarnApplication.verify|verify} messages. + * @param message YarnApplication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IYarnApplication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a YarnApplication message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns YarnApplication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.YarnApplication; + + /** + * Decodes a YarnApplication message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns YarnApplication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.YarnApplication; + + /** + * Verifies a YarnApplication message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a YarnApplication message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns YarnApplication + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.YarnApplication; + + /** + * Creates a plain object from a YarnApplication message. Also converts values to other types if specified. + * @param message YarnApplication + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.YarnApplication, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this YarnApplication to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for YarnApplication + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace YarnApplication { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + NEW = 1, + NEW_SAVING = 2, + SUBMITTED = 3, + ACCEPTED = 4, + RUNNING = 5, + FINISHED = 6, + FAILED = 7, + KILLED = 8 + } + } + + /** Properties of a Job. */ + interface IJob { + + /** Job reference */ + reference?: (google.cloud.dataproc.v1.IJobReference|null); + + /** Job placement */ + placement?: (google.cloud.dataproc.v1.IJobPlacement|null); + + /** Job hadoopJob */ + hadoopJob?: (google.cloud.dataproc.v1.IHadoopJob|null); + + /** Job sparkJob */ + sparkJob?: (google.cloud.dataproc.v1.ISparkJob|null); + + /** Job pysparkJob */ + pysparkJob?: (google.cloud.dataproc.v1.IPySparkJob|null); + + /** Job hiveJob */ + hiveJob?: (google.cloud.dataproc.v1.IHiveJob|null); + + /** Job pigJob */ + pigJob?: (google.cloud.dataproc.v1.IPigJob|null); + + /** Job sparkRJob */ + sparkRJob?: (google.cloud.dataproc.v1.ISparkRJob|null); + + /** Job sparkSqlJob */ + sparkSqlJob?: (google.cloud.dataproc.v1.ISparkSqlJob|null); + + /** Job prestoJob */ + prestoJob?: (google.cloud.dataproc.v1.IPrestoJob|null); + + /** Job trinoJob */ + trinoJob?: (google.cloud.dataproc.v1.ITrinoJob|null); + + /** Job flinkJob */ + flinkJob?: (google.cloud.dataproc.v1.IFlinkJob|null); + + /** Job status */ + status?: (google.cloud.dataproc.v1.IJobStatus|null); + + /** Job statusHistory */ + statusHistory?: (google.cloud.dataproc.v1.IJobStatus[]|null); + + /** Job yarnApplications */ + yarnApplications?: (google.cloud.dataproc.v1.IYarnApplication[]|null); + + /** Job driverOutputResourceUri */ + driverOutputResourceUri?: (string|null); + + /** Job driverControlFilesUri */ + driverControlFilesUri?: (string|null); + + /** Job labels */ + labels?: ({ [k: string]: string }|null); + + /** Job scheduling */ + scheduling?: (google.cloud.dataproc.v1.IJobScheduling|null); + + /** Job jobUuid */ + jobUuid?: (string|null); + + /** Job done */ + done?: (boolean|null); + + /** Job driverSchedulingConfig */ + driverSchedulingConfig?: (google.cloud.dataproc.v1.IDriverSchedulingConfig|null); + } + + /** Represents a Job. */ + class Job implements IJob { + + /** + * Constructs a new Job. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IJob); + + /** Job reference. */ + public reference?: (google.cloud.dataproc.v1.IJobReference|null); + + /** Job placement. */ + public placement?: (google.cloud.dataproc.v1.IJobPlacement|null); + + /** Job hadoopJob. */ + public hadoopJob?: (google.cloud.dataproc.v1.IHadoopJob|null); + + /** Job sparkJob. */ + public sparkJob?: (google.cloud.dataproc.v1.ISparkJob|null); + + /** Job pysparkJob. */ + public pysparkJob?: (google.cloud.dataproc.v1.IPySparkJob|null); + + /** Job hiveJob. */ + public hiveJob?: (google.cloud.dataproc.v1.IHiveJob|null); + + /** Job pigJob. */ + public pigJob?: (google.cloud.dataproc.v1.IPigJob|null); + + /** Job sparkRJob. */ + public sparkRJob?: (google.cloud.dataproc.v1.ISparkRJob|null); + + /** Job sparkSqlJob. */ + public sparkSqlJob?: (google.cloud.dataproc.v1.ISparkSqlJob|null); + + /** Job prestoJob. */ + public prestoJob?: (google.cloud.dataproc.v1.IPrestoJob|null); + + /** Job trinoJob. */ + public trinoJob?: (google.cloud.dataproc.v1.ITrinoJob|null); + + /** Job flinkJob. */ + public flinkJob?: (google.cloud.dataproc.v1.IFlinkJob|null); + + /** Job status. */ + public status?: (google.cloud.dataproc.v1.IJobStatus|null); + + /** Job statusHistory. */ + public statusHistory: google.cloud.dataproc.v1.IJobStatus[]; + + /** Job yarnApplications. */ + public yarnApplications: google.cloud.dataproc.v1.IYarnApplication[]; + + /** Job driverOutputResourceUri. */ + public driverOutputResourceUri: string; + + /** Job driverControlFilesUri. */ + public driverControlFilesUri: string; + + /** Job labels. */ + public labels: { [k: string]: string }; + + /** Job scheduling. */ + public scheduling?: (google.cloud.dataproc.v1.IJobScheduling|null); + + /** Job jobUuid. */ + public jobUuid: string; + + /** Job done. */ + public done: boolean; + + /** Job driverSchedulingConfig. */ + public driverSchedulingConfig?: (google.cloud.dataproc.v1.IDriverSchedulingConfig|null); + + /** Job typeJob. */ + public typeJob?: ("hadoopJob"|"sparkJob"|"pysparkJob"|"hiveJob"|"pigJob"|"sparkRJob"|"sparkSqlJob"|"prestoJob"|"trinoJob"|"flinkJob"); + + /** + * Creates a new Job instance using the specified properties. + * @param [properties] Properties to set + * @returns Job instance + */ + public static create(properties?: google.cloud.dataproc.v1.IJob): google.cloud.dataproc.v1.Job; + + /** + * Encodes the specified Job message. Does not implicitly {@link google.cloud.dataproc.v1.Job.verify|verify} messages. + * @param message Job message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.Job.verify|verify} messages. + * @param message Job message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Job message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.Job; + + /** + * Decodes a Job message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.Job; + + /** + * Verifies a Job message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Job message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Job + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.Job; + + /** + * Creates a plain object from a Job message. Also converts values to other types if specified. + * @param message Job + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.Job, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Job to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Job + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DriverSchedulingConfig. */ + interface IDriverSchedulingConfig { + + /** DriverSchedulingConfig memoryMb */ + memoryMb?: (number|null); + + /** DriverSchedulingConfig vcores */ + vcores?: (number|null); + } + + /** Represents a DriverSchedulingConfig. */ + class DriverSchedulingConfig implements IDriverSchedulingConfig { + + /** + * Constructs a new DriverSchedulingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IDriverSchedulingConfig); + + /** DriverSchedulingConfig memoryMb. */ + public memoryMb: number; + + /** DriverSchedulingConfig vcores. */ + public vcores: number; + + /** + * Creates a new DriverSchedulingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns DriverSchedulingConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IDriverSchedulingConfig): google.cloud.dataproc.v1.DriverSchedulingConfig; + + /** + * Encodes the specified DriverSchedulingConfig message. Does not implicitly {@link google.cloud.dataproc.v1.DriverSchedulingConfig.verify|verify} messages. + * @param message DriverSchedulingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IDriverSchedulingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DriverSchedulingConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DriverSchedulingConfig.verify|verify} messages. + * @param message DriverSchedulingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IDriverSchedulingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DriverSchedulingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DriverSchedulingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.DriverSchedulingConfig; + + /** + * Decodes a DriverSchedulingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DriverSchedulingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.DriverSchedulingConfig; + + /** + * Verifies a DriverSchedulingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DriverSchedulingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DriverSchedulingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.DriverSchedulingConfig; + + /** + * Creates a plain object from a DriverSchedulingConfig message. Also converts values to other types if specified. + * @param message DriverSchedulingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.DriverSchedulingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DriverSchedulingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DriverSchedulingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JobScheduling. */ + interface IJobScheduling { + + /** JobScheduling maxFailuresPerHour */ + maxFailuresPerHour?: (number|null); + + /** JobScheduling maxFailuresTotal */ + maxFailuresTotal?: (number|null); + } + + /** Represents a JobScheduling. */ + class JobScheduling implements IJobScheduling { + + /** + * Constructs a new JobScheduling. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IJobScheduling); + + /** JobScheduling maxFailuresPerHour. */ + public maxFailuresPerHour: number; + + /** JobScheduling maxFailuresTotal. */ + public maxFailuresTotal: number; + + /** + * Creates a new JobScheduling instance using the specified properties. + * @param [properties] Properties to set + * @returns JobScheduling instance + */ + public static create(properties?: google.cloud.dataproc.v1.IJobScheduling): google.cloud.dataproc.v1.JobScheduling; + + /** + * Encodes the specified JobScheduling message. Does not implicitly {@link google.cloud.dataproc.v1.JobScheduling.verify|verify} messages. + * @param message JobScheduling message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IJobScheduling, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobScheduling message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.JobScheduling.verify|verify} messages. + * @param message JobScheduling message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IJobScheduling, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobScheduling message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobScheduling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.JobScheduling; + + /** + * Decodes a JobScheduling message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobScheduling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.JobScheduling; + + /** + * Verifies a JobScheduling message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobScheduling message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobScheduling + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.JobScheduling; + + /** + * Creates a plain object from a JobScheduling message. Also converts values to other types if specified. + * @param message JobScheduling + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.JobScheduling, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobScheduling to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobScheduling + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SubmitJobRequest. */ + interface ISubmitJobRequest { + + /** SubmitJobRequest projectId */ + projectId?: (string|null); + + /** SubmitJobRequest region */ + region?: (string|null); + + /** SubmitJobRequest job */ + job?: (google.cloud.dataproc.v1.IJob|null); + + /** SubmitJobRequest requestId */ + requestId?: (string|null); + } + + /** Represents a SubmitJobRequest. */ + class SubmitJobRequest implements ISubmitJobRequest { + + /** + * Constructs a new SubmitJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.ISubmitJobRequest); + + /** SubmitJobRequest projectId. */ + public projectId: string; + + /** SubmitJobRequest region. */ + public region: string; + + /** SubmitJobRequest job. */ + public job?: (google.cloud.dataproc.v1.IJob|null); + + /** SubmitJobRequest requestId. */ + public requestId: string; + + /** + * Creates a new SubmitJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SubmitJobRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.ISubmitJobRequest): google.cloud.dataproc.v1.SubmitJobRequest; + + /** + * Encodes the specified SubmitJobRequest message. Does not implicitly {@link google.cloud.dataproc.v1.SubmitJobRequest.verify|verify} messages. + * @param message SubmitJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.ISubmitJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubmitJobRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SubmitJobRequest.verify|verify} messages. + * @param message SubmitJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.ISubmitJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubmitJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubmitJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.SubmitJobRequest; + + /** + * Decodes a SubmitJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubmitJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.SubmitJobRequest; + + /** + * Verifies a SubmitJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SubmitJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubmitJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.SubmitJobRequest; + + /** + * Creates a plain object from a SubmitJobRequest message. Also converts values to other types if specified. + * @param message SubmitJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.SubmitJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubmitJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SubmitJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JobMetadata. */ + interface IJobMetadata { + + /** JobMetadata jobId */ + jobId?: (string|null); + + /** JobMetadata status */ + status?: (google.cloud.dataproc.v1.IJobStatus|null); + + /** JobMetadata operationType */ + operationType?: (string|null); + + /** JobMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a JobMetadata. */ + class JobMetadata implements IJobMetadata { + + /** + * Constructs a new JobMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IJobMetadata); + + /** JobMetadata jobId. */ + public jobId: string; + + /** JobMetadata status. */ + public status?: (google.cloud.dataproc.v1.IJobStatus|null); + + /** JobMetadata operationType. */ + public operationType: string; + + /** JobMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new JobMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns JobMetadata instance + */ + public static create(properties?: google.cloud.dataproc.v1.IJobMetadata): google.cloud.dataproc.v1.JobMetadata; + + /** + * Encodes the specified JobMetadata message. Does not implicitly {@link google.cloud.dataproc.v1.JobMetadata.verify|verify} messages. + * @param message JobMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IJobMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JobMetadata message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.JobMetadata.verify|verify} messages. + * @param message JobMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IJobMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JobMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JobMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.JobMetadata; + + /** + * Decodes a JobMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JobMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.JobMetadata; + + /** + * Verifies a JobMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JobMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JobMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.JobMetadata; + + /** + * Creates a plain object from a JobMetadata message. Also converts values to other types if specified. + * @param message JobMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.JobMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JobMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JobMetadata + * @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 projectId */ + projectId?: (string|null); + + /** GetJobRequest region */ + region?: (string|null); + + /** GetJobRequest jobId */ + jobId?: (string|null); + } + + /** Represents a GetJobRequest. */ + class GetJobRequest implements IGetJobRequest { + + /** + * Constructs a new GetJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IGetJobRequest); + + /** GetJobRequest projectId. */ + public projectId: string; + + /** GetJobRequest region. */ + public region: string; + + /** GetJobRequest jobId. */ + public jobId: string; + + /** + * Creates a new GetJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetJobRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.IGetJobRequest): google.cloud.dataproc.v1.GetJobRequest; + + /** + * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.dataproc.v1.GetJobRequest.verify|verify} messages. + * @param message GetJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IGetJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetJobRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GetJobRequest.verify|verify} messages. + * @param message GetJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IGetJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.GetJobRequest; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.GetJobRequest; + + /** + * Verifies a GetJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.GetJobRequest; + + /** + * Creates a plain object from a GetJobRequest message. Also converts values to other types if specified. + * @param message GetJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.GetJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListJobsRequest. */ + interface IListJobsRequest { + + /** ListJobsRequest projectId */ + projectId?: (string|null); + + /** ListJobsRequest region */ + region?: (string|null); + + /** ListJobsRequest pageSize */ + pageSize?: (number|null); + + /** ListJobsRequest pageToken */ + pageToken?: (string|null); + + /** ListJobsRequest clusterName */ + clusterName?: (string|null); + + /** ListJobsRequest jobStateMatcher */ + jobStateMatcher?: (google.cloud.dataproc.v1.ListJobsRequest.JobStateMatcher|keyof typeof google.cloud.dataproc.v1.ListJobsRequest.JobStateMatcher|null); + + /** ListJobsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListJobsRequest. */ + class ListJobsRequest implements IListJobsRequest { + + /** + * Constructs a new ListJobsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IListJobsRequest); + + /** ListJobsRequest projectId. */ + public projectId: string; + + /** ListJobsRequest region. */ + public region: string; + + /** ListJobsRequest pageSize. */ + public pageSize: number; + + /** ListJobsRequest pageToken. */ + public pageToken: string; + + /** ListJobsRequest clusterName. */ + public clusterName: string; + + /** ListJobsRequest jobStateMatcher. */ + public jobStateMatcher: (google.cloud.dataproc.v1.ListJobsRequest.JobStateMatcher|keyof typeof google.cloud.dataproc.v1.ListJobsRequest.JobStateMatcher); + + /** ListJobsRequest filter. */ + public filter: string; + + /** + * Creates a new ListJobsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListJobsRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.IListJobsRequest): google.cloud.dataproc.v1.ListJobsRequest; + + /** + * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.dataproc.v1.ListJobsRequest.verify|verify} messages. + * @param message ListJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IListJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListJobsRequest.verify|verify} messages. + * @param message ListJobsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IListJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ListJobsRequest; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ListJobsRequest; + + /** + * Verifies a ListJobsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListJobsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListJobsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ListJobsRequest; + + /** + * Creates a plain object from a ListJobsRequest message. Also converts values to other types if specified. + * @param message ListJobsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.ListJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListJobsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListJobsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ListJobsRequest { + + /** JobStateMatcher enum. */ + enum JobStateMatcher { + ALL = 0, + ACTIVE = 1, + NON_ACTIVE = 2 + } + } + + /** Properties of an UpdateJobRequest. */ + interface IUpdateJobRequest { + + /** UpdateJobRequest projectId */ + projectId?: (string|null); + + /** UpdateJobRequest region */ + region?: (string|null); + + /** UpdateJobRequest jobId */ + jobId?: (string|null); + + /** UpdateJobRequest job */ + job?: (google.cloud.dataproc.v1.IJob|null); + + /** UpdateJobRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateJobRequest. */ + class UpdateJobRequest implements IUpdateJobRequest { + + /** + * Constructs a new UpdateJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IUpdateJobRequest); + + /** UpdateJobRequest projectId. */ + public projectId: string; + + /** UpdateJobRequest region. */ + public region: string; + + /** UpdateJobRequest jobId. */ + public jobId: string; + + /** UpdateJobRequest job. */ + public job?: (google.cloud.dataproc.v1.IJob|null); + + /** UpdateJobRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateJobRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.IUpdateJobRequest): google.cloud.dataproc.v1.UpdateJobRequest; + + /** + * Encodes the specified UpdateJobRequest message. Does not implicitly {@link google.cloud.dataproc.v1.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.dataproc.v1.IUpdateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateJobRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.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.dataproc.v1.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.dataproc.v1.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.dataproc.v1.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.dataproc.v1.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.dataproc.v1.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 ListJobsResponse. */ + interface IListJobsResponse { + + /** ListJobsResponse jobs */ + jobs?: (google.cloud.dataproc.v1.IJob[]|null); + + /** ListJobsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListJobsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListJobsResponse. */ + class ListJobsResponse implements IListJobsResponse { + + /** + * Constructs a new ListJobsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IListJobsResponse); + + /** ListJobsResponse jobs. */ + public jobs: google.cloud.dataproc.v1.IJob[]; + + /** ListJobsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListJobsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListJobsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListJobsResponse instance + */ + public static create(properties?: google.cloud.dataproc.v1.IListJobsResponse): google.cloud.dataproc.v1.ListJobsResponse; + + /** + * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.cloud.dataproc.v1.ListJobsResponse.verify|verify} messages. + * @param message ListJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IListJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListJobsResponse message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListJobsResponse.verify|verify} messages. + * @param message ListJobsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IListJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ListJobsResponse; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ListJobsResponse; + + /** + * Verifies a ListJobsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListJobsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListJobsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ListJobsResponse; + + /** + * Creates a plain object from a ListJobsResponse message. Also converts values to other types if specified. + * @param message ListJobsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.ListJobsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListJobsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListJobsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelJobRequest. */ + interface ICancelJobRequest { + + /** CancelJobRequest projectId */ + projectId?: (string|null); + + /** CancelJobRequest region */ + region?: (string|null); + + /** CancelJobRequest jobId */ + jobId?: (string|null); + } + + /** Represents a CancelJobRequest. */ + class CancelJobRequest implements ICancelJobRequest { + + /** + * Constructs a new CancelJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.ICancelJobRequest); + + /** CancelJobRequest projectId. */ + public projectId: string; + + /** CancelJobRequest region. */ + public region: string; + + /** CancelJobRequest jobId. */ + public jobId: string; + + /** + * Creates a new CancelJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelJobRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.ICancelJobRequest): google.cloud.dataproc.v1.CancelJobRequest; + + /** + * Encodes the specified CancelJobRequest message. Does not implicitly {@link google.cloud.dataproc.v1.CancelJobRequest.verify|verify} messages. + * @param message CancelJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.ICancelJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelJobRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.CancelJobRequest.verify|verify} messages. + * @param message CancelJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.ICancelJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.CancelJobRequest; + + /** + * Decodes a CancelJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.CancelJobRequest; + + /** + * Verifies a CancelJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.CancelJobRequest; + + /** + * Creates a plain object from a CancelJobRequest message. Also converts values to other types if specified. + * @param message CancelJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.CancelJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteJobRequest. */ + interface IDeleteJobRequest { + + /** DeleteJobRequest projectId */ + projectId?: (string|null); + + /** DeleteJobRequest region */ + region?: (string|null); + + /** DeleteJobRequest jobId */ + jobId?: (string|null); + } + + /** Represents a DeleteJobRequest. */ + class DeleteJobRequest implements IDeleteJobRequest { + + /** + * Constructs a new DeleteJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IDeleteJobRequest); + + /** DeleteJobRequest projectId. */ + public projectId: string; + + /** DeleteJobRequest region. */ + public region: string; + + /** DeleteJobRequest jobId. */ + public jobId: string; + + /** + * Creates a new DeleteJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteJobRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.IDeleteJobRequest): google.cloud.dataproc.v1.DeleteJobRequest; + + /** + * Encodes the specified DeleteJobRequest message. Does not implicitly {@link google.cloud.dataproc.v1.DeleteJobRequest.verify|verify} messages. + * @param message DeleteJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IDeleteJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteJobRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DeleteJobRequest.verify|verify} messages. + * @param message DeleteJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IDeleteJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.DeleteJobRequest; + + /** + * Decodes a DeleteJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.DeleteJobRequest; + + /** + * Verifies a DeleteJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.DeleteJobRequest; + + /** + * Creates a plain object from a DeleteJobRequest message. Also converts values to other types if specified. + * @param message DeleteJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.DeleteJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a NodeGroupController */ + class NodeGroupController extends $protobuf.rpc.Service { + + /** + * Constructs a new NodeGroupController 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 NodeGroupController 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): NodeGroupController; + + /** + * Calls CreateNodeGroup. + * @param request CreateNodeGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createNodeGroup(request: google.cloud.dataproc.v1.ICreateNodeGroupRequest, callback: google.cloud.dataproc.v1.NodeGroupController.CreateNodeGroupCallback): void; + + /** + * Calls CreateNodeGroup. + * @param request CreateNodeGroupRequest message or plain object + * @returns Promise + */ + public createNodeGroup(request: google.cloud.dataproc.v1.ICreateNodeGroupRequest): Promise; + + /** + * Calls ResizeNodeGroup. + * @param request ResizeNodeGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public resizeNodeGroup(request: google.cloud.dataproc.v1.IResizeNodeGroupRequest, callback: google.cloud.dataproc.v1.NodeGroupController.ResizeNodeGroupCallback): void; + + /** + * Calls ResizeNodeGroup. + * @param request ResizeNodeGroupRequest message or plain object + * @returns Promise + */ + public resizeNodeGroup(request: google.cloud.dataproc.v1.IResizeNodeGroupRequest): Promise; + + /** + * Calls GetNodeGroup. + * @param request GetNodeGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NodeGroup + */ + public getNodeGroup(request: google.cloud.dataproc.v1.IGetNodeGroupRequest, callback: google.cloud.dataproc.v1.NodeGroupController.GetNodeGroupCallback): void; + + /** + * Calls GetNodeGroup. + * @param request GetNodeGroupRequest message or plain object + * @returns Promise + */ + public getNodeGroup(request: google.cloud.dataproc.v1.IGetNodeGroupRequest): Promise; + } + + namespace NodeGroupController { + + /** + * Callback as used by {@link google.cloud.dataproc.v1.NodeGroupController|createNodeGroup}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateNodeGroupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.NodeGroupController|resizeNodeGroup}. + * @param error Error, if any + * @param [response] Operation + */ + type ResizeNodeGroupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.NodeGroupController|getNodeGroup}. + * @param error Error, if any + * @param [response] NodeGroup + */ + type GetNodeGroupCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.NodeGroup) => void; + } + + /** Properties of a CreateNodeGroupRequest. */ + interface ICreateNodeGroupRequest { + + /** CreateNodeGroupRequest parent */ + parent?: (string|null); + + /** CreateNodeGroupRequest nodeGroup */ + nodeGroup?: (google.cloud.dataproc.v1.INodeGroup|null); + + /** CreateNodeGroupRequest nodeGroupId */ + nodeGroupId?: (string|null); + + /** CreateNodeGroupRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateNodeGroupRequest. */ + class CreateNodeGroupRequest implements ICreateNodeGroupRequest { + + /** + * Constructs a new CreateNodeGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.ICreateNodeGroupRequest); + + /** CreateNodeGroupRequest parent. */ + public parent: string; + + /** CreateNodeGroupRequest nodeGroup. */ + public nodeGroup?: (google.cloud.dataproc.v1.INodeGroup|null); + + /** CreateNodeGroupRequest nodeGroupId. */ + public nodeGroupId: string; + + /** CreateNodeGroupRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateNodeGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateNodeGroupRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.ICreateNodeGroupRequest): google.cloud.dataproc.v1.CreateNodeGroupRequest; + + /** + * Encodes the specified CreateNodeGroupRequest message. Does not implicitly {@link google.cloud.dataproc.v1.CreateNodeGroupRequest.verify|verify} messages. + * @param message CreateNodeGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.ICreateNodeGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateNodeGroupRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.CreateNodeGroupRequest.verify|verify} messages. + * @param message CreateNodeGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.ICreateNodeGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateNodeGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.CreateNodeGroupRequest; + + /** + * Decodes a CreateNodeGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.CreateNodeGroupRequest; + + /** + * Verifies a CreateNodeGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateNodeGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateNodeGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.CreateNodeGroupRequest; + + /** + * Creates a plain object from a CreateNodeGroupRequest message. Also converts values to other types if specified. + * @param message CreateNodeGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.CreateNodeGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateNodeGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateNodeGroupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ResizeNodeGroupRequest. */ + interface IResizeNodeGroupRequest { + + /** ResizeNodeGroupRequest name */ + name?: (string|null); + + /** ResizeNodeGroupRequest size */ + size?: (number|null); + + /** ResizeNodeGroupRequest requestId */ + requestId?: (string|null); + + /** ResizeNodeGroupRequest gracefulDecommissionTimeout */ + gracefulDecommissionTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a ResizeNodeGroupRequest. */ + class ResizeNodeGroupRequest implements IResizeNodeGroupRequest { + + /** + * Constructs a new ResizeNodeGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IResizeNodeGroupRequest); + + /** ResizeNodeGroupRequest name. */ + public name: string; + + /** ResizeNodeGroupRequest size. */ + public size: number; + + /** ResizeNodeGroupRequest requestId. */ + public requestId: string; + + /** ResizeNodeGroupRequest gracefulDecommissionTimeout. */ + public gracefulDecommissionTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new ResizeNodeGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ResizeNodeGroupRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.IResizeNodeGroupRequest): google.cloud.dataproc.v1.ResizeNodeGroupRequest; + + /** + * Encodes the specified ResizeNodeGroupRequest message. Does not implicitly {@link google.cloud.dataproc.v1.ResizeNodeGroupRequest.verify|verify} messages. + * @param message ResizeNodeGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IResizeNodeGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResizeNodeGroupRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ResizeNodeGroupRequest.verify|verify} messages. + * @param message ResizeNodeGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IResizeNodeGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResizeNodeGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResizeNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ResizeNodeGroupRequest; + + /** + * Decodes a ResizeNodeGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResizeNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ResizeNodeGroupRequest; + + /** + * Verifies a ResizeNodeGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResizeNodeGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResizeNodeGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ResizeNodeGroupRequest; + + /** + * Creates a plain object from a ResizeNodeGroupRequest message. Also converts values to other types if specified. + * @param message ResizeNodeGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.ResizeNodeGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResizeNodeGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResizeNodeGroupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetNodeGroupRequest. */ + interface IGetNodeGroupRequest { + + /** GetNodeGroupRequest name */ + name?: (string|null); + } + + /** Represents a GetNodeGroupRequest. */ + class GetNodeGroupRequest implements IGetNodeGroupRequest { + + /** + * Constructs a new GetNodeGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IGetNodeGroupRequest); + + /** GetNodeGroupRequest name. */ + public name: string; + + /** + * Creates a new GetNodeGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetNodeGroupRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.IGetNodeGroupRequest): google.cloud.dataproc.v1.GetNodeGroupRequest; + + /** + * Encodes the specified GetNodeGroupRequest message. Does not implicitly {@link google.cloud.dataproc.v1.GetNodeGroupRequest.verify|verify} messages. + * @param message GetNodeGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IGetNodeGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetNodeGroupRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GetNodeGroupRequest.verify|verify} messages. + * @param message GetNodeGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IGetNodeGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetNodeGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.GetNodeGroupRequest; + + /** + * Decodes a GetNodeGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.GetNodeGroupRequest; + + /** + * Verifies a GetNodeGroupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetNodeGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetNodeGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.GetNodeGroupRequest; + + /** + * Creates a plain object from a GetNodeGroupRequest message. Also converts values to other types if specified. + * @param message GetNodeGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.GetNodeGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetNodeGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetNodeGroupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a SessionTemplateController */ + class SessionTemplateController extends $protobuf.rpc.Service { + + /** + * Constructs a new SessionTemplateController 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 SessionTemplateController 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): SessionTemplateController; + + /** + * Calls CreateSessionTemplate. + * @param request CreateSessionTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SessionTemplate + */ + public createSessionTemplate(request: google.cloud.dataproc.v1.ICreateSessionTemplateRequest, callback: google.cloud.dataproc.v1.SessionTemplateController.CreateSessionTemplateCallback): void; + + /** + * Calls CreateSessionTemplate. + * @param request CreateSessionTemplateRequest message or plain object + * @returns Promise + */ + public createSessionTemplate(request: google.cloud.dataproc.v1.ICreateSessionTemplateRequest): Promise; + + /** + * Calls UpdateSessionTemplate. + * @param request UpdateSessionTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SessionTemplate + */ + public updateSessionTemplate(request: google.cloud.dataproc.v1.IUpdateSessionTemplateRequest, callback: google.cloud.dataproc.v1.SessionTemplateController.UpdateSessionTemplateCallback): void; + + /** + * Calls UpdateSessionTemplate. + * @param request UpdateSessionTemplateRequest message or plain object + * @returns Promise + */ + public updateSessionTemplate(request: google.cloud.dataproc.v1.IUpdateSessionTemplateRequest): Promise; + + /** + * Calls GetSessionTemplate. + * @param request GetSessionTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SessionTemplate + */ + public getSessionTemplate(request: google.cloud.dataproc.v1.IGetSessionTemplateRequest, callback: google.cloud.dataproc.v1.SessionTemplateController.GetSessionTemplateCallback): void; + + /** + * Calls GetSessionTemplate. + * @param request GetSessionTemplateRequest message or plain object + * @returns Promise + */ + public getSessionTemplate(request: google.cloud.dataproc.v1.IGetSessionTemplateRequest): Promise; + + /** + * Calls ListSessionTemplates. + * @param request ListSessionTemplatesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSessionTemplatesResponse + */ + public listSessionTemplates(request: google.cloud.dataproc.v1.IListSessionTemplatesRequest, callback: google.cloud.dataproc.v1.SessionTemplateController.ListSessionTemplatesCallback): void; + + /** + * Calls ListSessionTemplates. + * @param request ListSessionTemplatesRequest message or plain object + * @returns Promise + */ + public listSessionTemplates(request: google.cloud.dataproc.v1.IListSessionTemplatesRequest): Promise; + + /** + * Calls DeleteSessionTemplate. + * @param request DeleteSessionTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteSessionTemplate(request: google.cloud.dataproc.v1.IDeleteSessionTemplateRequest, callback: google.cloud.dataproc.v1.SessionTemplateController.DeleteSessionTemplateCallback): void; + + /** + * Calls DeleteSessionTemplate. + * @param request DeleteSessionTemplateRequest message or plain object + * @returns Promise + */ + public deleteSessionTemplate(request: google.cloud.dataproc.v1.IDeleteSessionTemplateRequest): Promise; + } + + namespace SessionTemplateController { + + /** + * Callback as used by {@link google.cloud.dataproc.v1.SessionTemplateController|createSessionTemplate}. + * @param error Error, if any + * @param [response] SessionTemplate + */ + type CreateSessionTemplateCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.SessionTemplate) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.SessionTemplateController|updateSessionTemplate}. + * @param error Error, if any + * @param [response] SessionTemplate + */ + type UpdateSessionTemplateCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.SessionTemplate) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.SessionTemplateController|getSessionTemplate}. + * @param error Error, if any + * @param [response] SessionTemplate + */ + type GetSessionTemplateCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.SessionTemplate) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.SessionTemplateController|listSessionTemplates}. + * @param error Error, if any + * @param [response] ListSessionTemplatesResponse + */ + type ListSessionTemplatesCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.ListSessionTemplatesResponse) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.SessionTemplateController|deleteSessionTemplate}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteSessionTemplateCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a CreateSessionTemplateRequest. */ + interface ICreateSessionTemplateRequest { + + /** CreateSessionTemplateRequest parent */ + parent?: (string|null); + + /** CreateSessionTemplateRequest sessionTemplate */ + sessionTemplate?: (google.cloud.dataproc.v1.ISessionTemplate|null); + } + + /** Represents a CreateSessionTemplateRequest. */ + class CreateSessionTemplateRequest implements ICreateSessionTemplateRequest { + + /** + * Constructs a new CreateSessionTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.ICreateSessionTemplateRequest); + + /** CreateSessionTemplateRequest parent. */ + public parent: string; + + /** CreateSessionTemplateRequest sessionTemplate. */ + public sessionTemplate?: (google.cloud.dataproc.v1.ISessionTemplate|null); + + /** + * Creates a new CreateSessionTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSessionTemplateRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.ICreateSessionTemplateRequest): google.cloud.dataproc.v1.CreateSessionTemplateRequest; + + /** + * Encodes the specified CreateSessionTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.CreateSessionTemplateRequest.verify|verify} messages. + * @param message CreateSessionTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.ICreateSessionTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSessionTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.CreateSessionTemplateRequest.verify|verify} messages. + * @param message CreateSessionTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.ICreateSessionTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSessionTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSessionTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.CreateSessionTemplateRequest; + + /** + * Decodes a CreateSessionTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSessionTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.CreateSessionTemplateRequest; + + /** + * Verifies a CreateSessionTemplateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSessionTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSessionTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.CreateSessionTemplateRequest; + + /** + * Creates a plain object from a CreateSessionTemplateRequest message. Also converts values to other types if specified. + * @param message CreateSessionTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.CreateSessionTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSessionTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSessionTemplateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSessionTemplateRequest. */ + interface IUpdateSessionTemplateRequest { + + /** UpdateSessionTemplateRequest sessionTemplate */ + sessionTemplate?: (google.cloud.dataproc.v1.ISessionTemplate|null); + } + + /** Represents an UpdateSessionTemplateRequest. */ + class UpdateSessionTemplateRequest implements IUpdateSessionTemplateRequest { + + /** + * Constructs a new UpdateSessionTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IUpdateSessionTemplateRequest); + + /** UpdateSessionTemplateRequest sessionTemplate. */ + public sessionTemplate?: (google.cloud.dataproc.v1.ISessionTemplate|null); + + /** + * Creates a new UpdateSessionTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSessionTemplateRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.IUpdateSessionTemplateRequest): google.cloud.dataproc.v1.UpdateSessionTemplateRequest; + + /** + * Encodes the specified UpdateSessionTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.UpdateSessionTemplateRequest.verify|verify} messages. + * @param message UpdateSessionTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IUpdateSessionTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSessionTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.UpdateSessionTemplateRequest.verify|verify} messages. + * @param message UpdateSessionTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IUpdateSessionTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSessionTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSessionTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.UpdateSessionTemplateRequest; + + /** + * Decodes an UpdateSessionTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSessionTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.UpdateSessionTemplateRequest; + + /** + * Verifies an UpdateSessionTemplateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateSessionTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSessionTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.UpdateSessionTemplateRequest; + + /** + * Creates a plain object from an UpdateSessionTemplateRequest message. Also converts values to other types if specified. + * @param message UpdateSessionTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.UpdateSessionTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSessionTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSessionTemplateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSessionTemplateRequest. */ + interface IGetSessionTemplateRequest { + + /** GetSessionTemplateRequest name */ + name?: (string|null); + } + + /** Represents a GetSessionTemplateRequest. */ + class GetSessionTemplateRequest implements IGetSessionTemplateRequest { + + /** + * Constructs a new GetSessionTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IGetSessionTemplateRequest); + + /** GetSessionTemplateRequest name. */ + public name: string; + + /** + * Creates a new GetSessionTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSessionTemplateRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.IGetSessionTemplateRequest): google.cloud.dataproc.v1.GetSessionTemplateRequest; + + /** + * Encodes the specified GetSessionTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.GetSessionTemplateRequest.verify|verify} messages. + * @param message GetSessionTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IGetSessionTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSessionTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GetSessionTemplateRequest.verify|verify} messages. + * @param message GetSessionTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IGetSessionTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSessionTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSessionTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.GetSessionTemplateRequest; + + /** + * Decodes a GetSessionTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSessionTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.GetSessionTemplateRequest; + + /** + * Verifies a GetSessionTemplateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSessionTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSessionTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.GetSessionTemplateRequest; + + /** + * Creates a plain object from a GetSessionTemplateRequest message. Also converts values to other types if specified. + * @param message GetSessionTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.GetSessionTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSessionTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSessionTemplateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSessionTemplatesRequest. */ + interface IListSessionTemplatesRequest { + + /** ListSessionTemplatesRequest parent */ + parent?: (string|null); + + /** ListSessionTemplatesRequest pageSize */ + pageSize?: (number|null); + + /** ListSessionTemplatesRequest pageToken */ + pageToken?: (string|null); + + /** ListSessionTemplatesRequest filter */ + filter?: (string|null); + } + + /** Represents a ListSessionTemplatesRequest. */ + class ListSessionTemplatesRequest implements IListSessionTemplatesRequest { + + /** + * Constructs a new ListSessionTemplatesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IListSessionTemplatesRequest); + + /** ListSessionTemplatesRequest parent. */ + public parent: string; + + /** ListSessionTemplatesRequest pageSize. */ + public pageSize: number; + + /** ListSessionTemplatesRequest pageToken. */ + public pageToken: string; + + /** ListSessionTemplatesRequest filter. */ + public filter: string; + + /** + * Creates a new ListSessionTemplatesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSessionTemplatesRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.IListSessionTemplatesRequest): google.cloud.dataproc.v1.ListSessionTemplatesRequest; + + /** + * Encodes the specified ListSessionTemplatesRequest message. Does not implicitly {@link google.cloud.dataproc.v1.ListSessionTemplatesRequest.verify|verify} messages. + * @param message ListSessionTemplatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IListSessionTemplatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSessionTemplatesRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListSessionTemplatesRequest.verify|verify} messages. + * @param message ListSessionTemplatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IListSessionTemplatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSessionTemplatesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSessionTemplatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ListSessionTemplatesRequest; + + /** + * Decodes a ListSessionTemplatesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSessionTemplatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ListSessionTemplatesRequest; + + /** + * Verifies a ListSessionTemplatesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSessionTemplatesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSessionTemplatesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ListSessionTemplatesRequest; + + /** + * Creates a plain object from a ListSessionTemplatesRequest message. Also converts values to other types if specified. + * @param message ListSessionTemplatesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.ListSessionTemplatesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSessionTemplatesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSessionTemplatesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSessionTemplatesResponse. */ + interface IListSessionTemplatesResponse { + + /** ListSessionTemplatesResponse sessionTemplates */ + sessionTemplates?: (google.cloud.dataproc.v1.ISessionTemplate[]|null); + + /** ListSessionTemplatesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSessionTemplatesResponse. */ + class ListSessionTemplatesResponse implements IListSessionTemplatesResponse { + + /** + * Constructs a new ListSessionTemplatesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IListSessionTemplatesResponse); + + /** ListSessionTemplatesResponse sessionTemplates. */ + public sessionTemplates: google.cloud.dataproc.v1.ISessionTemplate[]; + + /** ListSessionTemplatesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSessionTemplatesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSessionTemplatesResponse instance + */ + public static create(properties?: google.cloud.dataproc.v1.IListSessionTemplatesResponse): google.cloud.dataproc.v1.ListSessionTemplatesResponse; + + /** + * Encodes the specified ListSessionTemplatesResponse message. Does not implicitly {@link google.cloud.dataproc.v1.ListSessionTemplatesResponse.verify|verify} messages. + * @param message ListSessionTemplatesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IListSessionTemplatesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSessionTemplatesResponse message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListSessionTemplatesResponse.verify|verify} messages. + * @param message ListSessionTemplatesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IListSessionTemplatesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSessionTemplatesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSessionTemplatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ListSessionTemplatesResponse; + + /** + * Decodes a ListSessionTemplatesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSessionTemplatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ListSessionTemplatesResponse; + + /** + * Verifies a ListSessionTemplatesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSessionTemplatesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSessionTemplatesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ListSessionTemplatesResponse; + + /** + * Creates a plain object from a ListSessionTemplatesResponse message. Also converts values to other types if specified. + * @param message ListSessionTemplatesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.ListSessionTemplatesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSessionTemplatesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSessionTemplatesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSessionTemplateRequest. */ + interface IDeleteSessionTemplateRequest { + + /** DeleteSessionTemplateRequest name */ + name?: (string|null); + } + + /** Represents a DeleteSessionTemplateRequest. */ + class DeleteSessionTemplateRequest implements IDeleteSessionTemplateRequest { + + /** + * Constructs a new DeleteSessionTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IDeleteSessionTemplateRequest); + + /** DeleteSessionTemplateRequest name. */ + public name: string; + + /** + * Creates a new DeleteSessionTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSessionTemplateRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.IDeleteSessionTemplateRequest): google.cloud.dataproc.v1.DeleteSessionTemplateRequest; + + /** + * Encodes the specified DeleteSessionTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.DeleteSessionTemplateRequest.verify|verify} messages. + * @param message DeleteSessionTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IDeleteSessionTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSessionTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DeleteSessionTemplateRequest.verify|verify} messages. + * @param message DeleteSessionTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IDeleteSessionTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSessionTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSessionTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.DeleteSessionTemplateRequest; + + /** + * Decodes a DeleteSessionTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSessionTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.DeleteSessionTemplateRequest; + + /** + * Verifies a DeleteSessionTemplateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSessionTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSessionTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.DeleteSessionTemplateRequest; + + /** + * Creates a plain object from a DeleteSessionTemplateRequest message. Also converts values to other types if specified. + * @param message DeleteSessionTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.DeleteSessionTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSessionTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSessionTemplateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SessionTemplate. */ + interface ISessionTemplate { + + /** SessionTemplate name */ + name?: (string|null); + + /** SessionTemplate description */ + description?: (string|null); + + /** SessionTemplate createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** SessionTemplate jupyterSession */ + jupyterSession?: (google.cloud.dataproc.v1.IJupyterConfig|null); + + /** SessionTemplate sparkConnectSession */ + sparkConnectSession?: (google.cloud.dataproc.v1.ISparkConnectConfig|null); + + /** SessionTemplate creator */ + creator?: (string|null); + + /** SessionTemplate labels */ + labels?: ({ [k: string]: string }|null); + + /** SessionTemplate runtimeConfig */ + runtimeConfig?: (google.cloud.dataproc.v1.IRuntimeConfig|null); + + /** SessionTemplate environmentConfig */ + environmentConfig?: (google.cloud.dataproc.v1.IEnvironmentConfig|null); + + /** SessionTemplate updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** SessionTemplate uuid */ + uuid?: (string|null); + } + + /** Represents a SessionTemplate. */ + class SessionTemplate implements ISessionTemplate { + + /** + * Constructs a new SessionTemplate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.ISessionTemplate); + + /** SessionTemplate name. */ + public name: string; + + /** SessionTemplate description. */ + public description: string; + + /** SessionTemplate createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** SessionTemplate jupyterSession. */ + public jupyterSession?: (google.cloud.dataproc.v1.IJupyterConfig|null); + + /** SessionTemplate sparkConnectSession. */ + public sparkConnectSession?: (google.cloud.dataproc.v1.ISparkConnectConfig|null); + + /** SessionTemplate creator. */ + public creator: string; + + /** SessionTemplate labels. */ + public labels: { [k: string]: string }; + + /** SessionTemplate runtimeConfig. */ + public runtimeConfig?: (google.cloud.dataproc.v1.IRuntimeConfig|null); + + /** SessionTemplate environmentConfig. */ + public environmentConfig?: (google.cloud.dataproc.v1.IEnvironmentConfig|null); + + /** SessionTemplate updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** SessionTemplate uuid. */ + public uuid: string; + + /** SessionTemplate sessionConfig. */ + public sessionConfig?: ("jupyterSession"|"sparkConnectSession"); + + /** + * Creates a new SessionTemplate instance using the specified properties. + * @param [properties] Properties to set + * @returns SessionTemplate instance + */ + public static create(properties?: google.cloud.dataproc.v1.ISessionTemplate): google.cloud.dataproc.v1.SessionTemplate; + + /** + * Encodes the specified SessionTemplate message. Does not implicitly {@link google.cloud.dataproc.v1.SessionTemplate.verify|verify} messages. + * @param message SessionTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.ISessionTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SessionTemplate message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SessionTemplate.verify|verify} messages. + * @param message SessionTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.ISessionTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SessionTemplate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SessionTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.SessionTemplate; + + /** + * Decodes a SessionTemplate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SessionTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.SessionTemplate; + + /** + * Verifies a SessionTemplate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SessionTemplate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SessionTemplate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.SessionTemplate; + + /** + * Creates a plain object from a SessionTemplate message. Also converts values to other types if specified. + * @param message SessionTemplate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.SessionTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SessionTemplate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SessionTemplate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a SessionController */ + class SessionController extends $protobuf.rpc.Service { + + /** + * Constructs a new SessionController 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 SessionController 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): SessionController; + + /** + * Calls CreateSession. + * @param request CreateSessionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createSession(request: google.cloud.dataproc.v1.ICreateSessionRequest, callback: google.cloud.dataproc.v1.SessionController.CreateSessionCallback): void; + + /** + * Calls CreateSession. + * @param request CreateSessionRequest message or plain object + * @returns Promise + */ + public createSession(request: google.cloud.dataproc.v1.ICreateSessionRequest): Promise; + + /** + * Calls GetSession. + * @param request GetSessionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Session + */ + public getSession(request: google.cloud.dataproc.v1.IGetSessionRequest, callback: google.cloud.dataproc.v1.SessionController.GetSessionCallback): void; + + /** + * Calls GetSession. + * @param request GetSessionRequest message or plain object + * @returns Promise + */ + public getSession(request: google.cloud.dataproc.v1.IGetSessionRequest): Promise; + + /** + * Calls ListSessions. + * @param request ListSessionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSessionsResponse + */ + public listSessions(request: google.cloud.dataproc.v1.IListSessionsRequest, callback: google.cloud.dataproc.v1.SessionController.ListSessionsCallback): void; + + /** + * Calls ListSessions. + * @param request ListSessionsRequest message or plain object + * @returns Promise + */ + public listSessions(request: google.cloud.dataproc.v1.IListSessionsRequest): Promise; + + /** + * Calls TerminateSession. + * @param request TerminateSessionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public terminateSession(request: google.cloud.dataproc.v1.ITerminateSessionRequest, callback: google.cloud.dataproc.v1.SessionController.TerminateSessionCallback): void; + + /** + * Calls TerminateSession. + * @param request TerminateSessionRequest message or plain object + * @returns Promise + */ + public terminateSession(request: google.cloud.dataproc.v1.ITerminateSessionRequest): Promise; + + /** + * Calls DeleteSession. + * @param request DeleteSessionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteSession(request: google.cloud.dataproc.v1.IDeleteSessionRequest, callback: google.cloud.dataproc.v1.SessionController.DeleteSessionCallback): void; + + /** + * Calls DeleteSession. + * @param request DeleteSessionRequest message or plain object + * @returns Promise + */ + public deleteSession(request: google.cloud.dataproc.v1.IDeleteSessionRequest): Promise; + } + + namespace SessionController { + + /** + * Callback as used by {@link google.cloud.dataproc.v1.SessionController|createSession}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateSessionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.SessionController|getSession}. + * @param error Error, if any + * @param [response] Session + */ + type GetSessionCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.Session) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.SessionController|listSessions}. + * @param error Error, if any + * @param [response] ListSessionsResponse + */ + type ListSessionsCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.ListSessionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.SessionController|terminateSession}. + * @param error Error, if any + * @param [response] Operation + */ + type TerminateSessionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.SessionController|deleteSession}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteSessionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a CreateSessionRequest. */ + interface ICreateSessionRequest { + + /** CreateSessionRequest parent */ + parent?: (string|null); + + /** CreateSessionRequest session */ + session?: (google.cloud.dataproc.v1.ISession|null); + + /** CreateSessionRequest sessionId */ + sessionId?: (string|null); + + /** CreateSessionRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateSessionRequest. */ + class CreateSessionRequest implements ICreateSessionRequest { + + /** + * Constructs a new CreateSessionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.ICreateSessionRequest); + + /** CreateSessionRequest parent. */ + public parent: string; + + /** CreateSessionRequest session. */ + public session?: (google.cloud.dataproc.v1.ISession|null); + + /** CreateSessionRequest sessionId. */ + public sessionId: string; + + /** CreateSessionRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateSessionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSessionRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.ICreateSessionRequest): google.cloud.dataproc.v1.CreateSessionRequest; + + /** + * Encodes the specified CreateSessionRequest message. Does not implicitly {@link google.cloud.dataproc.v1.CreateSessionRequest.verify|verify} messages. + * @param message CreateSessionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.ICreateSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSessionRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.CreateSessionRequest.verify|verify} messages. + * @param message CreateSessionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.ICreateSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSessionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.CreateSessionRequest; + + /** + * Decodes a CreateSessionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.CreateSessionRequest; + + /** + * Verifies a CreateSessionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSessionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSessionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.CreateSessionRequest; + + /** + * Creates a plain object from a CreateSessionRequest message. Also converts values to other types if specified. + * @param message CreateSessionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.CreateSessionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSessionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSessionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSessionRequest. */ + interface IGetSessionRequest { + + /** GetSessionRequest name */ + name?: (string|null); + } + + /** Represents a GetSessionRequest. */ + class GetSessionRequest implements IGetSessionRequest { + + /** + * Constructs a new GetSessionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IGetSessionRequest); + + /** GetSessionRequest name. */ + public name: string; + + /** + * Creates a new GetSessionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSessionRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.IGetSessionRequest): google.cloud.dataproc.v1.GetSessionRequest; + + /** + * Encodes the specified GetSessionRequest message. Does not implicitly {@link google.cloud.dataproc.v1.GetSessionRequest.verify|verify} messages. + * @param message GetSessionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IGetSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSessionRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GetSessionRequest.verify|verify} messages. + * @param message GetSessionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IGetSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSessionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.GetSessionRequest; + + /** + * Decodes a GetSessionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.GetSessionRequest; + + /** + * Verifies a GetSessionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSessionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSessionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.GetSessionRequest; + + /** + * Creates a plain object from a GetSessionRequest message. Also converts values to other types if specified. + * @param message GetSessionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.GetSessionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSessionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSessionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSessionsRequest. */ + interface IListSessionsRequest { + + /** ListSessionsRequest parent */ + parent?: (string|null); + + /** ListSessionsRequest pageSize */ + pageSize?: (number|null); + + /** ListSessionsRequest pageToken */ + pageToken?: (string|null); + + /** ListSessionsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListSessionsRequest. */ + class ListSessionsRequest implements IListSessionsRequest { + + /** + * Constructs a new ListSessionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IListSessionsRequest); + + /** ListSessionsRequest parent. */ + public parent: string; + + /** ListSessionsRequest pageSize. */ + public pageSize: number; + + /** ListSessionsRequest pageToken. */ + public pageToken: string; + + /** ListSessionsRequest filter. */ + public filter: string; + + /** + * Creates a new ListSessionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSessionsRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.IListSessionsRequest): google.cloud.dataproc.v1.ListSessionsRequest; + + /** + * Encodes the specified ListSessionsRequest message. Does not implicitly {@link google.cloud.dataproc.v1.ListSessionsRequest.verify|verify} messages. + * @param message ListSessionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IListSessionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSessionsRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListSessionsRequest.verify|verify} messages. + * @param message ListSessionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IListSessionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSessionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSessionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ListSessionsRequest; + + /** + * Decodes a ListSessionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSessionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ListSessionsRequest; + + /** + * Verifies a ListSessionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSessionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSessionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ListSessionsRequest; + + /** + * Creates a plain object from a ListSessionsRequest message. Also converts values to other types if specified. + * @param message ListSessionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.ListSessionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSessionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSessionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSessionsResponse. */ + interface IListSessionsResponse { + + /** ListSessionsResponse sessions */ + sessions?: (google.cloud.dataproc.v1.ISession[]|null); + + /** ListSessionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSessionsResponse. */ + class ListSessionsResponse implements IListSessionsResponse { + + /** + * Constructs a new ListSessionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IListSessionsResponse); + + /** ListSessionsResponse sessions. */ + public sessions: google.cloud.dataproc.v1.ISession[]; + + /** ListSessionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSessionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSessionsResponse instance + */ + public static create(properties?: google.cloud.dataproc.v1.IListSessionsResponse): google.cloud.dataproc.v1.ListSessionsResponse; + + /** + * Encodes the specified ListSessionsResponse message. Does not implicitly {@link google.cloud.dataproc.v1.ListSessionsResponse.verify|verify} messages. + * @param message ListSessionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IListSessionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSessionsResponse message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListSessionsResponse.verify|verify} messages. + * @param message ListSessionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IListSessionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSessionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSessionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ListSessionsResponse; + + /** + * Decodes a ListSessionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSessionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ListSessionsResponse; + + /** + * Verifies a ListSessionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSessionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSessionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ListSessionsResponse; + + /** + * Creates a plain object from a ListSessionsResponse message. Also converts values to other types if specified. + * @param message ListSessionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.ListSessionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSessionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSessionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TerminateSessionRequest. */ + interface ITerminateSessionRequest { + + /** TerminateSessionRequest name */ + name?: (string|null); + + /** TerminateSessionRequest requestId */ + requestId?: (string|null); + } + + /** Represents a TerminateSessionRequest. */ + class TerminateSessionRequest implements ITerminateSessionRequest { + + /** + * Constructs a new TerminateSessionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.ITerminateSessionRequest); + + /** TerminateSessionRequest name. */ + public name: string; + + /** TerminateSessionRequest requestId. */ + public requestId: string; + + /** + * Creates a new TerminateSessionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TerminateSessionRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.ITerminateSessionRequest): google.cloud.dataproc.v1.TerminateSessionRequest; + + /** + * Encodes the specified TerminateSessionRequest message. Does not implicitly {@link google.cloud.dataproc.v1.TerminateSessionRequest.verify|verify} messages. + * @param message TerminateSessionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.ITerminateSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TerminateSessionRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.TerminateSessionRequest.verify|verify} messages. + * @param message TerminateSessionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.ITerminateSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TerminateSessionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TerminateSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.TerminateSessionRequest; + + /** + * Decodes a TerminateSessionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TerminateSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.TerminateSessionRequest; + + /** + * Verifies a TerminateSessionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TerminateSessionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TerminateSessionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.TerminateSessionRequest; + + /** + * Creates a plain object from a TerminateSessionRequest message. Also converts values to other types if specified. + * @param message TerminateSessionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.TerminateSessionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TerminateSessionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TerminateSessionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSessionRequest. */ + interface IDeleteSessionRequest { + + /** DeleteSessionRequest name */ + name?: (string|null); + + /** DeleteSessionRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteSessionRequest. */ + class DeleteSessionRequest implements IDeleteSessionRequest { + + /** + * Constructs a new DeleteSessionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IDeleteSessionRequest); + + /** DeleteSessionRequest name. */ + public name: string; + + /** DeleteSessionRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteSessionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSessionRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.IDeleteSessionRequest): google.cloud.dataproc.v1.DeleteSessionRequest; + + /** + * Encodes the specified DeleteSessionRequest message. Does not implicitly {@link google.cloud.dataproc.v1.DeleteSessionRequest.verify|verify} messages. + * @param message DeleteSessionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IDeleteSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSessionRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DeleteSessionRequest.verify|verify} messages. + * @param message DeleteSessionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IDeleteSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSessionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.DeleteSessionRequest; + + /** + * Decodes a DeleteSessionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.DeleteSessionRequest; + + /** + * Verifies a DeleteSessionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSessionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSessionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.DeleteSessionRequest; + + /** + * Creates a plain object from a DeleteSessionRequest message. Also converts values to other types if specified. + * @param message DeleteSessionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.DeleteSessionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSessionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSessionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Session. */ + interface ISession { + + /** Session name */ + name?: (string|null); + + /** Session uuid */ + uuid?: (string|null); + + /** Session createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Session jupyterSession */ + jupyterSession?: (google.cloud.dataproc.v1.IJupyterConfig|null); + + /** Session sparkConnectSession */ + sparkConnectSession?: (google.cloud.dataproc.v1.ISparkConnectConfig|null); + + /** Session runtimeInfo */ + runtimeInfo?: (google.cloud.dataproc.v1.IRuntimeInfo|null); + + /** Session state */ + state?: (google.cloud.dataproc.v1.Session.State|keyof typeof google.cloud.dataproc.v1.Session.State|null); + + /** Session stateMessage */ + stateMessage?: (string|null); + + /** Session stateTime */ + stateTime?: (google.protobuf.ITimestamp|null); + + /** Session creator */ + creator?: (string|null); + + /** Session labels */ + labels?: ({ [k: string]: string }|null); + + /** Session runtimeConfig */ + runtimeConfig?: (google.cloud.dataproc.v1.IRuntimeConfig|null); + + /** Session environmentConfig */ + environmentConfig?: (google.cloud.dataproc.v1.IEnvironmentConfig|null); + + /** Session user */ + user?: (string|null); + + /** Session stateHistory */ + stateHistory?: (google.cloud.dataproc.v1.Session.ISessionStateHistory[]|null); + + /** Session sessionTemplate */ + sessionTemplate?: (string|null); + } + + /** Represents a Session. */ + class Session implements ISession { + + /** + * Constructs a new Session. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.ISession); + + /** Session name. */ + public name: string; + + /** Session uuid. */ + public uuid: string; + + /** Session createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Session jupyterSession. */ + public jupyterSession?: (google.cloud.dataproc.v1.IJupyterConfig|null); + + /** Session sparkConnectSession. */ + public sparkConnectSession?: (google.cloud.dataproc.v1.ISparkConnectConfig|null); + + /** Session runtimeInfo. */ + public runtimeInfo?: (google.cloud.dataproc.v1.IRuntimeInfo|null); + + /** Session state. */ + public state: (google.cloud.dataproc.v1.Session.State|keyof typeof google.cloud.dataproc.v1.Session.State); + + /** Session stateMessage. */ + public stateMessage: string; + + /** Session stateTime. */ + public stateTime?: (google.protobuf.ITimestamp|null); + + /** Session creator. */ + public creator: string; + + /** Session labels. */ + public labels: { [k: string]: string }; + + /** Session runtimeConfig. */ + public runtimeConfig?: (google.cloud.dataproc.v1.IRuntimeConfig|null); + + /** Session environmentConfig. */ + public environmentConfig?: (google.cloud.dataproc.v1.IEnvironmentConfig|null); + + /** Session user. */ + public user: string; + + /** Session stateHistory. */ + public stateHistory: google.cloud.dataproc.v1.Session.ISessionStateHistory[]; + + /** Session sessionTemplate. */ + public sessionTemplate: string; + + /** Session sessionConfig. */ + public sessionConfig?: ("jupyterSession"|"sparkConnectSession"); + + /** + * Creates a new Session instance using the specified properties. + * @param [properties] Properties to set + * @returns Session instance + */ + public static create(properties?: google.cloud.dataproc.v1.ISession): google.cloud.dataproc.v1.Session; + + /** + * Encodes the specified Session message. Does not implicitly {@link google.cloud.dataproc.v1.Session.verify|verify} messages. + * @param message Session message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.ISession, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Session message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.Session.verify|verify} messages. + * @param message Session message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.ISession, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Session message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Session + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.Session; + + /** + * Decodes a Session message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Session + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.Session; + + /** + * Verifies a Session message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Session message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Session + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.Session; + + /** + * Creates a plain object from a Session message. Also converts values to other types if specified. + * @param message Session + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.Session, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Session to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Session + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Session { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + ACTIVE = 2, + TERMINATING = 3, + TERMINATED = 4, + FAILED = 5 + } + + /** Properties of a SessionStateHistory. */ + interface ISessionStateHistory { + + /** SessionStateHistory state */ + state?: (google.cloud.dataproc.v1.Session.State|keyof typeof google.cloud.dataproc.v1.Session.State|null); + + /** SessionStateHistory stateMessage */ + stateMessage?: (string|null); + + /** SessionStateHistory stateStartTime */ + stateStartTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a SessionStateHistory. */ + class SessionStateHistory implements ISessionStateHistory { + + /** + * Constructs a new SessionStateHistory. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.Session.ISessionStateHistory); + + /** SessionStateHistory state. */ + public state: (google.cloud.dataproc.v1.Session.State|keyof typeof google.cloud.dataproc.v1.Session.State); + + /** SessionStateHistory stateMessage. */ + public stateMessage: string; + + /** SessionStateHistory stateStartTime. */ + public stateStartTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new SessionStateHistory instance using the specified properties. + * @param [properties] Properties to set + * @returns SessionStateHistory instance + */ + public static create(properties?: google.cloud.dataproc.v1.Session.ISessionStateHistory): google.cloud.dataproc.v1.Session.SessionStateHistory; + + /** + * Encodes the specified SessionStateHistory message. Does not implicitly {@link google.cloud.dataproc.v1.Session.SessionStateHistory.verify|verify} messages. + * @param message SessionStateHistory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.Session.ISessionStateHistory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SessionStateHistory message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.Session.SessionStateHistory.verify|verify} messages. + * @param message SessionStateHistory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.Session.ISessionStateHistory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SessionStateHistory message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SessionStateHistory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.Session.SessionStateHistory; + + /** + * Decodes a SessionStateHistory message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SessionStateHistory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.Session.SessionStateHistory; + + /** + * Verifies a SessionStateHistory message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SessionStateHistory message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SessionStateHistory + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.Session.SessionStateHistory; + + /** + * Creates a plain object from a SessionStateHistory message. Also converts values to other types if specified. + * @param message SessionStateHistory + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.Session.SessionStateHistory, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SessionStateHistory to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SessionStateHistory + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a JupyterConfig. */ + interface IJupyterConfig { + + /** JupyterConfig kernel */ + kernel?: (google.cloud.dataproc.v1.JupyterConfig.Kernel|keyof typeof google.cloud.dataproc.v1.JupyterConfig.Kernel|null); + + /** JupyterConfig displayName */ + displayName?: (string|null); + } + + /** Represents a JupyterConfig. */ + class JupyterConfig implements IJupyterConfig { + + /** + * Constructs a new JupyterConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IJupyterConfig); + + /** JupyterConfig kernel. */ + public kernel: (google.cloud.dataproc.v1.JupyterConfig.Kernel|keyof typeof google.cloud.dataproc.v1.JupyterConfig.Kernel); + + /** JupyterConfig displayName. */ + public displayName: string; + + /** + * Creates a new JupyterConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns JupyterConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.IJupyterConfig): google.cloud.dataproc.v1.JupyterConfig; + + /** + * Encodes the specified JupyterConfig message. Does not implicitly {@link google.cloud.dataproc.v1.JupyterConfig.verify|verify} messages. + * @param message JupyterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IJupyterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JupyterConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.JupyterConfig.verify|verify} messages. + * @param message JupyterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IJupyterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JupyterConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JupyterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.JupyterConfig; + + /** + * Decodes a JupyterConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JupyterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.JupyterConfig; + + /** + * Verifies a JupyterConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JupyterConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JupyterConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.JupyterConfig; + + /** + * Creates a plain object from a JupyterConfig message. Also converts values to other types if specified. + * @param message JupyterConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.JupyterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JupyterConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JupyterConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace JupyterConfig { + + /** Kernel enum. */ + enum Kernel { + KERNEL_UNSPECIFIED = 0, + PYTHON = 1, + SCALA = 2 + } + } + + /** Properties of a SparkConnectConfig. */ + interface ISparkConnectConfig { + } + + /** Represents a SparkConnectConfig. */ + class SparkConnectConfig implements ISparkConnectConfig { + + /** + * Constructs a new SparkConnectConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.ISparkConnectConfig); + + /** + * Creates a new SparkConnectConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SparkConnectConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.ISparkConnectConfig): google.cloud.dataproc.v1.SparkConnectConfig; + + /** + * Encodes the specified SparkConnectConfig message. Does not implicitly {@link google.cloud.dataproc.v1.SparkConnectConfig.verify|verify} messages. + * @param message SparkConnectConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.ISparkConnectConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SparkConnectConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SparkConnectConfig.verify|verify} messages. + * @param message SparkConnectConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.ISparkConnectConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SparkConnectConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SparkConnectConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.SparkConnectConfig; + + /** + * Decodes a SparkConnectConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SparkConnectConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.SparkConnectConfig; + + /** + * Verifies a SparkConnectConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SparkConnectConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SparkConnectConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.SparkConnectConfig; + + /** + * Creates a plain object from a SparkConnectConfig message. Also converts values to other types if specified. + * @param message SparkConnectConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.SparkConnectConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SparkConnectConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SparkConnectConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a WorkflowTemplateService */ + class WorkflowTemplateService extends $protobuf.rpc.Service { + + /** + * Constructs a new WorkflowTemplateService 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 WorkflowTemplateService 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): WorkflowTemplateService; + + /** + * Calls CreateWorkflowTemplate. + * @param request CreateWorkflowTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and WorkflowTemplate + */ + public createWorkflowTemplate(request: google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest, callback: google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplateCallback): void; + + /** + * Calls CreateWorkflowTemplate. + * @param request CreateWorkflowTemplateRequest message or plain object + * @returns Promise + */ + public createWorkflowTemplate(request: google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest): Promise; + + /** + * Calls GetWorkflowTemplate. + * @param request GetWorkflowTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and WorkflowTemplate + */ + public getWorkflowTemplate(request: google.cloud.dataproc.v1.IGetWorkflowTemplateRequest, callback: google.cloud.dataproc.v1.WorkflowTemplateService.GetWorkflowTemplateCallback): void; + + /** + * Calls GetWorkflowTemplate. + * @param request GetWorkflowTemplateRequest message or plain object + * @returns Promise + */ + public getWorkflowTemplate(request: google.cloud.dataproc.v1.IGetWorkflowTemplateRequest): Promise; + + /** + * Calls InstantiateWorkflowTemplate. + * @param request InstantiateWorkflowTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public instantiateWorkflowTemplate(request: google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest, callback: google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplateCallback): void; + + /** + * Calls InstantiateWorkflowTemplate. + * @param request InstantiateWorkflowTemplateRequest message or plain object + * @returns Promise + */ + public instantiateWorkflowTemplate(request: google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest): Promise; + + /** + * Calls InstantiateInlineWorkflowTemplate. + * @param request InstantiateInlineWorkflowTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public instantiateInlineWorkflowTemplate(request: google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest, callback: google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateInlineWorkflowTemplateCallback): void; + + /** + * Calls InstantiateInlineWorkflowTemplate. + * @param request InstantiateInlineWorkflowTemplateRequest message or plain object + * @returns Promise + */ + public instantiateInlineWorkflowTemplate(request: google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest): Promise; + + /** + * Calls UpdateWorkflowTemplate. + * @param request UpdateWorkflowTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and WorkflowTemplate + */ + public updateWorkflowTemplate(request: google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest, callback: google.cloud.dataproc.v1.WorkflowTemplateService.UpdateWorkflowTemplateCallback): void; + + /** + * Calls UpdateWorkflowTemplate. + * @param request UpdateWorkflowTemplateRequest message or plain object + * @returns Promise + */ + public updateWorkflowTemplate(request: google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest): Promise; + + /** + * Calls ListWorkflowTemplates. + * @param request ListWorkflowTemplatesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListWorkflowTemplatesResponse + */ + public listWorkflowTemplates(request: google.cloud.dataproc.v1.IListWorkflowTemplatesRequest, callback: google.cloud.dataproc.v1.WorkflowTemplateService.ListWorkflowTemplatesCallback): void; + + /** + * Calls ListWorkflowTemplates. + * @param request ListWorkflowTemplatesRequest message or plain object + * @returns Promise + */ + public listWorkflowTemplates(request: google.cloud.dataproc.v1.IListWorkflowTemplatesRequest): Promise; + + /** + * Calls DeleteWorkflowTemplate. + * @param request DeleteWorkflowTemplateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteWorkflowTemplate(request: google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest, callback: google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplateCallback): void; + + /** + * Calls DeleteWorkflowTemplate. + * @param request DeleteWorkflowTemplateRequest message or plain object + * @returns Promise + */ + public deleteWorkflowTemplate(request: google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest): Promise; + } + + namespace WorkflowTemplateService { + + /** + * Callback as used by {@link google.cloud.dataproc.v1.WorkflowTemplateService|createWorkflowTemplate}. + * @param error Error, if any + * @param [response] WorkflowTemplate + */ + type CreateWorkflowTemplateCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.WorkflowTemplate) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.WorkflowTemplateService|getWorkflowTemplate}. + * @param error Error, if any + * @param [response] WorkflowTemplate + */ + type GetWorkflowTemplateCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.WorkflowTemplate) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.WorkflowTemplateService|instantiateWorkflowTemplate}. + * @param error Error, if any + * @param [response] Operation + */ + type InstantiateWorkflowTemplateCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.WorkflowTemplateService|instantiateInlineWorkflowTemplate}. + * @param error Error, if any + * @param [response] Operation + */ + type InstantiateInlineWorkflowTemplateCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.WorkflowTemplateService|updateWorkflowTemplate}. + * @param error Error, if any + * @param [response] WorkflowTemplate + */ + type UpdateWorkflowTemplateCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.WorkflowTemplate) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.WorkflowTemplateService|listWorkflowTemplates}. + * @param error Error, if any + * @param [response] ListWorkflowTemplatesResponse + */ + type ListWorkflowTemplatesCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.ListWorkflowTemplatesResponse) => void; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.WorkflowTemplateService|deleteWorkflowTemplate}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteWorkflowTemplateCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a WorkflowTemplate. */ + interface IWorkflowTemplate { + + /** WorkflowTemplate id */ + id?: (string|null); + + /** WorkflowTemplate name */ + name?: (string|null); + + /** WorkflowTemplate version */ + version?: (number|null); + + /** WorkflowTemplate createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** WorkflowTemplate updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** WorkflowTemplate labels */ + labels?: ({ [k: string]: string }|null); + + /** WorkflowTemplate placement */ + placement?: (google.cloud.dataproc.v1.IWorkflowTemplatePlacement|null); + + /** WorkflowTemplate jobs */ + jobs?: (google.cloud.dataproc.v1.IOrderedJob[]|null); + + /** WorkflowTemplate parameters */ + parameters?: (google.cloud.dataproc.v1.ITemplateParameter[]|null); + + /** WorkflowTemplate dagTimeout */ + dagTimeout?: (google.protobuf.IDuration|null); + + /** WorkflowTemplate encryptionConfig */ + encryptionConfig?: (google.cloud.dataproc.v1.WorkflowTemplate.IEncryptionConfig|null); + } + + /** Represents a WorkflowTemplate. */ + class WorkflowTemplate implements IWorkflowTemplate { + + /** + * Constructs a new WorkflowTemplate. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IWorkflowTemplate); + + /** WorkflowTemplate id. */ + public id: string; + + /** WorkflowTemplate name. */ + public name: string; + + /** WorkflowTemplate version. */ + public version: number; + + /** WorkflowTemplate createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** WorkflowTemplate updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** WorkflowTemplate labels. */ + public labels: { [k: string]: string }; + + /** WorkflowTemplate placement. */ + public placement?: (google.cloud.dataproc.v1.IWorkflowTemplatePlacement|null); + + /** WorkflowTemplate jobs. */ + public jobs: google.cloud.dataproc.v1.IOrderedJob[]; + + /** WorkflowTemplate parameters. */ + public parameters: google.cloud.dataproc.v1.ITemplateParameter[]; + + /** WorkflowTemplate dagTimeout. */ + public dagTimeout?: (google.protobuf.IDuration|null); + + /** WorkflowTemplate encryptionConfig. */ + public encryptionConfig?: (google.cloud.dataproc.v1.WorkflowTemplate.IEncryptionConfig|null); + + /** + * Creates a new WorkflowTemplate instance using the specified properties. + * @param [properties] Properties to set + * @returns WorkflowTemplate instance + */ + public static create(properties?: google.cloud.dataproc.v1.IWorkflowTemplate): google.cloud.dataproc.v1.WorkflowTemplate; + + /** + * Encodes the specified WorkflowTemplate message. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowTemplate.verify|verify} messages. + * @param message WorkflowTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IWorkflowTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WorkflowTemplate message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowTemplate.verify|verify} messages. + * @param message WorkflowTemplate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IWorkflowTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WorkflowTemplate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WorkflowTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.WorkflowTemplate; + + /** + * Decodes a WorkflowTemplate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WorkflowTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.WorkflowTemplate; + + /** + * Verifies a WorkflowTemplate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WorkflowTemplate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WorkflowTemplate + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.WorkflowTemplate; + + /** + * Creates a plain object from a WorkflowTemplate message. Also converts values to other types if specified. + * @param message WorkflowTemplate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.WorkflowTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WorkflowTemplate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WorkflowTemplate + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace WorkflowTemplate { + + /** Properties of an EncryptionConfig. */ + interface IEncryptionConfig { + + /** EncryptionConfig kmsKey */ + kmsKey?: (string|null); + } + + /** Represents an EncryptionConfig. */ + class EncryptionConfig implements IEncryptionConfig { + + /** + * Constructs a new EncryptionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.WorkflowTemplate.IEncryptionConfig); + + /** EncryptionConfig kmsKey. */ + public kmsKey: string; + + /** + * Creates a new EncryptionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns EncryptionConfig instance + */ + public static create(properties?: google.cloud.dataproc.v1.WorkflowTemplate.IEncryptionConfig): google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig; + + /** + * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig.verify|verify} messages. + * @param message EncryptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.WorkflowTemplate.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig.verify|verify} messages. + * @param message EncryptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.WorkflowTemplate.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig; + + /** + * Verifies an EncryptionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EncryptionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig; + + /** + * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. + * @param message EncryptionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EncryptionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EncryptionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a WorkflowTemplatePlacement. */ + interface IWorkflowTemplatePlacement { + + /** WorkflowTemplatePlacement managedCluster */ + managedCluster?: (google.cloud.dataproc.v1.IManagedCluster|null); + + /** WorkflowTemplatePlacement clusterSelector */ + clusterSelector?: (google.cloud.dataproc.v1.IClusterSelector|null); + } + + /** Represents a WorkflowTemplatePlacement. */ + class WorkflowTemplatePlacement implements IWorkflowTemplatePlacement { + + /** + * Constructs a new WorkflowTemplatePlacement. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IWorkflowTemplatePlacement); + + /** WorkflowTemplatePlacement managedCluster. */ + public managedCluster?: (google.cloud.dataproc.v1.IManagedCluster|null); + + /** WorkflowTemplatePlacement clusterSelector. */ + public clusterSelector?: (google.cloud.dataproc.v1.IClusterSelector|null); + + /** WorkflowTemplatePlacement placement. */ + public placement?: ("managedCluster"|"clusterSelector"); + + /** + * Creates a new WorkflowTemplatePlacement instance using the specified properties. + * @param [properties] Properties to set + * @returns WorkflowTemplatePlacement instance + */ + public static create(properties?: google.cloud.dataproc.v1.IWorkflowTemplatePlacement): google.cloud.dataproc.v1.WorkflowTemplatePlacement; + + /** + * Encodes the specified WorkflowTemplatePlacement message. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowTemplatePlacement.verify|verify} messages. + * @param message WorkflowTemplatePlacement message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IWorkflowTemplatePlacement, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WorkflowTemplatePlacement message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowTemplatePlacement.verify|verify} messages. + * @param message WorkflowTemplatePlacement message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IWorkflowTemplatePlacement, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WorkflowTemplatePlacement message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WorkflowTemplatePlacement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.WorkflowTemplatePlacement; + + /** + * Decodes a WorkflowTemplatePlacement message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WorkflowTemplatePlacement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.WorkflowTemplatePlacement; + + /** + * Verifies a WorkflowTemplatePlacement message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WorkflowTemplatePlacement message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WorkflowTemplatePlacement + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.WorkflowTemplatePlacement; + + /** + * Creates a plain object from a WorkflowTemplatePlacement message. Also converts values to other types if specified. + * @param message WorkflowTemplatePlacement + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.WorkflowTemplatePlacement, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WorkflowTemplatePlacement to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WorkflowTemplatePlacement + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ManagedCluster. */ + interface IManagedCluster { + + /** ManagedCluster clusterName */ + clusterName?: (string|null); + + /** ManagedCluster config */ + config?: (google.cloud.dataproc.v1.IClusterConfig|null); + + /** ManagedCluster labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a ManagedCluster. */ + class ManagedCluster implements IManagedCluster { + + /** + * Constructs a new ManagedCluster. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IManagedCluster); + + /** ManagedCluster clusterName. */ + public clusterName: string; + + /** ManagedCluster config. */ + public config?: (google.cloud.dataproc.v1.IClusterConfig|null); + + /** ManagedCluster labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new ManagedCluster instance using the specified properties. + * @param [properties] Properties to set + * @returns ManagedCluster instance + */ + public static create(properties?: google.cloud.dataproc.v1.IManagedCluster): google.cloud.dataproc.v1.ManagedCluster; + + /** + * Encodes the specified ManagedCluster message. Does not implicitly {@link google.cloud.dataproc.v1.ManagedCluster.verify|verify} messages. + * @param message ManagedCluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IManagedCluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ManagedCluster message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ManagedCluster.verify|verify} messages. + * @param message ManagedCluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IManagedCluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ManagedCluster message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ManagedCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ManagedCluster; + + /** + * Decodes a ManagedCluster message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ManagedCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ManagedCluster; + + /** + * Verifies a ManagedCluster message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ManagedCluster message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ManagedCluster + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ManagedCluster; + + /** + * Creates a plain object from a ManagedCluster message. Also converts values to other types if specified. + * @param message ManagedCluster + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.ManagedCluster, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ManagedCluster to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ManagedCluster + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClusterSelector. */ + interface IClusterSelector { + + /** ClusterSelector zone */ + zone?: (string|null); + + /** ClusterSelector clusterLabels */ + clusterLabels?: ({ [k: string]: string }|null); + } + + /** Represents a ClusterSelector. */ + class ClusterSelector implements IClusterSelector { + + /** + * Constructs a new ClusterSelector. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IClusterSelector); + + /** ClusterSelector zone. */ + public zone: string; + + /** ClusterSelector clusterLabels. */ + public clusterLabels: { [k: string]: string }; + + /** + * Creates a new ClusterSelector instance using the specified properties. + * @param [properties] Properties to set + * @returns ClusterSelector instance + */ + public static create(properties?: google.cloud.dataproc.v1.IClusterSelector): google.cloud.dataproc.v1.ClusterSelector; + + /** + * Encodes the specified ClusterSelector message. Does not implicitly {@link google.cloud.dataproc.v1.ClusterSelector.verify|verify} messages. + * @param message ClusterSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IClusterSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClusterSelector message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ClusterSelector.verify|verify} messages. + * @param message ClusterSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IClusterSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClusterSelector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClusterSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ClusterSelector; + + /** + * Decodes a ClusterSelector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClusterSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ClusterSelector; + + /** + * Verifies a ClusterSelector message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClusterSelector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClusterSelector + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ClusterSelector; + + /** + * Creates a plain object from a ClusterSelector message. Also converts values to other types if specified. + * @param message ClusterSelector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.ClusterSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClusterSelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClusterSelector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OrderedJob. */ + interface IOrderedJob { + + /** OrderedJob stepId */ + stepId?: (string|null); + + /** OrderedJob hadoopJob */ + hadoopJob?: (google.cloud.dataproc.v1.IHadoopJob|null); + + /** OrderedJob sparkJob */ + sparkJob?: (google.cloud.dataproc.v1.ISparkJob|null); + + /** OrderedJob pysparkJob */ + pysparkJob?: (google.cloud.dataproc.v1.IPySparkJob|null); + + /** OrderedJob hiveJob */ + hiveJob?: (google.cloud.dataproc.v1.IHiveJob|null); + + /** OrderedJob pigJob */ + pigJob?: (google.cloud.dataproc.v1.IPigJob|null); + + /** OrderedJob sparkRJob */ + sparkRJob?: (google.cloud.dataproc.v1.ISparkRJob|null); + + /** OrderedJob sparkSqlJob */ + sparkSqlJob?: (google.cloud.dataproc.v1.ISparkSqlJob|null); + + /** OrderedJob prestoJob */ + prestoJob?: (google.cloud.dataproc.v1.IPrestoJob|null); + + /** OrderedJob trinoJob */ + trinoJob?: (google.cloud.dataproc.v1.ITrinoJob|null); + + /** OrderedJob flinkJob */ + flinkJob?: (google.cloud.dataproc.v1.IFlinkJob|null); + + /** OrderedJob labels */ + labels?: ({ [k: string]: string }|null); + + /** OrderedJob scheduling */ + scheduling?: (google.cloud.dataproc.v1.IJobScheduling|null); + + /** OrderedJob prerequisiteStepIds */ + prerequisiteStepIds?: (string[]|null); + } + + /** Represents an OrderedJob. */ + class OrderedJob implements IOrderedJob { + + /** + * Constructs a new OrderedJob. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IOrderedJob); + + /** OrderedJob stepId. */ + public stepId: string; + + /** OrderedJob hadoopJob. */ + public hadoopJob?: (google.cloud.dataproc.v1.IHadoopJob|null); + + /** OrderedJob sparkJob. */ + public sparkJob?: (google.cloud.dataproc.v1.ISparkJob|null); + + /** OrderedJob pysparkJob. */ + public pysparkJob?: (google.cloud.dataproc.v1.IPySparkJob|null); + + /** OrderedJob hiveJob. */ + public hiveJob?: (google.cloud.dataproc.v1.IHiveJob|null); + + /** OrderedJob pigJob. */ + public pigJob?: (google.cloud.dataproc.v1.IPigJob|null); + + /** OrderedJob sparkRJob. */ + public sparkRJob?: (google.cloud.dataproc.v1.ISparkRJob|null); + + /** OrderedJob sparkSqlJob. */ + public sparkSqlJob?: (google.cloud.dataproc.v1.ISparkSqlJob|null); + + /** OrderedJob prestoJob. */ + public prestoJob?: (google.cloud.dataproc.v1.IPrestoJob|null); + + /** OrderedJob trinoJob. */ + public trinoJob?: (google.cloud.dataproc.v1.ITrinoJob|null); + + /** OrderedJob flinkJob. */ + public flinkJob?: (google.cloud.dataproc.v1.IFlinkJob|null); + + /** OrderedJob labels. */ + public labels: { [k: string]: string }; + + /** OrderedJob scheduling. */ + public scheduling?: (google.cloud.dataproc.v1.IJobScheduling|null); + + /** OrderedJob prerequisiteStepIds. */ + public prerequisiteStepIds: string[]; + + /** OrderedJob jobType. */ + public jobType?: ("hadoopJob"|"sparkJob"|"pysparkJob"|"hiveJob"|"pigJob"|"sparkRJob"|"sparkSqlJob"|"prestoJob"|"trinoJob"|"flinkJob"); + + /** + * Creates a new OrderedJob instance using the specified properties. + * @param [properties] Properties to set + * @returns OrderedJob instance + */ + public static create(properties?: google.cloud.dataproc.v1.IOrderedJob): google.cloud.dataproc.v1.OrderedJob; + + /** + * Encodes the specified OrderedJob message. Does not implicitly {@link google.cloud.dataproc.v1.OrderedJob.verify|verify} messages. + * @param message OrderedJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IOrderedJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OrderedJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.OrderedJob.verify|verify} messages. + * @param message OrderedJob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IOrderedJob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OrderedJob message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OrderedJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.OrderedJob; + + /** + * Decodes an OrderedJob message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OrderedJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.OrderedJob; + + /** + * Verifies an OrderedJob message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OrderedJob message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OrderedJob + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.OrderedJob; + + /** + * Creates a plain object from an OrderedJob message. Also converts values to other types if specified. + * @param message OrderedJob + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.OrderedJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OrderedJob to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OrderedJob + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TemplateParameter. */ + interface ITemplateParameter { + + /** TemplateParameter name */ + name?: (string|null); + + /** TemplateParameter fields */ + fields?: (string[]|null); + + /** TemplateParameter description */ + description?: (string|null); + + /** TemplateParameter validation */ + validation?: (google.cloud.dataproc.v1.IParameterValidation|null); + } + + /** Represents a TemplateParameter. */ + class TemplateParameter implements ITemplateParameter { + + /** + * Constructs a new TemplateParameter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.ITemplateParameter); + + /** TemplateParameter name. */ + public name: string; + + /** TemplateParameter fields. */ + public fields: string[]; + + /** TemplateParameter description. */ + public description: string; + + /** TemplateParameter validation. */ + public validation?: (google.cloud.dataproc.v1.IParameterValidation|null); + + /** + * Creates a new TemplateParameter instance using the specified properties. + * @param [properties] Properties to set + * @returns TemplateParameter instance + */ + public static create(properties?: google.cloud.dataproc.v1.ITemplateParameter): google.cloud.dataproc.v1.TemplateParameter; + + /** + * Encodes the specified TemplateParameter message. Does not implicitly {@link google.cloud.dataproc.v1.TemplateParameter.verify|verify} messages. + * @param message TemplateParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.ITemplateParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TemplateParameter message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.TemplateParameter.verify|verify} messages. + * @param message TemplateParameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.ITemplateParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TemplateParameter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TemplateParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.TemplateParameter; + + /** + * Decodes a TemplateParameter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TemplateParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.TemplateParameter; + + /** + * Verifies a TemplateParameter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TemplateParameter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TemplateParameter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.TemplateParameter; + + /** + * Creates a plain object from a TemplateParameter message. Also converts values to other types if specified. + * @param message TemplateParameter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.TemplateParameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TemplateParameter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TemplateParameter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ParameterValidation. */ + interface IParameterValidation { + + /** ParameterValidation regex */ + regex?: (google.cloud.dataproc.v1.IRegexValidation|null); + + /** ParameterValidation values */ + values?: (google.cloud.dataproc.v1.IValueValidation|null); + } + + /** Represents a ParameterValidation. */ + class ParameterValidation implements IParameterValidation { + + /** + * Constructs a new ParameterValidation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IParameterValidation); + + /** ParameterValidation regex. */ + public regex?: (google.cloud.dataproc.v1.IRegexValidation|null); + + /** ParameterValidation values. */ + public values?: (google.cloud.dataproc.v1.IValueValidation|null); + + /** ParameterValidation validationType. */ + public validationType?: ("regex"|"values"); + + /** + * Creates a new ParameterValidation instance using the specified properties. + * @param [properties] Properties to set + * @returns ParameterValidation instance + */ + public static create(properties?: google.cloud.dataproc.v1.IParameterValidation): google.cloud.dataproc.v1.ParameterValidation; + + /** + * Encodes the specified ParameterValidation message. Does not implicitly {@link google.cloud.dataproc.v1.ParameterValidation.verify|verify} messages. + * @param message ParameterValidation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IParameterValidation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ParameterValidation message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ParameterValidation.verify|verify} messages. + * @param message ParameterValidation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IParameterValidation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ParameterValidation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ParameterValidation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ParameterValidation; + + /** + * Decodes a ParameterValidation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ParameterValidation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ParameterValidation; + + /** + * Verifies a ParameterValidation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ParameterValidation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ParameterValidation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ParameterValidation; + + /** + * Creates a plain object from a ParameterValidation message. Also converts values to other types if specified. + * @param message ParameterValidation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.ParameterValidation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ParameterValidation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ParameterValidation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RegexValidation. */ + interface IRegexValidation { + + /** RegexValidation regexes */ + regexes?: (string[]|null); + } + + /** Represents a RegexValidation. */ + class RegexValidation implements IRegexValidation { + + /** + * Constructs a new RegexValidation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IRegexValidation); + + /** RegexValidation regexes. */ + public regexes: string[]; + + /** + * Creates a new RegexValidation instance using the specified properties. + * @param [properties] Properties to set + * @returns RegexValidation instance + */ + public static create(properties?: google.cloud.dataproc.v1.IRegexValidation): google.cloud.dataproc.v1.RegexValidation; + + /** + * Encodes the specified RegexValidation message. Does not implicitly {@link google.cloud.dataproc.v1.RegexValidation.verify|verify} messages. + * @param message RegexValidation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IRegexValidation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegexValidation message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.RegexValidation.verify|verify} messages. + * @param message RegexValidation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IRegexValidation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegexValidation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegexValidation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.RegexValidation; + + /** + * Decodes a RegexValidation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegexValidation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.RegexValidation; + + /** + * Verifies a RegexValidation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegexValidation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegexValidation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.RegexValidation; + + /** + * Creates a plain object from a RegexValidation message. Also converts values to other types if specified. + * @param message RegexValidation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.RegexValidation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegexValidation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RegexValidation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ValueValidation. */ + interface IValueValidation { + + /** ValueValidation values */ + values?: (string[]|null); + } + + /** Represents a ValueValidation. */ + class ValueValidation implements IValueValidation { + + /** + * Constructs a new ValueValidation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IValueValidation); + + /** ValueValidation values. */ + public values: string[]; + + /** + * Creates a new ValueValidation instance using the specified properties. + * @param [properties] Properties to set + * @returns ValueValidation instance + */ + public static create(properties?: google.cloud.dataproc.v1.IValueValidation): google.cloud.dataproc.v1.ValueValidation; + + /** + * Encodes the specified ValueValidation message. Does not implicitly {@link google.cloud.dataproc.v1.ValueValidation.verify|verify} messages. + * @param message ValueValidation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IValueValidation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ValueValidation message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ValueValidation.verify|verify} messages. + * @param message ValueValidation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IValueValidation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ValueValidation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ValueValidation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ValueValidation; + + /** + * Decodes a ValueValidation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ValueValidation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ValueValidation; + + /** + * Verifies a ValueValidation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ValueValidation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ValueValidation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ValueValidation; + + /** + * Creates a plain object from a ValueValidation message. Also converts values to other types if specified. + * @param message ValueValidation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.ValueValidation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ValueValidation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ValueValidation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WorkflowMetadata. */ + interface IWorkflowMetadata { + + /** WorkflowMetadata template */ + template?: (string|null); + + /** WorkflowMetadata version */ + version?: (number|null); + + /** WorkflowMetadata createCluster */ + createCluster?: (google.cloud.dataproc.v1.IClusterOperation|null); + + /** WorkflowMetadata graph */ + graph?: (google.cloud.dataproc.v1.IWorkflowGraph|null); + + /** WorkflowMetadata deleteCluster */ + deleteCluster?: (google.cloud.dataproc.v1.IClusterOperation|null); + + /** WorkflowMetadata state */ + state?: (google.cloud.dataproc.v1.WorkflowMetadata.State|keyof typeof google.cloud.dataproc.v1.WorkflowMetadata.State|null); + + /** WorkflowMetadata clusterName */ + clusterName?: (string|null); + + /** WorkflowMetadata parameters */ + parameters?: ({ [k: string]: string }|null); + + /** WorkflowMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** WorkflowMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** WorkflowMetadata clusterUuid */ + clusterUuid?: (string|null); + + /** WorkflowMetadata dagTimeout */ + dagTimeout?: (google.protobuf.IDuration|null); + + /** WorkflowMetadata dagStartTime */ + dagStartTime?: (google.protobuf.ITimestamp|null); + + /** WorkflowMetadata dagEndTime */ + dagEndTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a WorkflowMetadata. */ + class WorkflowMetadata implements IWorkflowMetadata { + + /** + * Constructs a new WorkflowMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IWorkflowMetadata); + + /** WorkflowMetadata template. */ + public template: string; + + /** WorkflowMetadata version. */ + public version: number; + + /** WorkflowMetadata createCluster. */ + public createCluster?: (google.cloud.dataproc.v1.IClusterOperation|null); + + /** WorkflowMetadata graph. */ + public graph?: (google.cloud.dataproc.v1.IWorkflowGraph|null); + + /** WorkflowMetadata deleteCluster. */ + public deleteCluster?: (google.cloud.dataproc.v1.IClusterOperation|null); + + /** WorkflowMetadata state. */ + public state: (google.cloud.dataproc.v1.WorkflowMetadata.State|keyof typeof google.cloud.dataproc.v1.WorkflowMetadata.State); + + /** WorkflowMetadata clusterName. */ + public clusterName: string; + + /** WorkflowMetadata parameters. */ + public parameters: { [k: string]: string }; + + /** WorkflowMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** WorkflowMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** WorkflowMetadata clusterUuid. */ + public clusterUuid: string; + + /** WorkflowMetadata dagTimeout. */ + public dagTimeout?: (google.protobuf.IDuration|null); + + /** WorkflowMetadata dagStartTime. */ + public dagStartTime?: (google.protobuf.ITimestamp|null); + + /** WorkflowMetadata dagEndTime. */ + public dagEndTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new WorkflowMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns WorkflowMetadata instance + */ + public static create(properties?: google.cloud.dataproc.v1.IWorkflowMetadata): google.cloud.dataproc.v1.WorkflowMetadata; + + /** + * Encodes the specified WorkflowMetadata message. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowMetadata.verify|verify} messages. + * @param message WorkflowMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IWorkflowMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WorkflowMetadata message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowMetadata.verify|verify} messages. + * @param message WorkflowMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IWorkflowMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WorkflowMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WorkflowMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.WorkflowMetadata; + + /** + * Decodes a WorkflowMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WorkflowMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.WorkflowMetadata; + + /** + * Verifies a WorkflowMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WorkflowMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WorkflowMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.WorkflowMetadata; + + /** + * Creates a plain object from a WorkflowMetadata message. Also converts values to other types if specified. + * @param message WorkflowMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.WorkflowMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WorkflowMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WorkflowMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace WorkflowMetadata { + + /** State enum. */ + enum State { + UNKNOWN = 0, + PENDING = 1, + RUNNING = 2, + DONE = 3 + } + } + + /** Properties of a ClusterOperation. */ + interface IClusterOperation { + + /** ClusterOperation operationId */ + operationId?: (string|null); + + /** ClusterOperation error */ + error?: (string|null); + + /** ClusterOperation done */ + done?: (boolean|null); + } + + /** Represents a ClusterOperation. */ + class ClusterOperation implements IClusterOperation { + + /** + * Constructs a new ClusterOperation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IClusterOperation); + + /** ClusterOperation operationId. */ + public operationId: string; + + /** ClusterOperation error. */ + public error: string; + + /** ClusterOperation done. */ + public done: boolean; + + /** + * Creates a new ClusterOperation instance using the specified properties. + * @param [properties] Properties to set + * @returns ClusterOperation instance + */ + public static create(properties?: google.cloud.dataproc.v1.IClusterOperation): google.cloud.dataproc.v1.ClusterOperation; + + /** + * Encodes the specified ClusterOperation message. Does not implicitly {@link google.cloud.dataproc.v1.ClusterOperation.verify|verify} messages. + * @param message ClusterOperation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IClusterOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClusterOperation message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ClusterOperation.verify|verify} messages. + * @param message ClusterOperation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IClusterOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClusterOperation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClusterOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ClusterOperation; + + /** + * Decodes a ClusterOperation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClusterOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ClusterOperation; + + /** + * Verifies a ClusterOperation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClusterOperation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClusterOperation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ClusterOperation; + + /** + * Creates a plain object from a ClusterOperation message. Also converts values to other types if specified. + * @param message ClusterOperation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.ClusterOperation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClusterOperation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClusterOperation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WorkflowGraph. */ + interface IWorkflowGraph { + + /** WorkflowGraph nodes */ + nodes?: (google.cloud.dataproc.v1.IWorkflowNode[]|null); + } + + /** Represents a WorkflowGraph. */ + class WorkflowGraph implements IWorkflowGraph { + + /** + * Constructs a new WorkflowGraph. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IWorkflowGraph); + + /** WorkflowGraph nodes. */ + public nodes: google.cloud.dataproc.v1.IWorkflowNode[]; + + /** + * Creates a new WorkflowGraph instance using the specified properties. + * @param [properties] Properties to set + * @returns WorkflowGraph instance + */ + public static create(properties?: google.cloud.dataproc.v1.IWorkflowGraph): google.cloud.dataproc.v1.WorkflowGraph; + + /** + * Encodes the specified WorkflowGraph message. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowGraph.verify|verify} messages. + * @param message WorkflowGraph message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IWorkflowGraph, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WorkflowGraph message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowGraph.verify|verify} messages. + * @param message WorkflowGraph message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IWorkflowGraph, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WorkflowGraph message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WorkflowGraph + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.WorkflowGraph; + + /** + * Decodes a WorkflowGraph message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WorkflowGraph + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.WorkflowGraph; + + /** + * Verifies a WorkflowGraph message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WorkflowGraph message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WorkflowGraph + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.WorkflowGraph; + + /** + * Creates a plain object from a WorkflowGraph message. Also converts values to other types if specified. + * @param message WorkflowGraph + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.WorkflowGraph, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WorkflowGraph to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WorkflowGraph + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WorkflowNode. */ + interface IWorkflowNode { + + /** WorkflowNode stepId */ + stepId?: (string|null); + + /** WorkflowNode prerequisiteStepIds */ + prerequisiteStepIds?: (string[]|null); + + /** WorkflowNode jobId */ + jobId?: (string|null); + + /** WorkflowNode state */ + state?: (google.cloud.dataproc.v1.WorkflowNode.NodeState|keyof typeof google.cloud.dataproc.v1.WorkflowNode.NodeState|null); + + /** WorkflowNode error */ + error?: (string|null); + } + + /** Represents a WorkflowNode. */ + class WorkflowNode implements IWorkflowNode { + + /** + * Constructs a new WorkflowNode. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IWorkflowNode); + + /** WorkflowNode stepId. */ + public stepId: string; + + /** WorkflowNode prerequisiteStepIds. */ + public prerequisiteStepIds: string[]; + + /** WorkflowNode jobId. */ + public jobId: string; + + /** WorkflowNode state. */ + public state: (google.cloud.dataproc.v1.WorkflowNode.NodeState|keyof typeof google.cloud.dataproc.v1.WorkflowNode.NodeState); + + /** WorkflowNode error. */ + public error: string; + + /** + * Creates a new WorkflowNode instance using the specified properties. + * @param [properties] Properties to set + * @returns WorkflowNode instance + */ + public static create(properties?: google.cloud.dataproc.v1.IWorkflowNode): google.cloud.dataproc.v1.WorkflowNode; + + /** + * Encodes the specified WorkflowNode message. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowNode.verify|verify} messages. + * @param message WorkflowNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IWorkflowNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WorkflowNode message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowNode.verify|verify} messages. + * @param message WorkflowNode message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IWorkflowNode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WorkflowNode message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WorkflowNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.WorkflowNode; + + /** + * Decodes a WorkflowNode message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WorkflowNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.WorkflowNode; + + /** + * Verifies a WorkflowNode message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WorkflowNode message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WorkflowNode + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.WorkflowNode; + + /** + * Creates a plain object from a WorkflowNode message. Also converts values to other types if specified. + * @param message WorkflowNode + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.WorkflowNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WorkflowNode to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WorkflowNode + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace WorkflowNode { + + /** NodeState enum. */ + enum NodeState { + NODE_STATE_UNSPECIFIED = 0, + BLOCKED = 1, + RUNNABLE = 2, + RUNNING = 3, + COMPLETED = 4, + FAILED = 5 + } + } + + /** Properties of a CreateWorkflowTemplateRequest. */ + interface ICreateWorkflowTemplateRequest { + + /** CreateWorkflowTemplateRequest parent */ + parent?: (string|null); + + /** CreateWorkflowTemplateRequest template */ + template?: (google.cloud.dataproc.v1.IWorkflowTemplate|null); + } + + /** Represents a CreateWorkflowTemplateRequest. */ + class CreateWorkflowTemplateRequest implements ICreateWorkflowTemplateRequest { + + /** + * Constructs a new CreateWorkflowTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest); + + /** CreateWorkflowTemplateRequest parent. */ + public parent: string; + + /** CreateWorkflowTemplateRequest template. */ + public template?: (google.cloud.dataproc.v1.IWorkflowTemplate|null); + + /** + * Creates a new CreateWorkflowTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateWorkflowTemplateRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest): google.cloud.dataproc.v1.CreateWorkflowTemplateRequest; + + /** + * Encodes the specified CreateWorkflowTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.CreateWorkflowTemplateRequest.verify|verify} messages. + * @param message CreateWorkflowTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateWorkflowTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.CreateWorkflowTemplateRequest.verify|verify} messages. + * @param message CreateWorkflowTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateWorkflowTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateWorkflowTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.CreateWorkflowTemplateRequest; + + /** + * Decodes a CreateWorkflowTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateWorkflowTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.CreateWorkflowTemplateRequest; + + /** + * Verifies a CreateWorkflowTemplateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateWorkflowTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateWorkflowTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.CreateWorkflowTemplateRequest; + + /** + * Creates a plain object from a CreateWorkflowTemplateRequest message. Also converts values to other types if specified. + * @param message CreateWorkflowTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.CreateWorkflowTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateWorkflowTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateWorkflowTemplateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetWorkflowTemplateRequest. */ + interface IGetWorkflowTemplateRequest { + + /** GetWorkflowTemplateRequest name */ + name?: (string|null); + + /** GetWorkflowTemplateRequest version */ + version?: (number|null); + } + + /** Represents a GetWorkflowTemplateRequest. */ + class GetWorkflowTemplateRequest implements IGetWorkflowTemplateRequest { + + /** + * Constructs a new GetWorkflowTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IGetWorkflowTemplateRequest); + + /** GetWorkflowTemplateRequest name. */ + public name: string; + + /** GetWorkflowTemplateRequest version. */ + public version: number; + + /** + * Creates a new GetWorkflowTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetWorkflowTemplateRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.IGetWorkflowTemplateRequest): google.cloud.dataproc.v1.GetWorkflowTemplateRequest; + + /** + * Encodes the specified GetWorkflowTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.GetWorkflowTemplateRequest.verify|verify} messages. + * @param message GetWorkflowTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IGetWorkflowTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetWorkflowTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GetWorkflowTemplateRequest.verify|verify} messages. + * @param message GetWorkflowTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IGetWorkflowTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetWorkflowTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetWorkflowTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.GetWorkflowTemplateRequest; + + /** + * Decodes a GetWorkflowTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetWorkflowTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.GetWorkflowTemplateRequest; + + /** + * Verifies a GetWorkflowTemplateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetWorkflowTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetWorkflowTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.GetWorkflowTemplateRequest; + + /** + * Creates a plain object from a GetWorkflowTemplateRequest message. Also converts values to other types if specified. + * @param message GetWorkflowTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.GetWorkflowTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetWorkflowTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetWorkflowTemplateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InstantiateWorkflowTemplateRequest. */ + interface IInstantiateWorkflowTemplateRequest { + + /** InstantiateWorkflowTemplateRequest name */ + name?: (string|null); + + /** InstantiateWorkflowTemplateRequest version */ + version?: (number|null); + + /** InstantiateWorkflowTemplateRequest requestId */ + requestId?: (string|null); + + /** InstantiateWorkflowTemplateRequest parameters */ + parameters?: ({ [k: string]: string }|null); + } + + /** Represents an InstantiateWorkflowTemplateRequest. */ + class InstantiateWorkflowTemplateRequest implements IInstantiateWorkflowTemplateRequest { + + /** + * Constructs a new InstantiateWorkflowTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest); + + /** InstantiateWorkflowTemplateRequest name. */ + public name: string; + + /** InstantiateWorkflowTemplateRequest version. */ + public version: number; + + /** InstantiateWorkflowTemplateRequest requestId. */ + public requestId: string; + + /** InstantiateWorkflowTemplateRequest parameters. */ + public parameters: { [k: string]: string }; + + /** + * Creates a new InstantiateWorkflowTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InstantiateWorkflowTemplateRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest): google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest; + + /** + * Encodes the specified InstantiateWorkflowTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest.verify|verify} messages. + * @param message InstantiateWorkflowTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstantiateWorkflowTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest.verify|verify} messages. + * @param message InstantiateWorkflowTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstantiateWorkflowTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstantiateWorkflowTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest; + + /** + * Decodes an InstantiateWorkflowTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstantiateWorkflowTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest; + + /** + * Verifies an InstantiateWorkflowTemplateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstantiateWorkflowTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstantiateWorkflowTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest; + + /** + * Creates a plain object from an InstantiateWorkflowTemplateRequest message. Also converts values to other types if specified. + * @param message InstantiateWorkflowTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstantiateWorkflowTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstantiateWorkflowTemplateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InstantiateInlineWorkflowTemplateRequest. */ + interface IInstantiateInlineWorkflowTemplateRequest { + + /** InstantiateInlineWorkflowTemplateRequest parent */ + parent?: (string|null); + + /** InstantiateInlineWorkflowTemplateRequest template */ + template?: (google.cloud.dataproc.v1.IWorkflowTemplate|null); + + /** InstantiateInlineWorkflowTemplateRequest requestId */ + requestId?: (string|null); + } + + /** Represents an InstantiateInlineWorkflowTemplateRequest. */ + class InstantiateInlineWorkflowTemplateRequest implements IInstantiateInlineWorkflowTemplateRequest { + + /** + * Constructs a new InstantiateInlineWorkflowTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest); + + /** InstantiateInlineWorkflowTemplateRequest parent. */ + public parent: string; + + /** InstantiateInlineWorkflowTemplateRequest template. */ + public template?: (google.cloud.dataproc.v1.IWorkflowTemplate|null); + + /** InstantiateInlineWorkflowTemplateRequest requestId. */ + public requestId: string; + + /** + * Creates a new InstantiateInlineWorkflowTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InstantiateInlineWorkflowTemplateRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest): google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest; + + /** + * Encodes the specified InstantiateInlineWorkflowTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest.verify|verify} messages. + * @param message InstantiateInlineWorkflowTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstantiateInlineWorkflowTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest.verify|verify} messages. + * @param message InstantiateInlineWorkflowTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstantiateInlineWorkflowTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstantiateInlineWorkflowTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest; + + /** + * Decodes an InstantiateInlineWorkflowTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstantiateInlineWorkflowTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest; + + /** + * Verifies an InstantiateInlineWorkflowTemplateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstantiateInlineWorkflowTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstantiateInlineWorkflowTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest; + + /** + * Creates a plain object from an InstantiateInlineWorkflowTemplateRequest message. Also converts values to other types if specified. + * @param message InstantiateInlineWorkflowTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstantiateInlineWorkflowTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstantiateInlineWorkflowTemplateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateWorkflowTemplateRequest. */ + interface IUpdateWorkflowTemplateRequest { + + /** UpdateWorkflowTemplateRequest template */ + template?: (google.cloud.dataproc.v1.IWorkflowTemplate|null); + } + + /** Represents an UpdateWorkflowTemplateRequest. */ + class UpdateWorkflowTemplateRequest implements IUpdateWorkflowTemplateRequest { + + /** + * Constructs a new UpdateWorkflowTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest); + + /** UpdateWorkflowTemplateRequest template. */ + public template?: (google.cloud.dataproc.v1.IWorkflowTemplate|null); + + /** + * Creates a new UpdateWorkflowTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateWorkflowTemplateRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest): google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest; + + /** + * Encodes the specified UpdateWorkflowTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest.verify|verify} messages. + * @param message UpdateWorkflowTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateWorkflowTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest.verify|verify} messages. + * @param message UpdateWorkflowTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateWorkflowTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateWorkflowTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest; + + /** + * Decodes an UpdateWorkflowTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateWorkflowTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest; + + /** + * Verifies an UpdateWorkflowTemplateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateWorkflowTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateWorkflowTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest; + + /** + * Creates a plain object from an UpdateWorkflowTemplateRequest message. Also converts values to other types if specified. + * @param message UpdateWorkflowTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateWorkflowTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateWorkflowTemplateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListWorkflowTemplatesRequest. */ + interface IListWorkflowTemplatesRequest { + + /** ListWorkflowTemplatesRequest parent */ + parent?: (string|null); + + /** ListWorkflowTemplatesRequest pageSize */ + pageSize?: (number|null); + + /** ListWorkflowTemplatesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListWorkflowTemplatesRequest. */ + class ListWorkflowTemplatesRequest implements IListWorkflowTemplatesRequest { + + /** + * Constructs a new ListWorkflowTemplatesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IListWorkflowTemplatesRequest); + + /** ListWorkflowTemplatesRequest parent. */ + public parent: string; + + /** ListWorkflowTemplatesRequest pageSize. */ + public pageSize: number; + + /** ListWorkflowTemplatesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListWorkflowTemplatesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListWorkflowTemplatesRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.IListWorkflowTemplatesRequest): google.cloud.dataproc.v1.ListWorkflowTemplatesRequest; + + /** + * Encodes the specified ListWorkflowTemplatesRequest message. Does not implicitly {@link google.cloud.dataproc.v1.ListWorkflowTemplatesRequest.verify|verify} messages. + * @param message ListWorkflowTemplatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IListWorkflowTemplatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListWorkflowTemplatesRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListWorkflowTemplatesRequest.verify|verify} messages. + * @param message ListWorkflowTemplatesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IListWorkflowTemplatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListWorkflowTemplatesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListWorkflowTemplatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ListWorkflowTemplatesRequest; + + /** + * Decodes a ListWorkflowTemplatesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListWorkflowTemplatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ListWorkflowTemplatesRequest; + + /** + * Verifies a ListWorkflowTemplatesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListWorkflowTemplatesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListWorkflowTemplatesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ListWorkflowTemplatesRequest; + + /** + * Creates a plain object from a ListWorkflowTemplatesRequest message. Also converts values to other types if specified. + * @param message ListWorkflowTemplatesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.ListWorkflowTemplatesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListWorkflowTemplatesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListWorkflowTemplatesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListWorkflowTemplatesResponse. */ + interface IListWorkflowTemplatesResponse { + + /** ListWorkflowTemplatesResponse templates */ + templates?: (google.cloud.dataproc.v1.IWorkflowTemplate[]|null); + + /** ListWorkflowTemplatesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListWorkflowTemplatesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListWorkflowTemplatesResponse. */ + class ListWorkflowTemplatesResponse implements IListWorkflowTemplatesResponse { + + /** + * Constructs a new ListWorkflowTemplatesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IListWorkflowTemplatesResponse); + + /** ListWorkflowTemplatesResponse templates. */ + public templates: google.cloud.dataproc.v1.IWorkflowTemplate[]; + + /** ListWorkflowTemplatesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListWorkflowTemplatesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListWorkflowTemplatesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListWorkflowTemplatesResponse instance + */ + public static create(properties?: google.cloud.dataproc.v1.IListWorkflowTemplatesResponse): google.cloud.dataproc.v1.ListWorkflowTemplatesResponse; + + /** + * Encodes the specified ListWorkflowTemplatesResponse message. Does not implicitly {@link google.cloud.dataproc.v1.ListWorkflowTemplatesResponse.verify|verify} messages. + * @param message ListWorkflowTemplatesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IListWorkflowTemplatesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListWorkflowTemplatesResponse message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListWorkflowTemplatesResponse.verify|verify} messages. + * @param message ListWorkflowTemplatesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IListWorkflowTemplatesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListWorkflowTemplatesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListWorkflowTemplatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ListWorkflowTemplatesResponse; + + /** + * Decodes a ListWorkflowTemplatesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListWorkflowTemplatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ListWorkflowTemplatesResponse; + + /** + * Verifies a ListWorkflowTemplatesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListWorkflowTemplatesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListWorkflowTemplatesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ListWorkflowTemplatesResponse; + + /** + * Creates a plain object from a ListWorkflowTemplatesResponse message. Also converts values to other types if specified. + * @param message ListWorkflowTemplatesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.ListWorkflowTemplatesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListWorkflowTemplatesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListWorkflowTemplatesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteWorkflowTemplateRequest. */ + interface IDeleteWorkflowTemplateRequest { + + /** DeleteWorkflowTemplateRequest name */ + name?: (string|null); + + /** DeleteWorkflowTemplateRequest version */ + version?: (number|null); + } + + /** Represents a DeleteWorkflowTemplateRequest. */ + class DeleteWorkflowTemplateRequest implements IDeleteWorkflowTemplateRequest { + + /** + * Constructs a new DeleteWorkflowTemplateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest); + + /** DeleteWorkflowTemplateRequest name. */ + public name: string; + + /** DeleteWorkflowTemplateRequest version. */ + public version: number; + + /** + * Creates a new DeleteWorkflowTemplateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteWorkflowTemplateRequest instance + */ + public static create(properties?: google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest): google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest; + + /** + * Encodes the specified DeleteWorkflowTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest.verify|verify} messages. + * @param message DeleteWorkflowTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteWorkflowTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest.verify|verify} messages. + * @param message DeleteWorkflowTemplateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteWorkflowTemplateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteWorkflowTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest; + + /** + * Decodes a DeleteWorkflowTemplateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteWorkflowTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest; + + /** + * Verifies a DeleteWorkflowTemplateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteWorkflowTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteWorkflowTemplateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest; + + /** + * Creates a plain object from a DeleteWorkflowTemplateRequest message. Also converts values to other types if specified. + * @param message DeleteWorkflowTemplateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteWorkflowTemplateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteWorkflowTemplateRequest + * @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; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + EDITION_2023 = 1000, + EDITION_2024 = 1001, + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + EDITION_MAX = 2147483647 + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ExtensionRangeOptions declaration */ + declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); + + /** ExtensionRangeOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification */ + verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** ExtensionRangeOptions declaration. */ + public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; + + /** ExtensionRangeOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification. */ + public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExtensionRangeOptions { + + /** Properties of a Declaration. */ + interface IDeclaration { + + /** Declaration number */ + number?: (number|null); + + /** Declaration fullName */ + fullName?: (string|null); + + /** Declaration type */ + type?: (string|null); + + /** Declaration reserved */ + reserved?: (boolean|null); + + /** Declaration repeated */ + repeated?: (boolean|null); + } + + /** Represents a Declaration. */ + class Declaration implements IDeclaration { + + /** + * Constructs a new Declaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); + + /** Declaration number. */ + public number: number; + + /** Declaration fullName. */ + public fullName: string; + + /** Declaration type. */ + public type: string; + + /** Declaration reserved. */ + public reserved: boolean; + + /** Declaration repeated. */ + public repeated: boolean; + + /** + * Creates a new Declaration instance using the specified properties. + * @param [properties] Properties to set + * @returns Declaration instance + */ + public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Verifies a Declaration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Declaration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @param message Declaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Declaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Declaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerificationState enum. */ + enum VerificationState { + DECLARATION = 0, + UNVERIFIED = 1 + } + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REPEATED = 3, + LABEL_REQUIRED = 2 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** MessageOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** MessageOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions targets */ + targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); + + /** FieldOptions editionDefaults */ + editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); + + /** FieldOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + + /** Properties of an EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** EditionDefault value */ + value?: (string|null); + } + + /** Represents an EditionDefault. */ + class EditionDefault implements IEditionDefault { + + /** + * Constructs a new EditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); + + /** EditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** EditionDefault value. */ + public value: string; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns EditionDefault instance + */ + public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; + + /** + * Verifies an EditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @param message EditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|Buffer|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|Buffer|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; + + /** + * Verifies a FeatureSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault features */ + features?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an 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 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 a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** DoubleValue value */ + value?: (number|null); + } + + /** Represents a DoubleValue. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDoubleValue); + + /** DoubleValue value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DoubleValue; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DoubleValue; + + /** + * Verifies a DoubleValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DoubleValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @param message DoubleValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DoubleValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** FloatValue value */ + value?: (number|null); + } + + /** Represents a FloatValue. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFloatValue); + + /** FloatValue value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FloatValue; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FloatValue; + + /** + * Verifies a FloatValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FloatValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @param message FloatValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FloatValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** Int64Value value */ + value?: (number|Long|string|null); + } + + /** Represents an Int64Value. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt64Value); + + /** Int64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int64Value; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int64Value; + + /** + * Verifies an Int64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @param message Int64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** UInt64Value value */ + value?: (number|Long|string|null); + } + + /** Represents a UInt64Value. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt64Value); + + /** UInt64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt64Value; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt64Value; + + /** + * Verifies a UInt64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @param message UInt64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** Int32Value value */ + value?: (number|null); + } + + /** Represents an Int32Value. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt32Value); + + /** Int32Value value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int32Value; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int32Value; + + /** + * Verifies an Int32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @param message Int32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** UInt32Value value */ + value?: (number|null); + } + + /** Represents a UInt32Value. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt32Value); + + /** UInt32Value value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt32Value; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt32Value; + + /** + * Verifies a UInt32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @param message UInt32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** BoolValue value */ + value?: (boolean|null); + } + + /** Represents a BoolValue. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBoolValue); + + /** BoolValue value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BoolValue; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BoolValue; + + /** + * Verifies a BoolValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoolValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @param message BoolValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoolValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** StringValue value */ + value?: (string|null); + } + + /** Represents a StringValue. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStringValue); + + /** StringValue value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.StringValue; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.StringValue; + + /** + * Verifies a StringValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @param message StringValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** BytesValue value */ + value?: (Uint8Array|Buffer|string|null); + } + + /** Represents a BytesValue. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBytesValue); + + /** BytesValue value. */ + public value: (Uint8Array|Buffer|string); + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BytesValue; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BytesValue; + + /** + * Verifies a BytesValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BytesValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @param message BytesValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BytesValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Operations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; + + /** + * Verifies an Operation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of an Interval. */ + interface IInterval { + + /** Interval startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Interval endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an Interval. */ + class Interval implements IInterval { + + /** + * Constructs a new Interval. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IInterval); + + /** Interval startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Interval endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Interval instance using the specified properties. + * @param [properties] Properties to set + * @returns Interval instance + */ + public static create(properties?: google.type.IInterval): google.type.Interval; + + /** + * Encodes the specified Interval message. Does not implicitly {@link google.type.Interval.verify|verify} messages. + * @param message Interval message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IInterval, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Interval message, length delimited. Does not implicitly {@link google.type.Interval.verify|verify} messages. + * @param message Interval message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IInterval, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Interval message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Interval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Interval; + + /** + * Decodes an Interval message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Interval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Interval; + + /** + * Verifies an Interval message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Interval message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Interval + */ + public static fromObject(object: { [k: string]: any }): google.type.Interval; + + /** + * Creates a plain object from an Interval message. Also converts values to other types if specified. + * @param message Interval + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Interval, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Interval to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Interval + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/owl-bot-staging/google-cloud-dataproc/protos/protos.js b/owl-bot-staging/google-cloud-dataproc/protos/protos.js new file mode 100644 index 000000000000..6dbcef9c0aca --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/protos/protos.js @@ -0,0 +1,77201 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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_dataproc_protos || ($protobuf.roots._google_cloud_dataproc_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.dataproc = (function() { + + /** + * Namespace dataproc. + * @memberof google.cloud + * @namespace + */ + var dataproc = {}; + + dataproc.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.dataproc + * @namespace + */ + var v1 = {}; + + v1.AutoscalingPolicyService = (function() { + + /** + * Constructs a new AutoscalingPolicyService service. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents an AutoscalingPolicyService + * @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 AutoscalingPolicyService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AutoscalingPolicyService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AutoscalingPolicyService; + + /** + * Creates new AutoscalingPolicyService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dataproc.v1.AutoscalingPolicyService + * @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 {AutoscalingPolicyService} RPC service. Useful where requests and/or responses are streamed. + */ + AutoscalingPolicyService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.AutoscalingPolicyService|createAutoscalingPolicy}. + * @memberof google.cloud.dataproc.v1.AutoscalingPolicyService + * @typedef CreateAutoscalingPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataproc.v1.AutoscalingPolicy} [response] AutoscalingPolicy + */ + + /** + * Calls CreateAutoscalingPolicy. + * @function createAutoscalingPolicy + * @memberof google.cloud.dataproc.v1.AutoscalingPolicyService + * @instance + * @param {google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest} request CreateAutoscalingPolicyRequest message or plain object + * @param {google.cloud.dataproc.v1.AutoscalingPolicyService.CreateAutoscalingPolicyCallback} callback Node-style callback called with the error, if any, and AutoscalingPolicy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoscalingPolicyService.prototype.createAutoscalingPolicy = function createAutoscalingPolicy(request, callback) { + return this.rpcCall(createAutoscalingPolicy, $root.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest, $root.google.cloud.dataproc.v1.AutoscalingPolicy, request, callback); + }, "name", { value: "CreateAutoscalingPolicy" }); + + /** + * Calls CreateAutoscalingPolicy. + * @function createAutoscalingPolicy + * @memberof google.cloud.dataproc.v1.AutoscalingPolicyService + * @instance + * @param {google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest} request CreateAutoscalingPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.AutoscalingPolicyService|updateAutoscalingPolicy}. + * @memberof google.cloud.dataproc.v1.AutoscalingPolicyService + * @typedef UpdateAutoscalingPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataproc.v1.AutoscalingPolicy} [response] AutoscalingPolicy + */ + + /** + * Calls UpdateAutoscalingPolicy. + * @function updateAutoscalingPolicy + * @memberof google.cloud.dataproc.v1.AutoscalingPolicyService + * @instance + * @param {google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest} request UpdateAutoscalingPolicyRequest message or plain object + * @param {google.cloud.dataproc.v1.AutoscalingPolicyService.UpdateAutoscalingPolicyCallback} callback Node-style callback called with the error, if any, and AutoscalingPolicy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoscalingPolicyService.prototype.updateAutoscalingPolicy = function updateAutoscalingPolicy(request, callback) { + return this.rpcCall(updateAutoscalingPolicy, $root.google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest, $root.google.cloud.dataproc.v1.AutoscalingPolicy, request, callback); + }, "name", { value: "UpdateAutoscalingPolicy" }); + + /** + * Calls UpdateAutoscalingPolicy. + * @function updateAutoscalingPolicy + * @memberof google.cloud.dataproc.v1.AutoscalingPolicyService + * @instance + * @param {google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest} request UpdateAutoscalingPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.AutoscalingPolicyService|getAutoscalingPolicy}. + * @memberof google.cloud.dataproc.v1.AutoscalingPolicyService + * @typedef GetAutoscalingPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataproc.v1.AutoscalingPolicy} [response] AutoscalingPolicy + */ + + /** + * Calls GetAutoscalingPolicy. + * @function getAutoscalingPolicy + * @memberof google.cloud.dataproc.v1.AutoscalingPolicyService + * @instance + * @param {google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest} request GetAutoscalingPolicyRequest message or plain object + * @param {google.cloud.dataproc.v1.AutoscalingPolicyService.GetAutoscalingPolicyCallback} callback Node-style callback called with the error, if any, and AutoscalingPolicy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoscalingPolicyService.prototype.getAutoscalingPolicy = function getAutoscalingPolicy(request, callback) { + return this.rpcCall(getAutoscalingPolicy, $root.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest, $root.google.cloud.dataproc.v1.AutoscalingPolicy, request, callback); + }, "name", { value: "GetAutoscalingPolicy" }); + + /** + * Calls GetAutoscalingPolicy. + * @function getAutoscalingPolicy + * @memberof google.cloud.dataproc.v1.AutoscalingPolicyService + * @instance + * @param {google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest} request GetAutoscalingPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.AutoscalingPolicyService|listAutoscalingPolicies}. + * @memberof google.cloud.dataproc.v1.AutoscalingPolicyService + * @typedef ListAutoscalingPoliciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse} [response] ListAutoscalingPoliciesResponse + */ + + /** + * Calls ListAutoscalingPolicies. + * @function listAutoscalingPolicies + * @memberof google.cloud.dataproc.v1.AutoscalingPolicyService + * @instance + * @param {google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest} request ListAutoscalingPoliciesRequest message or plain object + * @param {google.cloud.dataproc.v1.AutoscalingPolicyService.ListAutoscalingPoliciesCallback} callback Node-style callback called with the error, if any, and ListAutoscalingPoliciesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoscalingPolicyService.prototype.listAutoscalingPolicies = function listAutoscalingPolicies(request, callback) { + return this.rpcCall(listAutoscalingPolicies, $root.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest, $root.google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse, request, callback); + }, "name", { value: "ListAutoscalingPolicies" }); + + /** + * Calls ListAutoscalingPolicies. + * @function listAutoscalingPolicies + * @memberof google.cloud.dataproc.v1.AutoscalingPolicyService + * @instance + * @param {google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest} request ListAutoscalingPoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.AutoscalingPolicyService|deleteAutoscalingPolicy}. + * @memberof google.cloud.dataproc.v1.AutoscalingPolicyService + * @typedef DeleteAutoscalingPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteAutoscalingPolicy. + * @function deleteAutoscalingPolicy + * @memberof google.cloud.dataproc.v1.AutoscalingPolicyService + * @instance + * @param {google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest} request DeleteAutoscalingPolicyRequest message or plain object + * @param {google.cloud.dataproc.v1.AutoscalingPolicyService.DeleteAutoscalingPolicyCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AutoscalingPolicyService.prototype.deleteAutoscalingPolicy = function deleteAutoscalingPolicy(request, callback) { + return this.rpcCall(deleteAutoscalingPolicy, $root.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteAutoscalingPolicy" }); + + /** + * Calls DeleteAutoscalingPolicy. + * @function deleteAutoscalingPolicy + * @memberof google.cloud.dataproc.v1.AutoscalingPolicyService + * @instance + * @param {google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest} request DeleteAutoscalingPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AutoscalingPolicyService; + })(); + + v1.AutoscalingPolicy = (function() { + + /** + * Properties of an AutoscalingPolicy. + * @memberof google.cloud.dataproc.v1 + * @interface IAutoscalingPolicy + * @property {string|null} [id] AutoscalingPolicy id + * @property {string|null} [name] AutoscalingPolicy name + * @property {google.cloud.dataproc.v1.IBasicAutoscalingAlgorithm|null} [basicAlgorithm] AutoscalingPolicy basicAlgorithm + * @property {google.cloud.dataproc.v1.IInstanceGroupAutoscalingPolicyConfig|null} [workerConfig] AutoscalingPolicy workerConfig + * @property {google.cloud.dataproc.v1.IInstanceGroupAutoscalingPolicyConfig|null} [secondaryWorkerConfig] AutoscalingPolicy secondaryWorkerConfig + * @property {Object.|null} [labels] AutoscalingPolicy labels + * @property {google.cloud.dataproc.v1.AutoscalingPolicy.ClusterType|null} [clusterType] AutoscalingPolicy clusterType + */ + + /** + * Constructs a new AutoscalingPolicy. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents an AutoscalingPolicy. + * @implements IAutoscalingPolicy + * @constructor + * @param {google.cloud.dataproc.v1.IAutoscalingPolicy=} [properties] Properties to set + */ + function AutoscalingPolicy(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoscalingPolicy id. + * @member {string} id + * @memberof google.cloud.dataproc.v1.AutoscalingPolicy + * @instance + */ + AutoscalingPolicy.prototype.id = ""; + + /** + * AutoscalingPolicy name. + * @member {string} name + * @memberof google.cloud.dataproc.v1.AutoscalingPolicy + * @instance + */ + AutoscalingPolicy.prototype.name = ""; + + /** + * AutoscalingPolicy basicAlgorithm. + * @member {google.cloud.dataproc.v1.IBasicAutoscalingAlgorithm|null|undefined} basicAlgorithm + * @memberof google.cloud.dataproc.v1.AutoscalingPolicy + * @instance + */ + AutoscalingPolicy.prototype.basicAlgorithm = null; + + /** + * AutoscalingPolicy workerConfig. + * @member {google.cloud.dataproc.v1.IInstanceGroupAutoscalingPolicyConfig|null|undefined} workerConfig + * @memberof google.cloud.dataproc.v1.AutoscalingPolicy + * @instance + */ + AutoscalingPolicy.prototype.workerConfig = null; + + /** + * AutoscalingPolicy secondaryWorkerConfig. + * @member {google.cloud.dataproc.v1.IInstanceGroupAutoscalingPolicyConfig|null|undefined} secondaryWorkerConfig + * @memberof google.cloud.dataproc.v1.AutoscalingPolicy + * @instance + */ + AutoscalingPolicy.prototype.secondaryWorkerConfig = null; + + /** + * AutoscalingPolicy labels. + * @member {Object.} labels + * @memberof google.cloud.dataproc.v1.AutoscalingPolicy + * @instance + */ + AutoscalingPolicy.prototype.labels = $util.emptyObject; + + /** + * AutoscalingPolicy clusterType. + * @member {google.cloud.dataproc.v1.AutoscalingPolicy.ClusterType} clusterType + * @memberof google.cloud.dataproc.v1.AutoscalingPolicy + * @instance + */ + AutoscalingPolicy.prototype.clusterType = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AutoscalingPolicy algorithm. + * @member {"basicAlgorithm"|undefined} algorithm + * @memberof google.cloud.dataproc.v1.AutoscalingPolicy + * @instance + */ + Object.defineProperty(AutoscalingPolicy.prototype, "algorithm", { + get: $util.oneOfGetter($oneOfFields = ["basicAlgorithm"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AutoscalingPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.AutoscalingPolicy + * @static + * @param {google.cloud.dataproc.v1.IAutoscalingPolicy=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.AutoscalingPolicy} AutoscalingPolicy instance + */ + AutoscalingPolicy.create = function create(properties) { + return new AutoscalingPolicy(properties); + }; + + /** + * Encodes the specified AutoscalingPolicy message. Does not implicitly {@link google.cloud.dataproc.v1.AutoscalingPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.AutoscalingPolicy + * @static + * @param {google.cloud.dataproc.v1.IAutoscalingPolicy} message AutoscalingPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.basicAlgorithm != null && Object.hasOwnProperty.call(message, "basicAlgorithm")) + $root.google.cloud.dataproc.v1.BasicAutoscalingAlgorithm.encode(message.basicAlgorithm, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.workerConfig != null && Object.hasOwnProperty.call(message, "workerConfig")) + $root.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig.encode(message.workerConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.secondaryWorkerConfig != null && Object.hasOwnProperty.call(message, "secondaryWorkerConfig")) + $root.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig.encode(message.secondaryWorkerConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.clusterType != null && Object.hasOwnProperty.call(message, "clusterType")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.clusterType); + return writer; + }; + + /** + * Encodes the specified AutoscalingPolicy message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.AutoscalingPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.AutoscalingPolicy + * @static + * @param {google.cloud.dataproc.v1.IAutoscalingPolicy} message AutoscalingPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoscalingPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.AutoscalingPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.AutoscalingPolicy} AutoscalingPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingPolicy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.AutoscalingPolicy(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + case 3: { + message.basicAlgorithm = $root.google.cloud.dataproc.v1.BasicAutoscalingAlgorithm.decode(reader, reader.uint32()); + break; + } + case 4: { + message.workerConfig = $root.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.secondaryWorkerConfig = $root.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 7: { + message.clusterType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoscalingPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.AutoscalingPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.AutoscalingPolicy} AutoscalingPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoscalingPolicy message. + * @function verify + * @memberof google.cloud.dataproc.v1.AutoscalingPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoscalingPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.basicAlgorithm != null && message.hasOwnProperty("basicAlgorithm")) { + properties.algorithm = 1; + { + var error = $root.google.cloud.dataproc.v1.BasicAutoscalingAlgorithm.verify(message.basicAlgorithm); + if (error) + return "basicAlgorithm." + error; + } + } + if (message.workerConfig != null && message.hasOwnProperty("workerConfig")) { + var error = $root.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig.verify(message.workerConfig); + if (error) + return "workerConfig." + error; + } + if (message.secondaryWorkerConfig != null && message.hasOwnProperty("secondaryWorkerConfig")) { + var error = $root.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig.verify(message.secondaryWorkerConfig); + if (error) + return "secondaryWorkerConfig." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.clusterType != null && message.hasOwnProperty("clusterType")) + switch (message.clusterType) { + default: + return "clusterType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an AutoscalingPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.AutoscalingPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.AutoscalingPolicy} AutoscalingPolicy + */ + AutoscalingPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.AutoscalingPolicy) + return object; + var message = new $root.google.cloud.dataproc.v1.AutoscalingPolicy(); + if (object.id != null) + message.id = String(object.id); + if (object.name != null) + message.name = String(object.name); + if (object.basicAlgorithm != null) { + if (typeof object.basicAlgorithm !== "object") + throw TypeError(".google.cloud.dataproc.v1.AutoscalingPolicy.basicAlgorithm: object expected"); + message.basicAlgorithm = $root.google.cloud.dataproc.v1.BasicAutoscalingAlgorithm.fromObject(object.basicAlgorithm); + } + if (object.workerConfig != null) { + if (typeof object.workerConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.AutoscalingPolicy.workerConfig: object expected"); + message.workerConfig = $root.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig.fromObject(object.workerConfig); + } + if (object.secondaryWorkerConfig != null) { + if (typeof object.secondaryWorkerConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.AutoscalingPolicy.secondaryWorkerConfig: object expected"); + message.secondaryWorkerConfig = $root.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig.fromObject(object.secondaryWorkerConfig); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.dataproc.v1.AutoscalingPolicy.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + switch (object.clusterType) { + default: + if (typeof object.clusterType === "number") { + message.clusterType = object.clusterType; + break; + } + break; + case "CLUSTER_TYPE_UNSPECIFIED": + case 0: + message.clusterType = 0; + break; + case "STANDARD": + case 1: + message.clusterType = 1; + break; + case "ZERO_SCALE": + case 2: + message.clusterType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an AutoscalingPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.AutoscalingPolicy + * @static + * @param {google.cloud.dataproc.v1.AutoscalingPolicy} message AutoscalingPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoscalingPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.id = ""; + object.name = ""; + object.workerConfig = null; + object.secondaryWorkerConfig = null; + object.clusterType = options.enums === String ? "CLUSTER_TYPE_UNSPECIFIED" : 0; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.basicAlgorithm != null && message.hasOwnProperty("basicAlgorithm")) { + object.basicAlgorithm = $root.google.cloud.dataproc.v1.BasicAutoscalingAlgorithm.toObject(message.basicAlgorithm, options); + if (options.oneofs) + object.algorithm = "basicAlgorithm"; + } + if (message.workerConfig != null && message.hasOwnProperty("workerConfig")) + object.workerConfig = $root.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig.toObject(message.workerConfig, options); + if (message.secondaryWorkerConfig != null && message.hasOwnProperty("secondaryWorkerConfig")) + object.secondaryWorkerConfig = $root.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig.toObject(message.secondaryWorkerConfig, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.clusterType != null && message.hasOwnProperty("clusterType")) + object.clusterType = options.enums === String ? $root.google.cloud.dataproc.v1.AutoscalingPolicy.ClusterType[message.clusterType] === undefined ? message.clusterType : $root.google.cloud.dataproc.v1.AutoscalingPolicy.ClusterType[message.clusterType] : message.clusterType; + return object; + }; + + /** + * Converts this AutoscalingPolicy to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.AutoscalingPolicy + * @instance + * @returns {Object.} JSON object + */ + AutoscalingPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoscalingPolicy + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.AutoscalingPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoscalingPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.AutoscalingPolicy"; + }; + + /** + * ClusterType enum. + * @name google.cloud.dataproc.v1.AutoscalingPolicy.ClusterType + * @enum {number} + * @property {number} CLUSTER_TYPE_UNSPECIFIED=0 CLUSTER_TYPE_UNSPECIFIED value + * @property {number} STANDARD=1 STANDARD value + * @property {number} ZERO_SCALE=2 ZERO_SCALE value + */ + AutoscalingPolicy.ClusterType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLUSTER_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STANDARD"] = 1; + values[valuesById[2] = "ZERO_SCALE"] = 2; + return values; + })(); + + return AutoscalingPolicy; + })(); + + v1.BasicAutoscalingAlgorithm = (function() { + + /** + * Properties of a BasicAutoscalingAlgorithm. + * @memberof google.cloud.dataproc.v1 + * @interface IBasicAutoscalingAlgorithm + * @property {google.cloud.dataproc.v1.IBasicYarnAutoscalingConfig|null} [yarnConfig] BasicAutoscalingAlgorithm yarnConfig + * @property {google.protobuf.IDuration|null} [cooldownPeriod] BasicAutoscalingAlgorithm cooldownPeriod + */ + + /** + * Constructs a new BasicAutoscalingAlgorithm. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a BasicAutoscalingAlgorithm. + * @implements IBasicAutoscalingAlgorithm + * @constructor + * @param {google.cloud.dataproc.v1.IBasicAutoscalingAlgorithm=} [properties] Properties to set + */ + function BasicAutoscalingAlgorithm(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BasicAutoscalingAlgorithm yarnConfig. + * @member {google.cloud.dataproc.v1.IBasicYarnAutoscalingConfig|null|undefined} yarnConfig + * @memberof google.cloud.dataproc.v1.BasicAutoscalingAlgorithm + * @instance + */ + BasicAutoscalingAlgorithm.prototype.yarnConfig = null; + + /** + * BasicAutoscalingAlgorithm cooldownPeriod. + * @member {google.protobuf.IDuration|null|undefined} cooldownPeriod + * @memberof google.cloud.dataproc.v1.BasicAutoscalingAlgorithm + * @instance + */ + BasicAutoscalingAlgorithm.prototype.cooldownPeriod = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BasicAutoscalingAlgorithm config. + * @member {"yarnConfig"|undefined} config + * @memberof google.cloud.dataproc.v1.BasicAutoscalingAlgorithm + * @instance + */ + Object.defineProperty(BasicAutoscalingAlgorithm.prototype, "config", { + get: $util.oneOfGetter($oneOfFields = ["yarnConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BasicAutoscalingAlgorithm instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.BasicAutoscalingAlgorithm + * @static + * @param {google.cloud.dataproc.v1.IBasicAutoscalingAlgorithm=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.BasicAutoscalingAlgorithm} BasicAutoscalingAlgorithm instance + */ + BasicAutoscalingAlgorithm.create = function create(properties) { + return new BasicAutoscalingAlgorithm(properties); + }; + + /** + * Encodes the specified BasicAutoscalingAlgorithm message. Does not implicitly {@link google.cloud.dataproc.v1.BasicAutoscalingAlgorithm.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.BasicAutoscalingAlgorithm + * @static + * @param {google.cloud.dataproc.v1.IBasicAutoscalingAlgorithm} message BasicAutoscalingAlgorithm message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BasicAutoscalingAlgorithm.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.yarnConfig != null && Object.hasOwnProperty.call(message, "yarnConfig")) + $root.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.encode(message.yarnConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.cooldownPeriod != null && Object.hasOwnProperty.call(message, "cooldownPeriod")) + $root.google.protobuf.Duration.encode(message.cooldownPeriod, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BasicAutoscalingAlgorithm message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.BasicAutoscalingAlgorithm.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.BasicAutoscalingAlgorithm + * @static + * @param {google.cloud.dataproc.v1.IBasicAutoscalingAlgorithm} message BasicAutoscalingAlgorithm message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BasicAutoscalingAlgorithm.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BasicAutoscalingAlgorithm message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.BasicAutoscalingAlgorithm + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.BasicAutoscalingAlgorithm} BasicAutoscalingAlgorithm + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BasicAutoscalingAlgorithm.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.BasicAutoscalingAlgorithm(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.yarnConfig = $root.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.cooldownPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BasicAutoscalingAlgorithm message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.BasicAutoscalingAlgorithm + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.BasicAutoscalingAlgorithm} BasicAutoscalingAlgorithm + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BasicAutoscalingAlgorithm.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BasicAutoscalingAlgorithm message. + * @function verify + * @memberof google.cloud.dataproc.v1.BasicAutoscalingAlgorithm + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BasicAutoscalingAlgorithm.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.yarnConfig != null && message.hasOwnProperty("yarnConfig")) { + properties.config = 1; + { + var error = $root.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.verify(message.yarnConfig); + if (error) + return "yarnConfig." + error; + } + } + if (message.cooldownPeriod != null && message.hasOwnProperty("cooldownPeriod")) { + var error = $root.google.protobuf.Duration.verify(message.cooldownPeriod); + if (error) + return "cooldownPeriod." + error; + } + return null; + }; + + /** + * Creates a BasicAutoscalingAlgorithm message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.BasicAutoscalingAlgorithm + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.BasicAutoscalingAlgorithm} BasicAutoscalingAlgorithm + */ + BasicAutoscalingAlgorithm.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.BasicAutoscalingAlgorithm) + return object; + var message = new $root.google.cloud.dataproc.v1.BasicAutoscalingAlgorithm(); + if (object.yarnConfig != null) { + if (typeof object.yarnConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.BasicAutoscalingAlgorithm.yarnConfig: object expected"); + message.yarnConfig = $root.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.fromObject(object.yarnConfig); + } + if (object.cooldownPeriod != null) { + if (typeof object.cooldownPeriod !== "object") + throw TypeError(".google.cloud.dataproc.v1.BasicAutoscalingAlgorithm.cooldownPeriod: object expected"); + message.cooldownPeriod = $root.google.protobuf.Duration.fromObject(object.cooldownPeriod); + } + return message; + }; + + /** + * Creates a plain object from a BasicAutoscalingAlgorithm message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.BasicAutoscalingAlgorithm + * @static + * @param {google.cloud.dataproc.v1.BasicAutoscalingAlgorithm} message BasicAutoscalingAlgorithm + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BasicAutoscalingAlgorithm.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.cooldownPeriod = null; + if (message.yarnConfig != null && message.hasOwnProperty("yarnConfig")) { + object.yarnConfig = $root.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.toObject(message.yarnConfig, options); + if (options.oneofs) + object.config = "yarnConfig"; + } + if (message.cooldownPeriod != null && message.hasOwnProperty("cooldownPeriod")) + object.cooldownPeriod = $root.google.protobuf.Duration.toObject(message.cooldownPeriod, options); + return object; + }; + + /** + * Converts this BasicAutoscalingAlgorithm to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.BasicAutoscalingAlgorithm + * @instance + * @returns {Object.} JSON object + */ + BasicAutoscalingAlgorithm.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BasicAutoscalingAlgorithm + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.BasicAutoscalingAlgorithm + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BasicAutoscalingAlgorithm.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.BasicAutoscalingAlgorithm"; + }; + + return BasicAutoscalingAlgorithm; + })(); + + v1.BasicYarnAutoscalingConfig = (function() { + + /** + * Properties of a BasicYarnAutoscalingConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IBasicYarnAutoscalingConfig + * @property {google.protobuf.IDuration|null} [gracefulDecommissionTimeout] BasicYarnAutoscalingConfig gracefulDecommissionTimeout + * @property {number|null} [scaleUpFactor] BasicYarnAutoscalingConfig scaleUpFactor + * @property {number|null} [scaleDownFactor] BasicYarnAutoscalingConfig scaleDownFactor + * @property {number|null} [scaleUpMinWorkerFraction] BasicYarnAutoscalingConfig scaleUpMinWorkerFraction + * @property {number|null} [scaleDownMinWorkerFraction] BasicYarnAutoscalingConfig scaleDownMinWorkerFraction + */ + + /** + * Constructs a new BasicYarnAutoscalingConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a BasicYarnAutoscalingConfig. + * @implements IBasicYarnAutoscalingConfig + * @constructor + * @param {google.cloud.dataproc.v1.IBasicYarnAutoscalingConfig=} [properties] Properties to set + */ + function BasicYarnAutoscalingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BasicYarnAutoscalingConfig gracefulDecommissionTimeout. + * @member {google.protobuf.IDuration|null|undefined} gracefulDecommissionTimeout + * @memberof google.cloud.dataproc.v1.BasicYarnAutoscalingConfig + * @instance + */ + BasicYarnAutoscalingConfig.prototype.gracefulDecommissionTimeout = null; + + /** + * BasicYarnAutoscalingConfig scaleUpFactor. + * @member {number} scaleUpFactor + * @memberof google.cloud.dataproc.v1.BasicYarnAutoscalingConfig + * @instance + */ + BasicYarnAutoscalingConfig.prototype.scaleUpFactor = 0; + + /** + * BasicYarnAutoscalingConfig scaleDownFactor. + * @member {number} scaleDownFactor + * @memberof google.cloud.dataproc.v1.BasicYarnAutoscalingConfig + * @instance + */ + BasicYarnAutoscalingConfig.prototype.scaleDownFactor = 0; + + /** + * BasicYarnAutoscalingConfig scaleUpMinWorkerFraction. + * @member {number} scaleUpMinWorkerFraction + * @memberof google.cloud.dataproc.v1.BasicYarnAutoscalingConfig + * @instance + */ + BasicYarnAutoscalingConfig.prototype.scaleUpMinWorkerFraction = 0; + + /** + * BasicYarnAutoscalingConfig scaleDownMinWorkerFraction. + * @member {number} scaleDownMinWorkerFraction + * @memberof google.cloud.dataproc.v1.BasicYarnAutoscalingConfig + * @instance + */ + BasicYarnAutoscalingConfig.prototype.scaleDownMinWorkerFraction = 0; + + /** + * Creates a new BasicYarnAutoscalingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.BasicYarnAutoscalingConfig + * @static + * @param {google.cloud.dataproc.v1.IBasicYarnAutoscalingConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.BasicYarnAutoscalingConfig} BasicYarnAutoscalingConfig instance + */ + BasicYarnAutoscalingConfig.create = function create(properties) { + return new BasicYarnAutoscalingConfig(properties); + }; + + /** + * Encodes the specified BasicYarnAutoscalingConfig message. Does not implicitly {@link google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.BasicYarnAutoscalingConfig + * @static + * @param {google.cloud.dataproc.v1.IBasicYarnAutoscalingConfig} message BasicYarnAutoscalingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BasicYarnAutoscalingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scaleUpFactor != null && Object.hasOwnProperty.call(message, "scaleUpFactor")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.scaleUpFactor); + if (message.scaleDownFactor != null && Object.hasOwnProperty.call(message, "scaleDownFactor")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.scaleDownFactor); + if (message.scaleUpMinWorkerFraction != null && Object.hasOwnProperty.call(message, "scaleUpMinWorkerFraction")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.scaleUpMinWorkerFraction); + if (message.scaleDownMinWorkerFraction != null && Object.hasOwnProperty.call(message, "scaleDownMinWorkerFraction")) + writer.uint32(/* id 4, wireType 1 =*/33).double(message.scaleDownMinWorkerFraction); + if (message.gracefulDecommissionTimeout != null && Object.hasOwnProperty.call(message, "gracefulDecommissionTimeout")) + $root.google.protobuf.Duration.encode(message.gracefulDecommissionTimeout, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BasicYarnAutoscalingConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.BasicYarnAutoscalingConfig + * @static + * @param {google.cloud.dataproc.v1.IBasicYarnAutoscalingConfig} message BasicYarnAutoscalingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BasicYarnAutoscalingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BasicYarnAutoscalingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.BasicYarnAutoscalingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.BasicYarnAutoscalingConfig} BasicYarnAutoscalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BasicYarnAutoscalingConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 5: { + message.gracefulDecommissionTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 1: { + message.scaleUpFactor = reader.double(); + break; + } + case 2: { + message.scaleDownFactor = reader.double(); + break; + } + case 3: { + message.scaleUpMinWorkerFraction = reader.double(); + break; + } + case 4: { + message.scaleDownMinWorkerFraction = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BasicYarnAutoscalingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.BasicYarnAutoscalingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.BasicYarnAutoscalingConfig} BasicYarnAutoscalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BasicYarnAutoscalingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BasicYarnAutoscalingConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.BasicYarnAutoscalingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BasicYarnAutoscalingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gracefulDecommissionTimeout != null && message.hasOwnProperty("gracefulDecommissionTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.gracefulDecommissionTimeout); + if (error) + return "gracefulDecommissionTimeout." + error; + } + if (message.scaleUpFactor != null && message.hasOwnProperty("scaleUpFactor")) + if (typeof message.scaleUpFactor !== "number") + return "scaleUpFactor: number expected"; + if (message.scaleDownFactor != null && message.hasOwnProperty("scaleDownFactor")) + if (typeof message.scaleDownFactor !== "number") + return "scaleDownFactor: number expected"; + if (message.scaleUpMinWorkerFraction != null && message.hasOwnProperty("scaleUpMinWorkerFraction")) + if (typeof message.scaleUpMinWorkerFraction !== "number") + return "scaleUpMinWorkerFraction: number expected"; + if (message.scaleDownMinWorkerFraction != null && message.hasOwnProperty("scaleDownMinWorkerFraction")) + if (typeof message.scaleDownMinWorkerFraction !== "number") + return "scaleDownMinWorkerFraction: number expected"; + return null; + }; + + /** + * Creates a BasicYarnAutoscalingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.BasicYarnAutoscalingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.BasicYarnAutoscalingConfig} BasicYarnAutoscalingConfig + */ + BasicYarnAutoscalingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig(); + if (object.gracefulDecommissionTimeout != null) { + if (typeof object.gracefulDecommissionTimeout !== "object") + throw TypeError(".google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.gracefulDecommissionTimeout: object expected"); + message.gracefulDecommissionTimeout = $root.google.protobuf.Duration.fromObject(object.gracefulDecommissionTimeout); + } + if (object.scaleUpFactor != null) + message.scaleUpFactor = Number(object.scaleUpFactor); + if (object.scaleDownFactor != null) + message.scaleDownFactor = Number(object.scaleDownFactor); + if (object.scaleUpMinWorkerFraction != null) + message.scaleUpMinWorkerFraction = Number(object.scaleUpMinWorkerFraction); + if (object.scaleDownMinWorkerFraction != null) + message.scaleDownMinWorkerFraction = Number(object.scaleDownMinWorkerFraction); + return message; + }; + + /** + * Creates a plain object from a BasicYarnAutoscalingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.BasicYarnAutoscalingConfig + * @static + * @param {google.cloud.dataproc.v1.BasicYarnAutoscalingConfig} message BasicYarnAutoscalingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BasicYarnAutoscalingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.scaleUpFactor = 0; + object.scaleDownFactor = 0; + object.scaleUpMinWorkerFraction = 0; + object.scaleDownMinWorkerFraction = 0; + object.gracefulDecommissionTimeout = null; + } + if (message.scaleUpFactor != null && message.hasOwnProperty("scaleUpFactor")) + object.scaleUpFactor = options.json && !isFinite(message.scaleUpFactor) ? String(message.scaleUpFactor) : message.scaleUpFactor; + if (message.scaleDownFactor != null && message.hasOwnProperty("scaleDownFactor")) + object.scaleDownFactor = options.json && !isFinite(message.scaleDownFactor) ? String(message.scaleDownFactor) : message.scaleDownFactor; + if (message.scaleUpMinWorkerFraction != null && message.hasOwnProperty("scaleUpMinWorkerFraction")) + object.scaleUpMinWorkerFraction = options.json && !isFinite(message.scaleUpMinWorkerFraction) ? String(message.scaleUpMinWorkerFraction) : message.scaleUpMinWorkerFraction; + if (message.scaleDownMinWorkerFraction != null && message.hasOwnProperty("scaleDownMinWorkerFraction")) + object.scaleDownMinWorkerFraction = options.json && !isFinite(message.scaleDownMinWorkerFraction) ? String(message.scaleDownMinWorkerFraction) : message.scaleDownMinWorkerFraction; + if (message.gracefulDecommissionTimeout != null && message.hasOwnProperty("gracefulDecommissionTimeout")) + object.gracefulDecommissionTimeout = $root.google.protobuf.Duration.toObject(message.gracefulDecommissionTimeout, options); + return object; + }; + + /** + * Converts this BasicYarnAutoscalingConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.BasicYarnAutoscalingConfig + * @instance + * @returns {Object.} JSON object + */ + BasicYarnAutoscalingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BasicYarnAutoscalingConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.BasicYarnAutoscalingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BasicYarnAutoscalingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.BasicYarnAutoscalingConfig"; + }; + + return BasicYarnAutoscalingConfig; + })(); + + v1.InstanceGroupAutoscalingPolicyConfig = (function() { + + /** + * Properties of an InstanceGroupAutoscalingPolicyConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IInstanceGroupAutoscalingPolicyConfig + * @property {number|null} [minInstances] InstanceGroupAutoscalingPolicyConfig minInstances + * @property {number|null} [maxInstances] InstanceGroupAutoscalingPolicyConfig maxInstances + * @property {number|null} [weight] InstanceGroupAutoscalingPolicyConfig weight + */ + + /** + * Constructs a new InstanceGroupAutoscalingPolicyConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents an InstanceGroupAutoscalingPolicyConfig. + * @implements IInstanceGroupAutoscalingPolicyConfig + * @constructor + * @param {google.cloud.dataproc.v1.IInstanceGroupAutoscalingPolicyConfig=} [properties] Properties to set + */ + function InstanceGroupAutoscalingPolicyConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroupAutoscalingPolicyConfig minInstances. + * @member {number} minInstances + * @memberof google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig + * @instance + */ + InstanceGroupAutoscalingPolicyConfig.prototype.minInstances = 0; + + /** + * InstanceGroupAutoscalingPolicyConfig maxInstances. + * @member {number} maxInstances + * @memberof google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig + * @instance + */ + InstanceGroupAutoscalingPolicyConfig.prototype.maxInstances = 0; + + /** + * InstanceGroupAutoscalingPolicyConfig weight. + * @member {number} weight + * @memberof google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig + * @instance + */ + InstanceGroupAutoscalingPolicyConfig.prototype.weight = 0; + + /** + * Creates a new InstanceGroupAutoscalingPolicyConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig + * @static + * @param {google.cloud.dataproc.v1.IInstanceGroupAutoscalingPolicyConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig} InstanceGroupAutoscalingPolicyConfig instance + */ + InstanceGroupAutoscalingPolicyConfig.create = function create(properties) { + return new InstanceGroupAutoscalingPolicyConfig(properties); + }; + + /** + * Encodes the specified InstanceGroupAutoscalingPolicyConfig message. Does not implicitly {@link google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig + * @static + * @param {google.cloud.dataproc.v1.IInstanceGroupAutoscalingPolicyConfig} message InstanceGroupAutoscalingPolicyConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupAutoscalingPolicyConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minInstances != null && Object.hasOwnProperty.call(message, "minInstances")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.minInstances); + if (message.maxInstances != null && Object.hasOwnProperty.call(message, "maxInstances")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxInstances); + if (message.weight != null && Object.hasOwnProperty.call(message, "weight")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.weight); + return writer; + }; + + /** + * Encodes the specified InstanceGroupAutoscalingPolicyConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig + * @static + * @param {google.cloud.dataproc.v1.IInstanceGroupAutoscalingPolicyConfig} message InstanceGroupAutoscalingPolicyConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupAutoscalingPolicyConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroupAutoscalingPolicyConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig} InstanceGroupAutoscalingPolicyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupAutoscalingPolicyConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.minInstances = reader.int32(); + break; + } + case 2: { + message.maxInstances = reader.int32(); + break; + } + case 3: { + message.weight = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroupAutoscalingPolicyConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig} InstanceGroupAutoscalingPolicyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupAutoscalingPolicyConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroupAutoscalingPolicyConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroupAutoscalingPolicyConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.minInstances != null && message.hasOwnProperty("minInstances")) + if (!$util.isInteger(message.minInstances)) + return "minInstances: integer expected"; + if (message.maxInstances != null && message.hasOwnProperty("maxInstances")) + if (!$util.isInteger(message.maxInstances)) + return "maxInstances: integer expected"; + if (message.weight != null && message.hasOwnProperty("weight")) + if (!$util.isInteger(message.weight)) + return "weight: integer expected"; + return null; + }; + + /** + * Creates an InstanceGroupAutoscalingPolicyConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig} InstanceGroupAutoscalingPolicyConfig + */ + InstanceGroupAutoscalingPolicyConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig(); + if (object.minInstances != null) + message.minInstances = object.minInstances | 0; + if (object.maxInstances != null) + message.maxInstances = object.maxInstances | 0; + if (object.weight != null) + message.weight = object.weight | 0; + return message; + }; + + /** + * Creates a plain object from an InstanceGroupAutoscalingPolicyConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig + * @static + * @param {google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig} message InstanceGroupAutoscalingPolicyConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroupAutoscalingPolicyConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.minInstances = 0; + object.maxInstances = 0; + object.weight = 0; + } + if (message.minInstances != null && message.hasOwnProperty("minInstances")) + object.minInstances = message.minInstances; + if (message.maxInstances != null && message.hasOwnProperty("maxInstances")) + object.maxInstances = message.maxInstances; + if (message.weight != null && message.hasOwnProperty("weight")) + object.weight = message.weight; + return object; + }; + + /** + * Converts this InstanceGroupAutoscalingPolicyConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig + * @instance + * @returns {Object.} JSON object + */ + InstanceGroupAutoscalingPolicyConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstanceGroupAutoscalingPolicyConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstanceGroupAutoscalingPolicyConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig"; + }; + + return InstanceGroupAutoscalingPolicyConfig; + })(); + + v1.CreateAutoscalingPolicyRequest = (function() { + + /** + * Properties of a CreateAutoscalingPolicyRequest. + * @memberof google.cloud.dataproc.v1 + * @interface ICreateAutoscalingPolicyRequest + * @property {string|null} [parent] CreateAutoscalingPolicyRequest parent + * @property {google.cloud.dataproc.v1.IAutoscalingPolicy|null} [policy] CreateAutoscalingPolicyRequest policy + */ + + /** + * Constructs a new CreateAutoscalingPolicyRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a CreateAutoscalingPolicyRequest. + * @implements ICreateAutoscalingPolicyRequest + * @constructor + * @param {google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest=} [properties] Properties to set + */ + function CreateAutoscalingPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateAutoscalingPolicyRequest parent. + * @member {string} parent + * @memberof google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest + * @instance + */ + CreateAutoscalingPolicyRequest.prototype.parent = ""; + + /** + * CreateAutoscalingPolicyRequest policy. + * @member {google.cloud.dataproc.v1.IAutoscalingPolicy|null|undefined} policy + * @memberof google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest + * @instance + */ + CreateAutoscalingPolicyRequest.prototype.policy = null; + + /** + * Creates a new CreateAutoscalingPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest + * @static + * @param {google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest} CreateAutoscalingPolicyRequest instance + */ + CreateAutoscalingPolicyRequest.create = function create(properties) { + return new CreateAutoscalingPolicyRequest(properties); + }; + + /** + * Encodes the specified CreateAutoscalingPolicyRequest message. Does not implicitly {@link google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest + * @static + * @param {google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest} message CreateAutoscalingPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAutoscalingPolicyRequest.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.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.cloud.dataproc.v1.AutoscalingPolicy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateAutoscalingPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest + * @static + * @param {google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest} message CreateAutoscalingPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateAutoscalingPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateAutoscalingPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest} CreateAutoscalingPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAutoscalingPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest(); + 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.policy = $root.google.cloud.dataproc.v1.AutoscalingPolicy.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateAutoscalingPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest} CreateAutoscalingPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateAutoscalingPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateAutoscalingPolicyRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateAutoscalingPolicyRequest.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.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.cloud.dataproc.v1.AutoscalingPolicy.verify(message.policy); + if (error) + return "policy." + error; + } + return null; + }; + + /** + * Creates a CreateAutoscalingPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest} CreateAutoscalingPolicyRequest + */ + CreateAutoscalingPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest.policy: object expected"); + message.policy = $root.google.cloud.dataproc.v1.AutoscalingPolicy.fromObject(object.policy); + } + return message; + }; + + /** + * Creates a plain object from a CreateAutoscalingPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest + * @static + * @param {google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest} message CreateAutoscalingPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateAutoscalingPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.policy = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.cloud.dataproc.v1.AutoscalingPolicy.toObject(message.policy, options); + return object; + }; + + /** + * Converts this CreateAutoscalingPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + CreateAutoscalingPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateAutoscalingPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateAutoscalingPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest"; + }; + + return CreateAutoscalingPolicyRequest; + })(); + + v1.GetAutoscalingPolicyRequest = (function() { + + /** + * Properties of a GetAutoscalingPolicyRequest. + * @memberof google.cloud.dataproc.v1 + * @interface IGetAutoscalingPolicyRequest + * @property {string|null} [name] GetAutoscalingPolicyRequest name + */ + + /** + * Constructs a new GetAutoscalingPolicyRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a GetAutoscalingPolicyRequest. + * @implements IGetAutoscalingPolicyRequest + * @constructor + * @param {google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest=} [properties] Properties to set + */ + function GetAutoscalingPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAutoscalingPolicyRequest name. + * @member {string} name + * @memberof google.cloud.dataproc.v1.GetAutoscalingPolicyRequest + * @instance + */ + GetAutoscalingPolicyRequest.prototype.name = ""; + + /** + * Creates a new GetAutoscalingPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.GetAutoscalingPolicyRequest + * @static + * @param {google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.GetAutoscalingPolicyRequest} GetAutoscalingPolicyRequest instance + */ + GetAutoscalingPolicyRequest.create = function create(properties) { + return new GetAutoscalingPolicyRequest(properties); + }; + + /** + * Encodes the specified GetAutoscalingPolicyRequest message. Does not implicitly {@link google.cloud.dataproc.v1.GetAutoscalingPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.GetAutoscalingPolicyRequest + * @static + * @param {google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest} message GetAutoscalingPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAutoscalingPolicyRequest.encode = function encode(message, writer) { + 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 GetAutoscalingPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GetAutoscalingPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.GetAutoscalingPolicyRequest + * @static + * @param {google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest} message GetAutoscalingPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAutoscalingPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAutoscalingPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.GetAutoscalingPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.GetAutoscalingPolicyRequest} GetAutoscalingPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAutoscalingPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest(); + 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 GetAutoscalingPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.GetAutoscalingPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.GetAutoscalingPolicyRequest} GetAutoscalingPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAutoscalingPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAutoscalingPolicyRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.GetAutoscalingPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAutoscalingPolicyRequest.verify = function verify(message) { + if (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 GetAutoscalingPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.GetAutoscalingPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.GetAutoscalingPolicyRequest} GetAutoscalingPolicyRequest + */ + GetAutoscalingPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAutoscalingPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.GetAutoscalingPolicyRequest + * @static + * @param {google.cloud.dataproc.v1.GetAutoscalingPolicyRequest} message GetAutoscalingPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAutoscalingPolicyRequest.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 GetAutoscalingPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.GetAutoscalingPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetAutoscalingPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetAutoscalingPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.GetAutoscalingPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetAutoscalingPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.GetAutoscalingPolicyRequest"; + }; + + return GetAutoscalingPolicyRequest; + })(); + + v1.UpdateAutoscalingPolicyRequest = (function() { + + /** + * Properties of an UpdateAutoscalingPolicyRequest. + * @memberof google.cloud.dataproc.v1 + * @interface IUpdateAutoscalingPolicyRequest + * @property {google.cloud.dataproc.v1.IAutoscalingPolicy|null} [policy] UpdateAutoscalingPolicyRequest policy + */ + + /** + * Constructs a new UpdateAutoscalingPolicyRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents an UpdateAutoscalingPolicyRequest. + * @implements IUpdateAutoscalingPolicyRequest + * @constructor + * @param {google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest=} [properties] Properties to set + */ + function UpdateAutoscalingPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateAutoscalingPolicyRequest policy. + * @member {google.cloud.dataproc.v1.IAutoscalingPolicy|null|undefined} policy + * @memberof google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest + * @instance + */ + UpdateAutoscalingPolicyRequest.prototype.policy = null; + + /** + * Creates a new UpdateAutoscalingPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest + * @static + * @param {google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest} UpdateAutoscalingPolicyRequest instance + */ + UpdateAutoscalingPolicyRequest.create = function create(properties) { + return new UpdateAutoscalingPolicyRequest(properties); + }; + + /** + * Encodes the specified UpdateAutoscalingPolicyRequest message. Does not implicitly {@link google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest + * @static + * @param {google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest} message UpdateAutoscalingPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAutoscalingPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.cloud.dataproc.v1.AutoscalingPolicy.encode(message.policy, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateAutoscalingPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest + * @static + * @param {google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest} message UpdateAutoscalingPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAutoscalingPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAutoscalingPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest} UpdateAutoscalingPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAutoscalingPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.policy = $root.google.cloud.dataproc.v1.AutoscalingPolicy.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateAutoscalingPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest} UpdateAutoscalingPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAutoscalingPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAutoscalingPolicyRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAutoscalingPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.cloud.dataproc.v1.AutoscalingPolicy.verify(message.policy); + if (error) + return "policy." + error; + } + return null; + }; + + /** + * Creates an UpdateAutoscalingPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest} UpdateAutoscalingPolicyRequest + */ + UpdateAutoscalingPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest(); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest.policy: object expected"); + message.policy = $root.google.cloud.dataproc.v1.AutoscalingPolicy.fromObject(object.policy); + } + return message; + }; + + /** + * Creates a plain object from an UpdateAutoscalingPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest + * @static + * @param {google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest} message UpdateAutoscalingPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAutoscalingPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.policy = null; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.cloud.dataproc.v1.AutoscalingPolicy.toObject(message.policy, options); + return object; + }; + + /** + * Converts this UpdateAutoscalingPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateAutoscalingPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateAutoscalingPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateAutoscalingPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest"; + }; + + return UpdateAutoscalingPolicyRequest; + })(); + + v1.DeleteAutoscalingPolicyRequest = (function() { + + /** + * Properties of a DeleteAutoscalingPolicyRequest. + * @memberof google.cloud.dataproc.v1 + * @interface IDeleteAutoscalingPolicyRequest + * @property {string|null} [name] DeleteAutoscalingPolicyRequest name + */ + + /** + * Constructs a new DeleteAutoscalingPolicyRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a DeleteAutoscalingPolicyRequest. + * @implements IDeleteAutoscalingPolicyRequest + * @constructor + * @param {google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest=} [properties] Properties to set + */ + function DeleteAutoscalingPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteAutoscalingPolicyRequest name. + * @member {string} name + * @memberof google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest + * @instance + */ + DeleteAutoscalingPolicyRequest.prototype.name = ""; + + /** + * Creates a new DeleteAutoscalingPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest + * @static + * @param {google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest} DeleteAutoscalingPolicyRequest instance + */ + DeleteAutoscalingPolicyRequest.create = function create(properties) { + return new DeleteAutoscalingPolicyRequest(properties); + }; + + /** + * Encodes the specified DeleteAutoscalingPolicyRequest message. Does not implicitly {@link google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest + * @static + * @param {google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest} message DeleteAutoscalingPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAutoscalingPolicyRequest.encode = function encode(message, writer) { + 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 DeleteAutoscalingPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest + * @static + * @param {google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest} message DeleteAutoscalingPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAutoscalingPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAutoscalingPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest} DeleteAutoscalingPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAutoscalingPolicyRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest(); + 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 DeleteAutoscalingPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest} DeleteAutoscalingPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAutoscalingPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAutoscalingPolicyRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAutoscalingPolicyRequest.verify = function verify(message) { + if (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 DeleteAutoscalingPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest} DeleteAutoscalingPolicyRequest + */ + DeleteAutoscalingPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteAutoscalingPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest + * @static + * @param {google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest} message DeleteAutoscalingPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAutoscalingPolicyRequest.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 DeleteAutoscalingPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAutoscalingPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteAutoscalingPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteAutoscalingPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest"; + }; + + return DeleteAutoscalingPolicyRequest; + })(); + + v1.ListAutoscalingPoliciesRequest = (function() { + + /** + * Properties of a ListAutoscalingPoliciesRequest. + * @memberof google.cloud.dataproc.v1 + * @interface IListAutoscalingPoliciesRequest + * @property {string|null} [parent] ListAutoscalingPoliciesRequest parent + * @property {number|null} [pageSize] ListAutoscalingPoliciesRequest pageSize + * @property {string|null} [pageToken] ListAutoscalingPoliciesRequest pageToken + */ + + /** + * Constructs a new ListAutoscalingPoliciesRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a ListAutoscalingPoliciesRequest. + * @implements IListAutoscalingPoliciesRequest + * @constructor + * @param {google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest=} [properties] Properties to set + */ + function ListAutoscalingPoliciesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAutoscalingPoliciesRequest parent. + * @member {string} parent + * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest + * @instance + */ + ListAutoscalingPoliciesRequest.prototype.parent = ""; + + /** + * ListAutoscalingPoliciesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest + * @instance + */ + ListAutoscalingPoliciesRequest.prototype.pageSize = 0; + + /** + * ListAutoscalingPoliciesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest + * @instance + */ + ListAutoscalingPoliciesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListAutoscalingPoliciesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest + * @static + * @param {google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest} ListAutoscalingPoliciesRequest instance + */ + ListAutoscalingPoliciesRequest.create = function create(properties) { + return new ListAutoscalingPoliciesRequest(properties); + }; + + /** + * Encodes the specified ListAutoscalingPoliciesRequest message. Does not implicitly {@link google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest + * @static + * @param {google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest} message ListAutoscalingPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAutoscalingPoliciesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListAutoscalingPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest + * @static + * @param {google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest} message ListAutoscalingPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAutoscalingPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAutoscalingPoliciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest} ListAutoscalingPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAutoscalingPoliciesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAutoscalingPoliciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest} ListAutoscalingPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAutoscalingPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAutoscalingPoliciesRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAutoscalingPoliciesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListAutoscalingPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest} ListAutoscalingPoliciesRequest + */ + ListAutoscalingPoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListAutoscalingPoliciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest + * @static + * @param {google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest} message ListAutoscalingPoliciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAutoscalingPoliciesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListAutoscalingPoliciesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest + * @instance + * @returns {Object.} JSON object + */ + ListAutoscalingPoliciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAutoscalingPoliciesRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAutoscalingPoliciesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest"; + }; + + return ListAutoscalingPoliciesRequest; + })(); + + v1.ListAutoscalingPoliciesResponse = (function() { + + /** + * Properties of a ListAutoscalingPoliciesResponse. + * @memberof google.cloud.dataproc.v1 + * @interface IListAutoscalingPoliciesResponse + * @property {Array.|null} [policies] ListAutoscalingPoliciesResponse policies + * @property {string|null} [nextPageToken] ListAutoscalingPoliciesResponse nextPageToken + */ + + /** + * Constructs a new ListAutoscalingPoliciesResponse. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a ListAutoscalingPoliciesResponse. + * @implements IListAutoscalingPoliciesResponse + * @constructor + * @param {google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse=} [properties] Properties to set + */ + function ListAutoscalingPoliciesResponse(properties) { + this.policies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAutoscalingPoliciesResponse policies. + * @member {Array.} policies + * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse + * @instance + */ + ListAutoscalingPoliciesResponse.prototype.policies = $util.emptyArray; + + /** + * ListAutoscalingPoliciesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse + * @instance + */ + ListAutoscalingPoliciesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAutoscalingPoliciesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse + * @static + * @param {google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse} ListAutoscalingPoliciesResponse instance + */ + ListAutoscalingPoliciesResponse.create = function create(properties) { + return new ListAutoscalingPoliciesResponse(properties); + }; + + /** + * Encodes the specified ListAutoscalingPoliciesResponse message. Does not implicitly {@link google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse + * @static + * @param {google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse} message ListAutoscalingPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAutoscalingPoliciesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.policies != null && message.policies.length) + for (var i = 0; i < message.policies.length; ++i) + $root.google.cloud.dataproc.v1.AutoscalingPolicy.encode(message.policies[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 ListAutoscalingPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse + * @static + * @param {google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse} message ListAutoscalingPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAutoscalingPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAutoscalingPoliciesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse} ListAutoscalingPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAutoscalingPoliciesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.policies && message.policies.length)) + message.policies = []; + message.policies.push($root.google.cloud.dataproc.v1.AutoscalingPolicy.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAutoscalingPoliciesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse} ListAutoscalingPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAutoscalingPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAutoscalingPoliciesResponse message. + * @function verify + * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAutoscalingPoliciesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.policies != null && message.hasOwnProperty("policies")) { + if (!Array.isArray(message.policies)) + return "policies: array expected"; + for (var i = 0; i < message.policies.length; ++i) { + var error = $root.google.cloud.dataproc.v1.AutoscalingPolicy.verify(message.policies[i]); + if (error) + return "policies." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAutoscalingPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse} ListAutoscalingPoliciesResponse + */ + ListAutoscalingPoliciesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse) + return object; + var message = new $root.google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse(); + if (object.policies) { + if (!Array.isArray(object.policies)) + throw TypeError(".google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse.policies: array expected"); + message.policies = []; + for (var i = 0; i < object.policies.length; ++i) { + if (typeof object.policies[i] !== "object") + throw TypeError(".google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse.policies: object expected"); + message.policies[i] = $root.google.cloud.dataproc.v1.AutoscalingPolicy.fromObject(object.policies[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAutoscalingPoliciesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse + * @static + * @param {google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse} message ListAutoscalingPoliciesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAutoscalingPoliciesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.policies = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.policies && message.policies.length) { + object.policies = []; + for (var j = 0; j < message.policies.length; ++j) + object.policies[j] = $root.google.cloud.dataproc.v1.AutoscalingPolicy.toObject(message.policies[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAutoscalingPoliciesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse + * @instance + * @returns {Object.} JSON object + */ + ListAutoscalingPoliciesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAutoscalingPoliciesResponse + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAutoscalingPoliciesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse"; + }; + + return ListAutoscalingPoliciesResponse; + })(); + + v1.BatchController = (function() { + + /** + * Constructs a new BatchController service. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a BatchController + * @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 BatchController(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (BatchController.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = BatchController; + + /** + * Creates new BatchController service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dataproc.v1.BatchController + * @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 {BatchController} RPC service. Useful where requests and/or responses are streamed. + */ + BatchController.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.BatchController|createBatch}. + * @memberof google.cloud.dataproc.v1.BatchController + * @typedef CreateBatchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateBatch. + * @function createBatch + * @memberof google.cloud.dataproc.v1.BatchController + * @instance + * @param {google.cloud.dataproc.v1.ICreateBatchRequest} request CreateBatchRequest message or plain object + * @param {google.cloud.dataproc.v1.BatchController.CreateBatchCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchController.prototype.createBatch = function createBatch(request, callback) { + return this.rpcCall(createBatch, $root.google.cloud.dataproc.v1.CreateBatchRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateBatch" }); + + /** + * Calls CreateBatch. + * @function createBatch + * @memberof google.cloud.dataproc.v1.BatchController + * @instance + * @param {google.cloud.dataproc.v1.ICreateBatchRequest} request CreateBatchRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.BatchController|getBatch}. + * @memberof google.cloud.dataproc.v1.BatchController + * @typedef GetBatchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataproc.v1.Batch} [response] Batch + */ + + /** + * Calls GetBatch. + * @function getBatch + * @memberof google.cloud.dataproc.v1.BatchController + * @instance + * @param {google.cloud.dataproc.v1.IGetBatchRequest} request GetBatchRequest message or plain object + * @param {google.cloud.dataproc.v1.BatchController.GetBatchCallback} callback Node-style callback called with the error, if any, and Batch + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchController.prototype.getBatch = function getBatch(request, callback) { + return this.rpcCall(getBatch, $root.google.cloud.dataproc.v1.GetBatchRequest, $root.google.cloud.dataproc.v1.Batch, request, callback); + }, "name", { value: "GetBatch" }); + + /** + * Calls GetBatch. + * @function getBatch + * @memberof google.cloud.dataproc.v1.BatchController + * @instance + * @param {google.cloud.dataproc.v1.IGetBatchRequest} request GetBatchRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.BatchController|listBatches}. + * @memberof google.cloud.dataproc.v1.BatchController + * @typedef ListBatchesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataproc.v1.ListBatchesResponse} [response] ListBatchesResponse + */ + + /** + * Calls ListBatches. + * @function listBatches + * @memberof google.cloud.dataproc.v1.BatchController + * @instance + * @param {google.cloud.dataproc.v1.IListBatchesRequest} request ListBatchesRequest message or plain object + * @param {google.cloud.dataproc.v1.BatchController.ListBatchesCallback} callback Node-style callback called with the error, if any, and ListBatchesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchController.prototype.listBatches = function listBatches(request, callback) { + return this.rpcCall(listBatches, $root.google.cloud.dataproc.v1.ListBatchesRequest, $root.google.cloud.dataproc.v1.ListBatchesResponse, request, callback); + }, "name", { value: "ListBatches" }); + + /** + * Calls ListBatches. + * @function listBatches + * @memberof google.cloud.dataproc.v1.BatchController + * @instance + * @param {google.cloud.dataproc.v1.IListBatchesRequest} request ListBatchesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.BatchController|deleteBatch}. + * @memberof google.cloud.dataproc.v1.BatchController + * @typedef DeleteBatchCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteBatch. + * @function deleteBatch + * @memberof google.cloud.dataproc.v1.BatchController + * @instance + * @param {google.cloud.dataproc.v1.IDeleteBatchRequest} request DeleteBatchRequest message or plain object + * @param {google.cloud.dataproc.v1.BatchController.DeleteBatchCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchController.prototype.deleteBatch = function deleteBatch(request, callback) { + return this.rpcCall(deleteBatch, $root.google.cloud.dataproc.v1.DeleteBatchRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteBatch" }); + + /** + * Calls DeleteBatch. + * @function deleteBatch + * @memberof google.cloud.dataproc.v1.BatchController + * @instance + * @param {google.cloud.dataproc.v1.IDeleteBatchRequest} request DeleteBatchRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return BatchController; + })(); + + v1.CreateBatchRequest = (function() { + + /** + * Properties of a CreateBatchRequest. + * @memberof google.cloud.dataproc.v1 + * @interface ICreateBatchRequest + * @property {string|null} [parent] CreateBatchRequest parent + * @property {google.cloud.dataproc.v1.IBatch|null} [batch] CreateBatchRequest batch + * @property {string|null} [batchId] CreateBatchRequest batchId + * @property {string|null} [requestId] CreateBatchRequest requestId + */ + + /** + * Constructs a new CreateBatchRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a CreateBatchRequest. + * @implements ICreateBatchRequest + * @constructor + * @param {google.cloud.dataproc.v1.ICreateBatchRequest=} [properties] Properties to set + */ + function CreateBatchRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateBatchRequest parent. + * @member {string} parent + * @memberof google.cloud.dataproc.v1.CreateBatchRequest + * @instance + */ + CreateBatchRequest.prototype.parent = ""; + + /** + * CreateBatchRequest batch. + * @member {google.cloud.dataproc.v1.IBatch|null|undefined} batch + * @memberof google.cloud.dataproc.v1.CreateBatchRequest + * @instance + */ + CreateBatchRequest.prototype.batch = null; + + /** + * CreateBatchRequest batchId. + * @member {string} batchId + * @memberof google.cloud.dataproc.v1.CreateBatchRequest + * @instance + */ + CreateBatchRequest.prototype.batchId = ""; + + /** + * CreateBatchRequest requestId. + * @member {string} requestId + * @memberof google.cloud.dataproc.v1.CreateBatchRequest + * @instance + */ + CreateBatchRequest.prototype.requestId = ""; + + /** + * Creates a new CreateBatchRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.CreateBatchRequest + * @static + * @param {google.cloud.dataproc.v1.ICreateBatchRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.CreateBatchRequest} CreateBatchRequest instance + */ + CreateBatchRequest.create = function create(properties) { + return new CreateBatchRequest(properties); + }; + + /** + * Encodes the specified CreateBatchRequest message. Does not implicitly {@link google.cloud.dataproc.v1.CreateBatchRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.CreateBatchRequest + * @static + * @param {google.cloud.dataproc.v1.ICreateBatchRequest} message CreateBatchRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBatchRequest.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.batch != null && Object.hasOwnProperty.call(message, "batch")) + $root.google.cloud.dataproc.v1.Batch.encode(message.batch, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.batchId != null && Object.hasOwnProperty.call(message, "batchId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.batchId); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateBatchRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.CreateBatchRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.CreateBatchRequest + * @static + * @param {google.cloud.dataproc.v1.ICreateBatchRequest} message CreateBatchRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBatchRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBatchRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.CreateBatchRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.CreateBatchRequest} CreateBatchRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBatchRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.CreateBatchRequest(); + 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.batch = $root.google.cloud.dataproc.v1.Batch.decode(reader, reader.uint32()); + break; + } + case 3: { + message.batchId = reader.string(); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBatchRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.CreateBatchRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.CreateBatchRequest} CreateBatchRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBatchRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBatchRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.CreateBatchRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBatchRequest.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.batch != null && message.hasOwnProperty("batch")) { + var error = $root.google.cloud.dataproc.v1.Batch.verify(message.batch); + if (error) + return "batch." + error; + } + if (message.batchId != null && message.hasOwnProperty("batchId")) + if (!$util.isString(message.batchId)) + return "batchId: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateBatchRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.CreateBatchRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.CreateBatchRequest} CreateBatchRequest + */ + CreateBatchRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.CreateBatchRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.CreateBatchRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.batch != null) { + if (typeof object.batch !== "object") + throw TypeError(".google.cloud.dataproc.v1.CreateBatchRequest.batch: object expected"); + message.batch = $root.google.cloud.dataproc.v1.Batch.fromObject(object.batch); + } + if (object.batchId != null) + message.batchId = String(object.batchId); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateBatchRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.CreateBatchRequest + * @static + * @param {google.cloud.dataproc.v1.CreateBatchRequest} message CreateBatchRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBatchRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.batch = null; + object.batchId = ""; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.batch != null && message.hasOwnProperty("batch")) + object.batch = $root.google.cloud.dataproc.v1.Batch.toObject(message.batch, options); + if (message.batchId != null && message.hasOwnProperty("batchId")) + object.batchId = message.batchId; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateBatchRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.CreateBatchRequest + * @instance + * @returns {Object.} JSON object + */ + CreateBatchRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateBatchRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.CreateBatchRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBatchRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.CreateBatchRequest"; + }; + + return CreateBatchRequest; + })(); + + v1.GetBatchRequest = (function() { + + /** + * Properties of a GetBatchRequest. + * @memberof google.cloud.dataproc.v1 + * @interface IGetBatchRequest + * @property {string|null} [name] GetBatchRequest name + */ + + /** + * Constructs a new GetBatchRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a GetBatchRequest. + * @implements IGetBatchRequest + * @constructor + * @param {google.cloud.dataproc.v1.IGetBatchRequest=} [properties] Properties to set + */ + function GetBatchRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBatchRequest name. + * @member {string} name + * @memberof google.cloud.dataproc.v1.GetBatchRequest + * @instance + */ + GetBatchRequest.prototype.name = ""; + + /** + * Creates a new GetBatchRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.GetBatchRequest + * @static + * @param {google.cloud.dataproc.v1.IGetBatchRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.GetBatchRequest} GetBatchRequest instance + */ + GetBatchRequest.create = function create(properties) { + return new GetBatchRequest(properties); + }; + + /** + * Encodes the specified GetBatchRequest message. Does not implicitly {@link google.cloud.dataproc.v1.GetBatchRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.GetBatchRequest + * @static + * @param {google.cloud.dataproc.v1.IGetBatchRequest} message GetBatchRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBatchRequest.encode = function encode(message, writer) { + 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 GetBatchRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GetBatchRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.GetBatchRequest + * @static + * @param {google.cloud.dataproc.v1.IGetBatchRequest} message GetBatchRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBatchRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBatchRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.GetBatchRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.GetBatchRequest} GetBatchRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBatchRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.GetBatchRequest(); + 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 GetBatchRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.GetBatchRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.GetBatchRequest} GetBatchRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBatchRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBatchRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.GetBatchRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBatchRequest.verify = function verify(message) { + if (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 GetBatchRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.GetBatchRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.GetBatchRequest} GetBatchRequest + */ + GetBatchRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.GetBatchRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.GetBatchRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetBatchRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.GetBatchRequest + * @static + * @param {google.cloud.dataproc.v1.GetBatchRequest} message GetBatchRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBatchRequest.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 GetBatchRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.GetBatchRequest + * @instance + * @returns {Object.} JSON object + */ + GetBatchRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBatchRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.GetBatchRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBatchRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.GetBatchRequest"; + }; + + return GetBatchRequest; + })(); + + v1.ListBatchesRequest = (function() { + + /** + * Properties of a ListBatchesRequest. + * @memberof google.cloud.dataproc.v1 + * @interface IListBatchesRequest + * @property {string|null} [parent] ListBatchesRequest parent + * @property {number|null} [pageSize] ListBatchesRequest pageSize + * @property {string|null} [pageToken] ListBatchesRequest pageToken + * @property {string|null} [filter] ListBatchesRequest filter + * @property {string|null} [orderBy] ListBatchesRequest orderBy + */ + + /** + * Constructs a new ListBatchesRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a ListBatchesRequest. + * @implements IListBatchesRequest + * @constructor + * @param {google.cloud.dataproc.v1.IListBatchesRequest=} [properties] Properties to set + */ + function ListBatchesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBatchesRequest parent. + * @member {string} parent + * @memberof google.cloud.dataproc.v1.ListBatchesRequest + * @instance + */ + ListBatchesRequest.prototype.parent = ""; + + /** + * ListBatchesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dataproc.v1.ListBatchesRequest + * @instance + */ + ListBatchesRequest.prototype.pageSize = 0; + + /** + * ListBatchesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dataproc.v1.ListBatchesRequest + * @instance + */ + ListBatchesRequest.prototype.pageToken = ""; + + /** + * ListBatchesRequest filter. + * @member {string} filter + * @memberof google.cloud.dataproc.v1.ListBatchesRequest + * @instance + */ + ListBatchesRequest.prototype.filter = ""; + + /** + * ListBatchesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.dataproc.v1.ListBatchesRequest + * @instance + */ + ListBatchesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListBatchesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.ListBatchesRequest + * @static + * @param {google.cloud.dataproc.v1.IListBatchesRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.ListBatchesRequest} ListBatchesRequest instance + */ + ListBatchesRequest.create = function create(properties) { + return new ListBatchesRequest(properties); + }; + + /** + * Encodes the specified ListBatchesRequest message. Does not implicitly {@link google.cloud.dataproc.v1.ListBatchesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.ListBatchesRequest + * @static + * @param {google.cloud.dataproc.v1.IListBatchesRequest} message ListBatchesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBatchesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListBatchesRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListBatchesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.ListBatchesRequest + * @static + * @param {google.cloud.dataproc.v1.IListBatchesRequest} message ListBatchesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBatchesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBatchesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.ListBatchesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.ListBatchesRequest} ListBatchesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBatchesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ListBatchesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBatchesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.ListBatchesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.ListBatchesRequest} ListBatchesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBatchesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBatchesRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.ListBatchesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBatchesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListBatchesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.ListBatchesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.ListBatchesRequest} ListBatchesRequest + */ + ListBatchesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.ListBatchesRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.ListBatchesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListBatchesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.ListBatchesRequest + * @static + * @param {google.cloud.dataproc.v1.ListBatchesRequest} message ListBatchesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBatchesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListBatchesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.ListBatchesRequest + * @instance + * @returns {Object.} JSON object + */ + ListBatchesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBatchesRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.ListBatchesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBatchesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.ListBatchesRequest"; + }; + + return ListBatchesRequest; + })(); + + v1.ListBatchesResponse = (function() { + + /** + * Properties of a ListBatchesResponse. + * @memberof google.cloud.dataproc.v1 + * @interface IListBatchesResponse + * @property {Array.|null} [batches] ListBatchesResponse batches + * @property {string|null} [nextPageToken] ListBatchesResponse nextPageToken + * @property {Array.|null} [unreachable] ListBatchesResponse unreachable + */ + + /** + * Constructs a new ListBatchesResponse. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a ListBatchesResponse. + * @implements IListBatchesResponse + * @constructor + * @param {google.cloud.dataproc.v1.IListBatchesResponse=} [properties] Properties to set + */ + function ListBatchesResponse(properties) { + this.batches = []; + 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]]; + } + + /** + * ListBatchesResponse batches. + * @member {Array.} batches + * @memberof google.cloud.dataproc.v1.ListBatchesResponse + * @instance + */ + ListBatchesResponse.prototype.batches = $util.emptyArray; + + /** + * ListBatchesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dataproc.v1.ListBatchesResponse + * @instance + */ + ListBatchesResponse.prototype.nextPageToken = ""; + + /** + * ListBatchesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.dataproc.v1.ListBatchesResponse + * @instance + */ + ListBatchesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListBatchesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.ListBatchesResponse + * @static + * @param {google.cloud.dataproc.v1.IListBatchesResponse=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.ListBatchesResponse} ListBatchesResponse instance + */ + ListBatchesResponse.create = function create(properties) { + return new ListBatchesResponse(properties); + }; + + /** + * Encodes the specified ListBatchesResponse message. Does not implicitly {@link google.cloud.dataproc.v1.ListBatchesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.ListBatchesResponse + * @static + * @param {google.cloud.dataproc.v1.IListBatchesResponse} message ListBatchesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBatchesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.batches != null && message.batches.length) + for (var i = 0; i < message.batches.length; ++i) + $root.google.cloud.dataproc.v1.Batch.encode(message.batches[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 ListBatchesResponse message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListBatchesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.ListBatchesResponse + * @static + * @param {google.cloud.dataproc.v1.IListBatchesResponse} message ListBatchesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBatchesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBatchesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.ListBatchesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.ListBatchesResponse} ListBatchesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBatchesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ListBatchesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.batches && message.batches.length)) + message.batches = []; + message.batches.push($root.google.cloud.dataproc.v1.Batch.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 ListBatchesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.ListBatchesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.ListBatchesResponse} ListBatchesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBatchesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBatchesResponse message. + * @function verify + * @memberof google.cloud.dataproc.v1.ListBatchesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBatchesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.batches != null && message.hasOwnProperty("batches")) { + if (!Array.isArray(message.batches)) + return "batches: array expected"; + for (var i = 0; i < message.batches.length; ++i) { + var error = $root.google.cloud.dataproc.v1.Batch.verify(message.batches[i]); + if (error) + return "batches." + 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 ListBatchesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.ListBatchesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.ListBatchesResponse} ListBatchesResponse + */ + ListBatchesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.ListBatchesResponse) + return object; + var message = new $root.google.cloud.dataproc.v1.ListBatchesResponse(); + if (object.batches) { + if (!Array.isArray(object.batches)) + throw TypeError(".google.cloud.dataproc.v1.ListBatchesResponse.batches: array expected"); + message.batches = []; + for (var i = 0; i < object.batches.length; ++i) { + if (typeof object.batches[i] !== "object") + throw TypeError(".google.cloud.dataproc.v1.ListBatchesResponse.batches: object expected"); + message.batches[i] = $root.google.cloud.dataproc.v1.Batch.fromObject(object.batches[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.dataproc.v1.ListBatchesResponse.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 ListBatchesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.ListBatchesResponse + * @static + * @param {google.cloud.dataproc.v1.ListBatchesResponse} message ListBatchesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBatchesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.batches = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.batches && message.batches.length) { + object.batches = []; + for (var j = 0; j < message.batches.length; ++j) + object.batches[j] = $root.google.cloud.dataproc.v1.Batch.toObject(message.batches[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 ListBatchesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.ListBatchesResponse + * @instance + * @returns {Object.} JSON object + */ + ListBatchesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBatchesResponse + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.ListBatchesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBatchesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.ListBatchesResponse"; + }; + + return ListBatchesResponse; + })(); + + v1.DeleteBatchRequest = (function() { + + /** + * Properties of a DeleteBatchRequest. + * @memberof google.cloud.dataproc.v1 + * @interface IDeleteBatchRequest + * @property {string|null} [name] DeleteBatchRequest name + */ + + /** + * Constructs a new DeleteBatchRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a DeleteBatchRequest. + * @implements IDeleteBatchRequest + * @constructor + * @param {google.cloud.dataproc.v1.IDeleteBatchRequest=} [properties] Properties to set + */ + function DeleteBatchRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteBatchRequest name. + * @member {string} name + * @memberof google.cloud.dataproc.v1.DeleteBatchRequest + * @instance + */ + DeleteBatchRequest.prototype.name = ""; + + /** + * Creates a new DeleteBatchRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.DeleteBatchRequest + * @static + * @param {google.cloud.dataproc.v1.IDeleteBatchRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.DeleteBatchRequest} DeleteBatchRequest instance + */ + DeleteBatchRequest.create = function create(properties) { + return new DeleteBatchRequest(properties); + }; + + /** + * Encodes the specified DeleteBatchRequest message. Does not implicitly {@link google.cloud.dataproc.v1.DeleteBatchRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.DeleteBatchRequest + * @static + * @param {google.cloud.dataproc.v1.IDeleteBatchRequest} message DeleteBatchRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBatchRequest.encode = function encode(message, writer) { + 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 DeleteBatchRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DeleteBatchRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.DeleteBatchRequest + * @static + * @param {google.cloud.dataproc.v1.IDeleteBatchRequest} message DeleteBatchRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBatchRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteBatchRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.DeleteBatchRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.DeleteBatchRequest} DeleteBatchRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBatchRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.DeleteBatchRequest(); + 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 DeleteBatchRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.DeleteBatchRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.DeleteBatchRequest} DeleteBatchRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBatchRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteBatchRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.DeleteBatchRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteBatchRequest.verify = function verify(message) { + if (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 DeleteBatchRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.DeleteBatchRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.DeleteBatchRequest} DeleteBatchRequest + */ + DeleteBatchRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.DeleteBatchRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.DeleteBatchRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteBatchRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.DeleteBatchRequest + * @static + * @param {google.cloud.dataproc.v1.DeleteBatchRequest} message DeleteBatchRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteBatchRequest.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 DeleteBatchRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.DeleteBatchRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBatchRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteBatchRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.DeleteBatchRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteBatchRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.DeleteBatchRequest"; + }; + + return DeleteBatchRequest; + })(); + + v1.Batch = (function() { + + /** + * Properties of a Batch. + * @memberof google.cloud.dataproc.v1 + * @interface IBatch + * @property {string|null} [name] Batch name + * @property {string|null} [uuid] Batch uuid + * @property {google.protobuf.ITimestamp|null} [createTime] Batch createTime + * @property {google.cloud.dataproc.v1.IPySparkBatch|null} [pysparkBatch] Batch pysparkBatch + * @property {google.cloud.dataproc.v1.ISparkBatch|null} [sparkBatch] Batch sparkBatch + * @property {google.cloud.dataproc.v1.ISparkRBatch|null} [sparkRBatch] Batch sparkRBatch + * @property {google.cloud.dataproc.v1.ISparkSqlBatch|null} [sparkSqlBatch] Batch sparkSqlBatch + * @property {google.cloud.dataproc.v1.IPySparkNotebookBatch|null} [pysparkNotebookBatch] Batch pysparkNotebookBatch + * @property {google.cloud.dataproc.v1.IRuntimeInfo|null} [runtimeInfo] Batch runtimeInfo + * @property {google.cloud.dataproc.v1.Batch.State|null} [state] Batch state + * @property {string|null} [stateMessage] Batch stateMessage + * @property {google.protobuf.ITimestamp|null} [stateTime] Batch stateTime + * @property {string|null} [creator] Batch creator + * @property {Object.|null} [labels] Batch labels + * @property {google.cloud.dataproc.v1.IRuntimeConfig|null} [runtimeConfig] Batch runtimeConfig + * @property {google.cloud.dataproc.v1.IEnvironmentConfig|null} [environmentConfig] Batch environmentConfig + * @property {string|null} [operation] Batch operation + * @property {Array.|null} [stateHistory] Batch stateHistory + */ + + /** + * Constructs a new Batch. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a Batch. + * @implements IBatch + * @constructor + * @param {google.cloud.dataproc.v1.IBatch=} [properties] Properties to set + */ + function Batch(properties) { + this.labels = {}; + this.stateHistory = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Batch name. + * @member {string} name + * @memberof google.cloud.dataproc.v1.Batch + * @instance + */ + Batch.prototype.name = ""; + + /** + * Batch uuid. + * @member {string} uuid + * @memberof google.cloud.dataproc.v1.Batch + * @instance + */ + Batch.prototype.uuid = ""; + + /** + * Batch createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.dataproc.v1.Batch + * @instance + */ + Batch.prototype.createTime = null; + + /** + * Batch pysparkBatch. + * @member {google.cloud.dataproc.v1.IPySparkBatch|null|undefined} pysparkBatch + * @memberof google.cloud.dataproc.v1.Batch + * @instance + */ + Batch.prototype.pysparkBatch = null; + + /** + * Batch sparkBatch. + * @member {google.cloud.dataproc.v1.ISparkBatch|null|undefined} sparkBatch + * @memberof google.cloud.dataproc.v1.Batch + * @instance + */ + Batch.prototype.sparkBatch = null; + + /** + * Batch sparkRBatch. + * @member {google.cloud.dataproc.v1.ISparkRBatch|null|undefined} sparkRBatch + * @memberof google.cloud.dataproc.v1.Batch + * @instance + */ + Batch.prototype.sparkRBatch = null; + + /** + * Batch sparkSqlBatch. + * @member {google.cloud.dataproc.v1.ISparkSqlBatch|null|undefined} sparkSqlBatch + * @memberof google.cloud.dataproc.v1.Batch + * @instance + */ + Batch.prototype.sparkSqlBatch = null; + + /** + * Batch pysparkNotebookBatch. + * @member {google.cloud.dataproc.v1.IPySparkNotebookBatch|null|undefined} pysparkNotebookBatch + * @memberof google.cloud.dataproc.v1.Batch + * @instance + */ + Batch.prototype.pysparkNotebookBatch = null; + + /** + * Batch runtimeInfo. + * @member {google.cloud.dataproc.v1.IRuntimeInfo|null|undefined} runtimeInfo + * @memberof google.cloud.dataproc.v1.Batch + * @instance + */ + Batch.prototype.runtimeInfo = null; + + /** + * Batch state. + * @member {google.cloud.dataproc.v1.Batch.State} state + * @memberof google.cloud.dataproc.v1.Batch + * @instance + */ + Batch.prototype.state = 0; + + /** + * Batch stateMessage. + * @member {string} stateMessage + * @memberof google.cloud.dataproc.v1.Batch + * @instance + */ + Batch.prototype.stateMessage = ""; + + /** + * Batch stateTime. + * @member {google.protobuf.ITimestamp|null|undefined} stateTime + * @memberof google.cloud.dataproc.v1.Batch + * @instance + */ + Batch.prototype.stateTime = null; + + /** + * Batch creator. + * @member {string} creator + * @memberof google.cloud.dataproc.v1.Batch + * @instance + */ + Batch.prototype.creator = ""; + + /** + * Batch labels. + * @member {Object.} labels + * @memberof google.cloud.dataproc.v1.Batch + * @instance + */ + Batch.prototype.labels = $util.emptyObject; + + /** + * Batch runtimeConfig. + * @member {google.cloud.dataproc.v1.IRuntimeConfig|null|undefined} runtimeConfig + * @memberof google.cloud.dataproc.v1.Batch + * @instance + */ + Batch.prototype.runtimeConfig = null; + + /** + * Batch environmentConfig. + * @member {google.cloud.dataproc.v1.IEnvironmentConfig|null|undefined} environmentConfig + * @memberof google.cloud.dataproc.v1.Batch + * @instance + */ + Batch.prototype.environmentConfig = null; + + /** + * Batch operation. + * @member {string} operation + * @memberof google.cloud.dataproc.v1.Batch + * @instance + */ + Batch.prototype.operation = ""; + + /** + * Batch stateHistory. + * @member {Array.} stateHistory + * @memberof google.cloud.dataproc.v1.Batch + * @instance + */ + Batch.prototype.stateHistory = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Batch batchConfig. + * @member {"pysparkBatch"|"sparkBatch"|"sparkRBatch"|"sparkSqlBatch"|"pysparkNotebookBatch"|undefined} batchConfig + * @memberof google.cloud.dataproc.v1.Batch + * @instance + */ + Object.defineProperty(Batch.prototype, "batchConfig", { + get: $util.oneOfGetter($oneOfFields = ["pysparkBatch", "sparkBatch", "sparkRBatch", "sparkSqlBatch", "pysparkNotebookBatch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Batch instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.Batch + * @static + * @param {google.cloud.dataproc.v1.IBatch=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.Batch} Batch instance + */ + Batch.create = function create(properties) { + return new Batch(properties); + }; + + /** + * Encodes the specified Batch message. Does not implicitly {@link google.cloud.dataproc.v1.Batch.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.Batch + * @static + * @param {google.cloud.dataproc.v1.IBatch} message Batch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Batch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.uuid != null && Object.hasOwnProperty.call(message, "uuid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uuid); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.pysparkBatch != null && Object.hasOwnProperty.call(message, "pysparkBatch")) + $root.google.cloud.dataproc.v1.PySparkBatch.encode(message.pysparkBatch, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.sparkBatch != null && Object.hasOwnProperty.call(message, "sparkBatch")) + $root.google.cloud.dataproc.v1.SparkBatch.encode(message.sparkBatch, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.sparkRBatch != null && Object.hasOwnProperty.call(message, "sparkRBatch")) + $root.google.cloud.dataproc.v1.SparkRBatch.encode(message.sparkRBatch, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.sparkSqlBatch != null && Object.hasOwnProperty.call(message, "sparkSqlBatch")) + $root.google.cloud.dataproc.v1.SparkSqlBatch.encode(message.sparkSqlBatch, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.runtimeInfo != null && Object.hasOwnProperty.call(message, "runtimeInfo")) + $root.google.cloud.dataproc.v1.RuntimeInfo.encode(message.runtimeInfo, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.state); + if (message.stateMessage != null && Object.hasOwnProperty.call(message, "stateMessage")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.stateMessage); + if (message.stateTime != null && Object.hasOwnProperty.call(message, "stateTime")) + $root.google.protobuf.Timestamp.encode(message.stateTime, 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.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.runtimeConfig != null && Object.hasOwnProperty.call(message, "runtimeConfig")) + $root.google.cloud.dataproc.v1.RuntimeConfig.encode(message.runtimeConfig, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.environmentConfig != null && Object.hasOwnProperty.call(message, "environmentConfig")) + $root.google.cloud.dataproc.v1.EnvironmentConfig.encode(message.environmentConfig, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.operation); + if (message.stateHistory != null && message.stateHistory.length) + for (var i = 0; i < message.stateHistory.length; ++i) + $root.google.cloud.dataproc.v1.Batch.StateHistory.encode(message.stateHistory[i], writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.pysparkNotebookBatch != null && Object.hasOwnProperty.call(message, "pysparkNotebookBatch")) + $root.google.cloud.dataproc.v1.PySparkNotebookBatch.encode(message.pysparkNotebookBatch, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Batch message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.Batch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.Batch + * @static + * @param {google.cloud.dataproc.v1.IBatch} message Batch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Batch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Batch message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.Batch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.Batch} Batch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Batch.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.Batch(), 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.uuid = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.pysparkBatch = $root.google.cloud.dataproc.v1.PySparkBatch.decode(reader, reader.uint32()); + break; + } + case 5: { + message.sparkBatch = $root.google.cloud.dataproc.v1.SparkBatch.decode(reader, reader.uint32()); + break; + } + case 6: { + message.sparkRBatch = $root.google.cloud.dataproc.v1.SparkRBatch.decode(reader, reader.uint32()); + break; + } + case 7: { + message.sparkSqlBatch = $root.google.cloud.dataproc.v1.SparkSqlBatch.decode(reader, reader.uint32()); + break; + } + case 19: { + message.pysparkNotebookBatch = $root.google.cloud.dataproc.v1.PySparkNotebookBatch.decode(reader, reader.uint32()); + break; + } + case 8: { + message.runtimeInfo = $root.google.cloud.dataproc.v1.RuntimeInfo.decode(reader, reader.uint32()); + break; + } + case 9: { + message.state = reader.int32(); + break; + } + case 10: { + message.stateMessage = reader.string(); + break; + } + case 11: { + message.stateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 12: { + message.creator = reader.string(); + break; + } + case 13: { + 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 14: { + message.runtimeConfig = $root.google.cloud.dataproc.v1.RuntimeConfig.decode(reader, reader.uint32()); + break; + } + case 15: { + message.environmentConfig = $root.google.cloud.dataproc.v1.EnvironmentConfig.decode(reader, reader.uint32()); + break; + } + case 16: { + message.operation = reader.string(); + break; + } + case 17: { + if (!(message.stateHistory && message.stateHistory.length)) + message.stateHistory = []; + message.stateHistory.push($root.google.cloud.dataproc.v1.Batch.StateHistory.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Batch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.Batch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.Batch} Batch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Batch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Batch message. + * @function verify + * @memberof google.cloud.dataproc.v1.Batch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Batch.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.uuid != null && message.hasOwnProperty("uuid")) + if (!$util.isString(message.uuid)) + return "uuid: 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.pysparkBatch != null && message.hasOwnProperty("pysparkBatch")) { + properties.batchConfig = 1; + { + var error = $root.google.cloud.dataproc.v1.PySparkBatch.verify(message.pysparkBatch); + if (error) + return "pysparkBatch." + error; + } + } + if (message.sparkBatch != null && message.hasOwnProperty("sparkBatch")) { + if (properties.batchConfig === 1) + return "batchConfig: multiple values"; + properties.batchConfig = 1; + { + var error = $root.google.cloud.dataproc.v1.SparkBatch.verify(message.sparkBatch); + if (error) + return "sparkBatch." + error; + } + } + if (message.sparkRBatch != null && message.hasOwnProperty("sparkRBatch")) { + if (properties.batchConfig === 1) + return "batchConfig: multiple values"; + properties.batchConfig = 1; + { + var error = $root.google.cloud.dataproc.v1.SparkRBatch.verify(message.sparkRBatch); + if (error) + return "sparkRBatch." + error; + } + } + if (message.sparkSqlBatch != null && message.hasOwnProperty("sparkSqlBatch")) { + if (properties.batchConfig === 1) + return "batchConfig: multiple values"; + properties.batchConfig = 1; + { + var error = $root.google.cloud.dataproc.v1.SparkSqlBatch.verify(message.sparkSqlBatch); + if (error) + return "sparkSqlBatch." + error; + } + } + if (message.pysparkNotebookBatch != null && message.hasOwnProperty("pysparkNotebookBatch")) { + if (properties.batchConfig === 1) + return "batchConfig: multiple values"; + properties.batchConfig = 1; + { + var error = $root.google.cloud.dataproc.v1.PySparkNotebookBatch.verify(message.pysparkNotebookBatch); + if (error) + return "pysparkNotebookBatch." + error; + } + } + if (message.runtimeInfo != null && message.hasOwnProperty("runtimeInfo")) { + var error = $root.google.cloud.dataproc.v1.RuntimeInfo.verify(message.runtimeInfo); + if (error) + return "runtimeInfo." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + if (!$util.isString(message.stateMessage)) + return "stateMessage: string expected"; + if (message.stateTime != null && message.hasOwnProperty("stateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.stateTime); + if (error) + return "stateTime." + error; + } + if (message.creator != null && message.hasOwnProperty("creator")) + if (!$util.isString(message.creator)) + return "creator: 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.runtimeConfig != null && message.hasOwnProperty("runtimeConfig")) { + var error = $root.google.cloud.dataproc.v1.RuntimeConfig.verify(message.runtimeConfig); + if (error) + return "runtimeConfig." + error; + } + if (message.environmentConfig != null && message.hasOwnProperty("environmentConfig")) { + var error = $root.google.cloud.dataproc.v1.EnvironmentConfig.verify(message.environmentConfig); + if (error) + return "environmentConfig." + error; + } + if (message.operation != null && message.hasOwnProperty("operation")) + if (!$util.isString(message.operation)) + return "operation: string expected"; + if (message.stateHistory != null && message.hasOwnProperty("stateHistory")) { + if (!Array.isArray(message.stateHistory)) + return "stateHistory: array expected"; + for (var i = 0; i < message.stateHistory.length; ++i) { + var error = $root.google.cloud.dataproc.v1.Batch.StateHistory.verify(message.stateHistory[i]); + if (error) + return "stateHistory." + error; + } + } + return null; + }; + + /** + * Creates a Batch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.Batch + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.Batch} Batch + */ + Batch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.Batch) + return object; + var message = new $root.google.cloud.dataproc.v1.Batch(); + if (object.name != null) + message.name = String(object.name); + if (object.uuid != null) + message.uuid = String(object.uuid); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.dataproc.v1.Batch.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.pysparkBatch != null) { + if (typeof object.pysparkBatch !== "object") + throw TypeError(".google.cloud.dataproc.v1.Batch.pysparkBatch: object expected"); + message.pysparkBatch = $root.google.cloud.dataproc.v1.PySparkBatch.fromObject(object.pysparkBatch); + } + if (object.sparkBatch != null) { + if (typeof object.sparkBatch !== "object") + throw TypeError(".google.cloud.dataproc.v1.Batch.sparkBatch: object expected"); + message.sparkBatch = $root.google.cloud.dataproc.v1.SparkBatch.fromObject(object.sparkBatch); + } + if (object.sparkRBatch != null) { + if (typeof object.sparkRBatch !== "object") + throw TypeError(".google.cloud.dataproc.v1.Batch.sparkRBatch: object expected"); + message.sparkRBatch = $root.google.cloud.dataproc.v1.SparkRBatch.fromObject(object.sparkRBatch); + } + if (object.sparkSqlBatch != null) { + if (typeof object.sparkSqlBatch !== "object") + throw TypeError(".google.cloud.dataproc.v1.Batch.sparkSqlBatch: object expected"); + message.sparkSqlBatch = $root.google.cloud.dataproc.v1.SparkSqlBatch.fromObject(object.sparkSqlBatch); + } + if (object.pysparkNotebookBatch != null) { + if (typeof object.pysparkNotebookBatch !== "object") + throw TypeError(".google.cloud.dataproc.v1.Batch.pysparkNotebookBatch: object expected"); + message.pysparkNotebookBatch = $root.google.cloud.dataproc.v1.PySparkNotebookBatch.fromObject(object.pysparkNotebookBatch); + } + if (object.runtimeInfo != null) { + if (typeof object.runtimeInfo !== "object") + throw TypeError(".google.cloud.dataproc.v1.Batch.runtimeInfo: object expected"); + message.runtimeInfo = $root.google.cloud.dataproc.v1.RuntimeInfo.fromObject(object.runtimeInfo); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING": + case 1: + message.state = 1; + break; + case "RUNNING": + case 2: + message.state = 2; + break; + case "CANCELLING": + case 3: + message.state = 3; + break; + case "CANCELLED": + case 4: + message.state = 4; + break; + case "SUCCEEDED": + case 5: + message.state = 5; + break; + case "FAILED": + case 6: + message.state = 6; + break; + } + if (object.stateMessage != null) + message.stateMessage = String(object.stateMessage); + if (object.stateTime != null) { + if (typeof object.stateTime !== "object") + throw TypeError(".google.cloud.dataproc.v1.Batch.stateTime: object expected"); + message.stateTime = $root.google.protobuf.Timestamp.fromObject(object.stateTime); + } + if (object.creator != null) + message.creator = String(object.creator); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.dataproc.v1.Batch.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.runtimeConfig != null) { + if (typeof object.runtimeConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.Batch.runtimeConfig: object expected"); + message.runtimeConfig = $root.google.cloud.dataproc.v1.RuntimeConfig.fromObject(object.runtimeConfig); + } + if (object.environmentConfig != null) { + if (typeof object.environmentConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.Batch.environmentConfig: object expected"); + message.environmentConfig = $root.google.cloud.dataproc.v1.EnvironmentConfig.fromObject(object.environmentConfig); + } + if (object.operation != null) + message.operation = String(object.operation); + if (object.stateHistory) { + if (!Array.isArray(object.stateHistory)) + throw TypeError(".google.cloud.dataproc.v1.Batch.stateHistory: array expected"); + message.stateHistory = []; + for (var i = 0; i < object.stateHistory.length; ++i) { + if (typeof object.stateHistory[i] !== "object") + throw TypeError(".google.cloud.dataproc.v1.Batch.stateHistory: object expected"); + message.stateHistory[i] = $root.google.cloud.dataproc.v1.Batch.StateHistory.fromObject(object.stateHistory[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Batch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.Batch + * @static + * @param {google.cloud.dataproc.v1.Batch} message Batch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Batch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.stateHistory = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.uuid = ""; + object.createTime = null; + object.runtimeInfo = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.stateMessage = ""; + object.stateTime = null; + object.creator = ""; + object.runtimeConfig = null; + object.environmentConfig = null; + object.operation = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uuid != null && message.hasOwnProperty("uuid")) + object.uuid = message.uuid; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.pysparkBatch != null && message.hasOwnProperty("pysparkBatch")) { + object.pysparkBatch = $root.google.cloud.dataproc.v1.PySparkBatch.toObject(message.pysparkBatch, options); + if (options.oneofs) + object.batchConfig = "pysparkBatch"; + } + if (message.sparkBatch != null && message.hasOwnProperty("sparkBatch")) { + object.sparkBatch = $root.google.cloud.dataproc.v1.SparkBatch.toObject(message.sparkBatch, options); + if (options.oneofs) + object.batchConfig = "sparkBatch"; + } + if (message.sparkRBatch != null && message.hasOwnProperty("sparkRBatch")) { + object.sparkRBatch = $root.google.cloud.dataproc.v1.SparkRBatch.toObject(message.sparkRBatch, options); + if (options.oneofs) + object.batchConfig = "sparkRBatch"; + } + if (message.sparkSqlBatch != null && message.hasOwnProperty("sparkSqlBatch")) { + object.sparkSqlBatch = $root.google.cloud.dataproc.v1.SparkSqlBatch.toObject(message.sparkSqlBatch, options); + if (options.oneofs) + object.batchConfig = "sparkSqlBatch"; + } + if (message.runtimeInfo != null && message.hasOwnProperty("runtimeInfo")) + object.runtimeInfo = $root.google.cloud.dataproc.v1.RuntimeInfo.toObject(message.runtimeInfo, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.dataproc.v1.Batch.State[message.state] === undefined ? message.state : $root.google.cloud.dataproc.v1.Batch.State[message.state] : message.state; + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + object.stateMessage = message.stateMessage; + if (message.stateTime != null && message.hasOwnProperty("stateTime")) + object.stateTime = $root.google.protobuf.Timestamp.toObject(message.stateTime, options); + if (message.creator != null && message.hasOwnProperty("creator")) + object.creator = message.creator; + 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.runtimeConfig != null && message.hasOwnProperty("runtimeConfig")) + object.runtimeConfig = $root.google.cloud.dataproc.v1.RuntimeConfig.toObject(message.runtimeConfig, options); + if (message.environmentConfig != null && message.hasOwnProperty("environmentConfig")) + object.environmentConfig = $root.google.cloud.dataproc.v1.EnvironmentConfig.toObject(message.environmentConfig, options); + if (message.operation != null && message.hasOwnProperty("operation")) + object.operation = message.operation; + if (message.stateHistory && message.stateHistory.length) { + object.stateHistory = []; + for (var j = 0; j < message.stateHistory.length; ++j) + object.stateHistory[j] = $root.google.cloud.dataproc.v1.Batch.StateHistory.toObject(message.stateHistory[j], options); + } + if (message.pysparkNotebookBatch != null && message.hasOwnProperty("pysparkNotebookBatch")) { + object.pysparkNotebookBatch = $root.google.cloud.dataproc.v1.PySparkNotebookBatch.toObject(message.pysparkNotebookBatch, options); + if (options.oneofs) + object.batchConfig = "pysparkNotebookBatch"; + } + return object; + }; + + /** + * Converts this Batch to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.Batch + * @instance + * @returns {Object.} JSON object + */ + Batch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Batch + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.Batch + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Batch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.Batch"; + }; + + /** + * State enum. + * @name google.cloud.dataproc.v1.Batch.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} RUNNING=2 RUNNING value + * @property {number} CANCELLING=3 CANCELLING value + * @property {number} CANCELLED=4 CANCELLED value + * @property {number} SUCCEEDED=5 SUCCEEDED value + * @property {number} FAILED=6 FAILED value + */ + Batch.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "RUNNING"] = 2; + values[valuesById[3] = "CANCELLING"] = 3; + values[valuesById[4] = "CANCELLED"] = 4; + values[valuesById[5] = "SUCCEEDED"] = 5; + values[valuesById[6] = "FAILED"] = 6; + return values; + })(); + + Batch.StateHistory = (function() { + + /** + * Properties of a StateHistory. + * @memberof google.cloud.dataproc.v1.Batch + * @interface IStateHistory + * @property {google.cloud.dataproc.v1.Batch.State|null} [state] StateHistory state + * @property {string|null} [stateMessage] StateHistory stateMessage + * @property {google.protobuf.ITimestamp|null} [stateStartTime] StateHistory stateStartTime + */ + + /** + * Constructs a new StateHistory. + * @memberof google.cloud.dataproc.v1.Batch + * @classdesc Represents a StateHistory. + * @implements IStateHistory + * @constructor + * @param {google.cloud.dataproc.v1.Batch.IStateHistory=} [properties] Properties to set + */ + function StateHistory(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StateHistory state. + * @member {google.cloud.dataproc.v1.Batch.State} state + * @memberof google.cloud.dataproc.v1.Batch.StateHistory + * @instance + */ + StateHistory.prototype.state = 0; + + /** + * StateHistory stateMessage. + * @member {string} stateMessage + * @memberof google.cloud.dataproc.v1.Batch.StateHistory + * @instance + */ + StateHistory.prototype.stateMessage = ""; + + /** + * StateHistory stateStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} stateStartTime + * @memberof google.cloud.dataproc.v1.Batch.StateHistory + * @instance + */ + StateHistory.prototype.stateStartTime = null; + + /** + * Creates a new StateHistory instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.Batch.StateHistory + * @static + * @param {google.cloud.dataproc.v1.Batch.IStateHistory=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.Batch.StateHistory} StateHistory instance + */ + StateHistory.create = function create(properties) { + return new StateHistory(properties); + }; + + /** + * Encodes the specified StateHistory message. Does not implicitly {@link google.cloud.dataproc.v1.Batch.StateHistory.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.Batch.StateHistory + * @static + * @param {google.cloud.dataproc.v1.Batch.IStateHistory} message StateHistory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StateHistory.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.stateMessage != null && Object.hasOwnProperty.call(message, "stateMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.stateMessage); + if (message.stateStartTime != null && Object.hasOwnProperty.call(message, "stateStartTime")) + $root.google.protobuf.Timestamp.encode(message.stateStartTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StateHistory message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.Batch.StateHistory.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.Batch.StateHistory + * @static + * @param {google.cloud.dataproc.v1.Batch.IStateHistory} message StateHistory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StateHistory.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StateHistory message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.Batch.StateHistory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.Batch.StateHistory} StateHistory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StateHistory.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.Batch.StateHistory(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.stateMessage = reader.string(); + break; + } + case 3: { + message.stateStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StateHistory message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.Batch.StateHistory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.Batch.StateHistory} StateHistory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StateHistory.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StateHistory message. + * @function verify + * @memberof google.cloud.dataproc.v1.Batch.StateHistory + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StateHistory.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + if (!$util.isString(message.stateMessage)) + return "stateMessage: string expected"; + if (message.stateStartTime != null && message.hasOwnProperty("stateStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.stateStartTime); + if (error) + return "stateStartTime." + error; + } + return null; + }; + + /** + * Creates a StateHistory message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.Batch.StateHistory + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.Batch.StateHistory} StateHistory + */ + StateHistory.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.Batch.StateHistory) + return object; + var message = new $root.google.cloud.dataproc.v1.Batch.StateHistory(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING": + case 1: + message.state = 1; + break; + case "RUNNING": + case 2: + message.state = 2; + break; + case "CANCELLING": + case 3: + message.state = 3; + break; + case "CANCELLED": + case 4: + message.state = 4; + break; + case "SUCCEEDED": + case 5: + message.state = 5; + break; + case "FAILED": + case 6: + message.state = 6; + break; + } + if (object.stateMessage != null) + message.stateMessage = String(object.stateMessage); + if (object.stateStartTime != null) { + if (typeof object.stateStartTime !== "object") + throw TypeError(".google.cloud.dataproc.v1.Batch.StateHistory.stateStartTime: object expected"); + message.stateStartTime = $root.google.protobuf.Timestamp.fromObject(object.stateStartTime); + } + return message; + }; + + /** + * Creates a plain object from a StateHistory message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.Batch.StateHistory + * @static + * @param {google.cloud.dataproc.v1.Batch.StateHistory} message StateHistory + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StateHistory.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.stateMessage = ""; + object.stateStartTime = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.dataproc.v1.Batch.State[message.state] === undefined ? message.state : $root.google.cloud.dataproc.v1.Batch.State[message.state] : message.state; + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + object.stateMessage = message.stateMessage; + if (message.stateStartTime != null && message.hasOwnProperty("stateStartTime")) + object.stateStartTime = $root.google.protobuf.Timestamp.toObject(message.stateStartTime, options); + return object; + }; + + /** + * Converts this StateHistory to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.Batch.StateHistory + * @instance + * @returns {Object.} JSON object + */ + StateHistory.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StateHistory + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.Batch.StateHistory + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StateHistory.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.Batch.StateHistory"; + }; + + return StateHistory; + })(); + + return Batch; + })(); + + v1.PySparkBatch = (function() { + + /** + * Properties of a PySparkBatch. + * @memberof google.cloud.dataproc.v1 + * @interface IPySparkBatch + * @property {string|null} [mainPythonFileUri] PySparkBatch mainPythonFileUri + * @property {Array.|null} [args] PySparkBatch args + * @property {Array.|null} [pythonFileUris] PySparkBatch pythonFileUris + * @property {Array.|null} [jarFileUris] PySparkBatch jarFileUris + * @property {Array.|null} [fileUris] PySparkBatch fileUris + * @property {Array.|null} [archiveUris] PySparkBatch archiveUris + */ + + /** + * Constructs a new PySparkBatch. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a PySparkBatch. + * @implements IPySparkBatch + * @constructor + * @param {google.cloud.dataproc.v1.IPySparkBatch=} [properties] Properties to set + */ + function PySparkBatch(properties) { + this.args = []; + this.pythonFileUris = []; + this.jarFileUris = []; + this.fileUris = []; + this.archiveUris = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PySparkBatch mainPythonFileUri. + * @member {string} mainPythonFileUri + * @memberof google.cloud.dataproc.v1.PySparkBatch + * @instance + */ + PySparkBatch.prototype.mainPythonFileUri = ""; + + /** + * PySparkBatch args. + * @member {Array.} args + * @memberof google.cloud.dataproc.v1.PySparkBatch + * @instance + */ + PySparkBatch.prototype.args = $util.emptyArray; + + /** + * PySparkBatch pythonFileUris. + * @member {Array.} pythonFileUris + * @memberof google.cloud.dataproc.v1.PySparkBatch + * @instance + */ + PySparkBatch.prototype.pythonFileUris = $util.emptyArray; + + /** + * PySparkBatch jarFileUris. + * @member {Array.} jarFileUris + * @memberof google.cloud.dataproc.v1.PySparkBatch + * @instance + */ + PySparkBatch.prototype.jarFileUris = $util.emptyArray; + + /** + * PySparkBatch fileUris. + * @member {Array.} fileUris + * @memberof google.cloud.dataproc.v1.PySparkBatch + * @instance + */ + PySparkBatch.prototype.fileUris = $util.emptyArray; + + /** + * PySparkBatch archiveUris. + * @member {Array.} archiveUris + * @memberof google.cloud.dataproc.v1.PySparkBatch + * @instance + */ + PySparkBatch.prototype.archiveUris = $util.emptyArray; + + /** + * Creates a new PySparkBatch instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.PySparkBatch + * @static + * @param {google.cloud.dataproc.v1.IPySparkBatch=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.PySparkBatch} PySparkBatch instance + */ + PySparkBatch.create = function create(properties) { + return new PySparkBatch(properties); + }; + + /** + * Encodes the specified PySparkBatch message. Does not implicitly {@link google.cloud.dataproc.v1.PySparkBatch.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.PySparkBatch + * @static + * @param {google.cloud.dataproc.v1.IPySparkBatch} message PySparkBatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PySparkBatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mainPythonFileUri != null && Object.hasOwnProperty.call(message, "mainPythonFileUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mainPythonFileUri); + 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.pythonFileUris != null && message.pythonFileUris.length) + for (var i = 0; i < message.pythonFileUris.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pythonFileUris[i]); + if (message.jarFileUris != null && message.jarFileUris.length) + for (var i = 0; i < message.jarFileUris.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.jarFileUris[i]); + if (message.fileUris != null && message.fileUris.length) + for (var i = 0; i < message.fileUris.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.fileUris[i]); + if (message.archiveUris != null && message.archiveUris.length) + for (var i = 0; i < message.archiveUris.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.archiveUris[i]); + return writer; + }; + + /** + * Encodes the specified PySparkBatch message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.PySparkBatch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.PySparkBatch + * @static + * @param {google.cloud.dataproc.v1.IPySparkBatch} message PySparkBatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PySparkBatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PySparkBatch message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.PySparkBatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.PySparkBatch} PySparkBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PySparkBatch.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.PySparkBatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.mainPythonFileUri = reader.string(); + break; + } + case 2: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push(reader.string()); + break; + } + case 3: { + if (!(message.pythonFileUris && message.pythonFileUris.length)) + message.pythonFileUris = []; + message.pythonFileUris.push(reader.string()); + break; + } + case 4: { + if (!(message.jarFileUris && message.jarFileUris.length)) + message.jarFileUris = []; + message.jarFileUris.push(reader.string()); + break; + } + case 5: { + if (!(message.fileUris && message.fileUris.length)) + message.fileUris = []; + message.fileUris.push(reader.string()); + break; + } + case 6: { + if (!(message.archiveUris && message.archiveUris.length)) + message.archiveUris = []; + message.archiveUris.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PySparkBatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.PySparkBatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.PySparkBatch} PySparkBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PySparkBatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PySparkBatch message. + * @function verify + * @memberof google.cloud.dataproc.v1.PySparkBatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PySparkBatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mainPythonFileUri != null && message.hasOwnProperty("mainPythonFileUri")) + if (!$util.isString(message.mainPythonFileUri)) + return "mainPythonFileUri: 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.pythonFileUris != null && message.hasOwnProperty("pythonFileUris")) { + if (!Array.isArray(message.pythonFileUris)) + return "pythonFileUris: array expected"; + for (var i = 0; i < message.pythonFileUris.length; ++i) + if (!$util.isString(message.pythonFileUris[i])) + return "pythonFileUris: string[] expected"; + } + if (message.jarFileUris != null && message.hasOwnProperty("jarFileUris")) { + if (!Array.isArray(message.jarFileUris)) + return "jarFileUris: array expected"; + for (var i = 0; i < message.jarFileUris.length; ++i) + if (!$util.isString(message.jarFileUris[i])) + return "jarFileUris: string[] expected"; + } + if (message.fileUris != null && message.hasOwnProperty("fileUris")) { + if (!Array.isArray(message.fileUris)) + return "fileUris: array expected"; + for (var i = 0; i < message.fileUris.length; ++i) + if (!$util.isString(message.fileUris[i])) + return "fileUris: string[] expected"; + } + if (message.archiveUris != null && message.hasOwnProperty("archiveUris")) { + if (!Array.isArray(message.archiveUris)) + return "archiveUris: array expected"; + for (var i = 0; i < message.archiveUris.length; ++i) + if (!$util.isString(message.archiveUris[i])) + return "archiveUris: string[] expected"; + } + return null; + }; + + /** + * Creates a PySparkBatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.PySparkBatch + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.PySparkBatch} PySparkBatch + */ + PySparkBatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.PySparkBatch) + return object; + var message = new $root.google.cloud.dataproc.v1.PySparkBatch(); + if (object.mainPythonFileUri != null) + message.mainPythonFileUri = String(object.mainPythonFileUri); + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".google.cloud.dataproc.v1.PySparkBatch.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) + message.args[i] = String(object.args[i]); + } + if (object.pythonFileUris) { + if (!Array.isArray(object.pythonFileUris)) + throw TypeError(".google.cloud.dataproc.v1.PySparkBatch.pythonFileUris: array expected"); + message.pythonFileUris = []; + for (var i = 0; i < object.pythonFileUris.length; ++i) + message.pythonFileUris[i] = String(object.pythonFileUris[i]); + } + if (object.jarFileUris) { + if (!Array.isArray(object.jarFileUris)) + throw TypeError(".google.cloud.dataproc.v1.PySparkBatch.jarFileUris: array expected"); + message.jarFileUris = []; + for (var i = 0; i < object.jarFileUris.length; ++i) + message.jarFileUris[i] = String(object.jarFileUris[i]); + } + if (object.fileUris) { + if (!Array.isArray(object.fileUris)) + throw TypeError(".google.cloud.dataproc.v1.PySparkBatch.fileUris: array expected"); + message.fileUris = []; + for (var i = 0; i < object.fileUris.length; ++i) + message.fileUris[i] = String(object.fileUris[i]); + } + if (object.archiveUris) { + if (!Array.isArray(object.archiveUris)) + throw TypeError(".google.cloud.dataproc.v1.PySparkBatch.archiveUris: array expected"); + message.archiveUris = []; + for (var i = 0; i < object.archiveUris.length; ++i) + message.archiveUris[i] = String(object.archiveUris[i]); + } + return message; + }; + + /** + * Creates a plain object from a PySparkBatch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.PySparkBatch + * @static + * @param {google.cloud.dataproc.v1.PySparkBatch} message PySparkBatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PySparkBatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.args = []; + object.pythonFileUris = []; + object.jarFileUris = []; + object.fileUris = []; + object.archiveUris = []; + } + if (options.defaults) + object.mainPythonFileUri = ""; + if (message.mainPythonFileUri != null && message.hasOwnProperty("mainPythonFileUri")) + object.mainPythonFileUri = message.mainPythonFileUri; + 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.pythonFileUris && message.pythonFileUris.length) { + object.pythonFileUris = []; + for (var j = 0; j < message.pythonFileUris.length; ++j) + object.pythonFileUris[j] = message.pythonFileUris[j]; + } + if (message.jarFileUris && message.jarFileUris.length) { + object.jarFileUris = []; + for (var j = 0; j < message.jarFileUris.length; ++j) + object.jarFileUris[j] = message.jarFileUris[j]; + } + if (message.fileUris && message.fileUris.length) { + object.fileUris = []; + for (var j = 0; j < message.fileUris.length; ++j) + object.fileUris[j] = message.fileUris[j]; + } + if (message.archiveUris && message.archiveUris.length) { + object.archiveUris = []; + for (var j = 0; j < message.archiveUris.length; ++j) + object.archiveUris[j] = message.archiveUris[j]; + } + return object; + }; + + /** + * Converts this PySparkBatch to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.PySparkBatch + * @instance + * @returns {Object.} JSON object + */ + PySparkBatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PySparkBatch + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.PySparkBatch + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PySparkBatch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.PySparkBatch"; + }; + + return PySparkBatch; + })(); + + v1.SparkBatch = (function() { + + /** + * Properties of a SparkBatch. + * @memberof google.cloud.dataproc.v1 + * @interface ISparkBatch + * @property {string|null} [mainJarFileUri] SparkBatch mainJarFileUri + * @property {string|null} [mainClass] SparkBatch mainClass + * @property {Array.|null} [args] SparkBatch args + * @property {Array.|null} [jarFileUris] SparkBatch jarFileUris + * @property {Array.|null} [fileUris] SparkBatch fileUris + * @property {Array.|null} [archiveUris] SparkBatch archiveUris + */ + + /** + * Constructs a new SparkBatch. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a SparkBatch. + * @implements ISparkBatch + * @constructor + * @param {google.cloud.dataproc.v1.ISparkBatch=} [properties] Properties to set + */ + function SparkBatch(properties) { + this.args = []; + this.jarFileUris = []; + this.fileUris = []; + this.archiveUris = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SparkBatch mainJarFileUri. + * @member {string|null|undefined} mainJarFileUri + * @memberof google.cloud.dataproc.v1.SparkBatch + * @instance + */ + SparkBatch.prototype.mainJarFileUri = null; + + /** + * SparkBatch mainClass. + * @member {string|null|undefined} mainClass + * @memberof google.cloud.dataproc.v1.SparkBatch + * @instance + */ + SparkBatch.prototype.mainClass = null; + + /** + * SparkBatch args. + * @member {Array.} args + * @memberof google.cloud.dataproc.v1.SparkBatch + * @instance + */ + SparkBatch.prototype.args = $util.emptyArray; + + /** + * SparkBatch jarFileUris. + * @member {Array.} jarFileUris + * @memberof google.cloud.dataproc.v1.SparkBatch + * @instance + */ + SparkBatch.prototype.jarFileUris = $util.emptyArray; + + /** + * SparkBatch fileUris. + * @member {Array.} fileUris + * @memberof google.cloud.dataproc.v1.SparkBatch + * @instance + */ + SparkBatch.prototype.fileUris = $util.emptyArray; + + /** + * SparkBatch archiveUris. + * @member {Array.} archiveUris + * @memberof google.cloud.dataproc.v1.SparkBatch + * @instance + */ + SparkBatch.prototype.archiveUris = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SparkBatch driver. + * @member {"mainJarFileUri"|"mainClass"|undefined} driver + * @memberof google.cloud.dataproc.v1.SparkBatch + * @instance + */ + Object.defineProperty(SparkBatch.prototype, "driver", { + get: $util.oneOfGetter($oneOfFields = ["mainJarFileUri", "mainClass"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SparkBatch instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.SparkBatch + * @static + * @param {google.cloud.dataproc.v1.ISparkBatch=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.SparkBatch} SparkBatch instance + */ + SparkBatch.create = function create(properties) { + return new SparkBatch(properties); + }; + + /** + * Encodes the specified SparkBatch message. Does not implicitly {@link google.cloud.dataproc.v1.SparkBatch.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.SparkBatch + * @static + * @param {google.cloud.dataproc.v1.ISparkBatch} message SparkBatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SparkBatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mainJarFileUri != null && Object.hasOwnProperty.call(message, "mainJarFileUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mainJarFileUri); + if (message.mainClass != null && Object.hasOwnProperty.call(message, "mainClass")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mainClass); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.args[i]); + if (message.jarFileUris != null && message.jarFileUris.length) + for (var i = 0; i < message.jarFileUris.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.jarFileUris[i]); + if (message.fileUris != null && message.fileUris.length) + for (var i = 0; i < message.fileUris.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.fileUris[i]); + if (message.archiveUris != null && message.archiveUris.length) + for (var i = 0; i < message.archiveUris.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.archiveUris[i]); + return writer; + }; + + /** + * Encodes the specified SparkBatch message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SparkBatch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.SparkBatch + * @static + * @param {google.cloud.dataproc.v1.ISparkBatch} message SparkBatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SparkBatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SparkBatch message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.SparkBatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.SparkBatch} SparkBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SparkBatch.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.SparkBatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.mainJarFileUri = reader.string(); + break; + } + case 2: { + message.mainClass = reader.string(); + break; + } + case 3: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push(reader.string()); + break; + } + case 4: { + if (!(message.jarFileUris && message.jarFileUris.length)) + message.jarFileUris = []; + message.jarFileUris.push(reader.string()); + break; + } + case 5: { + if (!(message.fileUris && message.fileUris.length)) + message.fileUris = []; + message.fileUris.push(reader.string()); + break; + } + case 6: { + if (!(message.archiveUris && message.archiveUris.length)) + message.archiveUris = []; + message.archiveUris.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SparkBatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.SparkBatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.SparkBatch} SparkBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SparkBatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SparkBatch message. + * @function verify + * @memberof google.cloud.dataproc.v1.SparkBatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SparkBatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.mainJarFileUri != null && message.hasOwnProperty("mainJarFileUri")) { + properties.driver = 1; + if (!$util.isString(message.mainJarFileUri)) + return "mainJarFileUri: string expected"; + } + if (message.mainClass != null && message.hasOwnProperty("mainClass")) { + if (properties.driver === 1) + return "driver: multiple values"; + properties.driver = 1; + if (!$util.isString(message.mainClass)) + return "mainClass: 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.jarFileUris != null && message.hasOwnProperty("jarFileUris")) { + if (!Array.isArray(message.jarFileUris)) + return "jarFileUris: array expected"; + for (var i = 0; i < message.jarFileUris.length; ++i) + if (!$util.isString(message.jarFileUris[i])) + return "jarFileUris: string[] expected"; + } + if (message.fileUris != null && message.hasOwnProperty("fileUris")) { + if (!Array.isArray(message.fileUris)) + return "fileUris: array expected"; + for (var i = 0; i < message.fileUris.length; ++i) + if (!$util.isString(message.fileUris[i])) + return "fileUris: string[] expected"; + } + if (message.archiveUris != null && message.hasOwnProperty("archiveUris")) { + if (!Array.isArray(message.archiveUris)) + return "archiveUris: array expected"; + for (var i = 0; i < message.archiveUris.length; ++i) + if (!$util.isString(message.archiveUris[i])) + return "archiveUris: string[] expected"; + } + return null; + }; + + /** + * Creates a SparkBatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.SparkBatch + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.SparkBatch} SparkBatch + */ + SparkBatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.SparkBatch) + return object; + var message = new $root.google.cloud.dataproc.v1.SparkBatch(); + if (object.mainJarFileUri != null) + message.mainJarFileUri = String(object.mainJarFileUri); + if (object.mainClass != null) + message.mainClass = String(object.mainClass); + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".google.cloud.dataproc.v1.SparkBatch.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) + message.args[i] = String(object.args[i]); + } + if (object.jarFileUris) { + if (!Array.isArray(object.jarFileUris)) + throw TypeError(".google.cloud.dataproc.v1.SparkBatch.jarFileUris: array expected"); + message.jarFileUris = []; + for (var i = 0; i < object.jarFileUris.length; ++i) + message.jarFileUris[i] = String(object.jarFileUris[i]); + } + if (object.fileUris) { + if (!Array.isArray(object.fileUris)) + throw TypeError(".google.cloud.dataproc.v1.SparkBatch.fileUris: array expected"); + message.fileUris = []; + for (var i = 0; i < object.fileUris.length; ++i) + message.fileUris[i] = String(object.fileUris[i]); + } + if (object.archiveUris) { + if (!Array.isArray(object.archiveUris)) + throw TypeError(".google.cloud.dataproc.v1.SparkBatch.archiveUris: array expected"); + message.archiveUris = []; + for (var i = 0; i < object.archiveUris.length; ++i) + message.archiveUris[i] = String(object.archiveUris[i]); + } + return message; + }; + + /** + * Creates a plain object from a SparkBatch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.SparkBatch + * @static + * @param {google.cloud.dataproc.v1.SparkBatch} message SparkBatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SparkBatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.args = []; + object.jarFileUris = []; + object.fileUris = []; + object.archiveUris = []; + } + if (message.mainJarFileUri != null && message.hasOwnProperty("mainJarFileUri")) { + object.mainJarFileUri = message.mainJarFileUri; + if (options.oneofs) + object.driver = "mainJarFileUri"; + } + if (message.mainClass != null && message.hasOwnProperty("mainClass")) { + object.mainClass = message.mainClass; + if (options.oneofs) + object.driver = "mainClass"; + } + 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.jarFileUris && message.jarFileUris.length) { + object.jarFileUris = []; + for (var j = 0; j < message.jarFileUris.length; ++j) + object.jarFileUris[j] = message.jarFileUris[j]; + } + if (message.fileUris && message.fileUris.length) { + object.fileUris = []; + for (var j = 0; j < message.fileUris.length; ++j) + object.fileUris[j] = message.fileUris[j]; + } + if (message.archiveUris && message.archiveUris.length) { + object.archiveUris = []; + for (var j = 0; j < message.archiveUris.length; ++j) + object.archiveUris[j] = message.archiveUris[j]; + } + return object; + }; + + /** + * Converts this SparkBatch to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.SparkBatch + * @instance + * @returns {Object.} JSON object + */ + SparkBatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SparkBatch + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.SparkBatch + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SparkBatch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.SparkBatch"; + }; + + return SparkBatch; + })(); + + v1.SparkRBatch = (function() { + + /** + * Properties of a SparkRBatch. + * @memberof google.cloud.dataproc.v1 + * @interface ISparkRBatch + * @property {string|null} [mainRFileUri] SparkRBatch mainRFileUri + * @property {Array.|null} [args] SparkRBatch args + * @property {Array.|null} [fileUris] SparkRBatch fileUris + * @property {Array.|null} [archiveUris] SparkRBatch archiveUris + */ + + /** + * Constructs a new SparkRBatch. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a SparkRBatch. + * @implements ISparkRBatch + * @constructor + * @param {google.cloud.dataproc.v1.ISparkRBatch=} [properties] Properties to set + */ + function SparkRBatch(properties) { + this.args = []; + this.fileUris = []; + this.archiveUris = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SparkRBatch mainRFileUri. + * @member {string} mainRFileUri + * @memberof google.cloud.dataproc.v1.SparkRBatch + * @instance + */ + SparkRBatch.prototype.mainRFileUri = ""; + + /** + * SparkRBatch args. + * @member {Array.} args + * @memberof google.cloud.dataproc.v1.SparkRBatch + * @instance + */ + SparkRBatch.prototype.args = $util.emptyArray; + + /** + * SparkRBatch fileUris. + * @member {Array.} fileUris + * @memberof google.cloud.dataproc.v1.SparkRBatch + * @instance + */ + SparkRBatch.prototype.fileUris = $util.emptyArray; + + /** + * SparkRBatch archiveUris. + * @member {Array.} archiveUris + * @memberof google.cloud.dataproc.v1.SparkRBatch + * @instance + */ + SparkRBatch.prototype.archiveUris = $util.emptyArray; + + /** + * Creates a new SparkRBatch instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.SparkRBatch + * @static + * @param {google.cloud.dataproc.v1.ISparkRBatch=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.SparkRBatch} SparkRBatch instance + */ + SparkRBatch.create = function create(properties) { + return new SparkRBatch(properties); + }; + + /** + * Encodes the specified SparkRBatch message. Does not implicitly {@link google.cloud.dataproc.v1.SparkRBatch.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.SparkRBatch + * @static + * @param {google.cloud.dataproc.v1.ISparkRBatch} message SparkRBatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SparkRBatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mainRFileUri != null && Object.hasOwnProperty.call(message, "mainRFileUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mainRFileUri); + 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.fileUris != null && message.fileUris.length) + for (var i = 0; i < message.fileUris.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.fileUris[i]); + if (message.archiveUris != null && message.archiveUris.length) + for (var i = 0; i < message.archiveUris.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.archiveUris[i]); + return writer; + }; + + /** + * Encodes the specified SparkRBatch message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SparkRBatch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.SparkRBatch + * @static + * @param {google.cloud.dataproc.v1.ISparkRBatch} message SparkRBatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SparkRBatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SparkRBatch message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.SparkRBatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.SparkRBatch} SparkRBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SparkRBatch.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.SparkRBatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.mainRFileUri = reader.string(); + break; + } + case 2: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push(reader.string()); + break; + } + case 3: { + if (!(message.fileUris && message.fileUris.length)) + message.fileUris = []; + message.fileUris.push(reader.string()); + break; + } + case 4: { + if (!(message.archiveUris && message.archiveUris.length)) + message.archiveUris = []; + message.archiveUris.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SparkRBatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.SparkRBatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.SparkRBatch} SparkRBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SparkRBatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SparkRBatch message. + * @function verify + * @memberof google.cloud.dataproc.v1.SparkRBatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SparkRBatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mainRFileUri != null && message.hasOwnProperty("mainRFileUri")) + if (!$util.isString(message.mainRFileUri)) + return "mainRFileUri: 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.fileUris != null && message.hasOwnProperty("fileUris")) { + if (!Array.isArray(message.fileUris)) + return "fileUris: array expected"; + for (var i = 0; i < message.fileUris.length; ++i) + if (!$util.isString(message.fileUris[i])) + return "fileUris: string[] expected"; + } + if (message.archiveUris != null && message.hasOwnProperty("archiveUris")) { + if (!Array.isArray(message.archiveUris)) + return "archiveUris: array expected"; + for (var i = 0; i < message.archiveUris.length; ++i) + if (!$util.isString(message.archiveUris[i])) + return "archiveUris: string[] expected"; + } + return null; + }; + + /** + * Creates a SparkRBatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.SparkRBatch + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.SparkRBatch} SparkRBatch + */ + SparkRBatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.SparkRBatch) + return object; + var message = new $root.google.cloud.dataproc.v1.SparkRBatch(); + if (object.mainRFileUri != null) + message.mainRFileUri = String(object.mainRFileUri); + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".google.cloud.dataproc.v1.SparkRBatch.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) + message.args[i] = String(object.args[i]); + } + if (object.fileUris) { + if (!Array.isArray(object.fileUris)) + throw TypeError(".google.cloud.dataproc.v1.SparkRBatch.fileUris: array expected"); + message.fileUris = []; + for (var i = 0; i < object.fileUris.length; ++i) + message.fileUris[i] = String(object.fileUris[i]); + } + if (object.archiveUris) { + if (!Array.isArray(object.archiveUris)) + throw TypeError(".google.cloud.dataproc.v1.SparkRBatch.archiveUris: array expected"); + message.archiveUris = []; + for (var i = 0; i < object.archiveUris.length; ++i) + message.archiveUris[i] = String(object.archiveUris[i]); + } + return message; + }; + + /** + * Creates a plain object from a SparkRBatch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.SparkRBatch + * @static + * @param {google.cloud.dataproc.v1.SparkRBatch} message SparkRBatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SparkRBatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.args = []; + object.fileUris = []; + object.archiveUris = []; + } + if (options.defaults) + object.mainRFileUri = ""; + if (message.mainRFileUri != null && message.hasOwnProperty("mainRFileUri")) + object.mainRFileUri = message.mainRFileUri; + 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.fileUris && message.fileUris.length) { + object.fileUris = []; + for (var j = 0; j < message.fileUris.length; ++j) + object.fileUris[j] = message.fileUris[j]; + } + if (message.archiveUris && message.archiveUris.length) { + object.archiveUris = []; + for (var j = 0; j < message.archiveUris.length; ++j) + object.archiveUris[j] = message.archiveUris[j]; + } + return object; + }; + + /** + * Converts this SparkRBatch to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.SparkRBatch + * @instance + * @returns {Object.} JSON object + */ + SparkRBatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SparkRBatch + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.SparkRBatch + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SparkRBatch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.SparkRBatch"; + }; + + return SparkRBatch; + })(); + + v1.SparkSqlBatch = (function() { + + /** + * Properties of a SparkSqlBatch. + * @memberof google.cloud.dataproc.v1 + * @interface ISparkSqlBatch + * @property {string|null} [queryFileUri] SparkSqlBatch queryFileUri + * @property {Object.|null} [queryVariables] SparkSqlBatch queryVariables + * @property {Array.|null} [jarFileUris] SparkSqlBatch jarFileUris + */ + + /** + * Constructs a new SparkSqlBatch. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a SparkSqlBatch. + * @implements ISparkSqlBatch + * @constructor + * @param {google.cloud.dataproc.v1.ISparkSqlBatch=} [properties] Properties to set + */ + function SparkSqlBatch(properties) { + this.queryVariables = {}; + this.jarFileUris = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SparkSqlBatch queryFileUri. + * @member {string} queryFileUri + * @memberof google.cloud.dataproc.v1.SparkSqlBatch + * @instance + */ + SparkSqlBatch.prototype.queryFileUri = ""; + + /** + * SparkSqlBatch queryVariables. + * @member {Object.} queryVariables + * @memberof google.cloud.dataproc.v1.SparkSqlBatch + * @instance + */ + SparkSqlBatch.prototype.queryVariables = $util.emptyObject; + + /** + * SparkSqlBatch jarFileUris. + * @member {Array.} jarFileUris + * @memberof google.cloud.dataproc.v1.SparkSqlBatch + * @instance + */ + SparkSqlBatch.prototype.jarFileUris = $util.emptyArray; + + /** + * Creates a new SparkSqlBatch instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.SparkSqlBatch + * @static + * @param {google.cloud.dataproc.v1.ISparkSqlBatch=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.SparkSqlBatch} SparkSqlBatch instance + */ + SparkSqlBatch.create = function create(properties) { + return new SparkSqlBatch(properties); + }; + + /** + * Encodes the specified SparkSqlBatch message. Does not implicitly {@link google.cloud.dataproc.v1.SparkSqlBatch.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.SparkSqlBatch + * @static + * @param {google.cloud.dataproc.v1.ISparkSqlBatch} message SparkSqlBatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SparkSqlBatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.queryFileUri != null && Object.hasOwnProperty.call(message, "queryFileUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.queryFileUri); + if (message.queryVariables != null && Object.hasOwnProperty.call(message, "queryVariables")) + for (var keys = Object.keys(message.queryVariables), 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.queryVariables[keys[i]]).ldelim(); + if (message.jarFileUris != null && message.jarFileUris.length) + for (var i = 0; i < message.jarFileUris.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.jarFileUris[i]); + return writer; + }; + + /** + * Encodes the specified SparkSqlBatch message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SparkSqlBatch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.SparkSqlBatch + * @static + * @param {google.cloud.dataproc.v1.ISparkSqlBatch} message SparkSqlBatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SparkSqlBatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SparkSqlBatch message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.SparkSqlBatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.SparkSqlBatch} SparkSqlBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SparkSqlBatch.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.SparkSqlBatch(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.queryFileUri = reader.string(); + break; + } + case 2: { + if (message.queryVariables === $util.emptyObject) + message.queryVariables = {}; + 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.queryVariables[key] = value; + break; + } + case 3: { + if (!(message.jarFileUris && message.jarFileUris.length)) + message.jarFileUris = []; + message.jarFileUris.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SparkSqlBatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.SparkSqlBatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.SparkSqlBatch} SparkSqlBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SparkSqlBatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SparkSqlBatch message. + * @function verify + * @memberof google.cloud.dataproc.v1.SparkSqlBatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SparkSqlBatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.queryFileUri != null && message.hasOwnProperty("queryFileUri")) + if (!$util.isString(message.queryFileUri)) + return "queryFileUri: string expected"; + if (message.queryVariables != null && message.hasOwnProperty("queryVariables")) { + if (!$util.isObject(message.queryVariables)) + return "queryVariables: object expected"; + var key = Object.keys(message.queryVariables); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.queryVariables[key[i]])) + return "queryVariables: string{k:string} expected"; + } + if (message.jarFileUris != null && message.hasOwnProperty("jarFileUris")) { + if (!Array.isArray(message.jarFileUris)) + return "jarFileUris: array expected"; + for (var i = 0; i < message.jarFileUris.length; ++i) + if (!$util.isString(message.jarFileUris[i])) + return "jarFileUris: string[] expected"; + } + return null; + }; + + /** + * Creates a SparkSqlBatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.SparkSqlBatch + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.SparkSqlBatch} SparkSqlBatch + */ + SparkSqlBatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.SparkSqlBatch) + return object; + var message = new $root.google.cloud.dataproc.v1.SparkSqlBatch(); + if (object.queryFileUri != null) + message.queryFileUri = String(object.queryFileUri); + if (object.queryVariables) { + if (typeof object.queryVariables !== "object") + throw TypeError(".google.cloud.dataproc.v1.SparkSqlBatch.queryVariables: object expected"); + message.queryVariables = {}; + for (var keys = Object.keys(object.queryVariables), i = 0; i < keys.length; ++i) + message.queryVariables[keys[i]] = String(object.queryVariables[keys[i]]); + } + if (object.jarFileUris) { + if (!Array.isArray(object.jarFileUris)) + throw TypeError(".google.cloud.dataproc.v1.SparkSqlBatch.jarFileUris: array expected"); + message.jarFileUris = []; + for (var i = 0; i < object.jarFileUris.length; ++i) + message.jarFileUris[i] = String(object.jarFileUris[i]); + } + return message; + }; + + /** + * Creates a plain object from a SparkSqlBatch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.SparkSqlBatch + * @static + * @param {google.cloud.dataproc.v1.SparkSqlBatch} message SparkSqlBatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SparkSqlBatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.jarFileUris = []; + if (options.objects || options.defaults) + object.queryVariables = {}; + if (options.defaults) + object.queryFileUri = ""; + if (message.queryFileUri != null && message.hasOwnProperty("queryFileUri")) + object.queryFileUri = message.queryFileUri; + var keys2; + if (message.queryVariables && (keys2 = Object.keys(message.queryVariables)).length) { + object.queryVariables = {}; + for (var j = 0; j < keys2.length; ++j) + object.queryVariables[keys2[j]] = message.queryVariables[keys2[j]]; + } + if (message.jarFileUris && message.jarFileUris.length) { + object.jarFileUris = []; + for (var j = 0; j < message.jarFileUris.length; ++j) + object.jarFileUris[j] = message.jarFileUris[j]; + } + return object; + }; + + /** + * Converts this SparkSqlBatch to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.SparkSqlBatch + * @instance + * @returns {Object.} JSON object + */ + SparkSqlBatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SparkSqlBatch + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.SparkSqlBatch + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SparkSqlBatch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.SparkSqlBatch"; + }; + + return SparkSqlBatch; + })(); + + v1.PySparkNotebookBatch = (function() { + + /** + * Properties of a PySparkNotebookBatch. + * @memberof google.cloud.dataproc.v1 + * @interface IPySparkNotebookBatch + * @property {string|null} [notebookFileUri] PySparkNotebookBatch notebookFileUri + * @property {Object.|null} [params] PySparkNotebookBatch params + * @property {Array.|null} [pythonFileUris] PySparkNotebookBatch pythonFileUris + * @property {Array.|null} [jarFileUris] PySparkNotebookBatch jarFileUris + * @property {Array.|null} [fileUris] PySparkNotebookBatch fileUris + * @property {Array.|null} [archiveUris] PySparkNotebookBatch archiveUris + */ + + /** + * Constructs a new PySparkNotebookBatch. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a PySparkNotebookBatch. + * @implements IPySparkNotebookBatch + * @constructor + * @param {google.cloud.dataproc.v1.IPySparkNotebookBatch=} [properties] Properties to set + */ + function PySparkNotebookBatch(properties) { + this.params = {}; + this.pythonFileUris = []; + this.jarFileUris = []; + this.fileUris = []; + this.archiveUris = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PySparkNotebookBatch notebookFileUri. + * @member {string} notebookFileUri + * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch + * @instance + */ + PySparkNotebookBatch.prototype.notebookFileUri = ""; + + /** + * PySparkNotebookBatch params. + * @member {Object.} params + * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch + * @instance + */ + PySparkNotebookBatch.prototype.params = $util.emptyObject; + + /** + * PySparkNotebookBatch pythonFileUris. + * @member {Array.} pythonFileUris + * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch + * @instance + */ + PySparkNotebookBatch.prototype.pythonFileUris = $util.emptyArray; + + /** + * PySparkNotebookBatch jarFileUris. + * @member {Array.} jarFileUris + * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch + * @instance + */ + PySparkNotebookBatch.prototype.jarFileUris = $util.emptyArray; + + /** + * PySparkNotebookBatch fileUris. + * @member {Array.} fileUris + * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch + * @instance + */ + PySparkNotebookBatch.prototype.fileUris = $util.emptyArray; + + /** + * PySparkNotebookBatch archiveUris. + * @member {Array.} archiveUris + * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch + * @instance + */ + PySparkNotebookBatch.prototype.archiveUris = $util.emptyArray; + + /** + * Creates a new PySparkNotebookBatch instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch + * @static + * @param {google.cloud.dataproc.v1.IPySparkNotebookBatch=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.PySparkNotebookBatch} PySparkNotebookBatch instance + */ + PySparkNotebookBatch.create = function create(properties) { + return new PySparkNotebookBatch(properties); + }; + + /** + * Encodes the specified PySparkNotebookBatch message. Does not implicitly {@link google.cloud.dataproc.v1.PySparkNotebookBatch.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch + * @static + * @param {google.cloud.dataproc.v1.IPySparkNotebookBatch} message PySparkNotebookBatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PySparkNotebookBatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.notebookFileUri != null && Object.hasOwnProperty.call(message, "notebookFileUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.notebookFileUri); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + for (var keys = Object.keys(message.params), 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.params[keys[i]]).ldelim(); + if (message.pythonFileUris != null && message.pythonFileUris.length) + for (var i = 0; i < message.pythonFileUris.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pythonFileUris[i]); + if (message.jarFileUris != null && message.jarFileUris.length) + for (var i = 0; i < message.jarFileUris.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.jarFileUris[i]); + if (message.fileUris != null && message.fileUris.length) + for (var i = 0; i < message.fileUris.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.fileUris[i]); + if (message.archiveUris != null && message.archiveUris.length) + for (var i = 0; i < message.archiveUris.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.archiveUris[i]); + return writer; + }; + + /** + * Encodes the specified PySparkNotebookBatch message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.PySparkNotebookBatch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch + * @static + * @param {google.cloud.dataproc.v1.IPySparkNotebookBatch} message PySparkNotebookBatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PySparkNotebookBatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PySparkNotebookBatch message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.PySparkNotebookBatch} PySparkNotebookBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PySparkNotebookBatch.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.PySparkNotebookBatch(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.notebookFileUri = reader.string(); + break; + } + case 2: { + if (message.params === $util.emptyObject) + message.params = {}; + 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.params[key] = value; + break; + } + case 3: { + if (!(message.pythonFileUris && message.pythonFileUris.length)) + message.pythonFileUris = []; + message.pythonFileUris.push(reader.string()); + break; + } + case 4: { + if (!(message.jarFileUris && message.jarFileUris.length)) + message.jarFileUris = []; + message.jarFileUris.push(reader.string()); + break; + } + case 5: { + if (!(message.fileUris && message.fileUris.length)) + message.fileUris = []; + message.fileUris.push(reader.string()); + break; + } + case 6: { + if (!(message.archiveUris && message.archiveUris.length)) + message.archiveUris = []; + message.archiveUris.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PySparkNotebookBatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.PySparkNotebookBatch} PySparkNotebookBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PySparkNotebookBatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PySparkNotebookBatch message. + * @function verify + * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PySparkNotebookBatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.notebookFileUri != null && message.hasOwnProperty("notebookFileUri")) + if (!$util.isString(message.notebookFileUri)) + return "notebookFileUri: string expected"; + if (message.params != null && message.hasOwnProperty("params")) { + if (!$util.isObject(message.params)) + return "params: object expected"; + var key = Object.keys(message.params); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.params[key[i]])) + return "params: string{k:string} expected"; + } + if (message.pythonFileUris != null && message.hasOwnProperty("pythonFileUris")) { + if (!Array.isArray(message.pythonFileUris)) + return "pythonFileUris: array expected"; + for (var i = 0; i < message.pythonFileUris.length; ++i) + if (!$util.isString(message.pythonFileUris[i])) + return "pythonFileUris: string[] expected"; + } + if (message.jarFileUris != null && message.hasOwnProperty("jarFileUris")) { + if (!Array.isArray(message.jarFileUris)) + return "jarFileUris: array expected"; + for (var i = 0; i < message.jarFileUris.length; ++i) + if (!$util.isString(message.jarFileUris[i])) + return "jarFileUris: string[] expected"; + } + if (message.fileUris != null && message.hasOwnProperty("fileUris")) { + if (!Array.isArray(message.fileUris)) + return "fileUris: array expected"; + for (var i = 0; i < message.fileUris.length; ++i) + if (!$util.isString(message.fileUris[i])) + return "fileUris: string[] expected"; + } + if (message.archiveUris != null && message.hasOwnProperty("archiveUris")) { + if (!Array.isArray(message.archiveUris)) + return "archiveUris: array expected"; + for (var i = 0; i < message.archiveUris.length; ++i) + if (!$util.isString(message.archiveUris[i])) + return "archiveUris: string[] expected"; + } + return null; + }; + + /** + * Creates a PySparkNotebookBatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.PySparkNotebookBatch} PySparkNotebookBatch + */ + PySparkNotebookBatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.PySparkNotebookBatch) + return object; + var message = new $root.google.cloud.dataproc.v1.PySparkNotebookBatch(); + if (object.notebookFileUri != null) + message.notebookFileUri = String(object.notebookFileUri); + if (object.params) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.dataproc.v1.PySparkNotebookBatch.params: object expected"); + message.params = {}; + for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) + message.params[keys[i]] = String(object.params[keys[i]]); + } + if (object.pythonFileUris) { + if (!Array.isArray(object.pythonFileUris)) + throw TypeError(".google.cloud.dataproc.v1.PySparkNotebookBatch.pythonFileUris: array expected"); + message.pythonFileUris = []; + for (var i = 0; i < object.pythonFileUris.length; ++i) + message.pythonFileUris[i] = String(object.pythonFileUris[i]); + } + if (object.jarFileUris) { + if (!Array.isArray(object.jarFileUris)) + throw TypeError(".google.cloud.dataproc.v1.PySparkNotebookBatch.jarFileUris: array expected"); + message.jarFileUris = []; + for (var i = 0; i < object.jarFileUris.length; ++i) + message.jarFileUris[i] = String(object.jarFileUris[i]); + } + if (object.fileUris) { + if (!Array.isArray(object.fileUris)) + throw TypeError(".google.cloud.dataproc.v1.PySparkNotebookBatch.fileUris: array expected"); + message.fileUris = []; + for (var i = 0; i < object.fileUris.length; ++i) + message.fileUris[i] = String(object.fileUris[i]); + } + if (object.archiveUris) { + if (!Array.isArray(object.archiveUris)) + throw TypeError(".google.cloud.dataproc.v1.PySparkNotebookBatch.archiveUris: array expected"); + message.archiveUris = []; + for (var i = 0; i < object.archiveUris.length; ++i) + message.archiveUris[i] = String(object.archiveUris[i]); + } + return message; + }; + + /** + * Creates a plain object from a PySparkNotebookBatch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch + * @static + * @param {google.cloud.dataproc.v1.PySparkNotebookBatch} message PySparkNotebookBatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PySparkNotebookBatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pythonFileUris = []; + object.jarFileUris = []; + object.fileUris = []; + object.archiveUris = []; + } + if (options.objects || options.defaults) + object.params = {}; + if (options.defaults) + object.notebookFileUri = ""; + if (message.notebookFileUri != null && message.hasOwnProperty("notebookFileUri")) + object.notebookFileUri = message.notebookFileUri; + var keys2; + if (message.params && (keys2 = Object.keys(message.params)).length) { + object.params = {}; + for (var j = 0; j < keys2.length; ++j) + object.params[keys2[j]] = message.params[keys2[j]]; + } + if (message.pythonFileUris && message.pythonFileUris.length) { + object.pythonFileUris = []; + for (var j = 0; j < message.pythonFileUris.length; ++j) + object.pythonFileUris[j] = message.pythonFileUris[j]; + } + if (message.jarFileUris && message.jarFileUris.length) { + object.jarFileUris = []; + for (var j = 0; j < message.jarFileUris.length; ++j) + object.jarFileUris[j] = message.jarFileUris[j]; + } + if (message.fileUris && message.fileUris.length) { + object.fileUris = []; + for (var j = 0; j < message.fileUris.length; ++j) + object.fileUris[j] = message.fileUris[j]; + } + if (message.archiveUris && message.archiveUris.length) { + object.archiveUris = []; + for (var j = 0; j < message.archiveUris.length; ++j) + object.archiveUris[j] = message.archiveUris[j]; + } + return object; + }; + + /** + * Converts this PySparkNotebookBatch to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch + * @instance + * @returns {Object.} JSON object + */ + PySparkNotebookBatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PySparkNotebookBatch + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PySparkNotebookBatch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.PySparkNotebookBatch"; + }; + + return PySparkNotebookBatch; + })(); + + v1.RuntimeConfig = (function() { + + /** + * Properties of a RuntimeConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IRuntimeConfig + * @property {string|null} [version] RuntimeConfig version + * @property {string|null} [containerImage] RuntimeConfig containerImage + * @property {Object.|null} [properties] RuntimeConfig properties + * @property {google.cloud.dataproc.v1.IRepositoryConfig|null} [repositoryConfig] RuntimeConfig repositoryConfig + * @property {google.cloud.dataproc.v1.IAutotuningConfig|null} [autotuningConfig] RuntimeConfig autotuningConfig + * @property {string|null} [cohort] RuntimeConfig cohort + */ + + /** + * Constructs a new RuntimeConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a RuntimeConfig. + * @implements IRuntimeConfig + * @constructor + * @param {google.cloud.dataproc.v1.IRuntimeConfig=} [properties] Properties to set + */ + function RuntimeConfig(properties) { + this.properties = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RuntimeConfig version. + * @member {string} version + * @memberof google.cloud.dataproc.v1.RuntimeConfig + * @instance + */ + RuntimeConfig.prototype.version = ""; + + /** + * RuntimeConfig containerImage. + * @member {string} containerImage + * @memberof google.cloud.dataproc.v1.RuntimeConfig + * @instance + */ + RuntimeConfig.prototype.containerImage = ""; + + /** + * RuntimeConfig properties. + * @member {Object.} properties + * @memberof google.cloud.dataproc.v1.RuntimeConfig + * @instance + */ + RuntimeConfig.prototype.properties = $util.emptyObject; + + /** + * RuntimeConfig repositoryConfig. + * @member {google.cloud.dataproc.v1.IRepositoryConfig|null|undefined} repositoryConfig + * @memberof google.cloud.dataproc.v1.RuntimeConfig + * @instance + */ + RuntimeConfig.prototype.repositoryConfig = null; + + /** + * RuntimeConfig autotuningConfig. + * @member {google.cloud.dataproc.v1.IAutotuningConfig|null|undefined} autotuningConfig + * @memberof google.cloud.dataproc.v1.RuntimeConfig + * @instance + */ + RuntimeConfig.prototype.autotuningConfig = null; + + /** + * RuntimeConfig cohort. + * @member {string} cohort + * @memberof google.cloud.dataproc.v1.RuntimeConfig + * @instance + */ + RuntimeConfig.prototype.cohort = ""; + + /** + * Creates a new RuntimeConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.RuntimeConfig + * @static + * @param {google.cloud.dataproc.v1.IRuntimeConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.RuntimeConfig} RuntimeConfig instance + */ + RuntimeConfig.create = function create(properties) { + return new RuntimeConfig(properties); + }; + + /** + * Encodes the specified RuntimeConfig message. Does not implicitly {@link google.cloud.dataproc.v1.RuntimeConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.RuntimeConfig + * @static + * @param {google.cloud.dataproc.v1.IRuntimeConfig} message RuntimeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuntimeConfig.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.containerImage != null && Object.hasOwnProperty.call(message, "containerImage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.containerImage); + if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) + for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.properties[keys[i]]).ldelim(); + if (message.repositoryConfig != null && Object.hasOwnProperty.call(message, "repositoryConfig")) + $root.google.cloud.dataproc.v1.RepositoryConfig.encode(message.repositoryConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.autotuningConfig != null && Object.hasOwnProperty.call(message, "autotuningConfig")) + $root.google.cloud.dataproc.v1.AutotuningConfig.encode(message.autotuningConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.cohort != null && Object.hasOwnProperty.call(message, "cohort")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.cohort); + return writer; + }; + + /** + * Encodes the specified RuntimeConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.RuntimeConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.RuntimeConfig + * @static + * @param {google.cloud.dataproc.v1.IRuntimeConfig} message RuntimeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuntimeConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RuntimeConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.RuntimeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.RuntimeConfig} RuntimeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuntimeConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.RuntimeConfig(), key, value; + 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.containerImage = reader.string(); + break; + } + case 3: { + if (message.properties === $util.emptyObject) + message.properties = {}; + 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.properties[key] = value; + break; + } + case 5: { + message.repositoryConfig = $root.google.cloud.dataproc.v1.RepositoryConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.autotuningConfig = $root.google.cloud.dataproc.v1.AutotuningConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.cohort = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RuntimeConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.RuntimeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.RuntimeConfig} RuntimeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuntimeConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RuntimeConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.RuntimeConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RuntimeConfig.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.containerImage != null && message.hasOwnProperty("containerImage")) + if (!$util.isString(message.containerImage)) + return "containerImage: string expected"; + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!$util.isObject(message.properties)) + return "properties: object expected"; + var key = Object.keys(message.properties); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.properties[key[i]])) + return "properties: string{k:string} expected"; + } + if (message.repositoryConfig != null && message.hasOwnProperty("repositoryConfig")) { + var error = $root.google.cloud.dataproc.v1.RepositoryConfig.verify(message.repositoryConfig); + if (error) + return "repositoryConfig." + error; + } + if (message.autotuningConfig != null && message.hasOwnProperty("autotuningConfig")) { + var error = $root.google.cloud.dataproc.v1.AutotuningConfig.verify(message.autotuningConfig); + if (error) + return "autotuningConfig." + error; + } + if (message.cohort != null && message.hasOwnProperty("cohort")) + if (!$util.isString(message.cohort)) + return "cohort: string expected"; + return null; + }; + + /** + * Creates a RuntimeConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.RuntimeConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.RuntimeConfig} RuntimeConfig + */ + RuntimeConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.RuntimeConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.RuntimeConfig(); + if (object.version != null) + message.version = String(object.version); + if (object.containerImage != null) + message.containerImage = String(object.containerImage); + if (object.properties) { + if (typeof object.properties !== "object") + throw TypeError(".google.cloud.dataproc.v1.RuntimeConfig.properties: object expected"); + message.properties = {}; + for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) + message.properties[keys[i]] = String(object.properties[keys[i]]); + } + if (object.repositoryConfig != null) { + if (typeof object.repositoryConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.RuntimeConfig.repositoryConfig: object expected"); + message.repositoryConfig = $root.google.cloud.dataproc.v1.RepositoryConfig.fromObject(object.repositoryConfig); + } + if (object.autotuningConfig != null) { + if (typeof object.autotuningConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.RuntimeConfig.autotuningConfig: object expected"); + message.autotuningConfig = $root.google.cloud.dataproc.v1.AutotuningConfig.fromObject(object.autotuningConfig); + } + if (object.cohort != null) + message.cohort = String(object.cohort); + return message; + }; + + /** + * Creates a plain object from a RuntimeConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.RuntimeConfig + * @static + * @param {google.cloud.dataproc.v1.RuntimeConfig} message RuntimeConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RuntimeConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.properties = {}; + if (options.defaults) { + object.version = ""; + object.containerImage = ""; + object.repositoryConfig = null; + object.autotuningConfig = null; + object.cohort = ""; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.containerImage != null && message.hasOwnProperty("containerImage")) + object.containerImage = message.containerImage; + var keys2; + if (message.properties && (keys2 = Object.keys(message.properties)).length) { + object.properties = {}; + for (var j = 0; j < keys2.length; ++j) + object.properties[keys2[j]] = message.properties[keys2[j]]; + } + if (message.repositoryConfig != null && message.hasOwnProperty("repositoryConfig")) + object.repositoryConfig = $root.google.cloud.dataproc.v1.RepositoryConfig.toObject(message.repositoryConfig, options); + if (message.autotuningConfig != null && message.hasOwnProperty("autotuningConfig")) + object.autotuningConfig = $root.google.cloud.dataproc.v1.AutotuningConfig.toObject(message.autotuningConfig, options); + if (message.cohort != null && message.hasOwnProperty("cohort")) + object.cohort = message.cohort; + return object; + }; + + /** + * Converts this RuntimeConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.RuntimeConfig + * @instance + * @returns {Object.} JSON object + */ + RuntimeConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RuntimeConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.RuntimeConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RuntimeConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.RuntimeConfig"; + }; + + return RuntimeConfig; + })(); + + v1.EnvironmentConfig = (function() { + + /** + * Properties of an EnvironmentConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IEnvironmentConfig + * @property {google.cloud.dataproc.v1.IExecutionConfig|null} [executionConfig] EnvironmentConfig executionConfig + * @property {google.cloud.dataproc.v1.IPeripheralsConfig|null} [peripheralsConfig] EnvironmentConfig peripheralsConfig + */ + + /** + * Constructs a new EnvironmentConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents an EnvironmentConfig. + * @implements IEnvironmentConfig + * @constructor + * @param {google.cloud.dataproc.v1.IEnvironmentConfig=} [properties] Properties to set + */ + function EnvironmentConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnvironmentConfig executionConfig. + * @member {google.cloud.dataproc.v1.IExecutionConfig|null|undefined} executionConfig + * @memberof google.cloud.dataproc.v1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.executionConfig = null; + + /** + * EnvironmentConfig peripheralsConfig. + * @member {google.cloud.dataproc.v1.IPeripheralsConfig|null|undefined} peripheralsConfig + * @memberof google.cloud.dataproc.v1.EnvironmentConfig + * @instance + */ + EnvironmentConfig.prototype.peripheralsConfig = null; + + /** + * Creates a new EnvironmentConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.EnvironmentConfig + * @static + * @param {google.cloud.dataproc.v1.IEnvironmentConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.EnvironmentConfig} EnvironmentConfig instance + */ + EnvironmentConfig.create = function create(properties) { + return new EnvironmentConfig(properties); + }; + + /** + * Encodes the specified EnvironmentConfig message. Does not implicitly {@link google.cloud.dataproc.v1.EnvironmentConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.EnvironmentConfig + * @static + * @param {google.cloud.dataproc.v1.IEnvironmentConfig} message EnvironmentConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnvironmentConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.executionConfig != null && Object.hasOwnProperty.call(message, "executionConfig")) + $root.google.cloud.dataproc.v1.ExecutionConfig.encode(message.executionConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.peripheralsConfig != null && Object.hasOwnProperty.call(message, "peripheralsConfig")) + $root.google.cloud.dataproc.v1.PeripheralsConfig.encode(message.peripheralsConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnvironmentConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.EnvironmentConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.EnvironmentConfig + * @static + * @param {google.cloud.dataproc.v1.IEnvironmentConfig} message EnvironmentConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnvironmentConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnvironmentConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.EnvironmentConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.EnvironmentConfig} EnvironmentConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnvironmentConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.EnvironmentConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.executionConfig = $root.google.cloud.dataproc.v1.ExecutionConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.peripheralsConfig = $root.google.cloud.dataproc.v1.PeripheralsConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnvironmentConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.EnvironmentConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.EnvironmentConfig} EnvironmentConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnvironmentConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnvironmentConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.EnvironmentConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnvironmentConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.executionConfig != null && message.hasOwnProperty("executionConfig")) { + var error = $root.google.cloud.dataproc.v1.ExecutionConfig.verify(message.executionConfig); + if (error) + return "executionConfig." + error; + } + if (message.peripheralsConfig != null && message.hasOwnProperty("peripheralsConfig")) { + var error = $root.google.cloud.dataproc.v1.PeripheralsConfig.verify(message.peripheralsConfig); + if (error) + return "peripheralsConfig." + error; + } + return null; + }; + + /** + * Creates an EnvironmentConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.EnvironmentConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.EnvironmentConfig} EnvironmentConfig + */ + EnvironmentConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.EnvironmentConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.EnvironmentConfig(); + if (object.executionConfig != null) { + if (typeof object.executionConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.EnvironmentConfig.executionConfig: object expected"); + message.executionConfig = $root.google.cloud.dataproc.v1.ExecutionConfig.fromObject(object.executionConfig); + } + if (object.peripheralsConfig != null) { + if (typeof object.peripheralsConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.EnvironmentConfig.peripheralsConfig: object expected"); + message.peripheralsConfig = $root.google.cloud.dataproc.v1.PeripheralsConfig.fromObject(object.peripheralsConfig); + } + return message; + }; + + /** + * Creates a plain object from an EnvironmentConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.EnvironmentConfig + * @static + * @param {google.cloud.dataproc.v1.EnvironmentConfig} message EnvironmentConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnvironmentConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.executionConfig = null; + object.peripheralsConfig = null; + } + if (message.executionConfig != null && message.hasOwnProperty("executionConfig")) + object.executionConfig = $root.google.cloud.dataproc.v1.ExecutionConfig.toObject(message.executionConfig, options); + if (message.peripheralsConfig != null && message.hasOwnProperty("peripheralsConfig")) + object.peripheralsConfig = $root.google.cloud.dataproc.v1.PeripheralsConfig.toObject(message.peripheralsConfig, options); + return object; + }; + + /** + * Converts this EnvironmentConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.EnvironmentConfig + * @instance + * @returns {Object.} JSON object + */ + EnvironmentConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnvironmentConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.EnvironmentConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnvironmentConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.EnvironmentConfig"; + }; + + return EnvironmentConfig; + })(); + + v1.ExecutionConfig = (function() { + + /** + * Properties of an ExecutionConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IExecutionConfig + * @property {string|null} [serviceAccount] ExecutionConfig serviceAccount + * @property {string|null} [networkUri] ExecutionConfig networkUri + * @property {string|null} [subnetworkUri] ExecutionConfig subnetworkUri + * @property {Array.|null} [networkTags] ExecutionConfig networkTags + * @property {string|null} [kmsKey] ExecutionConfig kmsKey + * @property {google.protobuf.IDuration|null} [idleTtl] ExecutionConfig idleTtl + * @property {google.protobuf.IDuration|null} [ttl] ExecutionConfig ttl + * @property {string|null} [stagingBucket] ExecutionConfig stagingBucket + * @property {google.cloud.dataproc.v1.IAuthenticationConfig|null} [authenticationConfig] ExecutionConfig authenticationConfig + */ + + /** + * Constructs a new ExecutionConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents an ExecutionConfig. + * @implements IExecutionConfig + * @constructor + * @param {google.cloud.dataproc.v1.IExecutionConfig=} [properties] Properties to set + */ + function ExecutionConfig(properties) { + this.networkTags = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExecutionConfig serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.dataproc.v1.ExecutionConfig + * @instance + */ + ExecutionConfig.prototype.serviceAccount = ""; + + /** + * ExecutionConfig networkUri. + * @member {string|null|undefined} networkUri + * @memberof google.cloud.dataproc.v1.ExecutionConfig + * @instance + */ + ExecutionConfig.prototype.networkUri = null; + + /** + * ExecutionConfig subnetworkUri. + * @member {string|null|undefined} subnetworkUri + * @memberof google.cloud.dataproc.v1.ExecutionConfig + * @instance + */ + ExecutionConfig.prototype.subnetworkUri = null; + + /** + * ExecutionConfig networkTags. + * @member {Array.} networkTags + * @memberof google.cloud.dataproc.v1.ExecutionConfig + * @instance + */ + ExecutionConfig.prototype.networkTags = $util.emptyArray; + + /** + * ExecutionConfig kmsKey. + * @member {string} kmsKey + * @memberof google.cloud.dataproc.v1.ExecutionConfig + * @instance + */ + ExecutionConfig.prototype.kmsKey = ""; + + /** + * ExecutionConfig idleTtl. + * @member {google.protobuf.IDuration|null|undefined} idleTtl + * @memberof google.cloud.dataproc.v1.ExecutionConfig + * @instance + */ + ExecutionConfig.prototype.idleTtl = null; + + /** + * ExecutionConfig ttl. + * @member {google.protobuf.IDuration|null|undefined} ttl + * @memberof google.cloud.dataproc.v1.ExecutionConfig + * @instance + */ + ExecutionConfig.prototype.ttl = null; + + /** + * ExecutionConfig stagingBucket. + * @member {string} stagingBucket + * @memberof google.cloud.dataproc.v1.ExecutionConfig + * @instance + */ + ExecutionConfig.prototype.stagingBucket = ""; + + /** + * ExecutionConfig authenticationConfig. + * @member {google.cloud.dataproc.v1.IAuthenticationConfig|null|undefined} authenticationConfig + * @memberof google.cloud.dataproc.v1.ExecutionConfig + * @instance + */ + ExecutionConfig.prototype.authenticationConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExecutionConfig network. + * @member {"networkUri"|"subnetworkUri"|undefined} network + * @memberof google.cloud.dataproc.v1.ExecutionConfig + * @instance + */ + Object.defineProperty(ExecutionConfig.prototype, "network", { + get: $util.oneOfGetter($oneOfFields = ["networkUri", "subnetworkUri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExecutionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.ExecutionConfig + * @static + * @param {google.cloud.dataproc.v1.IExecutionConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.ExecutionConfig} ExecutionConfig instance + */ + ExecutionConfig.create = function create(properties) { + return new ExecutionConfig(properties); + }; + + /** + * Encodes the specified ExecutionConfig message. Does not implicitly {@link google.cloud.dataproc.v1.ExecutionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.ExecutionConfig + * @static + * @param {google.cloud.dataproc.v1.IExecutionConfig} message ExecutionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecutionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.serviceAccount); + if (message.networkUri != null && Object.hasOwnProperty.call(message, "networkUri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.networkUri); + if (message.subnetworkUri != null && Object.hasOwnProperty.call(message, "subnetworkUri")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.subnetworkUri); + if (message.networkTags != null && message.networkTags.length) + for (var i = 0; i < message.networkTags.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.networkTags[i]); + if (message.kmsKey != null && Object.hasOwnProperty.call(message, "kmsKey")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.kmsKey); + if (message.idleTtl != null && Object.hasOwnProperty.call(message, "idleTtl")) + $root.google.protobuf.Duration.encode(message.idleTtl, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.ttl != null && Object.hasOwnProperty.call(message, "ttl")) + $root.google.protobuf.Duration.encode(message.ttl, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.stagingBucket != null && Object.hasOwnProperty.call(message, "stagingBucket")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.stagingBucket); + if (message.authenticationConfig != null && Object.hasOwnProperty.call(message, "authenticationConfig")) + $root.google.cloud.dataproc.v1.AuthenticationConfig.encode(message.authenticationConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExecutionConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ExecutionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.ExecutionConfig + * @static + * @param {google.cloud.dataproc.v1.IExecutionConfig} message ExecutionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExecutionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExecutionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.ExecutionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.ExecutionConfig} ExecutionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecutionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ExecutionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.serviceAccount = reader.string(); + break; + } + case 4: { + message.networkUri = reader.string(); + break; + } + case 5: { + message.subnetworkUri = reader.string(); + break; + } + case 6: { + if (!(message.networkTags && message.networkTags.length)) + message.networkTags = []; + message.networkTags.push(reader.string()); + break; + } + case 7: { + message.kmsKey = reader.string(); + break; + } + case 8: { + message.idleTtl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 9: { + message.ttl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 10: { + message.stagingBucket = reader.string(); + break; + } + case 11: { + message.authenticationConfig = $root.google.cloud.dataproc.v1.AuthenticationConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExecutionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.ExecutionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.ExecutionConfig} ExecutionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExecutionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExecutionConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.ExecutionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExecutionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.networkUri != null && message.hasOwnProperty("networkUri")) { + properties.network = 1; + if (!$util.isString(message.networkUri)) + return "networkUri: string expected"; + } + if (message.subnetworkUri != null && message.hasOwnProperty("subnetworkUri")) { + if (properties.network === 1) + return "network: multiple values"; + properties.network = 1; + if (!$util.isString(message.subnetworkUri)) + return "subnetworkUri: string expected"; + } + if (message.networkTags != null && message.hasOwnProperty("networkTags")) { + if (!Array.isArray(message.networkTags)) + return "networkTags: array expected"; + for (var i = 0; i < message.networkTags.length; ++i) + if (!$util.isString(message.networkTags[i])) + return "networkTags: string[] expected"; + } + if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) + if (!$util.isString(message.kmsKey)) + return "kmsKey: string expected"; + if (message.idleTtl != null && message.hasOwnProperty("idleTtl")) { + var error = $root.google.protobuf.Duration.verify(message.idleTtl); + if (error) + return "idleTtl." + error; + } + if (message.ttl != null && message.hasOwnProperty("ttl")) { + var error = $root.google.protobuf.Duration.verify(message.ttl); + if (error) + return "ttl." + error; + } + if (message.stagingBucket != null && message.hasOwnProperty("stagingBucket")) + if (!$util.isString(message.stagingBucket)) + return "stagingBucket: string expected"; + if (message.authenticationConfig != null && message.hasOwnProperty("authenticationConfig")) { + var error = $root.google.cloud.dataproc.v1.AuthenticationConfig.verify(message.authenticationConfig); + if (error) + return "authenticationConfig." + error; + } + return null; + }; + + /** + * Creates an ExecutionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.ExecutionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.ExecutionConfig} ExecutionConfig + */ + ExecutionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.ExecutionConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.ExecutionConfig(); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.networkUri != null) + message.networkUri = String(object.networkUri); + if (object.subnetworkUri != null) + message.subnetworkUri = String(object.subnetworkUri); + if (object.networkTags) { + if (!Array.isArray(object.networkTags)) + throw TypeError(".google.cloud.dataproc.v1.ExecutionConfig.networkTags: array expected"); + message.networkTags = []; + for (var i = 0; i < object.networkTags.length; ++i) + message.networkTags[i] = String(object.networkTags[i]); + } + if (object.kmsKey != null) + message.kmsKey = String(object.kmsKey); + if (object.idleTtl != null) { + if (typeof object.idleTtl !== "object") + throw TypeError(".google.cloud.dataproc.v1.ExecutionConfig.idleTtl: object expected"); + message.idleTtl = $root.google.protobuf.Duration.fromObject(object.idleTtl); + } + if (object.ttl != null) { + if (typeof object.ttl !== "object") + throw TypeError(".google.cloud.dataproc.v1.ExecutionConfig.ttl: object expected"); + message.ttl = $root.google.protobuf.Duration.fromObject(object.ttl); + } + if (object.stagingBucket != null) + message.stagingBucket = String(object.stagingBucket); + if (object.authenticationConfig != null) { + if (typeof object.authenticationConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.ExecutionConfig.authenticationConfig: object expected"); + message.authenticationConfig = $root.google.cloud.dataproc.v1.AuthenticationConfig.fromObject(object.authenticationConfig); + } + return message; + }; + + /** + * Creates a plain object from an ExecutionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.ExecutionConfig + * @static + * @param {google.cloud.dataproc.v1.ExecutionConfig} message ExecutionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExecutionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.networkTags = []; + if (options.defaults) { + object.serviceAccount = ""; + object.kmsKey = ""; + object.idleTtl = null; + object.ttl = null; + object.stagingBucket = ""; + object.authenticationConfig = null; + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.networkUri != null && message.hasOwnProperty("networkUri")) { + object.networkUri = message.networkUri; + if (options.oneofs) + object.network = "networkUri"; + } + if (message.subnetworkUri != null && message.hasOwnProperty("subnetworkUri")) { + object.subnetworkUri = message.subnetworkUri; + if (options.oneofs) + object.network = "subnetworkUri"; + } + if (message.networkTags && message.networkTags.length) { + object.networkTags = []; + for (var j = 0; j < message.networkTags.length; ++j) + object.networkTags[j] = message.networkTags[j]; + } + if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) + object.kmsKey = message.kmsKey; + if (message.idleTtl != null && message.hasOwnProperty("idleTtl")) + object.idleTtl = $root.google.protobuf.Duration.toObject(message.idleTtl, options); + if (message.ttl != null && message.hasOwnProperty("ttl")) + object.ttl = $root.google.protobuf.Duration.toObject(message.ttl, options); + if (message.stagingBucket != null && message.hasOwnProperty("stagingBucket")) + object.stagingBucket = message.stagingBucket; + if (message.authenticationConfig != null && message.hasOwnProperty("authenticationConfig")) + object.authenticationConfig = $root.google.cloud.dataproc.v1.AuthenticationConfig.toObject(message.authenticationConfig, options); + return object; + }; + + /** + * Converts this ExecutionConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.ExecutionConfig + * @instance + * @returns {Object.} JSON object + */ + ExecutionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExecutionConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.ExecutionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExecutionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.ExecutionConfig"; + }; + + return ExecutionConfig; + })(); + + v1.SparkHistoryServerConfig = (function() { + + /** + * Properties of a SparkHistoryServerConfig. + * @memberof google.cloud.dataproc.v1 + * @interface ISparkHistoryServerConfig + * @property {string|null} [dataprocCluster] SparkHistoryServerConfig dataprocCluster + */ + + /** + * Constructs a new SparkHistoryServerConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a SparkHistoryServerConfig. + * @implements ISparkHistoryServerConfig + * @constructor + * @param {google.cloud.dataproc.v1.ISparkHistoryServerConfig=} [properties] Properties to set + */ + function SparkHistoryServerConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SparkHistoryServerConfig dataprocCluster. + * @member {string} dataprocCluster + * @memberof google.cloud.dataproc.v1.SparkHistoryServerConfig + * @instance + */ + SparkHistoryServerConfig.prototype.dataprocCluster = ""; + + /** + * Creates a new SparkHistoryServerConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.SparkHistoryServerConfig + * @static + * @param {google.cloud.dataproc.v1.ISparkHistoryServerConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.SparkHistoryServerConfig} SparkHistoryServerConfig instance + */ + SparkHistoryServerConfig.create = function create(properties) { + return new SparkHistoryServerConfig(properties); + }; + + /** + * Encodes the specified SparkHistoryServerConfig message. Does not implicitly {@link google.cloud.dataproc.v1.SparkHistoryServerConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.SparkHistoryServerConfig + * @static + * @param {google.cloud.dataproc.v1.ISparkHistoryServerConfig} message SparkHistoryServerConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SparkHistoryServerConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataprocCluster != null && Object.hasOwnProperty.call(message, "dataprocCluster")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataprocCluster); + return writer; + }; + + /** + * Encodes the specified SparkHistoryServerConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SparkHistoryServerConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.SparkHistoryServerConfig + * @static + * @param {google.cloud.dataproc.v1.ISparkHistoryServerConfig} message SparkHistoryServerConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SparkHistoryServerConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SparkHistoryServerConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.SparkHistoryServerConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.SparkHistoryServerConfig} SparkHistoryServerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SparkHistoryServerConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.SparkHistoryServerConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.dataprocCluster = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SparkHistoryServerConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.SparkHistoryServerConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.SparkHistoryServerConfig} SparkHistoryServerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SparkHistoryServerConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SparkHistoryServerConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.SparkHistoryServerConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SparkHistoryServerConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataprocCluster != null && message.hasOwnProperty("dataprocCluster")) + if (!$util.isString(message.dataprocCluster)) + return "dataprocCluster: string expected"; + return null; + }; + + /** + * Creates a SparkHistoryServerConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.SparkHistoryServerConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.SparkHistoryServerConfig} SparkHistoryServerConfig + */ + SparkHistoryServerConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.SparkHistoryServerConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.SparkHistoryServerConfig(); + if (object.dataprocCluster != null) + message.dataprocCluster = String(object.dataprocCluster); + return message; + }; + + /** + * Creates a plain object from a SparkHistoryServerConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.SparkHistoryServerConfig + * @static + * @param {google.cloud.dataproc.v1.SparkHistoryServerConfig} message SparkHistoryServerConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SparkHistoryServerConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.dataprocCluster = ""; + if (message.dataprocCluster != null && message.hasOwnProperty("dataprocCluster")) + object.dataprocCluster = message.dataprocCluster; + return object; + }; + + /** + * Converts this SparkHistoryServerConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.SparkHistoryServerConfig + * @instance + * @returns {Object.} JSON object + */ + SparkHistoryServerConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SparkHistoryServerConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.SparkHistoryServerConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SparkHistoryServerConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.SparkHistoryServerConfig"; + }; + + return SparkHistoryServerConfig; + })(); + + v1.PeripheralsConfig = (function() { + + /** + * Properties of a PeripheralsConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IPeripheralsConfig + * @property {string|null} [metastoreService] PeripheralsConfig metastoreService + * @property {google.cloud.dataproc.v1.ISparkHistoryServerConfig|null} [sparkHistoryServerConfig] PeripheralsConfig sparkHistoryServerConfig + */ + + /** + * Constructs a new PeripheralsConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a PeripheralsConfig. + * @implements IPeripheralsConfig + * @constructor + * @param {google.cloud.dataproc.v1.IPeripheralsConfig=} [properties] Properties to set + */ + function PeripheralsConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PeripheralsConfig metastoreService. + * @member {string} metastoreService + * @memberof google.cloud.dataproc.v1.PeripheralsConfig + * @instance + */ + PeripheralsConfig.prototype.metastoreService = ""; + + /** + * PeripheralsConfig sparkHistoryServerConfig. + * @member {google.cloud.dataproc.v1.ISparkHistoryServerConfig|null|undefined} sparkHistoryServerConfig + * @memberof google.cloud.dataproc.v1.PeripheralsConfig + * @instance + */ + PeripheralsConfig.prototype.sparkHistoryServerConfig = null; + + /** + * Creates a new PeripheralsConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.PeripheralsConfig + * @static + * @param {google.cloud.dataproc.v1.IPeripheralsConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.PeripheralsConfig} PeripheralsConfig instance + */ + PeripheralsConfig.create = function create(properties) { + return new PeripheralsConfig(properties); + }; + + /** + * Encodes the specified PeripheralsConfig message. Does not implicitly {@link google.cloud.dataproc.v1.PeripheralsConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.PeripheralsConfig + * @static + * @param {google.cloud.dataproc.v1.IPeripheralsConfig} message PeripheralsConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PeripheralsConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metastoreService != null && Object.hasOwnProperty.call(message, "metastoreService")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.metastoreService); + if (message.sparkHistoryServerConfig != null && Object.hasOwnProperty.call(message, "sparkHistoryServerConfig")) + $root.google.cloud.dataproc.v1.SparkHistoryServerConfig.encode(message.sparkHistoryServerConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PeripheralsConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.PeripheralsConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.PeripheralsConfig + * @static + * @param {google.cloud.dataproc.v1.IPeripheralsConfig} message PeripheralsConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PeripheralsConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PeripheralsConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.PeripheralsConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.PeripheralsConfig} PeripheralsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PeripheralsConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.PeripheralsConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.metastoreService = reader.string(); + break; + } + case 2: { + message.sparkHistoryServerConfig = $root.google.cloud.dataproc.v1.SparkHistoryServerConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PeripheralsConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.PeripheralsConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.PeripheralsConfig} PeripheralsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PeripheralsConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PeripheralsConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.PeripheralsConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PeripheralsConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metastoreService != null && message.hasOwnProperty("metastoreService")) + if (!$util.isString(message.metastoreService)) + return "metastoreService: string expected"; + if (message.sparkHistoryServerConfig != null && message.hasOwnProperty("sparkHistoryServerConfig")) { + var error = $root.google.cloud.dataproc.v1.SparkHistoryServerConfig.verify(message.sparkHistoryServerConfig); + if (error) + return "sparkHistoryServerConfig." + error; + } + return null; + }; + + /** + * Creates a PeripheralsConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.PeripheralsConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.PeripheralsConfig} PeripheralsConfig + */ + PeripheralsConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.PeripheralsConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.PeripheralsConfig(); + if (object.metastoreService != null) + message.metastoreService = String(object.metastoreService); + if (object.sparkHistoryServerConfig != null) { + if (typeof object.sparkHistoryServerConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.PeripheralsConfig.sparkHistoryServerConfig: object expected"); + message.sparkHistoryServerConfig = $root.google.cloud.dataproc.v1.SparkHistoryServerConfig.fromObject(object.sparkHistoryServerConfig); + } + return message; + }; + + /** + * Creates a plain object from a PeripheralsConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.PeripheralsConfig + * @static + * @param {google.cloud.dataproc.v1.PeripheralsConfig} message PeripheralsConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PeripheralsConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.metastoreService = ""; + object.sparkHistoryServerConfig = null; + } + if (message.metastoreService != null && message.hasOwnProperty("metastoreService")) + object.metastoreService = message.metastoreService; + if (message.sparkHistoryServerConfig != null && message.hasOwnProperty("sparkHistoryServerConfig")) + object.sparkHistoryServerConfig = $root.google.cloud.dataproc.v1.SparkHistoryServerConfig.toObject(message.sparkHistoryServerConfig, options); + return object; + }; + + /** + * Converts this PeripheralsConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.PeripheralsConfig + * @instance + * @returns {Object.} JSON object + */ + PeripheralsConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PeripheralsConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.PeripheralsConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PeripheralsConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.PeripheralsConfig"; + }; + + return PeripheralsConfig; + })(); + + v1.RuntimeInfo = (function() { + + /** + * Properties of a RuntimeInfo. + * @memberof google.cloud.dataproc.v1 + * @interface IRuntimeInfo + * @property {Object.|null} [endpoints] RuntimeInfo endpoints + * @property {string|null} [outputUri] RuntimeInfo outputUri + * @property {string|null} [diagnosticOutputUri] RuntimeInfo diagnosticOutputUri + * @property {google.cloud.dataproc.v1.IUsageMetrics|null} [approximateUsage] RuntimeInfo approximateUsage + * @property {google.cloud.dataproc.v1.IUsageSnapshot|null} [currentUsage] RuntimeInfo currentUsage + */ + + /** + * Constructs a new RuntimeInfo. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a RuntimeInfo. + * @implements IRuntimeInfo + * @constructor + * @param {google.cloud.dataproc.v1.IRuntimeInfo=} [properties] Properties to set + */ + function RuntimeInfo(properties) { + this.endpoints = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RuntimeInfo endpoints. + * @member {Object.} endpoints + * @memberof google.cloud.dataproc.v1.RuntimeInfo + * @instance + */ + RuntimeInfo.prototype.endpoints = $util.emptyObject; + + /** + * RuntimeInfo outputUri. + * @member {string} outputUri + * @memberof google.cloud.dataproc.v1.RuntimeInfo + * @instance + */ + RuntimeInfo.prototype.outputUri = ""; + + /** + * RuntimeInfo diagnosticOutputUri. + * @member {string} diagnosticOutputUri + * @memberof google.cloud.dataproc.v1.RuntimeInfo + * @instance + */ + RuntimeInfo.prototype.diagnosticOutputUri = ""; + + /** + * RuntimeInfo approximateUsage. + * @member {google.cloud.dataproc.v1.IUsageMetrics|null|undefined} approximateUsage + * @memberof google.cloud.dataproc.v1.RuntimeInfo + * @instance + */ + RuntimeInfo.prototype.approximateUsage = null; + + /** + * RuntimeInfo currentUsage. + * @member {google.cloud.dataproc.v1.IUsageSnapshot|null|undefined} currentUsage + * @memberof google.cloud.dataproc.v1.RuntimeInfo + * @instance + */ + RuntimeInfo.prototype.currentUsage = null; + + /** + * Creates a new RuntimeInfo instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.RuntimeInfo + * @static + * @param {google.cloud.dataproc.v1.IRuntimeInfo=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.RuntimeInfo} RuntimeInfo instance + */ + RuntimeInfo.create = function create(properties) { + return new RuntimeInfo(properties); + }; + + /** + * Encodes the specified RuntimeInfo message. Does not implicitly {@link google.cloud.dataproc.v1.RuntimeInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.RuntimeInfo + * @static + * @param {google.cloud.dataproc.v1.IRuntimeInfo} message RuntimeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuntimeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.endpoints != null && Object.hasOwnProperty.call(message, "endpoints")) + for (var keys = Object.keys(message.endpoints), 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.endpoints[keys[i]]).ldelim(); + if (message.outputUri != null && Object.hasOwnProperty.call(message, "outputUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.outputUri); + if (message.diagnosticOutputUri != null && Object.hasOwnProperty.call(message, "diagnosticOutputUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.diagnosticOutputUri); + if (message.approximateUsage != null && Object.hasOwnProperty.call(message, "approximateUsage")) + $root.google.cloud.dataproc.v1.UsageMetrics.encode(message.approximateUsage, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.currentUsage != null && Object.hasOwnProperty.call(message, "currentUsage")) + $root.google.cloud.dataproc.v1.UsageSnapshot.encode(message.currentUsage, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RuntimeInfo message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.RuntimeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.RuntimeInfo + * @static + * @param {google.cloud.dataproc.v1.IRuntimeInfo} message RuntimeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuntimeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RuntimeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.RuntimeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.RuntimeInfo} RuntimeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuntimeInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.RuntimeInfo(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.endpoints === $util.emptyObject) + message.endpoints = {}; + 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.endpoints[key] = value; + break; + } + case 2: { + message.outputUri = reader.string(); + break; + } + case 3: { + message.diagnosticOutputUri = reader.string(); + break; + } + case 6: { + message.approximateUsage = $root.google.cloud.dataproc.v1.UsageMetrics.decode(reader, reader.uint32()); + break; + } + case 7: { + message.currentUsage = $root.google.cloud.dataproc.v1.UsageSnapshot.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RuntimeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.RuntimeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.RuntimeInfo} RuntimeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuntimeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RuntimeInfo message. + * @function verify + * @memberof google.cloud.dataproc.v1.RuntimeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RuntimeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.endpoints != null && message.hasOwnProperty("endpoints")) { + if (!$util.isObject(message.endpoints)) + return "endpoints: object expected"; + var key = Object.keys(message.endpoints); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.endpoints[key[i]])) + return "endpoints: string{k:string} expected"; + } + if (message.outputUri != null && message.hasOwnProperty("outputUri")) + if (!$util.isString(message.outputUri)) + return "outputUri: string expected"; + if (message.diagnosticOutputUri != null && message.hasOwnProperty("diagnosticOutputUri")) + if (!$util.isString(message.diagnosticOutputUri)) + return "diagnosticOutputUri: string expected"; + if (message.approximateUsage != null && message.hasOwnProperty("approximateUsage")) { + var error = $root.google.cloud.dataproc.v1.UsageMetrics.verify(message.approximateUsage); + if (error) + return "approximateUsage." + error; + } + if (message.currentUsage != null && message.hasOwnProperty("currentUsage")) { + var error = $root.google.cloud.dataproc.v1.UsageSnapshot.verify(message.currentUsage); + if (error) + return "currentUsage." + error; + } + return null; + }; + + /** + * Creates a RuntimeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.RuntimeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.RuntimeInfo} RuntimeInfo + */ + RuntimeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.RuntimeInfo) + return object; + var message = new $root.google.cloud.dataproc.v1.RuntimeInfo(); + if (object.endpoints) { + if (typeof object.endpoints !== "object") + throw TypeError(".google.cloud.dataproc.v1.RuntimeInfo.endpoints: object expected"); + message.endpoints = {}; + for (var keys = Object.keys(object.endpoints), i = 0; i < keys.length; ++i) + message.endpoints[keys[i]] = String(object.endpoints[keys[i]]); + } + if (object.outputUri != null) + message.outputUri = String(object.outputUri); + if (object.diagnosticOutputUri != null) + message.diagnosticOutputUri = String(object.diagnosticOutputUri); + if (object.approximateUsage != null) { + if (typeof object.approximateUsage !== "object") + throw TypeError(".google.cloud.dataproc.v1.RuntimeInfo.approximateUsage: object expected"); + message.approximateUsage = $root.google.cloud.dataproc.v1.UsageMetrics.fromObject(object.approximateUsage); + } + if (object.currentUsage != null) { + if (typeof object.currentUsage !== "object") + throw TypeError(".google.cloud.dataproc.v1.RuntimeInfo.currentUsage: object expected"); + message.currentUsage = $root.google.cloud.dataproc.v1.UsageSnapshot.fromObject(object.currentUsage); + } + return message; + }; + + /** + * Creates a plain object from a RuntimeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.RuntimeInfo + * @static + * @param {google.cloud.dataproc.v1.RuntimeInfo} message RuntimeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RuntimeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.endpoints = {}; + if (options.defaults) { + object.outputUri = ""; + object.diagnosticOutputUri = ""; + object.approximateUsage = null; + object.currentUsage = null; + } + var keys2; + if (message.endpoints && (keys2 = Object.keys(message.endpoints)).length) { + object.endpoints = {}; + for (var j = 0; j < keys2.length; ++j) + object.endpoints[keys2[j]] = message.endpoints[keys2[j]]; + } + if (message.outputUri != null && message.hasOwnProperty("outputUri")) + object.outputUri = message.outputUri; + if (message.diagnosticOutputUri != null && message.hasOwnProperty("diagnosticOutputUri")) + object.diagnosticOutputUri = message.diagnosticOutputUri; + if (message.approximateUsage != null && message.hasOwnProperty("approximateUsage")) + object.approximateUsage = $root.google.cloud.dataproc.v1.UsageMetrics.toObject(message.approximateUsage, options); + if (message.currentUsage != null && message.hasOwnProperty("currentUsage")) + object.currentUsage = $root.google.cloud.dataproc.v1.UsageSnapshot.toObject(message.currentUsage, options); + return object; + }; + + /** + * Converts this RuntimeInfo to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.RuntimeInfo + * @instance + * @returns {Object.} JSON object + */ + RuntimeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RuntimeInfo + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.RuntimeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RuntimeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.RuntimeInfo"; + }; + + return RuntimeInfo; + })(); + + v1.UsageMetrics = (function() { + + /** + * Properties of a UsageMetrics. + * @memberof google.cloud.dataproc.v1 + * @interface IUsageMetrics + * @property {number|Long|null} [milliDcuSeconds] UsageMetrics milliDcuSeconds + * @property {number|Long|null} [shuffleStorageGbSeconds] UsageMetrics shuffleStorageGbSeconds + * @property {number|Long|null} [milliAcceleratorSeconds] UsageMetrics milliAcceleratorSeconds + * @property {string|null} [acceleratorType] UsageMetrics acceleratorType + */ + + /** + * Constructs a new UsageMetrics. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a UsageMetrics. + * @implements IUsageMetrics + * @constructor + * @param {google.cloud.dataproc.v1.IUsageMetrics=} [properties] Properties to set + */ + function UsageMetrics(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UsageMetrics milliDcuSeconds. + * @member {number|Long} milliDcuSeconds + * @memberof google.cloud.dataproc.v1.UsageMetrics + * @instance + */ + UsageMetrics.prototype.milliDcuSeconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UsageMetrics shuffleStorageGbSeconds. + * @member {number|Long} shuffleStorageGbSeconds + * @memberof google.cloud.dataproc.v1.UsageMetrics + * @instance + */ + UsageMetrics.prototype.shuffleStorageGbSeconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UsageMetrics milliAcceleratorSeconds. + * @member {number|Long} milliAcceleratorSeconds + * @memberof google.cloud.dataproc.v1.UsageMetrics + * @instance + */ + UsageMetrics.prototype.milliAcceleratorSeconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UsageMetrics acceleratorType. + * @member {string} acceleratorType + * @memberof google.cloud.dataproc.v1.UsageMetrics + * @instance + */ + UsageMetrics.prototype.acceleratorType = ""; + + /** + * Creates a new UsageMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.UsageMetrics + * @static + * @param {google.cloud.dataproc.v1.IUsageMetrics=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.UsageMetrics} UsageMetrics instance + */ + UsageMetrics.create = function create(properties) { + return new UsageMetrics(properties); + }; + + /** + * Encodes the specified UsageMetrics message. Does not implicitly {@link google.cloud.dataproc.v1.UsageMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.UsageMetrics + * @static + * @param {google.cloud.dataproc.v1.IUsageMetrics} message UsageMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UsageMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.milliDcuSeconds != null && Object.hasOwnProperty.call(message, "milliDcuSeconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.milliDcuSeconds); + if (message.shuffleStorageGbSeconds != null && Object.hasOwnProperty.call(message, "shuffleStorageGbSeconds")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.shuffleStorageGbSeconds); + if (message.milliAcceleratorSeconds != null && Object.hasOwnProperty.call(message, "milliAcceleratorSeconds")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.milliAcceleratorSeconds); + if (message.acceleratorType != null && Object.hasOwnProperty.call(message, "acceleratorType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.acceleratorType); + return writer; + }; + + /** + * Encodes the specified UsageMetrics message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.UsageMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.UsageMetrics + * @static + * @param {google.cloud.dataproc.v1.IUsageMetrics} message UsageMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UsageMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UsageMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.UsageMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.UsageMetrics} UsageMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UsageMetrics.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.UsageMetrics(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.milliDcuSeconds = reader.int64(); + break; + } + case 2: { + message.shuffleStorageGbSeconds = reader.int64(); + break; + } + case 3: { + message.milliAcceleratorSeconds = reader.int64(); + break; + } + case 4: { + message.acceleratorType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UsageMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.UsageMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.UsageMetrics} UsageMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UsageMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UsageMetrics message. + * @function verify + * @memberof google.cloud.dataproc.v1.UsageMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UsageMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.milliDcuSeconds != null && message.hasOwnProperty("milliDcuSeconds")) + if (!$util.isInteger(message.milliDcuSeconds) && !(message.milliDcuSeconds && $util.isInteger(message.milliDcuSeconds.low) && $util.isInteger(message.milliDcuSeconds.high))) + return "milliDcuSeconds: integer|Long expected"; + if (message.shuffleStorageGbSeconds != null && message.hasOwnProperty("shuffleStorageGbSeconds")) + if (!$util.isInteger(message.shuffleStorageGbSeconds) && !(message.shuffleStorageGbSeconds && $util.isInteger(message.shuffleStorageGbSeconds.low) && $util.isInteger(message.shuffleStorageGbSeconds.high))) + return "shuffleStorageGbSeconds: integer|Long expected"; + if (message.milliAcceleratorSeconds != null && message.hasOwnProperty("milliAcceleratorSeconds")) + if (!$util.isInteger(message.milliAcceleratorSeconds) && !(message.milliAcceleratorSeconds && $util.isInteger(message.milliAcceleratorSeconds.low) && $util.isInteger(message.milliAcceleratorSeconds.high))) + return "milliAcceleratorSeconds: integer|Long expected"; + if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) + if (!$util.isString(message.acceleratorType)) + return "acceleratorType: string expected"; + return null; + }; + + /** + * Creates a UsageMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.UsageMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.UsageMetrics} UsageMetrics + */ + UsageMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.UsageMetrics) + return object; + var message = new $root.google.cloud.dataproc.v1.UsageMetrics(); + if (object.milliDcuSeconds != null) + if ($util.Long) + (message.milliDcuSeconds = $util.Long.fromValue(object.milliDcuSeconds)).unsigned = false; + else if (typeof object.milliDcuSeconds === "string") + message.milliDcuSeconds = parseInt(object.milliDcuSeconds, 10); + else if (typeof object.milliDcuSeconds === "number") + message.milliDcuSeconds = object.milliDcuSeconds; + else if (typeof object.milliDcuSeconds === "object") + message.milliDcuSeconds = new $util.LongBits(object.milliDcuSeconds.low >>> 0, object.milliDcuSeconds.high >>> 0).toNumber(); + if (object.shuffleStorageGbSeconds != null) + if ($util.Long) + (message.shuffleStorageGbSeconds = $util.Long.fromValue(object.shuffleStorageGbSeconds)).unsigned = false; + else if (typeof object.shuffleStorageGbSeconds === "string") + message.shuffleStorageGbSeconds = parseInt(object.shuffleStorageGbSeconds, 10); + else if (typeof object.shuffleStorageGbSeconds === "number") + message.shuffleStorageGbSeconds = object.shuffleStorageGbSeconds; + else if (typeof object.shuffleStorageGbSeconds === "object") + message.shuffleStorageGbSeconds = new $util.LongBits(object.shuffleStorageGbSeconds.low >>> 0, object.shuffleStorageGbSeconds.high >>> 0).toNumber(); + if (object.milliAcceleratorSeconds != null) + if ($util.Long) + (message.milliAcceleratorSeconds = $util.Long.fromValue(object.milliAcceleratorSeconds)).unsigned = false; + else if (typeof object.milliAcceleratorSeconds === "string") + message.milliAcceleratorSeconds = parseInt(object.milliAcceleratorSeconds, 10); + else if (typeof object.milliAcceleratorSeconds === "number") + message.milliAcceleratorSeconds = object.milliAcceleratorSeconds; + else if (typeof object.milliAcceleratorSeconds === "object") + message.milliAcceleratorSeconds = new $util.LongBits(object.milliAcceleratorSeconds.low >>> 0, object.milliAcceleratorSeconds.high >>> 0).toNumber(); + if (object.acceleratorType != null) + message.acceleratorType = String(object.acceleratorType); + return message; + }; + + /** + * Creates a plain object from a UsageMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.UsageMetrics + * @static + * @param {google.cloud.dataproc.v1.UsageMetrics} message UsageMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UsageMetrics.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.milliDcuSeconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.milliDcuSeconds = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.shuffleStorageGbSeconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.shuffleStorageGbSeconds = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.milliAcceleratorSeconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.milliAcceleratorSeconds = options.longs === String ? "0" : 0; + object.acceleratorType = ""; + } + if (message.milliDcuSeconds != null && message.hasOwnProperty("milliDcuSeconds")) + if (typeof message.milliDcuSeconds === "number") + object.milliDcuSeconds = options.longs === String ? String(message.milliDcuSeconds) : message.milliDcuSeconds; + else + object.milliDcuSeconds = options.longs === String ? $util.Long.prototype.toString.call(message.milliDcuSeconds) : options.longs === Number ? new $util.LongBits(message.milliDcuSeconds.low >>> 0, message.milliDcuSeconds.high >>> 0).toNumber() : message.milliDcuSeconds; + if (message.shuffleStorageGbSeconds != null && message.hasOwnProperty("shuffleStorageGbSeconds")) + if (typeof message.shuffleStorageGbSeconds === "number") + object.shuffleStorageGbSeconds = options.longs === String ? String(message.shuffleStorageGbSeconds) : message.shuffleStorageGbSeconds; + else + object.shuffleStorageGbSeconds = options.longs === String ? $util.Long.prototype.toString.call(message.shuffleStorageGbSeconds) : options.longs === Number ? new $util.LongBits(message.shuffleStorageGbSeconds.low >>> 0, message.shuffleStorageGbSeconds.high >>> 0).toNumber() : message.shuffleStorageGbSeconds; + if (message.milliAcceleratorSeconds != null && message.hasOwnProperty("milliAcceleratorSeconds")) + if (typeof message.milliAcceleratorSeconds === "number") + object.milliAcceleratorSeconds = options.longs === String ? String(message.milliAcceleratorSeconds) : message.milliAcceleratorSeconds; + else + object.milliAcceleratorSeconds = options.longs === String ? $util.Long.prototype.toString.call(message.milliAcceleratorSeconds) : options.longs === Number ? new $util.LongBits(message.milliAcceleratorSeconds.low >>> 0, message.milliAcceleratorSeconds.high >>> 0).toNumber() : message.milliAcceleratorSeconds; + if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) + object.acceleratorType = message.acceleratorType; + return object; + }; + + /** + * Converts this UsageMetrics to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.UsageMetrics + * @instance + * @returns {Object.} JSON object + */ + UsageMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UsageMetrics + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.UsageMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UsageMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.UsageMetrics"; + }; + + return UsageMetrics; + })(); + + v1.UsageSnapshot = (function() { + + /** + * Properties of a UsageSnapshot. + * @memberof google.cloud.dataproc.v1 + * @interface IUsageSnapshot + * @property {number|Long|null} [milliDcu] UsageSnapshot milliDcu + * @property {number|Long|null} [shuffleStorageGb] UsageSnapshot shuffleStorageGb + * @property {number|Long|null} [milliDcuPremium] UsageSnapshot milliDcuPremium + * @property {number|Long|null} [shuffleStorageGbPremium] UsageSnapshot shuffleStorageGbPremium + * @property {number|Long|null} [milliAccelerator] UsageSnapshot milliAccelerator + * @property {string|null} [acceleratorType] UsageSnapshot acceleratorType + * @property {google.protobuf.ITimestamp|null} [snapshotTime] UsageSnapshot snapshotTime + */ + + /** + * Constructs a new UsageSnapshot. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a UsageSnapshot. + * @implements IUsageSnapshot + * @constructor + * @param {google.cloud.dataproc.v1.IUsageSnapshot=} [properties] Properties to set + */ + function UsageSnapshot(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UsageSnapshot milliDcu. + * @member {number|Long} milliDcu + * @memberof google.cloud.dataproc.v1.UsageSnapshot + * @instance + */ + UsageSnapshot.prototype.milliDcu = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UsageSnapshot shuffleStorageGb. + * @member {number|Long} shuffleStorageGb + * @memberof google.cloud.dataproc.v1.UsageSnapshot + * @instance + */ + UsageSnapshot.prototype.shuffleStorageGb = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UsageSnapshot milliDcuPremium. + * @member {number|Long} milliDcuPremium + * @memberof google.cloud.dataproc.v1.UsageSnapshot + * @instance + */ + UsageSnapshot.prototype.milliDcuPremium = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UsageSnapshot shuffleStorageGbPremium. + * @member {number|Long} shuffleStorageGbPremium + * @memberof google.cloud.dataproc.v1.UsageSnapshot + * @instance + */ + UsageSnapshot.prototype.shuffleStorageGbPremium = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UsageSnapshot milliAccelerator. + * @member {number|Long} milliAccelerator + * @memberof google.cloud.dataproc.v1.UsageSnapshot + * @instance + */ + UsageSnapshot.prototype.milliAccelerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UsageSnapshot acceleratorType. + * @member {string} acceleratorType + * @memberof google.cloud.dataproc.v1.UsageSnapshot + * @instance + */ + UsageSnapshot.prototype.acceleratorType = ""; + + /** + * UsageSnapshot snapshotTime. + * @member {google.protobuf.ITimestamp|null|undefined} snapshotTime + * @memberof google.cloud.dataproc.v1.UsageSnapshot + * @instance + */ + UsageSnapshot.prototype.snapshotTime = null; + + /** + * Creates a new UsageSnapshot instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.UsageSnapshot + * @static + * @param {google.cloud.dataproc.v1.IUsageSnapshot=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.UsageSnapshot} UsageSnapshot instance + */ + UsageSnapshot.create = function create(properties) { + return new UsageSnapshot(properties); + }; + + /** + * Encodes the specified UsageSnapshot message. Does not implicitly {@link google.cloud.dataproc.v1.UsageSnapshot.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.UsageSnapshot + * @static + * @param {google.cloud.dataproc.v1.IUsageSnapshot} message UsageSnapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UsageSnapshot.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.milliDcu != null && Object.hasOwnProperty.call(message, "milliDcu")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.milliDcu); + if (message.shuffleStorageGb != null && Object.hasOwnProperty.call(message, "shuffleStorageGb")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.shuffleStorageGb); + if (message.snapshotTime != null && Object.hasOwnProperty.call(message, "snapshotTime")) + $root.google.protobuf.Timestamp.encode(message.snapshotTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.milliDcuPremium != null && Object.hasOwnProperty.call(message, "milliDcuPremium")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.milliDcuPremium); + if (message.shuffleStorageGbPremium != null && Object.hasOwnProperty.call(message, "shuffleStorageGbPremium")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.shuffleStorageGbPremium); + if (message.milliAccelerator != null && Object.hasOwnProperty.call(message, "milliAccelerator")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.milliAccelerator); + if (message.acceleratorType != null && Object.hasOwnProperty.call(message, "acceleratorType")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.acceleratorType); + return writer; + }; + + /** + * Encodes the specified UsageSnapshot message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.UsageSnapshot.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.UsageSnapshot + * @static + * @param {google.cloud.dataproc.v1.IUsageSnapshot} message UsageSnapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UsageSnapshot.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UsageSnapshot message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.UsageSnapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.UsageSnapshot} UsageSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UsageSnapshot.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.UsageSnapshot(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.milliDcu = reader.int64(); + break; + } + case 2: { + message.shuffleStorageGb = reader.int64(); + break; + } + case 4: { + message.milliDcuPremium = reader.int64(); + break; + } + case 5: { + message.shuffleStorageGbPremium = reader.int64(); + break; + } + case 6: { + message.milliAccelerator = reader.int64(); + break; + } + case 7: { + message.acceleratorType = reader.string(); + break; + } + case 3: { + message.snapshotTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UsageSnapshot message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.UsageSnapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.UsageSnapshot} UsageSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UsageSnapshot.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UsageSnapshot message. + * @function verify + * @memberof google.cloud.dataproc.v1.UsageSnapshot + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UsageSnapshot.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.milliDcu != null && message.hasOwnProperty("milliDcu")) + if (!$util.isInteger(message.milliDcu) && !(message.milliDcu && $util.isInteger(message.milliDcu.low) && $util.isInteger(message.milliDcu.high))) + return "milliDcu: integer|Long expected"; + if (message.shuffleStorageGb != null && message.hasOwnProperty("shuffleStorageGb")) + if (!$util.isInteger(message.shuffleStorageGb) && !(message.shuffleStorageGb && $util.isInteger(message.shuffleStorageGb.low) && $util.isInteger(message.shuffleStorageGb.high))) + return "shuffleStorageGb: integer|Long expected"; + if (message.milliDcuPremium != null && message.hasOwnProperty("milliDcuPremium")) + if (!$util.isInteger(message.milliDcuPremium) && !(message.milliDcuPremium && $util.isInteger(message.milliDcuPremium.low) && $util.isInteger(message.milliDcuPremium.high))) + return "milliDcuPremium: integer|Long expected"; + if (message.shuffleStorageGbPremium != null && message.hasOwnProperty("shuffleStorageGbPremium")) + if (!$util.isInteger(message.shuffleStorageGbPremium) && !(message.shuffleStorageGbPremium && $util.isInteger(message.shuffleStorageGbPremium.low) && $util.isInteger(message.shuffleStorageGbPremium.high))) + return "shuffleStorageGbPremium: integer|Long expected"; + if (message.milliAccelerator != null && message.hasOwnProperty("milliAccelerator")) + if (!$util.isInteger(message.milliAccelerator) && !(message.milliAccelerator && $util.isInteger(message.milliAccelerator.low) && $util.isInteger(message.milliAccelerator.high))) + return "milliAccelerator: integer|Long expected"; + if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) + if (!$util.isString(message.acceleratorType)) + return "acceleratorType: string expected"; + if (message.snapshotTime != null && message.hasOwnProperty("snapshotTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.snapshotTime); + if (error) + return "snapshotTime." + error; + } + return null; + }; + + /** + * Creates a UsageSnapshot message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.UsageSnapshot + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.UsageSnapshot} UsageSnapshot + */ + UsageSnapshot.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.UsageSnapshot) + return object; + var message = new $root.google.cloud.dataproc.v1.UsageSnapshot(); + if (object.milliDcu != null) + if ($util.Long) + (message.milliDcu = $util.Long.fromValue(object.milliDcu)).unsigned = false; + else if (typeof object.milliDcu === "string") + message.milliDcu = parseInt(object.milliDcu, 10); + else if (typeof object.milliDcu === "number") + message.milliDcu = object.milliDcu; + else if (typeof object.milliDcu === "object") + message.milliDcu = new $util.LongBits(object.milliDcu.low >>> 0, object.milliDcu.high >>> 0).toNumber(); + if (object.shuffleStorageGb != null) + if ($util.Long) + (message.shuffleStorageGb = $util.Long.fromValue(object.shuffleStorageGb)).unsigned = false; + else if (typeof object.shuffleStorageGb === "string") + message.shuffleStorageGb = parseInt(object.shuffleStorageGb, 10); + else if (typeof object.shuffleStorageGb === "number") + message.shuffleStorageGb = object.shuffleStorageGb; + else if (typeof object.shuffleStorageGb === "object") + message.shuffleStorageGb = new $util.LongBits(object.shuffleStorageGb.low >>> 0, object.shuffleStorageGb.high >>> 0).toNumber(); + if (object.milliDcuPremium != null) + if ($util.Long) + (message.milliDcuPremium = $util.Long.fromValue(object.milliDcuPremium)).unsigned = false; + else if (typeof object.milliDcuPremium === "string") + message.milliDcuPremium = parseInt(object.milliDcuPremium, 10); + else if (typeof object.milliDcuPremium === "number") + message.milliDcuPremium = object.milliDcuPremium; + else if (typeof object.milliDcuPremium === "object") + message.milliDcuPremium = new $util.LongBits(object.milliDcuPremium.low >>> 0, object.milliDcuPremium.high >>> 0).toNumber(); + if (object.shuffleStorageGbPremium != null) + if ($util.Long) + (message.shuffleStorageGbPremium = $util.Long.fromValue(object.shuffleStorageGbPremium)).unsigned = false; + else if (typeof object.shuffleStorageGbPremium === "string") + message.shuffleStorageGbPremium = parseInt(object.shuffleStorageGbPremium, 10); + else if (typeof object.shuffleStorageGbPremium === "number") + message.shuffleStorageGbPremium = object.shuffleStorageGbPremium; + else if (typeof object.shuffleStorageGbPremium === "object") + message.shuffleStorageGbPremium = new $util.LongBits(object.shuffleStorageGbPremium.low >>> 0, object.shuffleStorageGbPremium.high >>> 0).toNumber(); + if (object.milliAccelerator != null) + if ($util.Long) + (message.milliAccelerator = $util.Long.fromValue(object.milliAccelerator)).unsigned = false; + else if (typeof object.milliAccelerator === "string") + message.milliAccelerator = parseInt(object.milliAccelerator, 10); + else if (typeof object.milliAccelerator === "number") + message.milliAccelerator = object.milliAccelerator; + else if (typeof object.milliAccelerator === "object") + message.milliAccelerator = new $util.LongBits(object.milliAccelerator.low >>> 0, object.milliAccelerator.high >>> 0).toNumber(); + if (object.acceleratorType != null) + message.acceleratorType = String(object.acceleratorType); + if (object.snapshotTime != null) { + if (typeof object.snapshotTime !== "object") + throw TypeError(".google.cloud.dataproc.v1.UsageSnapshot.snapshotTime: object expected"); + message.snapshotTime = $root.google.protobuf.Timestamp.fromObject(object.snapshotTime); + } + return message; + }; + + /** + * Creates a plain object from a UsageSnapshot message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.UsageSnapshot + * @static + * @param {google.cloud.dataproc.v1.UsageSnapshot} message UsageSnapshot + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UsageSnapshot.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.milliDcu = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.milliDcu = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.shuffleStorageGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.shuffleStorageGb = options.longs === String ? "0" : 0; + object.snapshotTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.milliDcuPremium = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.milliDcuPremium = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.shuffleStorageGbPremium = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.shuffleStorageGbPremium = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.milliAccelerator = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.milliAccelerator = options.longs === String ? "0" : 0; + object.acceleratorType = ""; + } + if (message.milliDcu != null && message.hasOwnProperty("milliDcu")) + if (typeof message.milliDcu === "number") + object.milliDcu = options.longs === String ? String(message.milliDcu) : message.milliDcu; + else + object.milliDcu = options.longs === String ? $util.Long.prototype.toString.call(message.milliDcu) : options.longs === Number ? new $util.LongBits(message.milliDcu.low >>> 0, message.milliDcu.high >>> 0).toNumber() : message.milliDcu; + if (message.shuffleStorageGb != null && message.hasOwnProperty("shuffleStorageGb")) + if (typeof message.shuffleStorageGb === "number") + object.shuffleStorageGb = options.longs === String ? String(message.shuffleStorageGb) : message.shuffleStorageGb; + else + object.shuffleStorageGb = options.longs === String ? $util.Long.prototype.toString.call(message.shuffleStorageGb) : options.longs === Number ? new $util.LongBits(message.shuffleStorageGb.low >>> 0, message.shuffleStorageGb.high >>> 0).toNumber() : message.shuffleStorageGb; + if (message.snapshotTime != null && message.hasOwnProperty("snapshotTime")) + object.snapshotTime = $root.google.protobuf.Timestamp.toObject(message.snapshotTime, options); + if (message.milliDcuPremium != null && message.hasOwnProperty("milliDcuPremium")) + if (typeof message.milliDcuPremium === "number") + object.milliDcuPremium = options.longs === String ? String(message.milliDcuPremium) : message.milliDcuPremium; + else + object.milliDcuPremium = options.longs === String ? $util.Long.prototype.toString.call(message.milliDcuPremium) : options.longs === Number ? new $util.LongBits(message.milliDcuPremium.low >>> 0, message.milliDcuPremium.high >>> 0).toNumber() : message.milliDcuPremium; + if (message.shuffleStorageGbPremium != null && message.hasOwnProperty("shuffleStorageGbPremium")) + if (typeof message.shuffleStorageGbPremium === "number") + object.shuffleStorageGbPremium = options.longs === String ? String(message.shuffleStorageGbPremium) : message.shuffleStorageGbPremium; + else + object.shuffleStorageGbPremium = options.longs === String ? $util.Long.prototype.toString.call(message.shuffleStorageGbPremium) : options.longs === Number ? new $util.LongBits(message.shuffleStorageGbPremium.low >>> 0, message.shuffleStorageGbPremium.high >>> 0).toNumber() : message.shuffleStorageGbPremium; + if (message.milliAccelerator != null && message.hasOwnProperty("milliAccelerator")) + if (typeof message.milliAccelerator === "number") + object.milliAccelerator = options.longs === String ? String(message.milliAccelerator) : message.milliAccelerator; + else + object.milliAccelerator = options.longs === String ? $util.Long.prototype.toString.call(message.milliAccelerator) : options.longs === Number ? new $util.LongBits(message.milliAccelerator.low >>> 0, message.milliAccelerator.high >>> 0).toNumber() : message.milliAccelerator; + if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) + object.acceleratorType = message.acceleratorType; + return object; + }; + + /** + * Converts this UsageSnapshot to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.UsageSnapshot + * @instance + * @returns {Object.} JSON object + */ + UsageSnapshot.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UsageSnapshot + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.UsageSnapshot + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UsageSnapshot.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.UsageSnapshot"; + }; + + return UsageSnapshot; + })(); + + v1.GkeClusterConfig = (function() { + + /** + * Properties of a GkeClusterConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IGkeClusterConfig + * @property {string|null} [gkeClusterTarget] GkeClusterConfig gkeClusterTarget + * @property {Array.|null} [nodePoolTarget] GkeClusterConfig nodePoolTarget + */ + + /** + * Constructs a new GkeClusterConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a GkeClusterConfig. + * @implements IGkeClusterConfig + * @constructor + * @param {google.cloud.dataproc.v1.IGkeClusterConfig=} [properties] Properties to set + */ + function GkeClusterConfig(properties) { + this.nodePoolTarget = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GkeClusterConfig gkeClusterTarget. + * @member {string} gkeClusterTarget + * @memberof google.cloud.dataproc.v1.GkeClusterConfig + * @instance + */ + GkeClusterConfig.prototype.gkeClusterTarget = ""; + + /** + * GkeClusterConfig nodePoolTarget. + * @member {Array.} nodePoolTarget + * @memberof google.cloud.dataproc.v1.GkeClusterConfig + * @instance + */ + GkeClusterConfig.prototype.nodePoolTarget = $util.emptyArray; + + /** + * Creates a new GkeClusterConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.GkeClusterConfig + * @static + * @param {google.cloud.dataproc.v1.IGkeClusterConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.GkeClusterConfig} GkeClusterConfig instance + */ + GkeClusterConfig.create = function create(properties) { + return new GkeClusterConfig(properties); + }; + + /** + * Encodes the specified GkeClusterConfig message. Does not implicitly {@link google.cloud.dataproc.v1.GkeClusterConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.GkeClusterConfig + * @static + * @param {google.cloud.dataproc.v1.IGkeClusterConfig} message GkeClusterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GkeClusterConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gkeClusterTarget != null && Object.hasOwnProperty.call(message, "gkeClusterTarget")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.gkeClusterTarget); + if (message.nodePoolTarget != null && message.nodePoolTarget.length) + for (var i = 0; i < message.nodePoolTarget.length; ++i) + $root.google.cloud.dataproc.v1.GkeNodePoolTarget.encode(message.nodePoolTarget[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GkeClusterConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GkeClusterConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.GkeClusterConfig + * @static + * @param {google.cloud.dataproc.v1.IGkeClusterConfig} message GkeClusterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GkeClusterConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GkeClusterConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.GkeClusterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.GkeClusterConfig} GkeClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GkeClusterConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.GkeClusterConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.gkeClusterTarget = reader.string(); + break; + } + case 3: { + if (!(message.nodePoolTarget && message.nodePoolTarget.length)) + message.nodePoolTarget = []; + message.nodePoolTarget.push($root.google.cloud.dataproc.v1.GkeNodePoolTarget.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GkeClusterConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.GkeClusterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.GkeClusterConfig} GkeClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GkeClusterConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GkeClusterConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.GkeClusterConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GkeClusterConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gkeClusterTarget != null && message.hasOwnProperty("gkeClusterTarget")) + if (!$util.isString(message.gkeClusterTarget)) + return "gkeClusterTarget: string expected"; + if (message.nodePoolTarget != null && message.hasOwnProperty("nodePoolTarget")) { + if (!Array.isArray(message.nodePoolTarget)) + return "nodePoolTarget: array expected"; + for (var i = 0; i < message.nodePoolTarget.length; ++i) { + var error = $root.google.cloud.dataproc.v1.GkeNodePoolTarget.verify(message.nodePoolTarget[i]); + if (error) + return "nodePoolTarget." + error; + } + } + return null; + }; + + /** + * Creates a GkeClusterConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.GkeClusterConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.GkeClusterConfig} GkeClusterConfig + */ + GkeClusterConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.GkeClusterConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.GkeClusterConfig(); + if (object.gkeClusterTarget != null) + message.gkeClusterTarget = String(object.gkeClusterTarget); + if (object.nodePoolTarget) { + if (!Array.isArray(object.nodePoolTarget)) + throw TypeError(".google.cloud.dataproc.v1.GkeClusterConfig.nodePoolTarget: array expected"); + message.nodePoolTarget = []; + for (var i = 0; i < object.nodePoolTarget.length; ++i) { + if (typeof object.nodePoolTarget[i] !== "object") + throw TypeError(".google.cloud.dataproc.v1.GkeClusterConfig.nodePoolTarget: object expected"); + message.nodePoolTarget[i] = $root.google.cloud.dataproc.v1.GkeNodePoolTarget.fromObject(object.nodePoolTarget[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GkeClusterConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.GkeClusterConfig + * @static + * @param {google.cloud.dataproc.v1.GkeClusterConfig} message GkeClusterConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GkeClusterConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nodePoolTarget = []; + if (options.defaults) + object.gkeClusterTarget = ""; + if (message.gkeClusterTarget != null && message.hasOwnProperty("gkeClusterTarget")) + object.gkeClusterTarget = message.gkeClusterTarget; + if (message.nodePoolTarget && message.nodePoolTarget.length) { + object.nodePoolTarget = []; + for (var j = 0; j < message.nodePoolTarget.length; ++j) + object.nodePoolTarget[j] = $root.google.cloud.dataproc.v1.GkeNodePoolTarget.toObject(message.nodePoolTarget[j], options); + } + return object; + }; + + /** + * Converts this GkeClusterConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.GkeClusterConfig + * @instance + * @returns {Object.} JSON object + */ + GkeClusterConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GkeClusterConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.GkeClusterConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GkeClusterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.GkeClusterConfig"; + }; + + return GkeClusterConfig; + })(); + + v1.KubernetesClusterConfig = (function() { + + /** + * Properties of a KubernetesClusterConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IKubernetesClusterConfig + * @property {string|null} [kubernetesNamespace] KubernetesClusterConfig kubernetesNamespace + * @property {google.cloud.dataproc.v1.IGkeClusterConfig|null} [gkeClusterConfig] KubernetesClusterConfig gkeClusterConfig + * @property {google.cloud.dataproc.v1.IKubernetesSoftwareConfig|null} [kubernetesSoftwareConfig] KubernetesClusterConfig kubernetesSoftwareConfig + */ + + /** + * Constructs a new KubernetesClusterConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a KubernetesClusterConfig. + * @implements IKubernetesClusterConfig + * @constructor + * @param {google.cloud.dataproc.v1.IKubernetesClusterConfig=} [properties] Properties to set + */ + function KubernetesClusterConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KubernetesClusterConfig kubernetesNamespace. + * @member {string} kubernetesNamespace + * @memberof google.cloud.dataproc.v1.KubernetesClusterConfig + * @instance + */ + KubernetesClusterConfig.prototype.kubernetesNamespace = ""; + + /** + * KubernetesClusterConfig gkeClusterConfig. + * @member {google.cloud.dataproc.v1.IGkeClusterConfig|null|undefined} gkeClusterConfig + * @memberof google.cloud.dataproc.v1.KubernetesClusterConfig + * @instance + */ + KubernetesClusterConfig.prototype.gkeClusterConfig = null; + + /** + * KubernetesClusterConfig kubernetesSoftwareConfig. + * @member {google.cloud.dataproc.v1.IKubernetesSoftwareConfig|null|undefined} kubernetesSoftwareConfig + * @memberof google.cloud.dataproc.v1.KubernetesClusterConfig + * @instance + */ + KubernetesClusterConfig.prototype.kubernetesSoftwareConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * KubernetesClusterConfig config. + * @member {"gkeClusterConfig"|undefined} config + * @memberof google.cloud.dataproc.v1.KubernetesClusterConfig + * @instance + */ + Object.defineProperty(KubernetesClusterConfig.prototype, "config", { + get: $util.oneOfGetter($oneOfFields = ["gkeClusterConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new KubernetesClusterConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.KubernetesClusterConfig + * @static + * @param {google.cloud.dataproc.v1.IKubernetesClusterConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.KubernetesClusterConfig} KubernetesClusterConfig instance + */ + KubernetesClusterConfig.create = function create(properties) { + return new KubernetesClusterConfig(properties); + }; + + /** + * Encodes the specified KubernetesClusterConfig message. Does not implicitly {@link google.cloud.dataproc.v1.KubernetesClusterConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.KubernetesClusterConfig + * @static + * @param {google.cloud.dataproc.v1.IKubernetesClusterConfig} message KubernetesClusterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KubernetesClusterConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kubernetesNamespace != null && Object.hasOwnProperty.call(message, "kubernetesNamespace")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kubernetesNamespace); + if (message.gkeClusterConfig != null && Object.hasOwnProperty.call(message, "gkeClusterConfig")) + $root.google.cloud.dataproc.v1.GkeClusterConfig.encode(message.gkeClusterConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.kubernetesSoftwareConfig != null && Object.hasOwnProperty.call(message, "kubernetesSoftwareConfig")) + $root.google.cloud.dataproc.v1.KubernetesSoftwareConfig.encode(message.kubernetesSoftwareConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified KubernetesClusterConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.KubernetesClusterConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.KubernetesClusterConfig + * @static + * @param {google.cloud.dataproc.v1.IKubernetesClusterConfig} message KubernetesClusterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KubernetesClusterConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KubernetesClusterConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.KubernetesClusterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.KubernetesClusterConfig} KubernetesClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KubernetesClusterConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.KubernetesClusterConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kubernetesNamespace = reader.string(); + break; + } + case 2: { + message.gkeClusterConfig = $root.google.cloud.dataproc.v1.GkeClusterConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.kubernetesSoftwareConfig = $root.google.cloud.dataproc.v1.KubernetesSoftwareConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KubernetesClusterConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.KubernetesClusterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.KubernetesClusterConfig} KubernetesClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KubernetesClusterConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KubernetesClusterConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.KubernetesClusterConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KubernetesClusterConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.kubernetesNamespace != null && message.hasOwnProperty("kubernetesNamespace")) + if (!$util.isString(message.kubernetesNamespace)) + return "kubernetesNamespace: string expected"; + if (message.gkeClusterConfig != null && message.hasOwnProperty("gkeClusterConfig")) { + properties.config = 1; + { + var error = $root.google.cloud.dataproc.v1.GkeClusterConfig.verify(message.gkeClusterConfig); + if (error) + return "gkeClusterConfig." + error; + } + } + if (message.kubernetesSoftwareConfig != null && message.hasOwnProperty("kubernetesSoftwareConfig")) { + var error = $root.google.cloud.dataproc.v1.KubernetesSoftwareConfig.verify(message.kubernetesSoftwareConfig); + if (error) + return "kubernetesSoftwareConfig." + error; + } + return null; + }; + + /** + * Creates a KubernetesClusterConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.KubernetesClusterConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.KubernetesClusterConfig} KubernetesClusterConfig + */ + KubernetesClusterConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.KubernetesClusterConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.KubernetesClusterConfig(); + if (object.kubernetesNamespace != null) + message.kubernetesNamespace = String(object.kubernetesNamespace); + if (object.gkeClusterConfig != null) { + if (typeof object.gkeClusterConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.KubernetesClusterConfig.gkeClusterConfig: object expected"); + message.gkeClusterConfig = $root.google.cloud.dataproc.v1.GkeClusterConfig.fromObject(object.gkeClusterConfig); + } + if (object.kubernetesSoftwareConfig != null) { + if (typeof object.kubernetesSoftwareConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.KubernetesClusterConfig.kubernetesSoftwareConfig: object expected"); + message.kubernetesSoftwareConfig = $root.google.cloud.dataproc.v1.KubernetesSoftwareConfig.fromObject(object.kubernetesSoftwareConfig); + } + return message; + }; + + /** + * Creates a plain object from a KubernetesClusterConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.KubernetesClusterConfig + * @static + * @param {google.cloud.dataproc.v1.KubernetesClusterConfig} message KubernetesClusterConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KubernetesClusterConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kubernetesNamespace = ""; + object.kubernetesSoftwareConfig = null; + } + if (message.kubernetesNamespace != null && message.hasOwnProperty("kubernetesNamespace")) + object.kubernetesNamespace = message.kubernetesNamespace; + if (message.gkeClusterConfig != null && message.hasOwnProperty("gkeClusterConfig")) { + object.gkeClusterConfig = $root.google.cloud.dataproc.v1.GkeClusterConfig.toObject(message.gkeClusterConfig, options); + if (options.oneofs) + object.config = "gkeClusterConfig"; + } + if (message.kubernetesSoftwareConfig != null && message.hasOwnProperty("kubernetesSoftwareConfig")) + object.kubernetesSoftwareConfig = $root.google.cloud.dataproc.v1.KubernetesSoftwareConfig.toObject(message.kubernetesSoftwareConfig, options); + return object; + }; + + /** + * Converts this KubernetesClusterConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.KubernetesClusterConfig + * @instance + * @returns {Object.} JSON object + */ + KubernetesClusterConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KubernetesClusterConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.KubernetesClusterConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KubernetesClusterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.KubernetesClusterConfig"; + }; + + return KubernetesClusterConfig; + })(); + + v1.KubernetesSoftwareConfig = (function() { + + /** + * Properties of a KubernetesSoftwareConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IKubernetesSoftwareConfig + * @property {Object.|null} [componentVersion] KubernetesSoftwareConfig componentVersion + * @property {Object.|null} [properties] KubernetesSoftwareConfig properties + */ + + /** + * Constructs a new KubernetesSoftwareConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a KubernetesSoftwareConfig. + * @implements IKubernetesSoftwareConfig + * @constructor + * @param {google.cloud.dataproc.v1.IKubernetesSoftwareConfig=} [properties] Properties to set + */ + function KubernetesSoftwareConfig(properties) { + this.componentVersion = {}; + this.properties = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KubernetesSoftwareConfig componentVersion. + * @member {Object.} componentVersion + * @memberof google.cloud.dataproc.v1.KubernetesSoftwareConfig + * @instance + */ + KubernetesSoftwareConfig.prototype.componentVersion = $util.emptyObject; + + /** + * KubernetesSoftwareConfig properties. + * @member {Object.} properties + * @memberof google.cloud.dataproc.v1.KubernetesSoftwareConfig + * @instance + */ + KubernetesSoftwareConfig.prototype.properties = $util.emptyObject; + + /** + * Creates a new KubernetesSoftwareConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.KubernetesSoftwareConfig + * @static + * @param {google.cloud.dataproc.v1.IKubernetesSoftwareConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.KubernetesSoftwareConfig} KubernetesSoftwareConfig instance + */ + KubernetesSoftwareConfig.create = function create(properties) { + return new KubernetesSoftwareConfig(properties); + }; + + /** + * Encodes the specified KubernetesSoftwareConfig message. Does not implicitly {@link google.cloud.dataproc.v1.KubernetesSoftwareConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.KubernetesSoftwareConfig + * @static + * @param {google.cloud.dataproc.v1.IKubernetesSoftwareConfig} message KubernetesSoftwareConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KubernetesSoftwareConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.componentVersion != null && Object.hasOwnProperty.call(message, "componentVersion")) + for (var keys = Object.keys(message.componentVersion), 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.componentVersion[keys[i]]).ldelim(); + if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) + for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.properties[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified KubernetesSoftwareConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.KubernetesSoftwareConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.KubernetesSoftwareConfig + * @static + * @param {google.cloud.dataproc.v1.IKubernetesSoftwareConfig} message KubernetesSoftwareConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KubernetesSoftwareConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KubernetesSoftwareConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.KubernetesSoftwareConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.KubernetesSoftwareConfig} KubernetesSoftwareConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KubernetesSoftwareConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.KubernetesSoftwareConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.componentVersion === $util.emptyObject) + message.componentVersion = {}; + 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.componentVersion[key] = value; + break; + } + case 2: { + if (message.properties === $util.emptyObject) + message.properties = {}; + 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.properties[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KubernetesSoftwareConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.KubernetesSoftwareConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.KubernetesSoftwareConfig} KubernetesSoftwareConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KubernetesSoftwareConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KubernetesSoftwareConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.KubernetesSoftwareConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KubernetesSoftwareConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.componentVersion != null && message.hasOwnProperty("componentVersion")) { + if (!$util.isObject(message.componentVersion)) + return "componentVersion: object expected"; + var key = Object.keys(message.componentVersion); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.componentVersion[key[i]])) + return "componentVersion: string{k:string} expected"; + } + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!$util.isObject(message.properties)) + return "properties: object expected"; + var key = Object.keys(message.properties); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.properties[key[i]])) + return "properties: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a KubernetesSoftwareConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.KubernetesSoftwareConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.KubernetesSoftwareConfig} KubernetesSoftwareConfig + */ + KubernetesSoftwareConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.KubernetesSoftwareConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.KubernetesSoftwareConfig(); + if (object.componentVersion) { + if (typeof object.componentVersion !== "object") + throw TypeError(".google.cloud.dataproc.v1.KubernetesSoftwareConfig.componentVersion: object expected"); + message.componentVersion = {}; + for (var keys = Object.keys(object.componentVersion), i = 0; i < keys.length; ++i) + message.componentVersion[keys[i]] = String(object.componentVersion[keys[i]]); + } + if (object.properties) { + if (typeof object.properties !== "object") + throw TypeError(".google.cloud.dataproc.v1.KubernetesSoftwareConfig.properties: object expected"); + message.properties = {}; + for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) + message.properties[keys[i]] = String(object.properties[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a KubernetesSoftwareConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.KubernetesSoftwareConfig + * @static + * @param {google.cloud.dataproc.v1.KubernetesSoftwareConfig} message KubernetesSoftwareConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KubernetesSoftwareConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.componentVersion = {}; + object.properties = {}; + } + var keys2; + if (message.componentVersion && (keys2 = Object.keys(message.componentVersion)).length) { + object.componentVersion = {}; + for (var j = 0; j < keys2.length; ++j) + object.componentVersion[keys2[j]] = message.componentVersion[keys2[j]]; + } + if (message.properties && (keys2 = Object.keys(message.properties)).length) { + object.properties = {}; + for (var j = 0; j < keys2.length; ++j) + object.properties[keys2[j]] = message.properties[keys2[j]]; + } + return object; + }; + + /** + * Converts this KubernetesSoftwareConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.KubernetesSoftwareConfig + * @instance + * @returns {Object.} JSON object + */ + KubernetesSoftwareConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KubernetesSoftwareConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.KubernetesSoftwareConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KubernetesSoftwareConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.KubernetesSoftwareConfig"; + }; + + return KubernetesSoftwareConfig; + })(); + + v1.GkeNodePoolTarget = (function() { + + /** + * Properties of a GkeNodePoolTarget. + * @memberof google.cloud.dataproc.v1 + * @interface IGkeNodePoolTarget + * @property {string|null} [nodePool] GkeNodePoolTarget nodePool + * @property {Array.|null} [roles] GkeNodePoolTarget roles + * @property {google.cloud.dataproc.v1.IGkeNodePoolConfig|null} [nodePoolConfig] GkeNodePoolTarget nodePoolConfig + */ + + /** + * Constructs a new GkeNodePoolTarget. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a GkeNodePoolTarget. + * @implements IGkeNodePoolTarget + * @constructor + * @param {google.cloud.dataproc.v1.IGkeNodePoolTarget=} [properties] Properties to set + */ + function GkeNodePoolTarget(properties) { + this.roles = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GkeNodePoolTarget nodePool. + * @member {string} nodePool + * @memberof google.cloud.dataproc.v1.GkeNodePoolTarget + * @instance + */ + GkeNodePoolTarget.prototype.nodePool = ""; + + /** + * GkeNodePoolTarget roles. + * @member {Array.} roles + * @memberof google.cloud.dataproc.v1.GkeNodePoolTarget + * @instance + */ + GkeNodePoolTarget.prototype.roles = $util.emptyArray; + + /** + * GkeNodePoolTarget nodePoolConfig. + * @member {google.cloud.dataproc.v1.IGkeNodePoolConfig|null|undefined} nodePoolConfig + * @memberof google.cloud.dataproc.v1.GkeNodePoolTarget + * @instance + */ + GkeNodePoolTarget.prototype.nodePoolConfig = null; + + /** + * Creates a new GkeNodePoolTarget instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.GkeNodePoolTarget + * @static + * @param {google.cloud.dataproc.v1.IGkeNodePoolTarget=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.GkeNodePoolTarget} GkeNodePoolTarget instance + */ + GkeNodePoolTarget.create = function create(properties) { + return new GkeNodePoolTarget(properties); + }; + + /** + * Encodes the specified GkeNodePoolTarget message. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolTarget.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.GkeNodePoolTarget + * @static + * @param {google.cloud.dataproc.v1.IGkeNodePoolTarget} message GkeNodePoolTarget message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GkeNodePoolTarget.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodePool != null && Object.hasOwnProperty.call(message, "nodePool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.nodePool); + if (message.roles != null && message.roles.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.roles.length; ++i) + writer.int32(message.roles[i]); + writer.ldelim(); + } + if (message.nodePoolConfig != null && Object.hasOwnProperty.call(message, "nodePoolConfig")) + $root.google.cloud.dataproc.v1.GkeNodePoolConfig.encode(message.nodePoolConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GkeNodePoolTarget message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolTarget.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.GkeNodePoolTarget + * @static + * @param {google.cloud.dataproc.v1.IGkeNodePoolTarget} message GkeNodePoolTarget message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GkeNodePoolTarget.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GkeNodePoolTarget message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.GkeNodePoolTarget + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.GkeNodePoolTarget} GkeNodePoolTarget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GkeNodePoolTarget.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.GkeNodePoolTarget(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.nodePool = reader.string(); + break; + } + case 2: { + if (!(message.roles && message.roles.length)) + message.roles = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.roles.push(reader.int32()); + } else + message.roles.push(reader.int32()); + break; + } + case 3: { + message.nodePoolConfig = $root.google.cloud.dataproc.v1.GkeNodePoolConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GkeNodePoolTarget message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.GkeNodePoolTarget + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.GkeNodePoolTarget} GkeNodePoolTarget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GkeNodePoolTarget.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GkeNodePoolTarget message. + * @function verify + * @memberof google.cloud.dataproc.v1.GkeNodePoolTarget + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GkeNodePoolTarget.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodePool != null && message.hasOwnProperty("nodePool")) + if (!$util.isString(message.nodePool)) + return "nodePool: string expected"; + if (message.roles != null && message.hasOwnProperty("roles")) { + if (!Array.isArray(message.roles)) + return "roles: array expected"; + for (var i = 0; i < message.roles.length; ++i) + switch (message.roles[i]) { + default: + return "roles: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + } + if (message.nodePoolConfig != null && message.hasOwnProperty("nodePoolConfig")) { + var error = $root.google.cloud.dataproc.v1.GkeNodePoolConfig.verify(message.nodePoolConfig); + if (error) + return "nodePoolConfig." + error; + } + return null; + }; + + /** + * Creates a GkeNodePoolTarget message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.GkeNodePoolTarget + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.GkeNodePoolTarget} GkeNodePoolTarget + */ + GkeNodePoolTarget.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.GkeNodePoolTarget) + return object; + var message = new $root.google.cloud.dataproc.v1.GkeNodePoolTarget(); + if (object.nodePool != null) + message.nodePool = String(object.nodePool); + if (object.roles) { + if (!Array.isArray(object.roles)) + throw TypeError(".google.cloud.dataproc.v1.GkeNodePoolTarget.roles: array expected"); + message.roles = []; + for (var i = 0; i < object.roles.length; ++i) + switch (object.roles[i]) { + default: + if (typeof object.roles[i] === "number") { + message.roles[i] = object.roles[i]; + break; + } + case "ROLE_UNSPECIFIED": + case 0: + message.roles[i] = 0; + break; + case "DEFAULT": + case 1: + message.roles[i] = 1; + break; + case "CONTROLLER": + case 2: + message.roles[i] = 2; + break; + case "SPARK_DRIVER": + case 3: + message.roles[i] = 3; + break; + case "SPARK_EXECUTOR": + case 4: + message.roles[i] = 4; + break; + } + } + if (object.nodePoolConfig != null) { + if (typeof object.nodePoolConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.GkeNodePoolTarget.nodePoolConfig: object expected"); + message.nodePoolConfig = $root.google.cloud.dataproc.v1.GkeNodePoolConfig.fromObject(object.nodePoolConfig); + } + return message; + }; + + /** + * Creates a plain object from a GkeNodePoolTarget message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.GkeNodePoolTarget + * @static + * @param {google.cloud.dataproc.v1.GkeNodePoolTarget} message GkeNodePoolTarget + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GkeNodePoolTarget.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.roles = []; + if (options.defaults) { + object.nodePool = ""; + object.nodePoolConfig = null; + } + if (message.nodePool != null && message.hasOwnProperty("nodePool")) + object.nodePool = message.nodePool; + if (message.roles && message.roles.length) { + object.roles = []; + for (var j = 0; j < message.roles.length; ++j) + object.roles[j] = options.enums === String ? $root.google.cloud.dataproc.v1.GkeNodePoolTarget.Role[message.roles[j]] === undefined ? message.roles[j] : $root.google.cloud.dataproc.v1.GkeNodePoolTarget.Role[message.roles[j]] : message.roles[j]; + } + if (message.nodePoolConfig != null && message.hasOwnProperty("nodePoolConfig")) + object.nodePoolConfig = $root.google.cloud.dataproc.v1.GkeNodePoolConfig.toObject(message.nodePoolConfig, options); + return object; + }; + + /** + * Converts this GkeNodePoolTarget to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.GkeNodePoolTarget + * @instance + * @returns {Object.} JSON object + */ + GkeNodePoolTarget.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GkeNodePoolTarget + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.GkeNodePoolTarget + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GkeNodePoolTarget.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.GkeNodePoolTarget"; + }; + + /** + * Role enum. + * @name google.cloud.dataproc.v1.GkeNodePoolTarget.Role + * @enum {number} + * @property {number} ROLE_UNSPECIFIED=0 ROLE_UNSPECIFIED value + * @property {number} DEFAULT=1 DEFAULT value + * @property {number} CONTROLLER=2 CONTROLLER value + * @property {number} SPARK_DRIVER=3 SPARK_DRIVER value + * @property {number} SPARK_EXECUTOR=4 SPARK_EXECUTOR value + */ + GkeNodePoolTarget.Role = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ROLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DEFAULT"] = 1; + values[valuesById[2] = "CONTROLLER"] = 2; + values[valuesById[3] = "SPARK_DRIVER"] = 3; + values[valuesById[4] = "SPARK_EXECUTOR"] = 4; + return values; + })(); + + return GkeNodePoolTarget; + })(); + + v1.GkeNodePoolConfig = (function() { + + /** + * Properties of a GkeNodePoolConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IGkeNodePoolConfig + * @property {google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodeConfig|null} [config] GkeNodePoolConfig config + * @property {Array.|null} [locations] GkeNodePoolConfig locations + * @property {google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAutoscalingConfig|null} [autoscaling] GkeNodePoolConfig autoscaling + */ + + /** + * Constructs a new GkeNodePoolConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a GkeNodePoolConfig. + * @implements IGkeNodePoolConfig + * @constructor + * @param {google.cloud.dataproc.v1.IGkeNodePoolConfig=} [properties] Properties to set + */ + function GkeNodePoolConfig(properties) { + this.locations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GkeNodePoolConfig config. + * @member {google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodeConfig|null|undefined} config + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig + * @instance + */ + GkeNodePoolConfig.prototype.config = null; + + /** + * GkeNodePoolConfig locations. + * @member {Array.} locations + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig + * @instance + */ + GkeNodePoolConfig.prototype.locations = $util.emptyArray; + + /** + * GkeNodePoolConfig autoscaling. + * @member {google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAutoscalingConfig|null|undefined} autoscaling + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig + * @instance + */ + GkeNodePoolConfig.prototype.autoscaling = null; + + /** + * Creates a new GkeNodePoolConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig + * @static + * @param {google.cloud.dataproc.v1.IGkeNodePoolConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.GkeNodePoolConfig} GkeNodePoolConfig instance + */ + GkeNodePoolConfig.create = function create(properties) { + return new GkeNodePoolConfig(properties); + }; + + /** + * Encodes the specified GkeNodePoolConfig message. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig + * @static + * @param {google.cloud.dataproc.v1.IGkeNodePoolConfig} message GkeNodePoolConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GkeNodePoolConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.encode(message.config, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoscaling != null && Object.hasOwnProperty.call(message, "autoscaling")) + $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig.encode(message.autoscaling, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.locations != null && message.locations.length) + for (var i = 0; i < message.locations.length; ++i) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.locations[i]); + return writer; + }; + + /** + * Encodes the specified GkeNodePoolConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig + * @static + * @param {google.cloud.dataproc.v1.IGkeNodePoolConfig} message GkeNodePoolConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GkeNodePoolConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GkeNodePoolConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.GkeNodePoolConfig} GkeNodePoolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GkeNodePoolConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.GkeNodePoolConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.config = $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.decode(reader, reader.uint32()); + break; + } + case 13: { + if (!(message.locations && message.locations.length)) + message.locations = []; + message.locations.push(reader.string()); + break; + } + case 4: { + message.autoscaling = $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GkeNodePoolConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.GkeNodePoolConfig} GkeNodePoolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GkeNodePoolConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GkeNodePoolConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GkeNodePoolConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.locations != null && message.hasOwnProperty("locations")) { + if (!Array.isArray(message.locations)) + return "locations: array expected"; + for (var i = 0; i < message.locations.length; ++i) + if (!$util.isString(message.locations[i])) + return "locations: string[] expected"; + } + if (message.autoscaling != null && message.hasOwnProperty("autoscaling")) { + var error = $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig.verify(message.autoscaling); + if (error) + return "autoscaling." + error; + } + return null; + }; + + /** + * Creates a GkeNodePoolConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.GkeNodePoolConfig} GkeNodePoolConfig + */ + GkeNodePoolConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.GkeNodePoolConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.GkeNodePoolConfig(); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.dataproc.v1.GkeNodePoolConfig.config: object expected"); + message.config = $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.fromObject(object.config); + } + if (object.locations) { + if (!Array.isArray(object.locations)) + throw TypeError(".google.cloud.dataproc.v1.GkeNodePoolConfig.locations: array expected"); + message.locations = []; + for (var i = 0; i < object.locations.length; ++i) + message.locations[i] = String(object.locations[i]); + } + if (object.autoscaling != null) { + if (typeof object.autoscaling !== "object") + throw TypeError(".google.cloud.dataproc.v1.GkeNodePoolConfig.autoscaling: object expected"); + message.autoscaling = $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig.fromObject(object.autoscaling); + } + return message; + }; + + /** + * Creates a plain object from a GkeNodePoolConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig + * @static + * @param {google.cloud.dataproc.v1.GkeNodePoolConfig} message GkeNodePoolConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GkeNodePoolConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.locations = []; + if (options.defaults) { + object.config = null; + object.autoscaling = null; + } + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.toObject(message.config, options); + if (message.autoscaling != null && message.hasOwnProperty("autoscaling")) + object.autoscaling = $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig.toObject(message.autoscaling, options); + if (message.locations && message.locations.length) { + object.locations = []; + for (var j = 0; j < message.locations.length; ++j) + object.locations[j] = message.locations[j]; + } + return object; + }; + + /** + * Converts this GkeNodePoolConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig + * @instance + * @returns {Object.} JSON object + */ + GkeNodePoolConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GkeNodePoolConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GkeNodePoolConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.GkeNodePoolConfig"; + }; + + GkeNodePoolConfig.GkeNodeConfig = (function() { + + /** + * Properties of a GkeNodeConfig. + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig + * @interface IGkeNodeConfig + * @property {string|null} [machineType] GkeNodeConfig machineType + * @property {number|null} [localSsdCount] GkeNodeConfig localSsdCount + * @property {boolean|null} [preemptible] GkeNodeConfig preemptible + * @property {Array.|null} [accelerators] GkeNodeConfig accelerators + * @property {string|null} [minCpuPlatform] GkeNodeConfig minCpuPlatform + * @property {string|null} [bootDiskKmsKey] GkeNodeConfig bootDiskKmsKey + * @property {boolean|null} [spot] GkeNodeConfig spot + */ + + /** + * Constructs a new GkeNodeConfig. + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig + * @classdesc Represents a GkeNodeConfig. + * @implements IGkeNodeConfig + * @constructor + * @param {google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodeConfig=} [properties] Properties to set + */ + function GkeNodeConfig(properties) { + this.accelerators = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GkeNodeConfig machineType. + * @member {string} machineType + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig + * @instance + */ + GkeNodeConfig.prototype.machineType = ""; + + /** + * GkeNodeConfig localSsdCount. + * @member {number} localSsdCount + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig + * @instance + */ + GkeNodeConfig.prototype.localSsdCount = 0; + + /** + * GkeNodeConfig preemptible. + * @member {boolean} preemptible + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig + * @instance + */ + GkeNodeConfig.prototype.preemptible = false; + + /** + * GkeNodeConfig accelerators. + * @member {Array.} accelerators + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig + * @instance + */ + GkeNodeConfig.prototype.accelerators = $util.emptyArray; + + /** + * GkeNodeConfig minCpuPlatform. + * @member {string} minCpuPlatform + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig + * @instance + */ + GkeNodeConfig.prototype.minCpuPlatform = ""; + + /** + * GkeNodeConfig bootDiskKmsKey. + * @member {string} bootDiskKmsKey + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig + * @instance + */ + GkeNodeConfig.prototype.bootDiskKmsKey = ""; + + /** + * GkeNodeConfig spot. + * @member {boolean} spot + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig + * @instance + */ + GkeNodeConfig.prototype.spot = false; + + /** + * Creates a new GkeNodeConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig + * @static + * @param {google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodeConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig} GkeNodeConfig instance + */ + GkeNodeConfig.create = function create(properties) { + return new GkeNodeConfig(properties); + }; + + /** + * Encodes the specified GkeNodeConfig message. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig + * @static + * @param {google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodeConfig} message GkeNodeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GkeNodeConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.machineType); + if (message.localSsdCount != null && Object.hasOwnProperty.call(message, "localSsdCount")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.localSsdCount); + if (message.preemptible != null && Object.hasOwnProperty.call(message, "preemptible")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.preemptible); + if (message.accelerators != null && message.accelerators.length) + for (var i = 0; i < message.accelerators.length; ++i) + $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig.encode(message.accelerators[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.minCpuPlatform != null && Object.hasOwnProperty.call(message, "minCpuPlatform")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.minCpuPlatform); + if (message.bootDiskKmsKey != null && Object.hasOwnProperty.call(message, "bootDiskKmsKey")) + writer.uint32(/* id 23, wireType 2 =*/186).string(message.bootDiskKmsKey); + if (message.spot != null && Object.hasOwnProperty.call(message, "spot")) + writer.uint32(/* id 32, wireType 0 =*/256).bool(message.spot); + return writer; + }; + + /** + * Encodes the specified GkeNodeConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig + * @static + * @param {google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodeConfig} message GkeNodeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GkeNodeConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GkeNodeConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig} GkeNodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GkeNodeConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.machineType = reader.string(); + break; + } + case 7: { + message.localSsdCount = reader.int32(); + break; + } + case 10: { + message.preemptible = reader.bool(); + break; + } + case 11: { + if (!(message.accelerators && message.accelerators.length)) + message.accelerators = []; + message.accelerators.push($root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig.decode(reader, reader.uint32())); + break; + } + case 13: { + message.minCpuPlatform = reader.string(); + break; + } + case 23: { + message.bootDiskKmsKey = reader.string(); + break; + } + case 32: { + message.spot = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GkeNodeConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig} GkeNodeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GkeNodeConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GkeNodeConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GkeNodeConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.machineType != null && message.hasOwnProperty("machineType")) + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + if (message.localSsdCount != null && message.hasOwnProperty("localSsdCount")) + if (!$util.isInteger(message.localSsdCount)) + return "localSsdCount: integer expected"; + if (message.preemptible != null && message.hasOwnProperty("preemptible")) + if (typeof message.preemptible !== "boolean") + return "preemptible: boolean expected"; + if (message.accelerators != null && message.hasOwnProperty("accelerators")) { + if (!Array.isArray(message.accelerators)) + return "accelerators: array expected"; + for (var i = 0; i < message.accelerators.length; ++i) { + var error = $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig.verify(message.accelerators[i]); + if (error) + return "accelerators." + error; + } + } + if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) + if (!$util.isString(message.minCpuPlatform)) + return "minCpuPlatform: string expected"; + if (message.bootDiskKmsKey != null && message.hasOwnProperty("bootDiskKmsKey")) + if (!$util.isString(message.bootDiskKmsKey)) + return "bootDiskKmsKey: string expected"; + if (message.spot != null && message.hasOwnProperty("spot")) + if (typeof message.spot !== "boolean") + return "spot: boolean expected"; + return null; + }; + + /** + * Creates a GkeNodeConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig} GkeNodeConfig + */ + GkeNodeConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig(); + if (object.machineType != null) + message.machineType = String(object.machineType); + if (object.localSsdCount != null) + message.localSsdCount = object.localSsdCount | 0; + if (object.preemptible != null) + message.preemptible = Boolean(object.preemptible); + if (object.accelerators) { + if (!Array.isArray(object.accelerators)) + throw TypeError(".google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.accelerators: array expected"); + message.accelerators = []; + for (var i = 0; i < object.accelerators.length; ++i) { + if (typeof object.accelerators[i] !== "object") + throw TypeError(".google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.accelerators: object expected"); + message.accelerators[i] = $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig.fromObject(object.accelerators[i]); + } + } + if (object.minCpuPlatform != null) + message.minCpuPlatform = String(object.minCpuPlatform); + if (object.bootDiskKmsKey != null) + message.bootDiskKmsKey = String(object.bootDiskKmsKey); + if (object.spot != null) + message.spot = Boolean(object.spot); + return message; + }; + + /** + * Creates a plain object from a GkeNodeConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig + * @static + * @param {google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig} message GkeNodeConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GkeNodeConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.accelerators = []; + if (options.defaults) { + object.machineType = ""; + object.localSsdCount = 0; + object.preemptible = false; + object.minCpuPlatform = ""; + object.bootDiskKmsKey = ""; + object.spot = false; + } + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = message.machineType; + if (message.localSsdCount != null && message.hasOwnProperty("localSsdCount")) + object.localSsdCount = message.localSsdCount; + if (message.preemptible != null && message.hasOwnProperty("preemptible")) + object.preemptible = message.preemptible; + if (message.accelerators && message.accelerators.length) { + object.accelerators = []; + for (var j = 0; j < message.accelerators.length; ++j) + object.accelerators[j] = $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig.toObject(message.accelerators[j], options); + } + if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) + object.minCpuPlatform = message.minCpuPlatform; + if (message.bootDiskKmsKey != null && message.hasOwnProperty("bootDiskKmsKey")) + object.bootDiskKmsKey = message.bootDiskKmsKey; + if (message.spot != null && message.hasOwnProperty("spot")) + object.spot = message.spot; + return object; + }; + + /** + * Converts this GkeNodeConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig + * @instance + * @returns {Object.} JSON object + */ + GkeNodeConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GkeNodeConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GkeNodeConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig"; + }; + + return GkeNodeConfig; + })(); + + GkeNodePoolConfig.GkeNodePoolAcceleratorConfig = (function() { + + /** + * Properties of a GkeNodePoolAcceleratorConfig. + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig + * @interface IGkeNodePoolAcceleratorConfig + * @property {number|Long|null} [acceleratorCount] GkeNodePoolAcceleratorConfig acceleratorCount + * @property {string|null} [acceleratorType] GkeNodePoolAcceleratorConfig acceleratorType + * @property {string|null} [gpuPartitionSize] GkeNodePoolAcceleratorConfig gpuPartitionSize + */ + + /** + * Constructs a new GkeNodePoolAcceleratorConfig. + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig + * @classdesc Represents a GkeNodePoolAcceleratorConfig. + * @implements IGkeNodePoolAcceleratorConfig + * @constructor + * @param {google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAcceleratorConfig=} [properties] Properties to set + */ + function GkeNodePoolAcceleratorConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GkeNodePoolAcceleratorConfig acceleratorCount. + * @member {number|Long} acceleratorCount + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig + * @instance + */ + GkeNodePoolAcceleratorConfig.prototype.acceleratorCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * GkeNodePoolAcceleratorConfig acceleratorType. + * @member {string} acceleratorType + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig + * @instance + */ + GkeNodePoolAcceleratorConfig.prototype.acceleratorType = ""; + + /** + * GkeNodePoolAcceleratorConfig gpuPartitionSize. + * @member {string} gpuPartitionSize + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig + * @instance + */ + GkeNodePoolAcceleratorConfig.prototype.gpuPartitionSize = ""; + + /** + * Creates a new GkeNodePoolAcceleratorConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig + * @static + * @param {google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAcceleratorConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig} GkeNodePoolAcceleratorConfig instance + */ + GkeNodePoolAcceleratorConfig.create = function create(properties) { + return new GkeNodePoolAcceleratorConfig(properties); + }; + + /** + * Encodes the specified GkeNodePoolAcceleratorConfig message. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig + * @static + * @param {google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAcceleratorConfig} message GkeNodePoolAcceleratorConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GkeNodePoolAcceleratorConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.acceleratorCount != null && Object.hasOwnProperty.call(message, "acceleratorCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.acceleratorCount); + if (message.acceleratorType != null && Object.hasOwnProperty.call(message, "acceleratorType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.acceleratorType); + if (message.gpuPartitionSize != null && Object.hasOwnProperty.call(message, "gpuPartitionSize")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.gpuPartitionSize); + return writer; + }; + + /** + * Encodes the specified GkeNodePoolAcceleratorConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig + * @static + * @param {google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAcceleratorConfig} message GkeNodePoolAcceleratorConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GkeNodePoolAcceleratorConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GkeNodePoolAcceleratorConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig} GkeNodePoolAcceleratorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GkeNodePoolAcceleratorConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.acceleratorCount = reader.int64(); + break; + } + case 2: { + message.acceleratorType = reader.string(); + break; + } + case 3: { + message.gpuPartitionSize = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GkeNodePoolAcceleratorConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig} GkeNodePoolAcceleratorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GkeNodePoolAcceleratorConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GkeNodePoolAcceleratorConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GkeNodePoolAcceleratorConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.acceleratorCount != null && message.hasOwnProperty("acceleratorCount")) + if (!$util.isInteger(message.acceleratorCount) && !(message.acceleratorCount && $util.isInteger(message.acceleratorCount.low) && $util.isInteger(message.acceleratorCount.high))) + return "acceleratorCount: integer|Long expected"; + if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) + if (!$util.isString(message.acceleratorType)) + return "acceleratorType: string expected"; + if (message.gpuPartitionSize != null && message.hasOwnProperty("gpuPartitionSize")) + if (!$util.isString(message.gpuPartitionSize)) + return "gpuPartitionSize: string expected"; + return null; + }; + + /** + * Creates a GkeNodePoolAcceleratorConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig} GkeNodePoolAcceleratorConfig + */ + GkeNodePoolAcceleratorConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig(); + if (object.acceleratorCount != null) + if ($util.Long) + (message.acceleratorCount = $util.Long.fromValue(object.acceleratorCount)).unsigned = false; + else if (typeof object.acceleratorCount === "string") + message.acceleratorCount = parseInt(object.acceleratorCount, 10); + else if (typeof object.acceleratorCount === "number") + message.acceleratorCount = object.acceleratorCount; + else if (typeof object.acceleratorCount === "object") + message.acceleratorCount = new $util.LongBits(object.acceleratorCount.low >>> 0, object.acceleratorCount.high >>> 0).toNumber(); + if (object.acceleratorType != null) + message.acceleratorType = String(object.acceleratorType); + if (object.gpuPartitionSize != null) + message.gpuPartitionSize = String(object.gpuPartitionSize); + return message; + }; + + /** + * Creates a plain object from a GkeNodePoolAcceleratorConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig + * @static + * @param {google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig} message GkeNodePoolAcceleratorConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GkeNodePoolAcceleratorConfig.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.acceleratorCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.acceleratorCount = options.longs === String ? "0" : 0; + object.acceleratorType = ""; + object.gpuPartitionSize = ""; + } + if (message.acceleratorCount != null && message.hasOwnProperty("acceleratorCount")) + if (typeof message.acceleratorCount === "number") + object.acceleratorCount = options.longs === String ? String(message.acceleratorCount) : message.acceleratorCount; + else + object.acceleratorCount = options.longs === String ? $util.Long.prototype.toString.call(message.acceleratorCount) : options.longs === Number ? new $util.LongBits(message.acceleratorCount.low >>> 0, message.acceleratorCount.high >>> 0).toNumber() : message.acceleratorCount; + if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) + object.acceleratorType = message.acceleratorType; + if (message.gpuPartitionSize != null && message.hasOwnProperty("gpuPartitionSize")) + object.gpuPartitionSize = message.gpuPartitionSize; + return object; + }; + + /** + * Converts this GkeNodePoolAcceleratorConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig + * @instance + * @returns {Object.} JSON object + */ + GkeNodePoolAcceleratorConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GkeNodePoolAcceleratorConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GkeNodePoolAcceleratorConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig"; + }; + + return GkeNodePoolAcceleratorConfig; + })(); + + GkeNodePoolConfig.GkeNodePoolAutoscalingConfig = (function() { + + /** + * Properties of a GkeNodePoolAutoscalingConfig. + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig + * @interface IGkeNodePoolAutoscalingConfig + * @property {number|null} [minNodeCount] GkeNodePoolAutoscalingConfig minNodeCount + * @property {number|null} [maxNodeCount] GkeNodePoolAutoscalingConfig maxNodeCount + */ + + /** + * Constructs a new GkeNodePoolAutoscalingConfig. + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig + * @classdesc Represents a GkeNodePoolAutoscalingConfig. + * @implements IGkeNodePoolAutoscalingConfig + * @constructor + * @param {google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAutoscalingConfig=} [properties] Properties to set + */ + function GkeNodePoolAutoscalingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GkeNodePoolAutoscalingConfig minNodeCount. + * @member {number} minNodeCount + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig + * @instance + */ + GkeNodePoolAutoscalingConfig.prototype.minNodeCount = 0; + + /** + * GkeNodePoolAutoscalingConfig maxNodeCount. + * @member {number} maxNodeCount + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig + * @instance + */ + GkeNodePoolAutoscalingConfig.prototype.maxNodeCount = 0; + + /** + * Creates a new GkeNodePoolAutoscalingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig + * @static + * @param {google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAutoscalingConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig} GkeNodePoolAutoscalingConfig instance + */ + GkeNodePoolAutoscalingConfig.create = function create(properties) { + return new GkeNodePoolAutoscalingConfig(properties); + }; + + /** + * Encodes the specified GkeNodePoolAutoscalingConfig message. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig + * @static + * @param {google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAutoscalingConfig} message GkeNodePoolAutoscalingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GkeNodePoolAutoscalingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minNodeCount != null && Object.hasOwnProperty.call(message, "minNodeCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minNodeCount); + if (message.maxNodeCount != null && Object.hasOwnProperty.call(message, "maxNodeCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxNodeCount); + return writer; + }; + + /** + * Encodes the specified GkeNodePoolAutoscalingConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig + * @static + * @param {google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAutoscalingConfig} message GkeNodePoolAutoscalingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GkeNodePoolAutoscalingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GkeNodePoolAutoscalingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig} GkeNodePoolAutoscalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GkeNodePoolAutoscalingConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.minNodeCount = reader.int32(); + break; + } + case 3: { + message.maxNodeCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GkeNodePoolAutoscalingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig} GkeNodePoolAutoscalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GkeNodePoolAutoscalingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GkeNodePoolAutoscalingConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GkeNodePoolAutoscalingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.minNodeCount != null && message.hasOwnProperty("minNodeCount")) + if (!$util.isInteger(message.minNodeCount)) + return "minNodeCount: integer expected"; + if (message.maxNodeCount != null && message.hasOwnProperty("maxNodeCount")) + if (!$util.isInteger(message.maxNodeCount)) + return "maxNodeCount: integer expected"; + return null; + }; + + /** + * Creates a GkeNodePoolAutoscalingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig} GkeNodePoolAutoscalingConfig + */ + GkeNodePoolAutoscalingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig(); + if (object.minNodeCount != null) + message.minNodeCount = object.minNodeCount | 0; + if (object.maxNodeCount != null) + message.maxNodeCount = object.maxNodeCount | 0; + return message; + }; + + /** + * Creates a plain object from a GkeNodePoolAutoscalingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig + * @static + * @param {google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig} message GkeNodePoolAutoscalingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GkeNodePoolAutoscalingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.minNodeCount = 0; + object.maxNodeCount = 0; + } + if (message.minNodeCount != null && message.hasOwnProperty("minNodeCount")) + object.minNodeCount = message.minNodeCount; + if (message.maxNodeCount != null && message.hasOwnProperty("maxNodeCount")) + object.maxNodeCount = message.maxNodeCount; + return object; + }; + + /** + * Converts this GkeNodePoolAutoscalingConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig + * @instance + * @returns {Object.} JSON object + */ + GkeNodePoolAutoscalingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GkeNodePoolAutoscalingConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GkeNodePoolAutoscalingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig"; + }; + + return GkeNodePoolAutoscalingConfig; + })(); + + return GkeNodePoolConfig; + })(); + + v1.AuthenticationConfig = (function() { + + /** + * Properties of an AuthenticationConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IAuthenticationConfig + * @property {google.cloud.dataproc.v1.AuthenticationConfig.AuthenticationType|null} [userWorkloadAuthenticationType] AuthenticationConfig userWorkloadAuthenticationType + */ + + /** + * Constructs a new AuthenticationConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents an AuthenticationConfig. + * @implements IAuthenticationConfig + * @constructor + * @param {google.cloud.dataproc.v1.IAuthenticationConfig=} [properties] Properties to set + */ + function AuthenticationConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuthenticationConfig userWorkloadAuthenticationType. + * @member {google.cloud.dataproc.v1.AuthenticationConfig.AuthenticationType} userWorkloadAuthenticationType + * @memberof google.cloud.dataproc.v1.AuthenticationConfig + * @instance + */ + AuthenticationConfig.prototype.userWorkloadAuthenticationType = 0; + + /** + * Creates a new AuthenticationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.AuthenticationConfig + * @static + * @param {google.cloud.dataproc.v1.IAuthenticationConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.AuthenticationConfig} AuthenticationConfig instance + */ + AuthenticationConfig.create = function create(properties) { + return new AuthenticationConfig(properties); + }; + + /** + * Encodes the specified AuthenticationConfig message. Does not implicitly {@link google.cloud.dataproc.v1.AuthenticationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.AuthenticationConfig + * @static + * @param {google.cloud.dataproc.v1.IAuthenticationConfig} message AuthenticationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthenticationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.userWorkloadAuthenticationType != null && Object.hasOwnProperty.call(message, "userWorkloadAuthenticationType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.userWorkloadAuthenticationType); + return writer; + }; + + /** + * Encodes the specified AuthenticationConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.AuthenticationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.AuthenticationConfig + * @static + * @param {google.cloud.dataproc.v1.IAuthenticationConfig} message AuthenticationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuthenticationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuthenticationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.AuthenticationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.AuthenticationConfig} AuthenticationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthenticationConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.AuthenticationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.userWorkloadAuthenticationType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuthenticationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.AuthenticationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.AuthenticationConfig} AuthenticationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuthenticationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuthenticationConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.AuthenticationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuthenticationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.userWorkloadAuthenticationType != null && message.hasOwnProperty("userWorkloadAuthenticationType")) + switch (message.userWorkloadAuthenticationType) { + default: + return "userWorkloadAuthenticationType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an AuthenticationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.AuthenticationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.AuthenticationConfig} AuthenticationConfig + */ + AuthenticationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.AuthenticationConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.AuthenticationConfig(); + switch (object.userWorkloadAuthenticationType) { + default: + if (typeof object.userWorkloadAuthenticationType === "number") { + message.userWorkloadAuthenticationType = object.userWorkloadAuthenticationType; + break; + } + break; + case "AUTHENTICATION_TYPE_UNSPECIFIED": + case 0: + message.userWorkloadAuthenticationType = 0; + break; + case "SERVICE_ACCOUNT": + case 1: + message.userWorkloadAuthenticationType = 1; + break; + case "END_USER_CREDENTIALS": + case 2: + message.userWorkloadAuthenticationType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an AuthenticationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.AuthenticationConfig + * @static + * @param {google.cloud.dataproc.v1.AuthenticationConfig} message AuthenticationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuthenticationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.userWorkloadAuthenticationType = options.enums === String ? "AUTHENTICATION_TYPE_UNSPECIFIED" : 0; + if (message.userWorkloadAuthenticationType != null && message.hasOwnProperty("userWorkloadAuthenticationType")) + object.userWorkloadAuthenticationType = options.enums === String ? $root.google.cloud.dataproc.v1.AuthenticationConfig.AuthenticationType[message.userWorkloadAuthenticationType] === undefined ? message.userWorkloadAuthenticationType : $root.google.cloud.dataproc.v1.AuthenticationConfig.AuthenticationType[message.userWorkloadAuthenticationType] : message.userWorkloadAuthenticationType; + return object; + }; + + /** + * Converts this AuthenticationConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.AuthenticationConfig + * @instance + * @returns {Object.} JSON object + */ + AuthenticationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuthenticationConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.AuthenticationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuthenticationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.AuthenticationConfig"; + }; + + /** + * AuthenticationType enum. + * @name google.cloud.dataproc.v1.AuthenticationConfig.AuthenticationType + * @enum {number} + * @property {number} AUTHENTICATION_TYPE_UNSPECIFIED=0 AUTHENTICATION_TYPE_UNSPECIFIED value + * @property {number} SERVICE_ACCOUNT=1 SERVICE_ACCOUNT value + * @property {number} END_USER_CREDENTIALS=2 END_USER_CREDENTIALS value + */ + AuthenticationConfig.AuthenticationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AUTHENTICATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SERVICE_ACCOUNT"] = 1; + values[valuesById[2] = "END_USER_CREDENTIALS"] = 2; + return values; + })(); + + return AuthenticationConfig; + })(); + + v1.AutotuningConfig = (function() { + + /** + * Properties of an AutotuningConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IAutotuningConfig + * @property {Array.|null} [scenarios] AutotuningConfig scenarios + */ + + /** + * Constructs a new AutotuningConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents an AutotuningConfig. + * @implements IAutotuningConfig + * @constructor + * @param {google.cloud.dataproc.v1.IAutotuningConfig=} [properties] Properties to set + */ + function AutotuningConfig(properties) { + this.scenarios = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutotuningConfig scenarios. + * @member {Array.} scenarios + * @memberof google.cloud.dataproc.v1.AutotuningConfig + * @instance + */ + AutotuningConfig.prototype.scenarios = $util.emptyArray; + + /** + * Creates a new AutotuningConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.AutotuningConfig + * @static + * @param {google.cloud.dataproc.v1.IAutotuningConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.AutotuningConfig} AutotuningConfig instance + */ + AutotuningConfig.create = function create(properties) { + return new AutotuningConfig(properties); + }; + + /** + * Encodes the specified AutotuningConfig message. Does not implicitly {@link google.cloud.dataproc.v1.AutotuningConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.AutotuningConfig + * @static + * @param {google.cloud.dataproc.v1.IAutotuningConfig} message AutotuningConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutotuningConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scenarios != null && message.scenarios.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.scenarios.length; ++i) + writer.int32(message.scenarios[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified AutotuningConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.AutotuningConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.AutotuningConfig + * @static + * @param {google.cloud.dataproc.v1.IAutotuningConfig} message AutotuningConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutotuningConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutotuningConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.AutotuningConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.AutotuningConfig} AutotuningConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutotuningConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.AutotuningConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.scenarios && message.scenarios.length)) + message.scenarios = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.scenarios.push(reader.int32()); + } else + message.scenarios.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutotuningConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.AutotuningConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.AutotuningConfig} AutotuningConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutotuningConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutotuningConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.AutotuningConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutotuningConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scenarios != null && message.hasOwnProperty("scenarios")) { + if (!Array.isArray(message.scenarios)) + return "scenarios: array expected"; + for (var i = 0; i < message.scenarios.length; ++i) + switch (message.scenarios[i]) { + default: + return "scenarios: enum value[] expected"; + case 0: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + } + return null; + }; + + /** + * Creates an AutotuningConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.AutotuningConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.AutotuningConfig} AutotuningConfig + */ + AutotuningConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.AutotuningConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.AutotuningConfig(); + if (object.scenarios) { + if (!Array.isArray(object.scenarios)) + throw TypeError(".google.cloud.dataproc.v1.AutotuningConfig.scenarios: array expected"); + message.scenarios = []; + for (var i = 0; i < object.scenarios.length; ++i) + switch (object.scenarios[i]) { + default: + if (typeof object.scenarios[i] === "number") { + message.scenarios[i] = object.scenarios[i]; + break; + } + case "SCENARIO_UNSPECIFIED": + case 0: + message.scenarios[i] = 0; + break; + case "SCALING": + case 2: + message.scenarios[i] = 2; + break; + case "BROADCAST_HASH_JOIN": + case 3: + message.scenarios[i] = 3; + break; + case "MEMORY": + case 4: + message.scenarios[i] = 4; + break; + case "NONE": + case 5: + message.scenarios[i] = 5; + break; + case "AUTO": + case 6: + message.scenarios[i] = 6; + break; + } + } + return message; + }; + + /** + * Creates a plain object from an AutotuningConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.AutotuningConfig + * @static + * @param {google.cloud.dataproc.v1.AutotuningConfig} message AutotuningConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutotuningConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.scenarios = []; + if (message.scenarios && message.scenarios.length) { + object.scenarios = []; + for (var j = 0; j < message.scenarios.length; ++j) + object.scenarios[j] = options.enums === String ? $root.google.cloud.dataproc.v1.AutotuningConfig.Scenario[message.scenarios[j]] === undefined ? message.scenarios[j] : $root.google.cloud.dataproc.v1.AutotuningConfig.Scenario[message.scenarios[j]] : message.scenarios[j]; + } + return object; + }; + + /** + * Converts this AutotuningConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.AutotuningConfig + * @instance + * @returns {Object.} JSON object + */ + AutotuningConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutotuningConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.AutotuningConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutotuningConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.AutotuningConfig"; + }; + + /** + * Scenario enum. + * @name google.cloud.dataproc.v1.AutotuningConfig.Scenario + * @enum {number} + * @property {number} SCENARIO_UNSPECIFIED=0 SCENARIO_UNSPECIFIED value + * @property {number} SCALING=2 SCALING value + * @property {number} BROADCAST_HASH_JOIN=3 BROADCAST_HASH_JOIN value + * @property {number} MEMORY=4 MEMORY value + * @property {number} NONE=5 NONE value + * @property {number} AUTO=6 AUTO value + */ + AutotuningConfig.Scenario = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SCENARIO_UNSPECIFIED"] = 0; + values[valuesById[2] = "SCALING"] = 2; + values[valuesById[3] = "BROADCAST_HASH_JOIN"] = 3; + values[valuesById[4] = "MEMORY"] = 4; + values[valuesById[5] = "NONE"] = 5; + values[valuesById[6] = "AUTO"] = 6; + return values; + })(); + + return AutotuningConfig; + })(); + + v1.RepositoryConfig = (function() { + + /** + * Properties of a RepositoryConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IRepositoryConfig + * @property {google.cloud.dataproc.v1.IPyPiRepositoryConfig|null} [pypiRepositoryConfig] RepositoryConfig pypiRepositoryConfig + */ + + /** + * Constructs a new RepositoryConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a RepositoryConfig. + * @implements IRepositoryConfig + * @constructor + * @param {google.cloud.dataproc.v1.IRepositoryConfig=} [properties] Properties to set + */ + function RepositoryConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RepositoryConfig pypiRepositoryConfig. + * @member {google.cloud.dataproc.v1.IPyPiRepositoryConfig|null|undefined} pypiRepositoryConfig + * @memberof google.cloud.dataproc.v1.RepositoryConfig + * @instance + */ + RepositoryConfig.prototype.pypiRepositoryConfig = null; + + /** + * Creates a new RepositoryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.RepositoryConfig + * @static + * @param {google.cloud.dataproc.v1.IRepositoryConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.RepositoryConfig} RepositoryConfig instance + */ + RepositoryConfig.create = function create(properties) { + return new RepositoryConfig(properties); + }; + + /** + * Encodes the specified RepositoryConfig message. Does not implicitly {@link google.cloud.dataproc.v1.RepositoryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.RepositoryConfig + * @static + * @param {google.cloud.dataproc.v1.IRepositoryConfig} message RepositoryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RepositoryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pypiRepositoryConfig != null && Object.hasOwnProperty.call(message, "pypiRepositoryConfig")) + $root.google.cloud.dataproc.v1.PyPiRepositoryConfig.encode(message.pypiRepositoryConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RepositoryConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.RepositoryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.RepositoryConfig + * @static + * @param {google.cloud.dataproc.v1.IRepositoryConfig} message RepositoryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RepositoryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RepositoryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.RepositoryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.RepositoryConfig} RepositoryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RepositoryConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.RepositoryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.pypiRepositoryConfig = $root.google.cloud.dataproc.v1.PyPiRepositoryConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RepositoryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.RepositoryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.RepositoryConfig} RepositoryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RepositoryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RepositoryConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.RepositoryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RepositoryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pypiRepositoryConfig != null && message.hasOwnProperty("pypiRepositoryConfig")) { + var error = $root.google.cloud.dataproc.v1.PyPiRepositoryConfig.verify(message.pypiRepositoryConfig); + if (error) + return "pypiRepositoryConfig." + error; + } + return null; + }; + + /** + * Creates a RepositoryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.RepositoryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.RepositoryConfig} RepositoryConfig + */ + RepositoryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.RepositoryConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.RepositoryConfig(); + if (object.pypiRepositoryConfig != null) { + if (typeof object.pypiRepositoryConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.RepositoryConfig.pypiRepositoryConfig: object expected"); + message.pypiRepositoryConfig = $root.google.cloud.dataproc.v1.PyPiRepositoryConfig.fromObject(object.pypiRepositoryConfig); + } + return message; + }; + + /** + * Creates a plain object from a RepositoryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.RepositoryConfig + * @static + * @param {google.cloud.dataproc.v1.RepositoryConfig} message RepositoryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RepositoryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.pypiRepositoryConfig = null; + if (message.pypiRepositoryConfig != null && message.hasOwnProperty("pypiRepositoryConfig")) + object.pypiRepositoryConfig = $root.google.cloud.dataproc.v1.PyPiRepositoryConfig.toObject(message.pypiRepositoryConfig, options); + return object; + }; + + /** + * Converts this RepositoryConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.RepositoryConfig + * @instance + * @returns {Object.} JSON object + */ + RepositoryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RepositoryConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.RepositoryConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RepositoryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.RepositoryConfig"; + }; + + return RepositoryConfig; + })(); + + v1.PyPiRepositoryConfig = (function() { + + /** + * Properties of a PyPiRepositoryConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IPyPiRepositoryConfig + * @property {string|null} [pypiRepository] PyPiRepositoryConfig pypiRepository + */ + + /** + * Constructs a new PyPiRepositoryConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a PyPiRepositoryConfig. + * @implements IPyPiRepositoryConfig + * @constructor + * @param {google.cloud.dataproc.v1.IPyPiRepositoryConfig=} [properties] Properties to set + */ + function PyPiRepositoryConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PyPiRepositoryConfig pypiRepository. + * @member {string} pypiRepository + * @memberof google.cloud.dataproc.v1.PyPiRepositoryConfig + * @instance + */ + PyPiRepositoryConfig.prototype.pypiRepository = ""; + + /** + * Creates a new PyPiRepositoryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.PyPiRepositoryConfig + * @static + * @param {google.cloud.dataproc.v1.IPyPiRepositoryConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.PyPiRepositoryConfig} PyPiRepositoryConfig instance + */ + PyPiRepositoryConfig.create = function create(properties) { + return new PyPiRepositoryConfig(properties); + }; + + /** + * Encodes the specified PyPiRepositoryConfig message. Does not implicitly {@link google.cloud.dataproc.v1.PyPiRepositoryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.PyPiRepositoryConfig + * @static + * @param {google.cloud.dataproc.v1.IPyPiRepositoryConfig} message PyPiRepositoryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PyPiRepositoryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pypiRepository != null && Object.hasOwnProperty.call(message, "pypiRepository")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pypiRepository); + return writer; + }; + + /** + * Encodes the specified PyPiRepositoryConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.PyPiRepositoryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.PyPiRepositoryConfig + * @static + * @param {google.cloud.dataproc.v1.IPyPiRepositoryConfig} message PyPiRepositoryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PyPiRepositoryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PyPiRepositoryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.PyPiRepositoryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.PyPiRepositoryConfig} PyPiRepositoryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PyPiRepositoryConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.PyPiRepositoryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.pypiRepository = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PyPiRepositoryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.PyPiRepositoryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.PyPiRepositoryConfig} PyPiRepositoryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PyPiRepositoryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PyPiRepositoryConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.PyPiRepositoryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PyPiRepositoryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pypiRepository != null && message.hasOwnProperty("pypiRepository")) + if (!$util.isString(message.pypiRepository)) + return "pypiRepository: string expected"; + return null; + }; + + /** + * Creates a PyPiRepositoryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.PyPiRepositoryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.PyPiRepositoryConfig} PyPiRepositoryConfig + */ + PyPiRepositoryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.PyPiRepositoryConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.PyPiRepositoryConfig(); + if (object.pypiRepository != null) + message.pypiRepository = String(object.pypiRepository); + return message; + }; + + /** + * Creates a plain object from a PyPiRepositoryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.PyPiRepositoryConfig + * @static + * @param {google.cloud.dataproc.v1.PyPiRepositoryConfig} message PyPiRepositoryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PyPiRepositoryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.pypiRepository = ""; + if (message.pypiRepository != null && message.hasOwnProperty("pypiRepository")) + object.pypiRepository = message.pypiRepository; + return object; + }; + + /** + * Converts this PyPiRepositoryConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.PyPiRepositoryConfig + * @instance + * @returns {Object.} JSON object + */ + PyPiRepositoryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PyPiRepositoryConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.PyPiRepositoryConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PyPiRepositoryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.PyPiRepositoryConfig"; + }; + + return PyPiRepositoryConfig; + })(); + + /** + * Component enum. + * @name google.cloud.dataproc.v1.Component + * @enum {number} + * @property {number} COMPONENT_UNSPECIFIED=0 COMPONENT_UNSPECIFIED value + * @property {number} ANACONDA=5 ANACONDA value + * @property {number} DELTA=20 DELTA value + * @property {number} DOCKER=13 DOCKER value + * @property {number} DRUID=9 DRUID value + * @property {number} FLINK=14 FLINK value + * @property {number} HBASE=11 HBASE value + * @property {number} HIVE_WEBHCAT=3 HIVE_WEBHCAT value + * @property {number} HUDI=18 HUDI value + * @property {number} ICEBERG=19 ICEBERG value + * @property {number} JUPYTER=1 JUPYTER value + * @property {number} JUPYTER_KERNEL_GATEWAY=22 JUPYTER_KERNEL_GATEWAY value + * @property {number} PIG=21 PIG value + * @property {number} PRESTO=6 PRESTO value + * @property {number} TRINO=17 TRINO value + * @property {number} RANGER=12 RANGER value + * @property {number} SOLR=10 SOLR value + * @property {number} ZEPPELIN=4 ZEPPELIN value + * @property {number} ZOOKEEPER=8 ZOOKEEPER value + */ + v1.Component = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMPONENT_UNSPECIFIED"] = 0; + values[valuesById[5] = "ANACONDA"] = 5; + values[valuesById[20] = "DELTA"] = 20; + values[valuesById[13] = "DOCKER"] = 13; + values[valuesById[9] = "DRUID"] = 9; + values[valuesById[14] = "FLINK"] = 14; + values[valuesById[11] = "HBASE"] = 11; + values[valuesById[3] = "HIVE_WEBHCAT"] = 3; + values[valuesById[18] = "HUDI"] = 18; + values[valuesById[19] = "ICEBERG"] = 19; + values[valuesById[1] = "JUPYTER"] = 1; + values[valuesById[22] = "JUPYTER_KERNEL_GATEWAY"] = 22; + values[valuesById[21] = "PIG"] = 21; + values[valuesById[6] = "PRESTO"] = 6; + values[valuesById[17] = "TRINO"] = 17; + values[valuesById[12] = "RANGER"] = 12; + values[valuesById[10] = "SOLR"] = 10; + values[valuesById[4] = "ZEPPELIN"] = 4; + values[valuesById[8] = "ZOOKEEPER"] = 8; + return values; + })(); + + /** + * FailureAction enum. + * @name google.cloud.dataproc.v1.FailureAction + * @enum {number} + * @property {number} FAILURE_ACTION_UNSPECIFIED=0 FAILURE_ACTION_UNSPECIFIED value + * @property {number} NO_ACTION=1 NO_ACTION value + * @property {number} DELETE=2 DELETE value + */ + v1.FailureAction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FAILURE_ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "NO_ACTION"] = 1; + values[valuesById[2] = "DELETE"] = 2; + return values; + })(); + + v1.ClusterController = (function() { + + /** + * Constructs a new ClusterController service. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a ClusterController + * @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 ClusterController(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ClusterController.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ClusterController; + + /** + * Creates new ClusterController service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dataproc.v1.ClusterController + * @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 {ClusterController} RPC service. Useful where requests and/or responses are streamed. + */ + ClusterController.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.ClusterController|createCluster}. + * @memberof google.cloud.dataproc.v1.ClusterController + * @typedef CreateClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateCluster. + * @function createCluster + * @memberof google.cloud.dataproc.v1.ClusterController + * @instance + * @param {google.cloud.dataproc.v1.ICreateClusterRequest} request CreateClusterRequest message or plain object + * @param {google.cloud.dataproc.v1.ClusterController.CreateClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ClusterController.prototype.createCluster = function createCluster(request, callback) { + return this.rpcCall(createCluster, $root.google.cloud.dataproc.v1.CreateClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateCluster" }); + + /** + * Calls CreateCluster. + * @function createCluster + * @memberof google.cloud.dataproc.v1.ClusterController + * @instance + * @param {google.cloud.dataproc.v1.ICreateClusterRequest} request CreateClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.ClusterController|updateCluster}. + * @memberof google.cloud.dataproc.v1.ClusterController + * @typedef UpdateClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateCluster. + * @function updateCluster + * @memberof google.cloud.dataproc.v1.ClusterController + * @instance + * @param {google.cloud.dataproc.v1.IUpdateClusterRequest} request UpdateClusterRequest message or plain object + * @param {google.cloud.dataproc.v1.ClusterController.UpdateClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ClusterController.prototype.updateCluster = function updateCluster(request, callback) { + return this.rpcCall(updateCluster, $root.google.cloud.dataproc.v1.UpdateClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateCluster" }); + + /** + * Calls UpdateCluster. + * @function updateCluster + * @memberof google.cloud.dataproc.v1.ClusterController + * @instance + * @param {google.cloud.dataproc.v1.IUpdateClusterRequest} request UpdateClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.ClusterController|stopCluster}. + * @memberof google.cloud.dataproc.v1.ClusterController + * @typedef StopClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls StopCluster. + * @function stopCluster + * @memberof google.cloud.dataproc.v1.ClusterController + * @instance + * @param {google.cloud.dataproc.v1.IStopClusterRequest} request StopClusterRequest message or plain object + * @param {google.cloud.dataproc.v1.ClusterController.StopClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ClusterController.prototype.stopCluster = function stopCluster(request, callback) { + return this.rpcCall(stopCluster, $root.google.cloud.dataproc.v1.StopClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "StopCluster" }); + + /** + * Calls StopCluster. + * @function stopCluster + * @memberof google.cloud.dataproc.v1.ClusterController + * @instance + * @param {google.cloud.dataproc.v1.IStopClusterRequest} request StopClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.ClusterController|startCluster}. + * @memberof google.cloud.dataproc.v1.ClusterController + * @typedef StartClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls StartCluster. + * @function startCluster + * @memberof google.cloud.dataproc.v1.ClusterController + * @instance + * @param {google.cloud.dataproc.v1.IStartClusterRequest} request StartClusterRequest message or plain object + * @param {google.cloud.dataproc.v1.ClusterController.StartClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ClusterController.prototype.startCluster = function startCluster(request, callback) { + return this.rpcCall(startCluster, $root.google.cloud.dataproc.v1.StartClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "StartCluster" }); + + /** + * Calls StartCluster. + * @function startCluster + * @memberof google.cloud.dataproc.v1.ClusterController + * @instance + * @param {google.cloud.dataproc.v1.IStartClusterRequest} request StartClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.ClusterController|deleteCluster}. + * @memberof google.cloud.dataproc.v1.ClusterController + * @typedef DeleteClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteCluster. + * @function deleteCluster + * @memberof google.cloud.dataproc.v1.ClusterController + * @instance + * @param {google.cloud.dataproc.v1.IDeleteClusterRequest} request DeleteClusterRequest message or plain object + * @param {google.cloud.dataproc.v1.ClusterController.DeleteClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ClusterController.prototype.deleteCluster = function deleteCluster(request, callback) { + return this.rpcCall(deleteCluster, $root.google.cloud.dataproc.v1.DeleteClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteCluster" }); + + /** + * Calls DeleteCluster. + * @function deleteCluster + * @memberof google.cloud.dataproc.v1.ClusterController + * @instance + * @param {google.cloud.dataproc.v1.IDeleteClusterRequest} request DeleteClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.ClusterController|getCluster}. + * @memberof google.cloud.dataproc.v1.ClusterController + * @typedef GetClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataproc.v1.Cluster} [response] Cluster + */ + + /** + * Calls GetCluster. + * @function getCluster + * @memberof google.cloud.dataproc.v1.ClusterController + * @instance + * @param {google.cloud.dataproc.v1.IGetClusterRequest} request GetClusterRequest message or plain object + * @param {google.cloud.dataproc.v1.ClusterController.GetClusterCallback} callback Node-style callback called with the error, if any, and Cluster + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ClusterController.prototype.getCluster = function getCluster(request, callback) { + return this.rpcCall(getCluster, $root.google.cloud.dataproc.v1.GetClusterRequest, $root.google.cloud.dataproc.v1.Cluster, request, callback); + }, "name", { value: "GetCluster" }); + + /** + * Calls GetCluster. + * @function getCluster + * @memberof google.cloud.dataproc.v1.ClusterController + * @instance + * @param {google.cloud.dataproc.v1.IGetClusterRequest} request GetClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.ClusterController|listClusters}. + * @memberof google.cloud.dataproc.v1.ClusterController + * @typedef ListClustersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataproc.v1.ListClustersResponse} [response] ListClustersResponse + */ + + /** + * Calls ListClusters. + * @function listClusters + * @memberof google.cloud.dataproc.v1.ClusterController + * @instance + * @param {google.cloud.dataproc.v1.IListClustersRequest} request ListClustersRequest message or plain object + * @param {google.cloud.dataproc.v1.ClusterController.ListClustersCallback} callback Node-style callback called with the error, if any, and ListClustersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ClusterController.prototype.listClusters = function listClusters(request, callback) { + return this.rpcCall(listClusters, $root.google.cloud.dataproc.v1.ListClustersRequest, $root.google.cloud.dataproc.v1.ListClustersResponse, request, callback); + }, "name", { value: "ListClusters" }); + + /** + * Calls ListClusters. + * @function listClusters + * @memberof google.cloud.dataproc.v1.ClusterController + * @instance + * @param {google.cloud.dataproc.v1.IListClustersRequest} request ListClustersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.ClusterController|diagnoseCluster}. + * @memberof google.cloud.dataproc.v1.ClusterController + * @typedef DiagnoseClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DiagnoseCluster. + * @function diagnoseCluster + * @memberof google.cloud.dataproc.v1.ClusterController + * @instance + * @param {google.cloud.dataproc.v1.IDiagnoseClusterRequest} request DiagnoseClusterRequest message or plain object + * @param {google.cloud.dataproc.v1.ClusterController.DiagnoseClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ClusterController.prototype.diagnoseCluster = function diagnoseCluster(request, callback) { + return this.rpcCall(diagnoseCluster, $root.google.cloud.dataproc.v1.DiagnoseClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DiagnoseCluster" }); + + /** + * Calls DiagnoseCluster. + * @function diagnoseCluster + * @memberof google.cloud.dataproc.v1.ClusterController + * @instance + * @param {google.cloud.dataproc.v1.IDiagnoseClusterRequest} request DiagnoseClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ClusterController; + })(); + + v1.Cluster = (function() { + + /** + * Properties of a Cluster. + * @memberof google.cloud.dataproc.v1 + * @interface ICluster + * @property {string|null} [projectId] Cluster projectId + * @property {string|null} [clusterName] Cluster clusterName + * @property {google.cloud.dataproc.v1.IClusterConfig|null} [config] Cluster config + * @property {google.cloud.dataproc.v1.IVirtualClusterConfig|null} [virtualClusterConfig] Cluster virtualClusterConfig + * @property {Object.|null} [labels] Cluster labels + * @property {google.cloud.dataproc.v1.IClusterStatus|null} [status] Cluster status + * @property {Array.|null} [statusHistory] Cluster statusHistory + * @property {string|null} [clusterUuid] Cluster clusterUuid + * @property {google.cloud.dataproc.v1.IClusterMetrics|null} [metrics] Cluster metrics + */ + + /** + * Constructs a new Cluster. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a Cluster. + * @implements ICluster + * @constructor + * @param {google.cloud.dataproc.v1.ICluster=} [properties] Properties to set + */ + function Cluster(properties) { + this.labels = {}; + this.statusHistory = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Cluster projectId. + * @member {string} projectId + * @memberof google.cloud.dataproc.v1.Cluster + * @instance + */ + Cluster.prototype.projectId = ""; + + /** + * Cluster clusterName. + * @member {string} clusterName + * @memberof google.cloud.dataproc.v1.Cluster + * @instance + */ + Cluster.prototype.clusterName = ""; + + /** + * Cluster config. + * @member {google.cloud.dataproc.v1.IClusterConfig|null|undefined} config + * @memberof google.cloud.dataproc.v1.Cluster + * @instance + */ + Cluster.prototype.config = null; + + /** + * Cluster virtualClusterConfig. + * @member {google.cloud.dataproc.v1.IVirtualClusterConfig|null|undefined} virtualClusterConfig + * @memberof google.cloud.dataproc.v1.Cluster + * @instance + */ + Cluster.prototype.virtualClusterConfig = null; + + /** + * Cluster labels. + * @member {Object.} labels + * @memberof google.cloud.dataproc.v1.Cluster + * @instance + */ + Cluster.prototype.labels = $util.emptyObject; + + /** + * Cluster status. + * @member {google.cloud.dataproc.v1.IClusterStatus|null|undefined} status + * @memberof google.cloud.dataproc.v1.Cluster + * @instance + */ + Cluster.prototype.status = null; + + /** + * Cluster statusHistory. + * @member {Array.} statusHistory + * @memberof google.cloud.dataproc.v1.Cluster + * @instance + */ + Cluster.prototype.statusHistory = $util.emptyArray; + + /** + * Cluster clusterUuid. + * @member {string} clusterUuid + * @memberof google.cloud.dataproc.v1.Cluster + * @instance + */ + Cluster.prototype.clusterUuid = ""; + + /** + * Cluster metrics. + * @member {google.cloud.dataproc.v1.IClusterMetrics|null|undefined} metrics + * @memberof google.cloud.dataproc.v1.Cluster + * @instance + */ + Cluster.prototype.metrics = null; + + /** + * Creates a new Cluster instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.Cluster + * @static + * @param {google.cloud.dataproc.v1.ICluster=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.Cluster} Cluster instance + */ + Cluster.create = function create(properties) { + return new Cluster(properties); + }; + + /** + * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.dataproc.v1.Cluster.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.Cluster + * @static + * @param {google.cloud.dataproc.v1.ICluster} message Cluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cluster.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterName); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.dataproc.v1.ClusterConfig.encode(message.config, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.cloud.dataproc.v1.ClusterStatus.encode(message.status, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clusterUuid != null && Object.hasOwnProperty.call(message, "clusterUuid")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.clusterUuid); + if (message.statusHistory != null && message.statusHistory.length) + for (var i = 0; i < message.statusHistory.length; ++i) + $root.google.cloud.dataproc.v1.ClusterStatus.encode(message.statusHistory[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.metrics != null && Object.hasOwnProperty.call(message, "metrics")) + $root.google.cloud.dataproc.v1.ClusterMetrics.encode(message.metrics, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.virtualClusterConfig != null && Object.hasOwnProperty.call(message, "virtualClusterConfig")) + $root.google.cloud.dataproc.v1.VirtualClusterConfig.encode(message.virtualClusterConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.Cluster.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.Cluster + * @static + * @param {google.cloud.dataproc.v1.ICluster} message Cluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cluster.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Cluster message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.Cluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.Cluster} Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cluster.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.Cluster(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.clusterName = reader.string(); + break; + } + case 3: { + message.config = $root.google.cloud.dataproc.v1.ClusterConfig.decode(reader, reader.uint32()); + break; + } + case 10: { + message.virtualClusterConfig = $root.google.cloud.dataproc.v1.VirtualClusterConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 4: { + message.status = $root.google.cloud.dataproc.v1.ClusterStatus.decode(reader, reader.uint32()); + break; + } + case 7: { + if (!(message.statusHistory && message.statusHistory.length)) + message.statusHistory = []; + message.statusHistory.push($root.google.cloud.dataproc.v1.ClusterStatus.decode(reader, reader.uint32())); + break; + } + case 6: { + message.clusterUuid = reader.string(); + break; + } + case 9: { + message.metrics = $root.google.cloud.dataproc.v1.ClusterMetrics.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Cluster message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.Cluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.Cluster} Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cluster.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Cluster message. + * @function verify + * @memberof google.cloud.dataproc.v1.Cluster + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Cluster.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + if (!$util.isString(message.clusterName)) + return "clusterName: string expected"; + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.dataproc.v1.ClusterConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.virtualClusterConfig != null && message.hasOwnProperty("virtualClusterConfig")) { + var error = $root.google.cloud.dataproc.v1.VirtualClusterConfig.verify(message.virtualClusterConfig); + if (error) + return "virtualClusterConfig." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.cloud.dataproc.v1.ClusterStatus.verify(message.status); + if (error) + return "status." + error; + } + if (message.statusHistory != null && message.hasOwnProperty("statusHistory")) { + if (!Array.isArray(message.statusHistory)) + return "statusHistory: array expected"; + for (var i = 0; i < message.statusHistory.length; ++i) { + var error = $root.google.cloud.dataproc.v1.ClusterStatus.verify(message.statusHistory[i]); + if (error) + return "statusHistory." + error; + } + } + if (message.clusterUuid != null && message.hasOwnProperty("clusterUuid")) + if (!$util.isString(message.clusterUuid)) + return "clusterUuid: string expected"; + if (message.metrics != null && message.hasOwnProperty("metrics")) { + var error = $root.google.cloud.dataproc.v1.ClusterMetrics.verify(message.metrics); + if (error) + return "metrics." + error; + } + return null; + }; + + /** + * Creates a Cluster message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.Cluster + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.Cluster} Cluster + */ + Cluster.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.Cluster) + return object; + var message = new $root.google.cloud.dataproc.v1.Cluster(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.clusterName != null) + message.clusterName = String(object.clusterName); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.dataproc.v1.Cluster.config: object expected"); + message.config = $root.google.cloud.dataproc.v1.ClusterConfig.fromObject(object.config); + } + if (object.virtualClusterConfig != null) { + if (typeof object.virtualClusterConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.Cluster.virtualClusterConfig: object expected"); + message.virtualClusterConfig = $root.google.cloud.dataproc.v1.VirtualClusterConfig.fromObject(object.virtualClusterConfig); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.dataproc.v1.Cluster.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.dataproc.v1.Cluster.status: object expected"); + message.status = $root.google.cloud.dataproc.v1.ClusterStatus.fromObject(object.status); + } + if (object.statusHistory) { + if (!Array.isArray(object.statusHistory)) + throw TypeError(".google.cloud.dataproc.v1.Cluster.statusHistory: array expected"); + message.statusHistory = []; + for (var i = 0; i < object.statusHistory.length; ++i) { + if (typeof object.statusHistory[i] !== "object") + throw TypeError(".google.cloud.dataproc.v1.Cluster.statusHistory: object expected"); + message.statusHistory[i] = $root.google.cloud.dataproc.v1.ClusterStatus.fromObject(object.statusHistory[i]); + } + } + if (object.clusterUuid != null) + message.clusterUuid = String(object.clusterUuid); + if (object.metrics != null) { + if (typeof object.metrics !== "object") + throw TypeError(".google.cloud.dataproc.v1.Cluster.metrics: object expected"); + message.metrics = $root.google.cloud.dataproc.v1.ClusterMetrics.fromObject(object.metrics); + } + return message; + }; + + /** + * Creates a plain object from a Cluster message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.Cluster + * @static + * @param {google.cloud.dataproc.v1.Cluster} message Cluster + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Cluster.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.statusHistory = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.projectId = ""; + object.clusterName = ""; + object.config = null; + object.status = null; + object.clusterUuid = ""; + object.metrics = null; + object.virtualClusterConfig = null; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + object.clusterName = message.clusterName; + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.dataproc.v1.ClusterConfig.toObject(message.config, options); + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.cloud.dataproc.v1.ClusterStatus.toObject(message.status, options); + if (message.clusterUuid != null && message.hasOwnProperty("clusterUuid")) + object.clusterUuid = message.clusterUuid; + if (message.statusHistory && message.statusHistory.length) { + object.statusHistory = []; + for (var j = 0; j < message.statusHistory.length; ++j) + object.statusHistory[j] = $root.google.cloud.dataproc.v1.ClusterStatus.toObject(message.statusHistory[j], options); + } + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.metrics != null && message.hasOwnProperty("metrics")) + object.metrics = $root.google.cloud.dataproc.v1.ClusterMetrics.toObject(message.metrics, options); + if (message.virtualClusterConfig != null && message.hasOwnProperty("virtualClusterConfig")) + object.virtualClusterConfig = $root.google.cloud.dataproc.v1.VirtualClusterConfig.toObject(message.virtualClusterConfig, options); + return object; + }; + + /** + * Converts this Cluster to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.Cluster + * @instance + * @returns {Object.} JSON object + */ + Cluster.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Cluster + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.Cluster + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Cluster.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.Cluster"; + }; + + return Cluster; + })(); + + v1.ClusterConfig = (function() { + + /** + * Properties of a ClusterConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IClusterConfig + * @property {google.cloud.dataproc.v1.ClusterConfig.ClusterType|null} [clusterType] ClusterConfig clusterType + * @property {google.cloud.dataproc.v1.ClusterConfig.ClusterTier|null} [clusterTier] ClusterConfig clusterTier + * @property {google.cloud.dataproc.v1.ClusterConfig.Engine|null} [engine] ClusterConfig engine + * @property {string|null} [configBucket] ClusterConfig configBucket + * @property {string|null} [tempBucket] ClusterConfig tempBucket + * @property {google.cloud.dataproc.v1.IGceClusterConfig|null} [gceClusterConfig] ClusterConfig gceClusterConfig + * @property {google.cloud.dataproc.v1.IInstanceGroupConfig|null} [masterConfig] ClusterConfig masterConfig + * @property {google.cloud.dataproc.v1.IInstanceGroupConfig|null} [workerConfig] ClusterConfig workerConfig + * @property {google.cloud.dataproc.v1.IInstanceGroupConfig|null} [secondaryWorkerConfig] ClusterConfig secondaryWorkerConfig + * @property {google.cloud.dataproc.v1.ISoftwareConfig|null} [softwareConfig] ClusterConfig softwareConfig + * @property {Array.|null} [initializationActions] ClusterConfig initializationActions + * @property {google.cloud.dataproc.v1.IEncryptionConfig|null} [encryptionConfig] ClusterConfig encryptionConfig + * @property {google.cloud.dataproc.v1.IAutoscalingConfig|null} [autoscalingConfig] ClusterConfig autoscalingConfig + * @property {google.cloud.dataproc.v1.ISecurityConfig|null} [securityConfig] ClusterConfig securityConfig + * @property {google.cloud.dataproc.v1.ILifecycleConfig|null} [lifecycleConfig] ClusterConfig lifecycleConfig + * @property {google.cloud.dataproc.v1.IEndpointConfig|null} [endpointConfig] ClusterConfig endpointConfig + * @property {google.cloud.dataproc.v1.IMetastoreConfig|null} [metastoreConfig] ClusterConfig metastoreConfig + * @property {google.cloud.dataproc.v1.IDataprocMetricConfig|null} [dataprocMetricConfig] ClusterConfig dataprocMetricConfig + * @property {Array.|null} [auxiliaryNodeGroups] ClusterConfig auxiliaryNodeGroups + */ + + /** + * Constructs a new ClusterConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a ClusterConfig. + * @implements IClusterConfig + * @constructor + * @param {google.cloud.dataproc.v1.IClusterConfig=} [properties] Properties to set + */ + function ClusterConfig(properties) { + this.initializationActions = []; + this.auxiliaryNodeGroups = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClusterConfig clusterType. + * @member {google.cloud.dataproc.v1.ClusterConfig.ClusterType} clusterType + * @memberof google.cloud.dataproc.v1.ClusterConfig + * @instance + */ + ClusterConfig.prototype.clusterType = 0; + + /** + * ClusterConfig clusterTier. + * @member {google.cloud.dataproc.v1.ClusterConfig.ClusterTier} clusterTier + * @memberof google.cloud.dataproc.v1.ClusterConfig + * @instance + */ + ClusterConfig.prototype.clusterTier = 0; + + /** + * ClusterConfig engine. + * @member {google.cloud.dataproc.v1.ClusterConfig.Engine} engine + * @memberof google.cloud.dataproc.v1.ClusterConfig + * @instance + */ + ClusterConfig.prototype.engine = 0; + + /** + * ClusterConfig configBucket. + * @member {string} configBucket + * @memberof google.cloud.dataproc.v1.ClusterConfig + * @instance + */ + ClusterConfig.prototype.configBucket = ""; + + /** + * ClusterConfig tempBucket. + * @member {string} tempBucket + * @memberof google.cloud.dataproc.v1.ClusterConfig + * @instance + */ + ClusterConfig.prototype.tempBucket = ""; + + /** + * ClusterConfig gceClusterConfig. + * @member {google.cloud.dataproc.v1.IGceClusterConfig|null|undefined} gceClusterConfig + * @memberof google.cloud.dataproc.v1.ClusterConfig + * @instance + */ + ClusterConfig.prototype.gceClusterConfig = null; + + /** + * ClusterConfig masterConfig. + * @member {google.cloud.dataproc.v1.IInstanceGroupConfig|null|undefined} masterConfig + * @memberof google.cloud.dataproc.v1.ClusterConfig + * @instance + */ + ClusterConfig.prototype.masterConfig = null; + + /** + * ClusterConfig workerConfig. + * @member {google.cloud.dataproc.v1.IInstanceGroupConfig|null|undefined} workerConfig + * @memberof google.cloud.dataproc.v1.ClusterConfig + * @instance + */ + ClusterConfig.prototype.workerConfig = null; + + /** + * ClusterConfig secondaryWorkerConfig. + * @member {google.cloud.dataproc.v1.IInstanceGroupConfig|null|undefined} secondaryWorkerConfig + * @memberof google.cloud.dataproc.v1.ClusterConfig + * @instance + */ + ClusterConfig.prototype.secondaryWorkerConfig = null; + + /** + * ClusterConfig softwareConfig. + * @member {google.cloud.dataproc.v1.ISoftwareConfig|null|undefined} softwareConfig + * @memberof google.cloud.dataproc.v1.ClusterConfig + * @instance + */ + ClusterConfig.prototype.softwareConfig = null; + + /** + * ClusterConfig initializationActions. + * @member {Array.} initializationActions + * @memberof google.cloud.dataproc.v1.ClusterConfig + * @instance + */ + ClusterConfig.prototype.initializationActions = $util.emptyArray; + + /** + * ClusterConfig encryptionConfig. + * @member {google.cloud.dataproc.v1.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.cloud.dataproc.v1.ClusterConfig + * @instance + */ + ClusterConfig.prototype.encryptionConfig = null; + + /** + * ClusterConfig autoscalingConfig. + * @member {google.cloud.dataproc.v1.IAutoscalingConfig|null|undefined} autoscalingConfig + * @memberof google.cloud.dataproc.v1.ClusterConfig + * @instance + */ + ClusterConfig.prototype.autoscalingConfig = null; + + /** + * ClusterConfig securityConfig. + * @member {google.cloud.dataproc.v1.ISecurityConfig|null|undefined} securityConfig + * @memberof google.cloud.dataproc.v1.ClusterConfig + * @instance + */ + ClusterConfig.prototype.securityConfig = null; + + /** + * ClusterConfig lifecycleConfig. + * @member {google.cloud.dataproc.v1.ILifecycleConfig|null|undefined} lifecycleConfig + * @memberof google.cloud.dataproc.v1.ClusterConfig + * @instance + */ + ClusterConfig.prototype.lifecycleConfig = null; + + /** + * ClusterConfig endpointConfig. + * @member {google.cloud.dataproc.v1.IEndpointConfig|null|undefined} endpointConfig + * @memberof google.cloud.dataproc.v1.ClusterConfig + * @instance + */ + ClusterConfig.prototype.endpointConfig = null; + + /** + * ClusterConfig metastoreConfig. + * @member {google.cloud.dataproc.v1.IMetastoreConfig|null|undefined} metastoreConfig + * @memberof google.cloud.dataproc.v1.ClusterConfig + * @instance + */ + ClusterConfig.prototype.metastoreConfig = null; + + /** + * ClusterConfig dataprocMetricConfig. + * @member {google.cloud.dataproc.v1.IDataprocMetricConfig|null|undefined} dataprocMetricConfig + * @memberof google.cloud.dataproc.v1.ClusterConfig + * @instance + */ + ClusterConfig.prototype.dataprocMetricConfig = null; + + /** + * ClusterConfig auxiliaryNodeGroups. + * @member {Array.} auxiliaryNodeGroups + * @memberof google.cloud.dataproc.v1.ClusterConfig + * @instance + */ + ClusterConfig.prototype.auxiliaryNodeGroups = $util.emptyArray; + + /** + * Creates a new ClusterConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.ClusterConfig + * @static + * @param {google.cloud.dataproc.v1.IClusterConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.ClusterConfig} ClusterConfig instance + */ + ClusterConfig.create = function create(properties) { + return new ClusterConfig(properties); + }; + + /** + * Encodes the specified ClusterConfig message. Does not implicitly {@link google.cloud.dataproc.v1.ClusterConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.ClusterConfig + * @static + * @param {google.cloud.dataproc.v1.IClusterConfig} message ClusterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.configBucket != null && Object.hasOwnProperty.call(message, "configBucket")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.configBucket); + if (message.tempBucket != null && Object.hasOwnProperty.call(message, "tempBucket")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tempBucket); + if (message.gceClusterConfig != null && Object.hasOwnProperty.call(message, "gceClusterConfig")) + $root.google.cloud.dataproc.v1.GceClusterConfig.encode(message.gceClusterConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.masterConfig != null && Object.hasOwnProperty.call(message, "masterConfig")) + $root.google.cloud.dataproc.v1.InstanceGroupConfig.encode(message.masterConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.workerConfig != null && Object.hasOwnProperty.call(message, "workerConfig")) + $root.google.cloud.dataproc.v1.InstanceGroupConfig.encode(message.workerConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.initializationActions != null && message.initializationActions.length) + for (var i = 0; i < message.initializationActions.length; ++i) + $root.google.cloud.dataproc.v1.NodeInitializationAction.encode(message.initializationActions[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.secondaryWorkerConfig != null && Object.hasOwnProperty.call(message, "secondaryWorkerConfig")) + $root.google.cloud.dataproc.v1.InstanceGroupConfig.encode(message.secondaryWorkerConfig, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.softwareConfig != null && Object.hasOwnProperty.call(message, "softwareConfig")) + $root.google.cloud.dataproc.v1.SoftwareConfig.encode(message.softwareConfig, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.cloud.dataproc.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.securityConfig != null && Object.hasOwnProperty.call(message, "securityConfig")) + $root.google.cloud.dataproc.v1.SecurityConfig.encode(message.securityConfig, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.lifecycleConfig != null && Object.hasOwnProperty.call(message, "lifecycleConfig")) + $root.google.cloud.dataproc.v1.LifecycleConfig.encode(message.lifecycleConfig, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.autoscalingConfig != null && Object.hasOwnProperty.call(message, "autoscalingConfig")) + $root.google.cloud.dataproc.v1.AutoscalingConfig.encode(message.autoscalingConfig, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.endpointConfig != null && Object.hasOwnProperty.call(message, "endpointConfig")) + $root.google.cloud.dataproc.v1.EndpointConfig.encode(message.endpointConfig, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.metastoreConfig != null && Object.hasOwnProperty.call(message, "metastoreConfig")) + $root.google.cloud.dataproc.v1.MetastoreConfig.encode(message.metastoreConfig, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.dataprocMetricConfig != null && Object.hasOwnProperty.call(message, "dataprocMetricConfig")) + $root.google.cloud.dataproc.v1.DataprocMetricConfig.encode(message.dataprocMetricConfig, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.auxiliaryNodeGroups != null && message.auxiliaryNodeGroups.length) + for (var i = 0; i < message.auxiliaryNodeGroups.length; ++i) + $root.google.cloud.dataproc.v1.AuxiliaryNodeGroup.encode(message.auxiliaryNodeGroups[i], writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.clusterType != null && Object.hasOwnProperty.call(message, "clusterType")) + writer.uint32(/* id 27, wireType 0 =*/216).int32(message.clusterType); + if (message.clusterTier != null && Object.hasOwnProperty.call(message, "clusterTier")) + writer.uint32(/* id 29, wireType 0 =*/232).int32(message.clusterTier); + if (message.engine != null && Object.hasOwnProperty.call(message, "engine")) + writer.uint32(/* id 30, wireType 0 =*/240).int32(message.engine); + return writer; + }; + + /** + * Encodes the specified ClusterConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ClusterConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.ClusterConfig + * @static + * @param {google.cloud.dataproc.v1.IClusterConfig} message ClusterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClusterConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.ClusterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.ClusterConfig} ClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ClusterConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 27: { + message.clusterType = reader.int32(); + break; + } + case 29: { + message.clusterTier = reader.int32(); + break; + } + case 30: { + message.engine = reader.int32(); + break; + } + case 1: { + message.configBucket = reader.string(); + break; + } + case 2: { + message.tempBucket = reader.string(); + break; + } + case 8: { + message.gceClusterConfig = $root.google.cloud.dataproc.v1.GceClusterConfig.decode(reader, reader.uint32()); + break; + } + case 9: { + message.masterConfig = $root.google.cloud.dataproc.v1.InstanceGroupConfig.decode(reader, reader.uint32()); + break; + } + case 10: { + message.workerConfig = $root.google.cloud.dataproc.v1.InstanceGroupConfig.decode(reader, reader.uint32()); + break; + } + case 12: { + message.secondaryWorkerConfig = $root.google.cloud.dataproc.v1.InstanceGroupConfig.decode(reader, reader.uint32()); + break; + } + case 13: { + message.softwareConfig = $root.google.cloud.dataproc.v1.SoftwareConfig.decode(reader, reader.uint32()); + break; + } + case 11: { + if (!(message.initializationActions && message.initializationActions.length)) + message.initializationActions = []; + message.initializationActions.push($root.google.cloud.dataproc.v1.NodeInitializationAction.decode(reader, reader.uint32())); + break; + } + case 15: { + message.encryptionConfig = $root.google.cloud.dataproc.v1.EncryptionConfig.decode(reader, reader.uint32()); + break; + } + case 18: { + message.autoscalingConfig = $root.google.cloud.dataproc.v1.AutoscalingConfig.decode(reader, reader.uint32()); + break; + } + case 16: { + message.securityConfig = $root.google.cloud.dataproc.v1.SecurityConfig.decode(reader, reader.uint32()); + break; + } + case 17: { + message.lifecycleConfig = $root.google.cloud.dataproc.v1.LifecycleConfig.decode(reader, reader.uint32()); + break; + } + case 19: { + message.endpointConfig = $root.google.cloud.dataproc.v1.EndpointConfig.decode(reader, reader.uint32()); + break; + } + case 20: { + message.metastoreConfig = $root.google.cloud.dataproc.v1.MetastoreConfig.decode(reader, reader.uint32()); + break; + } + case 23: { + message.dataprocMetricConfig = $root.google.cloud.dataproc.v1.DataprocMetricConfig.decode(reader, reader.uint32()); + break; + } + case 25: { + if (!(message.auxiliaryNodeGroups && message.auxiliaryNodeGroups.length)) + message.auxiliaryNodeGroups = []; + message.auxiliaryNodeGroups.push($root.google.cloud.dataproc.v1.AuxiliaryNodeGroup.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClusterConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.ClusterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.ClusterConfig} ClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClusterConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.ClusterConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClusterConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clusterType != null && message.hasOwnProperty("clusterType")) + switch (message.clusterType) { + default: + return "clusterType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.clusterTier != null && message.hasOwnProperty("clusterTier")) + switch (message.clusterTier) { + default: + return "clusterTier: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.engine != null && message.hasOwnProperty("engine")) + switch (message.engine) { + default: + return "engine: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.configBucket != null && message.hasOwnProperty("configBucket")) + if (!$util.isString(message.configBucket)) + return "configBucket: string expected"; + if (message.tempBucket != null && message.hasOwnProperty("tempBucket")) + if (!$util.isString(message.tempBucket)) + return "tempBucket: string expected"; + if (message.gceClusterConfig != null && message.hasOwnProperty("gceClusterConfig")) { + var error = $root.google.cloud.dataproc.v1.GceClusterConfig.verify(message.gceClusterConfig); + if (error) + return "gceClusterConfig." + error; + } + if (message.masterConfig != null && message.hasOwnProperty("masterConfig")) { + var error = $root.google.cloud.dataproc.v1.InstanceGroupConfig.verify(message.masterConfig); + if (error) + return "masterConfig." + error; + } + if (message.workerConfig != null && message.hasOwnProperty("workerConfig")) { + var error = $root.google.cloud.dataproc.v1.InstanceGroupConfig.verify(message.workerConfig); + if (error) + return "workerConfig." + error; + } + if (message.secondaryWorkerConfig != null && message.hasOwnProperty("secondaryWorkerConfig")) { + var error = $root.google.cloud.dataproc.v1.InstanceGroupConfig.verify(message.secondaryWorkerConfig); + if (error) + return "secondaryWorkerConfig." + error; + } + if (message.softwareConfig != null && message.hasOwnProperty("softwareConfig")) { + var error = $root.google.cloud.dataproc.v1.SoftwareConfig.verify(message.softwareConfig); + if (error) + return "softwareConfig." + error; + } + if (message.initializationActions != null && message.hasOwnProperty("initializationActions")) { + if (!Array.isArray(message.initializationActions)) + return "initializationActions: array expected"; + for (var i = 0; i < message.initializationActions.length; ++i) { + var error = $root.google.cloud.dataproc.v1.NodeInitializationAction.verify(message.initializationActions[i]); + if (error) + return "initializationActions." + error; + } + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.cloud.dataproc.v1.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) { + var error = $root.google.cloud.dataproc.v1.AutoscalingConfig.verify(message.autoscalingConfig); + if (error) + return "autoscalingConfig." + error; + } + if (message.securityConfig != null && message.hasOwnProperty("securityConfig")) { + var error = $root.google.cloud.dataproc.v1.SecurityConfig.verify(message.securityConfig); + if (error) + return "securityConfig." + error; + } + if (message.lifecycleConfig != null && message.hasOwnProperty("lifecycleConfig")) { + var error = $root.google.cloud.dataproc.v1.LifecycleConfig.verify(message.lifecycleConfig); + if (error) + return "lifecycleConfig." + error; + } + if (message.endpointConfig != null && message.hasOwnProperty("endpointConfig")) { + var error = $root.google.cloud.dataproc.v1.EndpointConfig.verify(message.endpointConfig); + if (error) + return "endpointConfig." + error; + } + if (message.metastoreConfig != null && message.hasOwnProperty("metastoreConfig")) { + var error = $root.google.cloud.dataproc.v1.MetastoreConfig.verify(message.metastoreConfig); + if (error) + return "metastoreConfig." + error; + } + if (message.dataprocMetricConfig != null && message.hasOwnProperty("dataprocMetricConfig")) { + var error = $root.google.cloud.dataproc.v1.DataprocMetricConfig.verify(message.dataprocMetricConfig); + if (error) + return "dataprocMetricConfig." + error; + } + if (message.auxiliaryNodeGroups != null && message.hasOwnProperty("auxiliaryNodeGroups")) { + if (!Array.isArray(message.auxiliaryNodeGroups)) + return "auxiliaryNodeGroups: array expected"; + for (var i = 0; i < message.auxiliaryNodeGroups.length; ++i) { + var error = $root.google.cloud.dataproc.v1.AuxiliaryNodeGroup.verify(message.auxiliaryNodeGroups[i]); + if (error) + return "auxiliaryNodeGroups." + error; + } + } + return null; + }; + + /** + * Creates a ClusterConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.ClusterConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.ClusterConfig} ClusterConfig + */ + ClusterConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.ClusterConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.ClusterConfig(); + switch (object.clusterType) { + default: + if (typeof object.clusterType === "number") { + message.clusterType = object.clusterType; + break; + } + break; + case "CLUSTER_TYPE_UNSPECIFIED": + case 0: + message.clusterType = 0; + break; + case "STANDARD": + case 1: + message.clusterType = 1; + break; + case "SINGLE_NODE": + case 2: + message.clusterType = 2; + break; + case "ZERO_SCALE": + case 3: + message.clusterType = 3; + break; + } + switch (object.clusterTier) { + default: + if (typeof object.clusterTier === "number") { + message.clusterTier = object.clusterTier; + break; + } + break; + case "CLUSTER_TIER_UNSPECIFIED": + case 0: + message.clusterTier = 0; + break; + case "CLUSTER_TIER_STANDARD": + case 1: + message.clusterTier = 1; + break; + case "CLUSTER_TIER_PREMIUM": + case 2: + message.clusterTier = 2; + break; + } + switch (object.engine) { + default: + if (typeof object.engine === "number") { + message.engine = object.engine; + break; + } + break; + case "ENGINE_UNSPECIFIED": + case 0: + message.engine = 0; + break; + case "DEFAULT": + case 1: + message.engine = 1; + break; + case "LIGHTNING": + case 2: + message.engine = 2; + break; + } + if (object.configBucket != null) + message.configBucket = String(object.configBucket); + if (object.tempBucket != null) + message.tempBucket = String(object.tempBucket); + if (object.gceClusterConfig != null) { + if (typeof object.gceClusterConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.ClusterConfig.gceClusterConfig: object expected"); + message.gceClusterConfig = $root.google.cloud.dataproc.v1.GceClusterConfig.fromObject(object.gceClusterConfig); + } + if (object.masterConfig != null) { + if (typeof object.masterConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.ClusterConfig.masterConfig: object expected"); + message.masterConfig = $root.google.cloud.dataproc.v1.InstanceGroupConfig.fromObject(object.masterConfig); + } + if (object.workerConfig != null) { + if (typeof object.workerConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.ClusterConfig.workerConfig: object expected"); + message.workerConfig = $root.google.cloud.dataproc.v1.InstanceGroupConfig.fromObject(object.workerConfig); + } + if (object.secondaryWorkerConfig != null) { + if (typeof object.secondaryWorkerConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.ClusterConfig.secondaryWorkerConfig: object expected"); + message.secondaryWorkerConfig = $root.google.cloud.dataproc.v1.InstanceGroupConfig.fromObject(object.secondaryWorkerConfig); + } + if (object.softwareConfig != null) { + if (typeof object.softwareConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.ClusterConfig.softwareConfig: object expected"); + message.softwareConfig = $root.google.cloud.dataproc.v1.SoftwareConfig.fromObject(object.softwareConfig); + } + if (object.initializationActions) { + if (!Array.isArray(object.initializationActions)) + throw TypeError(".google.cloud.dataproc.v1.ClusterConfig.initializationActions: array expected"); + message.initializationActions = []; + for (var i = 0; i < object.initializationActions.length; ++i) { + if (typeof object.initializationActions[i] !== "object") + throw TypeError(".google.cloud.dataproc.v1.ClusterConfig.initializationActions: object expected"); + message.initializationActions[i] = $root.google.cloud.dataproc.v1.NodeInitializationAction.fromObject(object.initializationActions[i]); + } + } + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.ClusterConfig.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.cloud.dataproc.v1.EncryptionConfig.fromObject(object.encryptionConfig); + } + if (object.autoscalingConfig != null) { + if (typeof object.autoscalingConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.ClusterConfig.autoscalingConfig: object expected"); + message.autoscalingConfig = $root.google.cloud.dataproc.v1.AutoscalingConfig.fromObject(object.autoscalingConfig); + } + if (object.securityConfig != null) { + if (typeof object.securityConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.ClusterConfig.securityConfig: object expected"); + message.securityConfig = $root.google.cloud.dataproc.v1.SecurityConfig.fromObject(object.securityConfig); + } + if (object.lifecycleConfig != null) { + if (typeof object.lifecycleConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.ClusterConfig.lifecycleConfig: object expected"); + message.lifecycleConfig = $root.google.cloud.dataproc.v1.LifecycleConfig.fromObject(object.lifecycleConfig); + } + if (object.endpointConfig != null) { + if (typeof object.endpointConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.ClusterConfig.endpointConfig: object expected"); + message.endpointConfig = $root.google.cloud.dataproc.v1.EndpointConfig.fromObject(object.endpointConfig); + } + if (object.metastoreConfig != null) { + if (typeof object.metastoreConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.ClusterConfig.metastoreConfig: object expected"); + message.metastoreConfig = $root.google.cloud.dataproc.v1.MetastoreConfig.fromObject(object.metastoreConfig); + } + if (object.dataprocMetricConfig != null) { + if (typeof object.dataprocMetricConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.ClusterConfig.dataprocMetricConfig: object expected"); + message.dataprocMetricConfig = $root.google.cloud.dataproc.v1.DataprocMetricConfig.fromObject(object.dataprocMetricConfig); + } + if (object.auxiliaryNodeGroups) { + if (!Array.isArray(object.auxiliaryNodeGroups)) + throw TypeError(".google.cloud.dataproc.v1.ClusterConfig.auxiliaryNodeGroups: array expected"); + message.auxiliaryNodeGroups = []; + for (var i = 0; i < object.auxiliaryNodeGroups.length; ++i) { + if (typeof object.auxiliaryNodeGroups[i] !== "object") + throw TypeError(".google.cloud.dataproc.v1.ClusterConfig.auxiliaryNodeGroups: object expected"); + message.auxiliaryNodeGroups[i] = $root.google.cloud.dataproc.v1.AuxiliaryNodeGroup.fromObject(object.auxiliaryNodeGroups[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ClusterConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.ClusterConfig + * @static + * @param {google.cloud.dataproc.v1.ClusterConfig} message ClusterConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClusterConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.initializationActions = []; + object.auxiliaryNodeGroups = []; + } + if (options.defaults) { + object.configBucket = ""; + object.tempBucket = ""; + object.gceClusterConfig = null; + object.masterConfig = null; + object.workerConfig = null; + object.secondaryWorkerConfig = null; + object.softwareConfig = null; + object.encryptionConfig = null; + object.securityConfig = null; + object.lifecycleConfig = null; + object.autoscalingConfig = null; + object.endpointConfig = null; + object.metastoreConfig = null; + object.dataprocMetricConfig = null; + object.clusterType = options.enums === String ? "CLUSTER_TYPE_UNSPECIFIED" : 0; + object.clusterTier = options.enums === String ? "CLUSTER_TIER_UNSPECIFIED" : 0; + object.engine = options.enums === String ? "ENGINE_UNSPECIFIED" : 0; + } + if (message.configBucket != null && message.hasOwnProperty("configBucket")) + object.configBucket = message.configBucket; + if (message.tempBucket != null && message.hasOwnProperty("tempBucket")) + object.tempBucket = message.tempBucket; + if (message.gceClusterConfig != null && message.hasOwnProperty("gceClusterConfig")) + object.gceClusterConfig = $root.google.cloud.dataproc.v1.GceClusterConfig.toObject(message.gceClusterConfig, options); + if (message.masterConfig != null && message.hasOwnProperty("masterConfig")) + object.masterConfig = $root.google.cloud.dataproc.v1.InstanceGroupConfig.toObject(message.masterConfig, options); + if (message.workerConfig != null && message.hasOwnProperty("workerConfig")) + object.workerConfig = $root.google.cloud.dataproc.v1.InstanceGroupConfig.toObject(message.workerConfig, options); + if (message.initializationActions && message.initializationActions.length) { + object.initializationActions = []; + for (var j = 0; j < message.initializationActions.length; ++j) + object.initializationActions[j] = $root.google.cloud.dataproc.v1.NodeInitializationAction.toObject(message.initializationActions[j], options); + } + if (message.secondaryWorkerConfig != null && message.hasOwnProperty("secondaryWorkerConfig")) + object.secondaryWorkerConfig = $root.google.cloud.dataproc.v1.InstanceGroupConfig.toObject(message.secondaryWorkerConfig, options); + if (message.softwareConfig != null && message.hasOwnProperty("softwareConfig")) + object.softwareConfig = $root.google.cloud.dataproc.v1.SoftwareConfig.toObject(message.softwareConfig, options); + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.cloud.dataproc.v1.EncryptionConfig.toObject(message.encryptionConfig, options); + if (message.securityConfig != null && message.hasOwnProperty("securityConfig")) + object.securityConfig = $root.google.cloud.dataproc.v1.SecurityConfig.toObject(message.securityConfig, options); + if (message.lifecycleConfig != null && message.hasOwnProperty("lifecycleConfig")) + object.lifecycleConfig = $root.google.cloud.dataproc.v1.LifecycleConfig.toObject(message.lifecycleConfig, options); + if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) + object.autoscalingConfig = $root.google.cloud.dataproc.v1.AutoscalingConfig.toObject(message.autoscalingConfig, options); + if (message.endpointConfig != null && message.hasOwnProperty("endpointConfig")) + object.endpointConfig = $root.google.cloud.dataproc.v1.EndpointConfig.toObject(message.endpointConfig, options); + if (message.metastoreConfig != null && message.hasOwnProperty("metastoreConfig")) + object.metastoreConfig = $root.google.cloud.dataproc.v1.MetastoreConfig.toObject(message.metastoreConfig, options); + if (message.dataprocMetricConfig != null && message.hasOwnProperty("dataprocMetricConfig")) + object.dataprocMetricConfig = $root.google.cloud.dataproc.v1.DataprocMetricConfig.toObject(message.dataprocMetricConfig, options); + if (message.auxiliaryNodeGroups && message.auxiliaryNodeGroups.length) { + object.auxiliaryNodeGroups = []; + for (var j = 0; j < message.auxiliaryNodeGroups.length; ++j) + object.auxiliaryNodeGroups[j] = $root.google.cloud.dataproc.v1.AuxiliaryNodeGroup.toObject(message.auxiliaryNodeGroups[j], options); + } + if (message.clusterType != null && message.hasOwnProperty("clusterType")) + object.clusterType = options.enums === String ? $root.google.cloud.dataproc.v1.ClusterConfig.ClusterType[message.clusterType] === undefined ? message.clusterType : $root.google.cloud.dataproc.v1.ClusterConfig.ClusterType[message.clusterType] : message.clusterType; + if (message.clusterTier != null && message.hasOwnProperty("clusterTier")) + object.clusterTier = options.enums === String ? $root.google.cloud.dataproc.v1.ClusterConfig.ClusterTier[message.clusterTier] === undefined ? message.clusterTier : $root.google.cloud.dataproc.v1.ClusterConfig.ClusterTier[message.clusterTier] : message.clusterTier; + if (message.engine != null && message.hasOwnProperty("engine")) + object.engine = options.enums === String ? $root.google.cloud.dataproc.v1.ClusterConfig.Engine[message.engine] === undefined ? message.engine : $root.google.cloud.dataproc.v1.ClusterConfig.Engine[message.engine] : message.engine; + return object; + }; + + /** + * Converts this ClusterConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.ClusterConfig + * @instance + * @returns {Object.} JSON object + */ + ClusterConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClusterConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.ClusterConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClusterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.ClusterConfig"; + }; + + /** + * ClusterType enum. + * @name google.cloud.dataproc.v1.ClusterConfig.ClusterType + * @enum {number} + * @property {number} CLUSTER_TYPE_UNSPECIFIED=0 CLUSTER_TYPE_UNSPECIFIED value + * @property {number} STANDARD=1 STANDARD value + * @property {number} SINGLE_NODE=2 SINGLE_NODE value + * @property {number} ZERO_SCALE=3 ZERO_SCALE value + */ + ClusterConfig.ClusterType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLUSTER_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STANDARD"] = 1; + values[valuesById[2] = "SINGLE_NODE"] = 2; + values[valuesById[3] = "ZERO_SCALE"] = 3; + return values; + })(); + + /** + * ClusterTier enum. + * @name google.cloud.dataproc.v1.ClusterConfig.ClusterTier + * @enum {number} + * @property {number} CLUSTER_TIER_UNSPECIFIED=0 CLUSTER_TIER_UNSPECIFIED value + * @property {number} CLUSTER_TIER_STANDARD=1 CLUSTER_TIER_STANDARD value + * @property {number} CLUSTER_TIER_PREMIUM=2 CLUSTER_TIER_PREMIUM value + */ + ClusterConfig.ClusterTier = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLUSTER_TIER_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLUSTER_TIER_STANDARD"] = 1; + values[valuesById[2] = "CLUSTER_TIER_PREMIUM"] = 2; + return values; + })(); + + /** + * Engine enum. + * @name google.cloud.dataproc.v1.ClusterConfig.Engine + * @enum {number} + * @property {number} ENGINE_UNSPECIFIED=0 ENGINE_UNSPECIFIED value + * @property {number} DEFAULT=1 DEFAULT value + * @property {number} LIGHTNING=2 LIGHTNING value + */ + ClusterConfig.Engine = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENGINE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DEFAULT"] = 1; + values[valuesById[2] = "LIGHTNING"] = 2; + return values; + })(); + + return ClusterConfig; + })(); + + v1.VirtualClusterConfig = (function() { + + /** + * Properties of a VirtualClusterConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IVirtualClusterConfig + * @property {string|null} [stagingBucket] VirtualClusterConfig stagingBucket + * @property {google.cloud.dataproc.v1.IKubernetesClusterConfig|null} [kubernetesClusterConfig] VirtualClusterConfig kubernetesClusterConfig + * @property {google.cloud.dataproc.v1.IAuxiliaryServicesConfig|null} [auxiliaryServicesConfig] VirtualClusterConfig auxiliaryServicesConfig + */ + + /** + * Constructs a new VirtualClusterConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a VirtualClusterConfig. + * @implements IVirtualClusterConfig + * @constructor + * @param {google.cloud.dataproc.v1.IVirtualClusterConfig=} [properties] Properties to set + */ + function VirtualClusterConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VirtualClusterConfig stagingBucket. + * @member {string} stagingBucket + * @memberof google.cloud.dataproc.v1.VirtualClusterConfig + * @instance + */ + VirtualClusterConfig.prototype.stagingBucket = ""; + + /** + * VirtualClusterConfig kubernetesClusterConfig. + * @member {google.cloud.dataproc.v1.IKubernetesClusterConfig|null|undefined} kubernetesClusterConfig + * @memberof google.cloud.dataproc.v1.VirtualClusterConfig + * @instance + */ + VirtualClusterConfig.prototype.kubernetesClusterConfig = null; + + /** + * VirtualClusterConfig auxiliaryServicesConfig. + * @member {google.cloud.dataproc.v1.IAuxiliaryServicesConfig|null|undefined} auxiliaryServicesConfig + * @memberof google.cloud.dataproc.v1.VirtualClusterConfig + * @instance + */ + VirtualClusterConfig.prototype.auxiliaryServicesConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * VirtualClusterConfig infrastructureConfig. + * @member {"kubernetesClusterConfig"|undefined} infrastructureConfig + * @memberof google.cloud.dataproc.v1.VirtualClusterConfig + * @instance + */ + Object.defineProperty(VirtualClusterConfig.prototype, "infrastructureConfig", { + get: $util.oneOfGetter($oneOfFields = ["kubernetesClusterConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new VirtualClusterConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.VirtualClusterConfig + * @static + * @param {google.cloud.dataproc.v1.IVirtualClusterConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.VirtualClusterConfig} VirtualClusterConfig instance + */ + VirtualClusterConfig.create = function create(properties) { + return new VirtualClusterConfig(properties); + }; + + /** + * Encodes the specified VirtualClusterConfig message. Does not implicitly {@link google.cloud.dataproc.v1.VirtualClusterConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.VirtualClusterConfig + * @static + * @param {google.cloud.dataproc.v1.IVirtualClusterConfig} message VirtualClusterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VirtualClusterConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stagingBucket != null && Object.hasOwnProperty.call(message, "stagingBucket")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.stagingBucket); + if (message.kubernetesClusterConfig != null && Object.hasOwnProperty.call(message, "kubernetesClusterConfig")) + $root.google.cloud.dataproc.v1.KubernetesClusterConfig.encode(message.kubernetesClusterConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.auxiliaryServicesConfig != null && Object.hasOwnProperty.call(message, "auxiliaryServicesConfig")) + $root.google.cloud.dataproc.v1.AuxiliaryServicesConfig.encode(message.auxiliaryServicesConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VirtualClusterConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.VirtualClusterConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.VirtualClusterConfig + * @static + * @param {google.cloud.dataproc.v1.IVirtualClusterConfig} message VirtualClusterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VirtualClusterConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VirtualClusterConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.VirtualClusterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.VirtualClusterConfig} VirtualClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VirtualClusterConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.VirtualClusterConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.stagingBucket = reader.string(); + break; + } + case 6: { + message.kubernetesClusterConfig = $root.google.cloud.dataproc.v1.KubernetesClusterConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.auxiliaryServicesConfig = $root.google.cloud.dataproc.v1.AuxiliaryServicesConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VirtualClusterConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.VirtualClusterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.VirtualClusterConfig} VirtualClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VirtualClusterConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VirtualClusterConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.VirtualClusterConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VirtualClusterConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.stagingBucket != null && message.hasOwnProperty("stagingBucket")) + if (!$util.isString(message.stagingBucket)) + return "stagingBucket: string expected"; + if (message.kubernetesClusterConfig != null && message.hasOwnProperty("kubernetesClusterConfig")) { + properties.infrastructureConfig = 1; + { + var error = $root.google.cloud.dataproc.v1.KubernetesClusterConfig.verify(message.kubernetesClusterConfig); + if (error) + return "kubernetesClusterConfig." + error; + } + } + if (message.auxiliaryServicesConfig != null && message.hasOwnProperty("auxiliaryServicesConfig")) { + var error = $root.google.cloud.dataproc.v1.AuxiliaryServicesConfig.verify(message.auxiliaryServicesConfig); + if (error) + return "auxiliaryServicesConfig." + error; + } + return null; + }; + + /** + * Creates a VirtualClusterConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.VirtualClusterConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.VirtualClusterConfig} VirtualClusterConfig + */ + VirtualClusterConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.VirtualClusterConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.VirtualClusterConfig(); + if (object.stagingBucket != null) + message.stagingBucket = String(object.stagingBucket); + if (object.kubernetesClusterConfig != null) { + if (typeof object.kubernetesClusterConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.VirtualClusterConfig.kubernetesClusterConfig: object expected"); + message.kubernetesClusterConfig = $root.google.cloud.dataproc.v1.KubernetesClusterConfig.fromObject(object.kubernetesClusterConfig); + } + if (object.auxiliaryServicesConfig != null) { + if (typeof object.auxiliaryServicesConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.VirtualClusterConfig.auxiliaryServicesConfig: object expected"); + message.auxiliaryServicesConfig = $root.google.cloud.dataproc.v1.AuxiliaryServicesConfig.fromObject(object.auxiliaryServicesConfig); + } + return message; + }; + + /** + * Creates a plain object from a VirtualClusterConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.VirtualClusterConfig + * @static + * @param {google.cloud.dataproc.v1.VirtualClusterConfig} message VirtualClusterConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VirtualClusterConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.stagingBucket = ""; + object.auxiliaryServicesConfig = null; + } + if (message.stagingBucket != null && message.hasOwnProperty("stagingBucket")) + object.stagingBucket = message.stagingBucket; + if (message.kubernetesClusterConfig != null && message.hasOwnProperty("kubernetesClusterConfig")) { + object.kubernetesClusterConfig = $root.google.cloud.dataproc.v1.KubernetesClusterConfig.toObject(message.kubernetesClusterConfig, options); + if (options.oneofs) + object.infrastructureConfig = "kubernetesClusterConfig"; + } + if (message.auxiliaryServicesConfig != null && message.hasOwnProperty("auxiliaryServicesConfig")) + object.auxiliaryServicesConfig = $root.google.cloud.dataproc.v1.AuxiliaryServicesConfig.toObject(message.auxiliaryServicesConfig, options); + return object; + }; + + /** + * Converts this VirtualClusterConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.VirtualClusterConfig + * @instance + * @returns {Object.} JSON object + */ + VirtualClusterConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VirtualClusterConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.VirtualClusterConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VirtualClusterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.VirtualClusterConfig"; + }; + + return VirtualClusterConfig; + })(); + + v1.AuxiliaryServicesConfig = (function() { + + /** + * Properties of an AuxiliaryServicesConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IAuxiliaryServicesConfig + * @property {google.cloud.dataproc.v1.IMetastoreConfig|null} [metastoreConfig] AuxiliaryServicesConfig metastoreConfig + * @property {google.cloud.dataproc.v1.ISparkHistoryServerConfig|null} [sparkHistoryServerConfig] AuxiliaryServicesConfig sparkHistoryServerConfig + */ + + /** + * Constructs a new AuxiliaryServicesConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents an AuxiliaryServicesConfig. + * @implements IAuxiliaryServicesConfig + * @constructor + * @param {google.cloud.dataproc.v1.IAuxiliaryServicesConfig=} [properties] Properties to set + */ + function AuxiliaryServicesConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuxiliaryServicesConfig metastoreConfig. + * @member {google.cloud.dataproc.v1.IMetastoreConfig|null|undefined} metastoreConfig + * @memberof google.cloud.dataproc.v1.AuxiliaryServicesConfig + * @instance + */ + AuxiliaryServicesConfig.prototype.metastoreConfig = null; + + /** + * AuxiliaryServicesConfig sparkHistoryServerConfig. + * @member {google.cloud.dataproc.v1.ISparkHistoryServerConfig|null|undefined} sparkHistoryServerConfig + * @memberof google.cloud.dataproc.v1.AuxiliaryServicesConfig + * @instance + */ + AuxiliaryServicesConfig.prototype.sparkHistoryServerConfig = null; + + /** + * Creates a new AuxiliaryServicesConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.AuxiliaryServicesConfig + * @static + * @param {google.cloud.dataproc.v1.IAuxiliaryServicesConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.AuxiliaryServicesConfig} AuxiliaryServicesConfig instance + */ + AuxiliaryServicesConfig.create = function create(properties) { + return new AuxiliaryServicesConfig(properties); + }; + + /** + * Encodes the specified AuxiliaryServicesConfig message. Does not implicitly {@link google.cloud.dataproc.v1.AuxiliaryServicesConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.AuxiliaryServicesConfig + * @static + * @param {google.cloud.dataproc.v1.IAuxiliaryServicesConfig} message AuxiliaryServicesConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuxiliaryServicesConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metastoreConfig != null && Object.hasOwnProperty.call(message, "metastoreConfig")) + $root.google.cloud.dataproc.v1.MetastoreConfig.encode(message.metastoreConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.sparkHistoryServerConfig != null && Object.hasOwnProperty.call(message, "sparkHistoryServerConfig")) + $root.google.cloud.dataproc.v1.SparkHistoryServerConfig.encode(message.sparkHistoryServerConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AuxiliaryServicesConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.AuxiliaryServicesConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.AuxiliaryServicesConfig + * @static + * @param {google.cloud.dataproc.v1.IAuxiliaryServicesConfig} message AuxiliaryServicesConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuxiliaryServicesConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuxiliaryServicesConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.AuxiliaryServicesConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.AuxiliaryServicesConfig} AuxiliaryServicesConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuxiliaryServicesConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.AuxiliaryServicesConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.metastoreConfig = $root.google.cloud.dataproc.v1.MetastoreConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.sparkHistoryServerConfig = $root.google.cloud.dataproc.v1.SparkHistoryServerConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuxiliaryServicesConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.AuxiliaryServicesConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.AuxiliaryServicesConfig} AuxiliaryServicesConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuxiliaryServicesConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuxiliaryServicesConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.AuxiliaryServicesConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuxiliaryServicesConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metastoreConfig != null && message.hasOwnProperty("metastoreConfig")) { + var error = $root.google.cloud.dataproc.v1.MetastoreConfig.verify(message.metastoreConfig); + if (error) + return "metastoreConfig." + error; + } + if (message.sparkHistoryServerConfig != null && message.hasOwnProperty("sparkHistoryServerConfig")) { + var error = $root.google.cloud.dataproc.v1.SparkHistoryServerConfig.verify(message.sparkHistoryServerConfig); + if (error) + return "sparkHistoryServerConfig." + error; + } + return null; + }; + + /** + * Creates an AuxiliaryServicesConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.AuxiliaryServicesConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.AuxiliaryServicesConfig} AuxiliaryServicesConfig + */ + AuxiliaryServicesConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.AuxiliaryServicesConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.AuxiliaryServicesConfig(); + if (object.metastoreConfig != null) { + if (typeof object.metastoreConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.AuxiliaryServicesConfig.metastoreConfig: object expected"); + message.metastoreConfig = $root.google.cloud.dataproc.v1.MetastoreConfig.fromObject(object.metastoreConfig); + } + if (object.sparkHistoryServerConfig != null) { + if (typeof object.sparkHistoryServerConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.AuxiliaryServicesConfig.sparkHistoryServerConfig: object expected"); + message.sparkHistoryServerConfig = $root.google.cloud.dataproc.v1.SparkHistoryServerConfig.fromObject(object.sparkHistoryServerConfig); + } + return message; + }; + + /** + * Creates a plain object from an AuxiliaryServicesConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.AuxiliaryServicesConfig + * @static + * @param {google.cloud.dataproc.v1.AuxiliaryServicesConfig} message AuxiliaryServicesConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuxiliaryServicesConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.metastoreConfig = null; + object.sparkHistoryServerConfig = null; + } + if (message.metastoreConfig != null && message.hasOwnProperty("metastoreConfig")) + object.metastoreConfig = $root.google.cloud.dataproc.v1.MetastoreConfig.toObject(message.metastoreConfig, options); + if (message.sparkHistoryServerConfig != null && message.hasOwnProperty("sparkHistoryServerConfig")) + object.sparkHistoryServerConfig = $root.google.cloud.dataproc.v1.SparkHistoryServerConfig.toObject(message.sparkHistoryServerConfig, options); + return object; + }; + + /** + * Converts this AuxiliaryServicesConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.AuxiliaryServicesConfig + * @instance + * @returns {Object.} JSON object + */ + AuxiliaryServicesConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuxiliaryServicesConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.AuxiliaryServicesConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuxiliaryServicesConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.AuxiliaryServicesConfig"; + }; + + return AuxiliaryServicesConfig; + })(); + + v1.EndpointConfig = (function() { + + /** + * Properties of an EndpointConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IEndpointConfig + * @property {Object.|null} [httpPorts] EndpointConfig httpPorts + * @property {boolean|null} [enableHttpPortAccess] EndpointConfig enableHttpPortAccess + */ + + /** + * Constructs a new EndpointConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents an EndpointConfig. + * @implements IEndpointConfig + * @constructor + * @param {google.cloud.dataproc.v1.IEndpointConfig=} [properties] Properties to set + */ + function EndpointConfig(properties) { + this.httpPorts = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EndpointConfig httpPorts. + * @member {Object.} httpPorts + * @memberof google.cloud.dataproc.v1.EndpointConfig + * @instance + */ + EndpointConfig.prototype.httpPorts = $util.emptyObject; + + /** + * EndpointConfig enableHttpPortAccess. + * @member {boolean} enableHttpPortAccess + * @memberof google.cloud.dataproc.v1.EndpointConfig + * @instance + */ + EndpointConfig.prototype.enableHttpPortAccess = false; + + /** + * Creates a new EndpointConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.EndpointConfig + * @static + * @param {google.cloud.dataproc.v1.IEndpointConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.EndpointConfig} EndpointConfig instance + */ + EndpointConfig.create = function create(properties) { + return new EndpointConfig(properties); + }; + + /** + * Encodes the specified EndpointConfig message. Does not implicitly {@link google.cloud.dataproc.v1.EndpointConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.EndpointConfig + * @static + * @param {google.cloud.dataproc.v1.IEndpointConfig} message EndpointConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndpointConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.httpPorts != null && Object.hasOwnProperty.call(message, "httpPorts")) + for (var keys = Object.keys(message.httpPorts), 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.httpPorts[keys[i]]).ldelim(); + if (message.enableHttpPortAccess != null && Object.hasOwnProperty.call(message, "enableHttpPortAccess")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableHttpPortAccess); + return writer; + }; + + /** + * Encodes the specified EndpointConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.EndpointConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.EndpointConfig + * @static + * @param {google.cloud.dataproc.v1.IEndpointConfig} message EndpointConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndpointConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EndpointConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.EndpointConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.EndpointConfig} EndpointConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndpointConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.EndpointConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.httpPorts === $util.emptyObject) + message.httpPorts = {}; + 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.httpPorts[key] = value; + break; + } + case 2: { + message.enableHttpPortAccess = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EndpointConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.EndpointConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.EndpointConfig} EndpointConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndpointConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EndpointConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.EndpointConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EndpointConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.httpPorts != null && message.hasOwnProperty("httpPorts")) { + if (!$util.isObject(message.httpPorts)) + return "httpPorts: object expected"; + var key = Object.keys(message.httpPorts); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.httpPorts[key[i]])) + return "httpPorts: string{k:string} expected"; + } + if (message.enableHttpPortAccess != null && message.hasOwnProperty("enableHttpPortAccess")) + if (typeof message.enableHttpPortAccess !== "boolean") + return "enableHttpPortAccess: boolean expected"; + return null; + }; + + /** + * Creates an EndpointConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.EndpointConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.EndpointConfig} EndpointConfig + */ + EndpointConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.EndpointConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.EndpointConfig(); + if (object.httpPorts) { + if (typeof object.httpPorts !== "object") + throw TypeError(".google.cloud.dataproc.v1.EndpointConfig.httpPorts: object expected"); + message.httpPorts = {}; + for (var keys = Object.keys(object.httpPorts), i = 0; i < keys.length; ++i) + message.httpPorts[keys[i]] = String(object.httpPorts[keys[i]]); + } + if (object.enableHttpPortAccess != null) + message.enableHttpPortAccess = Boolean(object.enableHttpPortAccess); + return message; + }; + + /** + * Creates a plain object from an EndpointConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.EndpointConfig + * @static + * @param {google.cloud.dataproc.v1.EndpointConfig} message EndpointConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EndpointConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.httpPorts = {}; + if (options.defaults) + object.enableHttpPortAccess = false; + var keys2; + if (message.httpPorts && (keys2 = Object.keys(message.httpPorts)).length) { + object.httpPorts = {}; + for (var j = 0; j < keys2.length; ++j) + object.httpPorts[keys2[j]] = message.httpPorts[keys2[j]]; + } + if (message.enableHttpPortAccess != null && message.hasOwnProperty("enableHttpPortAccess")) + object.enableHttpPortAccess = message.enableHttpPortAccess; + return object; + }; + + /** + * Converts this EndpointConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.EndpointConfig + * @instance + * @returns {Object.} JSON object + */ + EndpointConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EndpointConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.EndpointConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EndpointConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.EndpointConfig"; + }; + + return EndpointConfig; + })(); + + v1.AutoscalingConfig = (function() { + + /** + * Properties of an AutoscalingConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IAutoscalingConfig + * @property {string|null} [policyUri] AutoscalingConfig policyUri + */ + + /** + * Constructs a new AutoscalingConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents an AutoscalingConfig. + * @implements IAutoscalingConfig + * @constructor + * @param {google.cloud.dataproc.v1.IAutoscalingConfig=} [properties] Properties to set + */ + function AutoscalingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoscalingConfig policyUri. + * @member {string} policyUri + * @memberof google.cloud.dataproc.v1.AutoscalingConfig + * @instance + */ + AutoscalingConfig.prototype.policyUri = ""; + + /** + * Creates a new AutoscalingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.AutoscalingConfig + * @static + * @param {google.cloud.dataproc.v1.IAutoscalingConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.AutoscalingConfig} AutoscalingConfig instance + */ + AutoscalingConfig.create = function create(properties) { + return new AutoscalingConfig(properties); + }; + + /** + * Encodes the specified AutoscalingConfig message. Does not implicitly {@link google.cloud.dataproc.v1.AutoscalingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.AutoscalingConfig + * @static + * @param {google.cloud.dataproc.v1.IAutoscalingConfig} message AutoscalingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.policyUri != null && Object.hasOwnProperty.call(message, "policyUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.policyUri); + return writer; + }; + + /** + * Encodes the specified AutoscalingConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.AutoscalingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.AutoscalingConfig + * @static + * @param {google.cloud.dataproc.v1.IAutoscalingConfig} message AutoscalingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoscalingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoscalingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.AutoscalingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.AutoscalingConfig} AutoscalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.AutoscalingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.policyUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoscalingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.AutoscalingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.AutoscalingConfig} AutoscalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoscalingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoscalingConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.AutoscalingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoscalingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.policyUri != null && message.hasOwnProperty("policyUri")) + if (!$util.isString(message.policyUri)) + return "policyUri: string expected"; + return null; + }; + + /** + * Creates an AutoscalingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.AutoscalingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.AutoscalingConfig} AutoscalingConfig + */ + AutoscalingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.AutoscalingConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.AutoscalingConfig(); + if (object.policyUri != null) + message.policyUri = String(object.policyUri); + return message; + }; + + /** + * Creates a plain object from an AutoscalingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.AutoscalingConfig + * @static + * @param {google.cloud.dataproc.v1.AutoscalingConfig} message AutoscalingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoscalingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.policyUri = ""; + if (message.policyUri != null && message.hasOwnProperty("policyUri")) + object.policyUri = message.policyUri; + return object; + }; + + /** + * Converts this AutoscalingConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.AutoscalingConfig + * @instance + * @returns {Object.} JSON object + */ + AutoscalingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoscalingConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.AutoscalingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoscalingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.AutoscalingConfig"; + }; + + return AutoscalingConfig; + })(); + + v1.EncryptionConfig = (function() { + + /** + * Properties of an EncryptionConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IEncryptionConfig + * @property {string|null} [gcePdKmsKeyName] EncryptionConfig gcePdKmsKeyName + * @property {string|null} [kmsKey] EncryptionConfig kmsKey + */ + + /** + * Constructs a new EncryptionConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents an EncryptionConfig. + * @implements IEncryptionConfig + * @constructor + * @param {google.cloud.dataproc.v1.IEncryptionConfig=} [properties] Properties to set + */ + function EncryptionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EncryptionConfig gcePdKmsKeyName. + * @member {string} gcePdKmsKeyName + * @memberof google.cloud.dataproc.v1.EncryptionConfig + * @instance + */ + EncryptionConfig.prototype.gcePdKmsKeyName = ""; + + /** + * EncryptionConfig kmsKey. + * @member {string} kmsKey + * @memberof google.cloud.dataproc.v1.EncryptionConfig + * @instance + */ + EncryptionConfig.prototype.kmsKey = ""; + + /** + * Creates a new EncryptionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.EncryptionConfig + * @static + * @param {google.cloud.dataproc.v1.IEncryptionConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.EncryptionConfig} EncryptionConfig instance + */ + EncryptionConfig.create = function create(properties) { + return new EncryptionConfig(properties); + }; + + /** + * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.dataproc.v1.EncryptionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.EncryptionConfig + * @static + * @param {google.cloud.dataproc.v1.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcePdKmsKeyName != null && Object.hasOwnProperty.call(message, "gcePdKmsKeyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcePdKmsKeyName); + if (message.kmsKey != null && Object.hasOwnProperty.call(message, "kmsKey")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKey); + return writer; + }; + + /** + * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.EncryptionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.EncryptionConfig + * @static + * @param {google.cloud.dataproc.v1.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.EncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.EncryptionConfig} EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.EncryptionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcePdKmsKeyName = reader.string(); + break; + } + case 2: { + message.kmsKey = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.EncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.EncryptionConfig} EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EncryptionConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.EncryptionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EncryptionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcePdKmsKeyName != null && message.hasOwnProperty("gcePdKmsKeyName")) + if (!$util.isString(message.gcePdKmsKeyName)) + return "gcePdKmsKeyName: string expected"; + if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) + if (!$util.isString(message.kmsKey)) + return "kmsKey: string expected"; + return null; + }; + + /** + * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.EncryptionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.EncryptionConfig} EncryptionConfig + */ + EncryptionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.EncryptionConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.EncryptionConfig(); + if (object.gcePdKmsKeyName != null) + message.gcePdKmsKeyName = String(object.gcePdKmsKeyName); + if (object.kmsKey != null) + message.kmsKey = String(object.kmsKey); + return message; + }; + + /** + * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.EncryptionConfig + * @static + * @param {google.cloud.dataproc.v1.EncryptionConfig} message EncryptionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EncryptionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gcePdKmsKeyName = ""; + object.kmsKey = ""; + } + if (message.gcePdKmsKeyName != null && message.hasOwnProperty("gcePdKmsKeyName")) + object.gcePdKmsKeyName = message.gcePdKmsKeyName; + if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) + object.kmsKey = message.kmsKey; + return object; + }; + + /** + * Converts this EncryptionConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.EncryptionConfig + * @instance + * @returns {Object.} JSON object + */ + EncryptionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EncryptionConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.EncryptionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.EncryptionConfig"; + }; + + return EncryptionConfig; + })(); + + v1.GceClusterConfig = (function() { + + /** + * Properties of a GceClusterConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IGceClusterConfig + * @property {string|null} [zoneUri] GceClusterConfig zoneUri + * @property {string|null} [networkUri] GceClusterConfig networkUri + * @property {string|null} [subnetworkUri] GceClusterConfig subnetworkUri + * @property {boolean|null} [internalIpOnly] GceClusterConfig internalIpOnly + * @property {google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccess|null} [privateIpv6GoogleAccess] GceClusterConfig privateIpv6GoogleAccess + * @property {string|null} [serviceAccount] GceClusterConfig serviceAccount + * @property {Array.|null} [serviceAccountScopes] GceClusterConfig serviceAccountScopes + * @property {Array.|null} [tags] GceClusterConfig tags + * @property {Object.|null} [metadata] GceClusterConfig metadata + * @property {google.cloud.dataproc.v1.IReservationAffinity|null} [reservationAffinity] GceClusterConfig reservationAffinity + * @property {google.cloud.dataproc.v1.INodeGroupAffinity|null} [nodeGroupAffinity] GceClusterConfig nodeGroupAffinity + * @property {google.cloud.dataproc.v1.IShieldedInstanceConfig|null} [shieldedInstanceConfig] GceClusterConfig shieldedInstanceConfig + * @property {google.cloud.dataproc.v1.IConfidentialInstanceConfig|null} [confidentialInstanceConfig] GceClusterConfig confidentialInstanceConfig + */ + + /** + * Constructs a new GceClusterConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a GceClusterConfig. + * @implements IGceClusterConfig + * @constructor + * @param {google.cloud.dataproc.v1.IGceClusterConfig=} [properties] Properties to set + */ + function GceClusterConfig(properties) { + this.serviceAccountScopes = []; + this.tags = []; + this.metadata = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GceClusterConfig zoneUri. + * @member {string} zoneUri + * @memberof google.cloud.dataproc.v1.GceClusterConfig + * @instance + */ + GceClusterConfig.prototype.zoneUri = ""; + + /** + * GceClusterConfig networkUri. + * @member {string} networkUri + * @memberof google.cloud.dataproc.v1.GceClusterConfig + * @instance + */ + GceClusterConfig.prototype.networkUri = ""; + + /** + * GceClusterConfig subnetworkUri. + * @member {string} subnetworkUri + * @memberof google.cloud.dataproc.v1.GceClusterConfig + * @instance + */ + GceClusterConfig.prototype.subnetworkUri = ""; + + /** + * GceClusterConfig internalIpOnly. + * @member {boolean|null|undefined} internalIpOnly + * @memberof google.cloud.dataproc.v1.GceClusterConfig + * @instance + */ + GceClusterConfig.prototype.internalIpOnly = null; + + /** + * GceClusterConfig privateIpv6GoogleAccess. + * @member {google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccess} privateIpv6GoogleAccess + * @memberof google.cloud.dataproc.v1.GceClusterConfig + * @instance + */ + GceClusterConfig.prototype.privateIpv6GoogleAccess = 0; + + /** + * GceClusterConfig serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.dataproc.v1.GceClusterConfig + * @instance + */ + GceClusterConfig.prototype.serviceAccount = ""; + + /** + * GceClusterConfig serviceAccountScopes. + * @member {Array.} serviceAccountScopes + * @memberof google.cloud.dataproc.v1.GceClusterConfig + * @instance + */ + GceClusterConfig.prototype.serviceAccountScopes = $util.emptyArray; + + /** + * GceClusterConfig tags. + * @member {Array.} tags + * @memberof google.cloud.dataproc.v1.GceClusterConfig + * @instance + */ + GceClusterConfig.prototype.tags = $util.emptyArray; + + /** + * GceClusterConfig metadata. + * @member {Object.} metadata + * @memberof google.cloud.dataproc.v1.GceClusterConfig + * @instance + */ + GceClusterConfig.prototype.metadata = $util.emptyObject; + + /** + * GceClusterConfig reservationAffinity. + * @member {google.cloud.dataproc.v1.IReservationAffinity|null|undefined} reservationAffinity + * @memberof google.cloud.dataproc.v1.GceClusterConfig + * @instance + */ + GceClusterConfig.prototype.reservationAffinity = null; + + /** + * GceClusterConfig nodeGroupAffinity. + * @member {google.cloud.dataproc.v1.INodeGroupAffinity|null|undefined} nodeGroupAffinity + * @memberof google.cloud.dataproc.v1.GceClusterConfig + * @instance + */ + GceClusterConfig.prototype.nodeGroupAffinity = null; + + /** + * GceClusterConfig shieldedInstanceConfig. + * @member {google.cloud.dataproc.v1.IShieldedInstanceConfig|null|undefined} shieldedInstanceConfig + * @memberof google.cloud.dataproc.v1.GceClusterConfig + * @instance + */ + GceClusterConfig.prototype.shieldedInstanceConfig = null; + + /** + * GceClusterConfig confidentialInstanceConfig. + * @member {google.cloud.dataproc.v1.IConfidentialInstanceConfig|null|undefined} confidentialInstanceConfig + * @memberof google.cloud.dataproc.v1.GceClusterConfig + * @instance + */ + GceClusterConfig.prototype.confidentialInstanceConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GceClusterConfig.prototype, "_internalIpOnly", { + get: $util.oneOfGetter($oneOfFields = ["internalIpOnly"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GceClusterConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.GceClusterConfig + * @static + * @param {google.cloud.dataproc.v1.IGceClusterConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.GceClusterConfig} GceClusterConfig instance + */ + GceClusterConfig.create = function create(properties) { + return new GceClusterConfig(properties); + }; + + /** + * Encodes the specified GceClusterConfig message. Does not implicitly {@link google.cloud.dataproc.v1.GceClusterConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.GceClusterConfig + * @static + * @param {google.cloud.dataproc.v1.IGceClusterConfig} message GceClusterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GceClusterConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zoneUri != null && Object.hasOwnProperty.call(message, "zoneUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.zoneUri); + if (message.networkUri != null && Object.hasOwnProperty.call(message, "networkUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.networkUri); + if (message.serviceAccountScopes != null && message.serviceAccountScopes.length) + for (var i = 0; i < message.serviceAccountScopes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.serviceAccountScopes[i]); + if (message.tags != null && message.tags.length) + for (var i = 0; i < message.tags.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.tags[i]); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + for (var keys = Object.keys(message.metadata), 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.metadata[keys[i]]).ldelim(); + if (message.subnetworkUri != null && Object.hasOwnProperty.call(message, "subnetworkUri")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.subnetworkUri); + if (message.internalIpOnly != null && Object.hasOwnProperty.call(message, "internalIpOnly")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.internalIpOnly); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.serviceAccount); + if (message.reservationAffinity != null && Object.hasOwnProperty.call(message, "reservationAffinity")) + $root.google.cloud.dataproc.v1.ReservationAffinity.encode(message.reservationAffinity, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.privateIpv6GoogleAccess != null && Object.hasOwnProperty.call(message, "privateIpv6GoogleAccess")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.privateIpv6GoogleAccess); + if (message.nodeGroupAffinity != null && Object.hasOwnProperty.call(message, "nodeGroupAffinity")) + $root.google.cloud.dataproc.v1.NodeGroupAffinity.encode(message.nodeGroupAffinity, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.shieldedInstanceConfig != null && Object.hasOwnProperty.call(message, "shieldedInstanceConfig")) + $root.google.cloud.dataproc.v1.ShieldedInstanceConfig.encode(message.shieldedInstanceConfig, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.confidentialInstanceConfig != null && Object.hasOwnProperty.call(message, "confidentialInstanceConfig")) + $root.google.cloud.dataproc.v1.ConfidentialInstanceConfig.encode(message.confidentialInstanceConfig, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GceClusterConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GceClusterConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.GceClusterConfig + * @static + * @param {google.cloud.dataproc.v1.IGceClusterConfig} message GceClusterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GceClusterConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GceClusterConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.GceClusterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.GceClusterConfig} GceClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GceClusterConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.GceClusterConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.zoneUri = reader.string(); + break; + } + case 2: { + message.networkUri = reader.string(); + break; + } + case 6: { + message.subnetworkUri = reader.string(); + break; + } + case 7: { + message.internalIpOnly = reader.bool(); + break; + } + case 12: { + message.privateIpv6GoogleAccess = reader.int32(); + break; + } + case 8: { + message.serviceAccount = reader.string(); + break; + } + case 3: { + if (!(message.serviceAccountScopes && message.serviceAccountScopes.length)) + message.serviceAccountScopes = []; + message.serviceAccountScopes.push(reader.string()); + break; + } + case 4: { + if (!(message.tags && message.tags.length)) + message.tags = []; + message.tags.push(reader.string()); + break; + } + case 5: { + if (message.metadata === $util.emptyObject) + message.metadata = {}; + 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.metadata[key] = value; + break; + } + case 11: { + message.reservationAffinity = $root.google.cloud.dataproc.v1.ReservationAffinity.decode(reader, reader.uint32()); + break; + } + case 13: { + message.nodeGroupAffinity = $root.google.cloud.dataproc.v1.NodeGroupAffinity.decode(reader, reader.uint32()); + break; + } + case 14: { + message.shieldedInstanceConfig = $root.google.cloud.dataproc.v1.ShieldedInstanceConfig.decode(reader, reader.uint32()); + break; + } + case 15: { + message.confidentialInstanceConfig = $root.google.cloud.dataproc.v1.ConfidentialInstanceConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GceClusterConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.GceClusterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.GceClusterConfig} GceClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GceClusterConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GceClusterConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.GceClusterConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GceClusterConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.zoneUri != null && message.hasOwnProperty("zoneUri")) + if (!$util.isString(message.zoneUri)) + return "zoneUri: string expected"; + if (message.networkUri != null && message.hasOwnProperty("networkUri")) + if (!$util.isString(message.networkUri)) + return "networkUri: string expected"; + if (message.subnetworkUri != null && message.hasOwnProperty("subnetworkUri")) + if (!$util.isString(message.subnetworkUri)) + return "subnetworkUri: string expected"; + if (message.internalIpOnly != null && message.hasOwnProperty("internalIpOnly")) { + properties._internalIpOnly = 1; + if (typeof message.internalIpOnly !== "boolean") + return "internalIpOnly: boolean expected"; + } + if (message.privateIpv6GoogleAccess != null && message.hasOwnProperty("privateIpv6GoogleAccess")) + switch (message.privateIpv6GoogleAccess) { + default: + return "privateIpv6GoogleAccess: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.serviceAccountScopes != null && message.hasOwnProperty("serviceAccountScopes")) { + if (!Array.isArray(message.serviceAccountScopes)) + return "serviceAccountScopes: array expected"; + for (var i = 0; i < message.serviceAccountScopes.length; ++i) + if (!$util.isString(message.serviceAccountScopes[i])) + return "serviceAccountScopes: 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.metadata != null && message.hasOwnProperty("metadata")) { + if (!$util.isObject(message.metadata)) + return "metadata: object expected"; + var key = Object.keys(message.metadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.metadata[key[i]])) + return "metadata: string{k:string} expected"; + } + if (message.reservationAffinity != null && message.hasOwnProperty("reservationAffinity")) { + var error = $root.google.cloud.dataproc.v1.ReservationAffinity.verify(message.reservationAffinity); + if (error) + return "reservationAffinity." + error; + } + if (message.nodeGroupAffinity != null && message.hasOwnProperty("nodeGroupAffinity")) { + var error = $root.google.cloud.dataproc.v1.NodeGroupAffinity.verify(message.nodeGroupAffinity); + if (error) + return "nodeGroupAffinity." + error; + } + if (message.shieldedInstanceConfig != null && message.hasOwnProperty("shieldedInstanceConfig")) { + var error = $root.google.cloud.dataproc.v1.ShieldedInstanceConfig.verify(message.shieldedInstanceConfig); + if (error) + return "shieldedInstanceConfig." + error; + } + if (message.confidentialInstanceConfig != null && message.hasOwnProperty("confidentialInstanceConfig")) { + var error = $root.google.cloud.dataproc.v1.ConfidentialInstanceConfig.verify(message.confidentialInstanceConfig); + if (error) + return "confidentialInstanceConfig." + error; + } + return null; + }; + + /** + * Creates a GceClusterConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.GceClusterConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.GceClusterConfig} GceClusterConfig + */ + GceClusterConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.GceClusterConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.GceClusterConfig(); + if (object.zoneUri != null) + message.zoneUri = String(object.zoneUri); + if (object.networkUri != null) + message.networkUri = String(object.networkUri); + if (object.subnetworkUri != null) + message.subnetworkUri = String(object.subnetworkUri); + if (object.internalIpOnly != null) + message.internalIpOnly = Boolean(object.internalIpOnly); + switch (object.privateIpv6GoogleAccess) { + default: + if (typeof object.privateIpv6GoogleAccess === "number") { + message.privateIpv6GoogleAccess = object.privateIpv6GoogleAccess; + break; + } + break; + case "PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED": + case 0: + message.privateIpv6GoogleAccess = 0; + break; + case "INHERIT_FROM_SUBNETWORK": + case 1: + message.privateIpv6GoogleAccess = 1; + break; + case "OUTBOUND": + case 2: + message.privateIpv6GoogleAccess = 2; + break; + case "BIDIRECTIONAL": + case 3: + message.privateIpv6GoogleAccess = 3; + break; + } + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.serviceAccountScopes) { + if (!Array.isArray(object.serviceAccountScopes)) + throw TypeError(".google.cloud.dataproc.v1.GceClusterConfig.serviceAccountScopes: array expected"); + message.serviceAccountScopes = []; + for (var i = 0; i < object.serviceAccountScopes.length; ++i) + message.serviceAccountScopes[i] = String(object.serviceAccountScopes[i]); + } + if (object.tags) { + if (!Array.isArray(object.tags)) + throw TypeError(".google.cloud.dataproc.v1.GceClusterConfig.tags: array expected"); + message.tags = []; + for (var i = 0; i < object.tags.length; ++i) + message.tags[i] = String(object.tags[i]); + } + if (object.metadata) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.dataproc.v1.GceClusterConfig.metadata: object expected"); + message.metadata = {}; + for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) + message.metadata[keys[i]] = String(object.metadata[keys[i]]); + } + if (object.reservationAffinity != null) { + if (typeof object.reservationAffinity !== "object") + throw TypeError(".google.cloud.dataproc.v1.GceClusterConfig.reservationAffinity: object expected"); + message.reservationAffinity = $root.google.cloud.dataproc.v1.ReservationAffinity.fromObject(object.reservationAffinity); + } + if (object.nodeGroupAffinity != null) { + if (typeof object.nodeGroupAffinity !== "object") + throw TypeError(".google.cloud.dataproc.v1.GceClusterConfig.nodeGroupAffinity: object expected"); + message.nodeGroupAffinity = $root.google.cloud.dataproc.v1.NodeGroupAffinity.fromObject(object.nodeGroupAffinity); + } + if (object.shieldedInstanceConfig != null) { + if (typeof object.shieldedInstanceConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.GceClusterConfig.shieldedInstanceConfig: object expected"); + message.shieldedInstanceConfig = $root.google.cloud.dataproc.v1.ShieldedInstanceConfig.fromObject(object.shieldedInstanceConfig); + } + if (object.confidentialInstanceConfig != null) { + if (typeof object.confidentialInstanceConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.GceClusterConfig.confidentialInstanceConfig: object expected"); + message.confidentialInstanceConfig = $root.google.cloud.dataproc.v1.ConfidentialInstanceConfig.fromObject(object.confidentialInstanceConfig); + } + return message; + }; + + /** + * Creates a plain object from a GceClusterConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.GceClusterConfig + * @static + * @param {google.cloud.dataproc.v1.GceClusterConfig} message GceClusterConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GceClusterConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.serviceAccountScopes = []; + object.tags = []; + } + if (options.objects || options.defaults) + object.metadata = {}; + if (options.defaults) { + object.zoneUri = ""; + object.networkUri = ""; + object.subnetworkUri = ""; + object.serviceAccount = ""; + object.reservationAffinity = null; + object.privateIpv6GoogleAccess = options.enums === String ? "PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED" : 0; + object.nodeGroupAffinity = null; + object.shieldedInstanceConfig = null; + object.confidentialInstanceConfig = null; + } + if (message.zoneUri != null && message.hasOwnProperty("zoneUri")) + object.zoneUri = message.zoneUri; + if (message.networkUri != null && message.hasOwnProperty("networkUri")) + object.networkUri = message.networkUri; + if (message.serviceAccountScopes && message.serviceAccountScopes.length) { + object.serviceAccountScopes = []; + for (var j = 0; j < message.serviceAccountScopes.length; ++j) + object.serviceAccountScopes[j] = message.serviceAccountScopes[j]; + } + if (message.tags && message.tags.length) { + object.tags = []; + for (var j = 0; j < message.tags.length; ++j) + object.tags[j] = message.tags[j]; + } + var keys2; + if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { + object.metadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.metadata[keys2[j]] = message.metadata[keys2[j]]; + } + if (message.subnetworkUri != null && message.hasOwnProperty("subnetworkUri")) + object.subnetworkUri = message.subnetworkUri; + if (message.internalIpOnly != null && message.hasOwnProperty("internalIpOnly")) { + object.internalIpOnly = message.internalIpOnly; + if (options.oneofs) + object._internalIpOnly = "internalIpOnly"; + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.reservationAffinity != null && message.hasOwnProperty("reservationAffinity")) + object.reservationAffinity = $root.google.cloud.dataproc.v1.ReservationAffinity.toObject(message.reservationAffinity, options); + if (message.privateIpv6GoogleAccess != null && message.hasOwnProperty("privateIpv6GoogleAccess")) + object.privateIpv6GoogleAccess = options.enums === String ? $root.google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccess[message.privateIpv6GoogleAccess] === undefined ? message.privateIpv6GoogleAccess : $root.google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccess[message.privateIpv6GoogleAccess] : message.privateIpv6GoogleAccess; + if (message.nodeGroupAffinity != null && message.hasOwnProperty("nodeGroupAffinity")) + object.nodeGroupAffinity = $root.google.cloud.dataproc.v1.NodeGroupAffinity.toObject(message.nodeGroupAffinity, options); + if (message.shieldedInstanceConfig != null && message.hasOwnProperty("shieldedInstanceConfig")) + object.shieldedInstanceConfig = $root.google.cloud.dataproc.v1.ShieldedInstanceConfig.toObject(message.shieldedInstanceConfig, options); + if (message.confidentialInstanceConfig != null && message.hasOwnProperty("confidentialInstanceConfig")) + object.confidentialInstanceConfig = $root.google.cloud.dataproc.v1.ConfidentialInstanceConfig.toObject(message.confidentialInstanceConfig, options); + return object; + }; + + /** + * Converts this GceClusterConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.GceClusterConfig + * @instance + * @returns {Object.} JSON object + */ + GceClusterConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GceClusterConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.GceClusterConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GceClusterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.GceClusterConfig"; + }; + + /** + * PrivateIpv6GoogleAccess enum. + * @name google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccess + * @enum {number} + * @property {number} PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED=0 PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED value + * @property {number} INHERIT_FROM_SUBNETWORK=1 INHERIT_FROM_SUBNETWORK value + * @property {number} OUTBOUND=2 OUTBOUND value + * @property {number} BIDIRECTIONAL=3 BIDIRECTIONAL value + */ + GceClusterConfig.PrivateIpv6GoogleAccess = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED"] = 0; + values[valuesById[1] = "INHERIT_FROM_SUBNETWORK"] = 1; + values[valuesById[2] = "OUTBOUND"] = 2; + values[valuesById[3] = "BIDIRECTIONAL"] = 3; + return values; + })(); + + return GceClusterConfig; + })(); + + v1.NodeGroupAffinity = (function() { + + /** + * Properties of a NodeGroupAffinity. + * @memberof google.cloud.dataproc.v1 + * @interface INodeGroupAffinity + * @property {string|null} [nodeGroupUri] NodeGroupAffinity nodeGroupUri + */ + + /** + * Constructs a new NodeGroupAffinity. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a NodeGroupAffinity. + * @implements INodeGroupAffinity + * @constructor + * @param {google.cloud.dataproc.v1.INodeGroupAffinity=} [properties] Properties to set + */ + function NodeGroupAffinity(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeGroupAffinity nodeGroupUri. + * @member {string} nodeGroupUri + * @memberof google.cloud.dataproc.v1.NodeGroupAffinity + * @instance + */ + NodeGroupAffinity.prototype.nodeGroupUri = ""; + + /** + * Creates a new NodeGroupAffinity instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.NodeGroupAffinity + * @static + * @param {google.cloud.dataproc.v1.INodeGroupAffinity=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.NodeGroupAffinity} NodeGroupAffinity instance + */ + NodeGroupAffinity.create = function create(properties) { + return new NodeGroupAffinity(properties); + }; + + /** + * Encodes the specified NodeGroupAffinity message. Does not implicitly {@link google.cloud.dataproc.v1.NodeGroupAffinity.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.NodeGroupAffinity + * @static + * @param {google.cloud.dataproc.v1.INodeGroupAffinity} message NodeGroupAffinity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeGroupAffinity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodeGroupUri != null && Object.hasOwnProperty.call(message, "nodeGroupUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.nodeGroupUri); + return writer; + }; + + /** + * Encodes the specified NodeGroupAffinity message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.NodeGroupAffinity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.NodeGroupAffinity + * @static + * @param {google.cloud.dataproc.v1.INodeGroupAffinity} message NodeGroupAffinity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeGroupAffinity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeGroupAffinity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.NodeGroupAffinity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.NodeGroupAffinity} NodeGroupAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeGroupAffinity.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.NodeGroupAffinity(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.nodeGroupUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeGroupAffinity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.NodeGroupAffinity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.NodeGroupAffinity} NodeGroupAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeGroupAffinity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeGroupAffinity message. + * @function verify + * @memberof google.cloud.dataproc.v1.NodeGroupAffinity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeGroupAffinity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeGroupUri != null && message.hasOwnProperty("nodeGroupUri")) + if (!$util.isString(message.nodeGroupUri)) + return "nodeGroupUri: string expected"; + return null; + }; + + /** + * Creates a NodeGroupAffinity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.NodeGroupAffinity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.NodeGroupAffinity} NodeGroupAffinity + */ + NodeGroupAffinity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.NodeGroupAffinity) + return object; + var message = new $root.google.cloud.dataproc.v1.NodeGroupAffinity(); + if (object.nodeGroupUri != null) + message.nodeGroupUri = String(object.nodeGroupUri); + return message; + }; + + /** + * Creates a plain object from a NodeGroupAffinity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.NodeGroupAffinity + * @static + * @param {google.cloud.dataproc.v1.NodeGroupAffinity} message NodeGroupAffinity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeGroupAffinity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.nodeGroupUri = ""; + if (message.nodeGroupUri != null && message.hasOwnProperty("nodeGroupUri")) + object.nodeGroupUri = message.nodeGroupUri; + return object; + }; + + /** + * Converts this NodeGroupAffinity to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.NodeGroupAffinity + * @instance + * @returns {Object.} JSON object + */ + NodeGroupAffinity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeGroupAffinity + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.NodeGroupAffinity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeGroupAffinity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.NodeGroupAffinity"; + }; + + return NodeGroupAffinity; + })(); + + v1.ShieldedInstanceConfig = (function() { + + /** + * Properties of a ShieldedInstanceConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IShieldedInstanceConfig + * @property {boolean|null} [enableSecureBoot] ShieldedInstanceConfig enableSecureBoot + * @property {boolean|null} [enableVtpm] ShieldedInstanceConfig enableVtpm + * @property {boolean|null} [enableIntegrityMonitoring] ShieldedInstanceConfig enableIntegrityMonitoring + */ + + /** + * Constructs a new ShieldedInstanceConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a ShieldedInstanceConfig. + * @implements IShieldedInstanceConfig + * @constructor + * @param {google.cloud.dataproc.v1.IShieldedInstanceConfig=} [properties] Properties to set + */ + function ShieldedInstanceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ShieldedInstanceConfig enableSecureBoot. + * @member {boolean|null|undefined} enableSecureBoot + * @memberof google.cloud.dataproc.v1.ShieldedInstanceConfig + * @instance + */ + ShieldedInstanceConfig.prototype.enableSecureBoot = null; + + /** + * ShieldedInstanceConfig enableVtpm. + * @member {boolean|null|undefined} enableVtpm + * @memberof google.cloud.dataproc.v1.ShieldedInstanceConfig + * @instance + */ + ShieldedInstanceConfig.prototype.enableVtpm = null; + + /** + * ShieldedInstanceConfig enableIntegrityMonitoring. + * @member {boolean|null|undefined} enableIntegrityMonitoring + * @memberof google.cloud.dataproc.v1.ShieldedInstanceConfig + * @instance + */ + ShieldedInstanceConfig.prototype.enableIntegrityMonitoring = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ShieldedInstanceConfig.prototype, "_enableSecureBoot", { + get: $util.oneOfGetter($oneOfFields = ["enableSecureBoot"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ShieldedInstanceConfig.prototype, "_enableVtpm", { + get: $util.oneOfGetter($oneOfFields = ["enableVtpm"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ShieldedInstanceConfig.prototype, "_enableIntegrityMonitoring", { + get: $util.oneOfGetter($oneOfFields = ["enableIntegrityMonitoring"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ShieldedInstanceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.ShieldedInstanceConfig + * @static + * @param {google.cloud.dataproc.v1.IShieldedInstanceConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.ShieldedInstanceConfig} ShieldedInstanceConfig instance + */ + ShieldedInstanceConfig.create = function create(properties) { + return new ShieldedInstanceConfig(properties); + }; + + /** + * Encodes the specified ShieldedInstanceConfig message. Does not implicitly {@link google.cloud.dataproc.v1.ShieldedInstanceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.ShieldedInstanceConfig + * @static + * @param {google.cloud.dataproc.v1.IShieldedInstanceConfig} message ShieldedInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShieldedInstanceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableSecureBoot != null && Object.hasOwnProperty.call(message, "enableSecureBoot")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableSecureBoot); + if (message.enableVtpm != null && Object.hasOwnProperty.call(message, "enableVtpm")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableVtpm); + if (message.enableIntegrityMonitoring != null && Object.hasOwnProperty.call(message, "enableIntegrityMonitoring")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableIntegrityMonitoring); + return writer; + }; + + /** + * Encodes the specified ShieldedInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ShieldedInstanceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.ShieldedInstanceConfig + * @static + * @param {google.cloud.dataproc.v1.IShieldedInstanceConfig} message ShieldedInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShieldedInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ShieldedInstanceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.ShieldedInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.ShieldedInstanceConfig} ShieldedInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShieldedInstanceConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ShieldedInstanceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enableSecureBoot = reader.bool(); + break; + } + case 2: { + message.enableVtpm = reader.bool(); + break; + } + case 3: { + message.enableIntegrityMonitoring = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ShieldedInstanceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.ShieldedInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.ShieldedInstanceConfig} ShieldedInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShieldedInstanceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ShieldedInstanceConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.ShieldedInstanceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ShieldedInstanceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.enableSecureBoot != null && message.hasOwnProperty("enableSecureBoot")) { + properties._enableSecureBoot = 1; + if (typeof message.enableSecureBoot !== "boolean") + return "enableSecureBoot: boolean expected"; + } + if (message.enableVtpm != null && message.hasOwnProperty("enableVtpm")) { + properties._enableVtpm = 1; + if (typeof message.enableVtpm !== "boolean") + return "enableVtpm: boolean expected"; + } + if (message.enableIntegrityMonitoring != null && message.hasOwnProperty("enableIntegrityMonitoring")) { + properties._enableIntegrityMonitoring = 1; + if (typeof message.enableIntegrityMonitoring !== "boolean") + return "enableIntegrityMonitoring: boolean expected"; + } + return null; + }; + + /** + * Creates a ShieldedInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.ShieldedInstanceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.ShieldedInstanceConfig} ShieldedInstanceConfig + */ + ShieldedInstanceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.ShieldedInstanceConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.ShieldedInstanceConfig(); + if (object.enableSecureBoot != null) + message.enableSecureBoot = Boolean(object.enableSecureBoot); + if (object.enableVtpm != null) + message.enableVtpm = Boolean(object.enableVtpm); + if (object.enableIntegrityMonitoring != null) + message.enableIntegrityMonitoring = Boolean(object.enableIntegrityMonitoring); + return message; + }; + + /** + * Creates a plain object from a ShieldedInstanceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.ShieldedInstanceConfig + * @static + * @param {google.cloud.dataproc.v1.ShieldedInstanceConfig} message ShieldedInstanceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ShieldedInstanceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.enableSecureBoot != null && message.hasOwnProperty("enableSecureBoot")) { + object.enableSecureBoot = message.enableSecureBoot; + if (options.oneofs) + object._enableSecureBoot = "enableSecureBoot"; + } + if (message.enableVtpm != null && message.hasOwnProperty("enableVtpm")) { + object.enableVtpm = message.enableVtpm; + if (options.oneofs) + object._enableVtpm = "enableVtpm"; + } + if (message.enableIntegrityMonitoring != null && message.hasOwnProperty("enableIntegrityMonitoring")) { + object.enableIntegrityMonitoring = message.enableIntegrityMonitoring; + if (options.oneofs) + object._enableIntegrityMonitoring = "enableIntegrityMonitoring"; + } + return object; + }; + + /** + * Converts this ShieldedInstanceConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.ShieldedInstanceConfig + * @instance + * @returns {Object.} JSON object + */ + ShieldedInstanceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ShieldedInstanceConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.ShieldedInstanceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShieldedInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.ShieldedInstanceConfig"; + }; + + return ShieldedInstanceConfig; + })(); + + v1.ConfidentialInstanceConfig = (function() { + + /** + * Properties of a ConfidentialInstanceConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IConfidentialInstanceConfig + * @property {boolean|null} [enableConfidentialCompute] ConfidentialInstanceConfig enableConfidentialCompute + */ + + /** + * Constructs a new ConfidentialInstanceConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a ConfidentialInstanceConfig. + * @implements IConfidentialInstanceConfig + * @constructor + * @param {google.cloud.dataproc.v1.IConfidentialInstanceConfig=} [properties] Properties to set + */ + function ConfidentialInstanceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConfidentialInstanceConfig enableConfidentialCompute. + * @member {boolean} enableConfidentialCompute + * @memberof google.cloud.dataproc.v1.ConfidentialInstanceConfig + * @instance + */ + ConfidentialInstanceConfig.prototype.enableConfidentialCompute = false; + + /** + * Creates a new ConfidentialInstanceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.ConfidentialInstanceConfig + * @static + * @param {google.cloud.dataproc.v1.IConfidentialInstanceConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.ConfidentialInstanceConfig} ConfidentialInstanceConfig instance + */ + ConfidentialInstanceConfig.create = function create(properties) { + return new ConfidentialInstanceConfig(properties); + }; + + /** + * Encodes the specified ConfidentialInstanceConfig message. Does not implicitly {@link google.cloud.dataproc.v1.ConfidentialInstanceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.ConfidentialInstanceConfig + * @static + * @param {google.cloud.dataproc.v1.IConfidentialInstanceConfig} message ConfidentialInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidentialInstanceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableConfidentialCompute != null && Object.hasOwnProperty.call(message, "enableConfidentialCompute")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableConfidentialCompute); + return writer; + }; + + /** + * Encodes the specified ConfidentialInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ConfidentialInstanceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.ConfidentialInstanceConfig + * @static + * @param {google.cloud.dataproc.v1.IConfidentialInstanceConfig} message ConfidentialInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidentialInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConfidentialInstanceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.ConfidentialInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.ConfidentialInstanceConfig} ConfidentialInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidentialInstanceConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ConfidentialInstanceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enableConfidentialCompute = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConfidentialInstanceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.ConfidentialInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.ConfidentialInstanceConfig} ConfidentialInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidentialInstanceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfidentialInstanceConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.ConfidentialInstanceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfidentialInstanceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableConfidentialCompute != null && message.hasOwnProperty("enableConfidentialCompute")) + if (typeof message.enableConfidentialCompute !== "boolean") + return "enableConfidentialCompute: boolean expected"; + return null; + }; + + /** + * Creates a ConfidentialInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.ConfidentialInstanceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.ConfidentialInstanceConfig} ConfidentialInstanceConfig + */ + ConfidentialInstanceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.ConfidentialInstanceConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.ConfidentialInstanceConfig(); + if (object.enableConfidentialCompute != null) + message.enableConfidentialCompute = Boolean(object.enableConfidentialCompute); + return message; + }; + + /** + * Creates a plain object from a ConfidentialInstanceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.ConfidentialInstanceConfig + * @static + * @param {google.cloud.dataproc.v1.ConfidentialInstanceConfig} message ConfidentialInstanceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfidentialInstanceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enableConfidentialCompute = false; + if (message.enableConfidentialCompute != null && message.hasOwnProperty("enableConfidentialCompute")) + object.enableConfidentialCompute = message.enableConfidentialCompute; + return object; + }; + + /** + * Converts this ConfidentialInstanceConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.ConfidentialInstanceConfig + * @instance + * @returns {Object.} JSON object + */ + ConfidentialInstanceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConfidentialInstanceConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.ConfidentialInstanceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConfidentialInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.ConfidentialInstanceConfig"; + }; + + return ConfidentialInstanceConfig; + })(); + + v1.InstanceGroupConfig = (function() { + + /** + * Properties of an InstanceGroupConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IInstanceGroupConfig + * @property {number|null} [numInstances] InstanceGroupConfig numInstances + * @property {Array.|null} [instanceNames] InstanceGroupConfig instanceNames + * @property {Array.|null} [instanceReferences] InstanceGroupConfig instanceReferences + * @property {string|null} [imageUri] InstanceGroupConfig imageUri + * @property {string|null} [machineTypeUri] InstanceGroupConfig machineTypeUri + * @property {google.cloud.dataproc.v1.IDiskConfig|null} [diskConfig] InstanceGroupConfig diskConfig + * @property {boolean|null} [isPreemptible] InstanceGroupConfig isPreemptible + * @property {google.cloud.dataproc.v1.InstanceGroupConfig.Preemptibility|null} [preemptibility] InstanceGroupConfig preemptibility + * @property {google.cloud.dataproc.v1.IManagedGroupConfig|null} [managedGroupConfig] InstanceGroupConfig managedGroupConfig + * @property {Array.|null} [accelerators] InstanceGroupConfig accelerators + * @property {string|null} [minCpuPlatform] InstanceGroupConfig minCpuPlatform + * @property {number|null} [minNumInstances] InstanceGroupConfig minNumInstances + * @property {google.cloud.dataproc.v1.IInstanceFlexibilityPolicy|null} [instanceFlexibilityPolicy] InstanceGroupConfig instanceFlexibilityPolicy + * @property {google.cloud.dataproc.v1.IStartupConfig|null} [startupConfig] InstanceGroupConfig startupConfig + */ + + /** + * Constructs a new InstanceGroupConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents an InstanceGroupConfig. + * @implements IInstanceGroupConfig + * @constructor + * @param {google.cloud.dataproc.v1.IInstanceGroupConfig=} [properties] Properties to set + */ + function InstanceGroupConfig(properties) { + this.instanceNames = []; + this.instanceReferences = []; + this.accelerators = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceGroupConfig numInstances. + * @member {number} numInstances + * @memberof google.cloud.dataproc.v1.InstanceGroupConfig + * @instance + */ + InstanceGroupConfig.prototype.numInstances = 0; + + /** + * InstanceGroupConfig instanceNames. + * @member {Array.} instanceNames + * @memberof google.cloud.dataproc.v1.InstanceGroupConfig + * @instance + */ + InstanceGroupConfig.prototype.instanceNames = $util.emptyArray; + + /** + * InstanceGroupConfig instanceReferences. + * @member {Array.} instanceReferences + * @memberof google.cloud.dataproc.v1.InstanceGroupConfig + * @instance + */ + InstanceGroupConfig.prototype.instanceReferences = $util.emptyArray; + + /** + * InstanceGroupConfig imageUri. + * @member {string} imageUri + * @memberof google.cloud.dataproc.v1.InstanceGroupConfig + * @instance + */ + InstanceGroupConfig.prototype.imageUri = ""; + + /** + * InstanceGroupConfig machineTypeUri. + * @member {string} machineTypeUri + * @memberof google.cloud.dataproc.v1.InstanceGroupConfig + * @instance + */ + InstanceGroupConfig.prototype.machineTypeUri = ""; + + /** + * InstanceGroupConfig diskConfig. + * @member {google.cloud.dataproc.v1.IDiskConfig|null|undefined} diskConfig + * @memberof google.cloud.dataproc.v1.InstanceGroupConfig + * @instance + */ + InstanceGroupConfig.prototype.diskConfig = null; + + /** + * InstanceGroupConfig isPreemptible. + * @member {boolean} isPreemptible + * @memberof google.cloud.dataproc.v1.InstanceGroupConfig + * @instance + */ + InstanceGroupConfig.prototype.isPreemptible = false; + + /** + * InstanceGroupConfig preemptibility. + * @member {google.cloud.dataproc.v1.InstanceGroupConfig.Preemptibility} preemptibility + * @memberof google.cloud.dataproc.v1.InstanceGroupConfig + * @instance + */ + InstanceGroupConfig.prototype.preemptibility = 0; + + /** + * InstanceGroupConfig managedGroupConfig. + * @member {google.cloud.dataproc.v1.IManagedGroupConfig|null|undefined} managedGroupConfig + * @memberof google.cloud.dataproc.v1.InstanceGroupConfig + * @instance + */ + InstanceGroupConfig.prototype.managedGroupConfig = null; + + /** + * InstanceGroupConfig accelerators. + * @member {Array.} accelerators + * @memberof google.cloud.dataproc.v1.InstanceGroupConfig + * @instance + */ + InstanceGroupConfig.prototype.accelerators = $util.emptyArray; + + /** + * InstanceGroupConfig minCpuPlatform. + * @member {string} minCpuPlatform + * @memberof google.cloud.dataproc.v1.InstanceGroupConfig + * @instance + */ + InstanceGroupConfig.prototype.minCpuPlatform = ""; + + /** + * InstanceGroupConfig minNumInstances. + * @member {number} minNumInstances + * @memberof google.cloud.dataproc.v1.InstanceGroupConfig + * @instance + */ + InstanceGroupConfig.prototype.minNumInstances = 0; + + /** + * InstanceGroupConfig instanceFlexibilityPolicy. + * @member {google.cloud.dataproc.v1.IInstanceFlexibilityPolicy|null|undefined} instanceFlexibilityPolicy + * @memberof google.cloud.dataproc.v1.InstanceGroupConfig + * @instance + */ + InstanceGroupConfig.prototype.instanceFlexibilityPolicy = null; + + /** + * InstanceGroupConfig startupConfig. + * @member {google.cloud.dataproc.v1.IStartupConfig|null|undefined} startupConfig + * @memberof google.cloud.dataproc.v1.InstanceGroupConfig + * @instance + */ + InstanceGroupConfig.prototype.startupConfig = null; + + /** + * Creates a new InstanceGroupConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.InstanceGroupConfig + * @static + * @param {google.cloud.dataproc.v1.IInstanceGroupConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.InstanceGroupConfig} InstanceGroupConfig instance + */ + InstanceGroupConfig.create = function create(properties) { + return new InstanceGroupConfig(properties); + }; + + /** + * Encodes the specified InstanceGroupConfig message. Does not implicitly {@link google.cloud.dataproc.v1.InstanceGroupConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.InstanceGroupConfig + * @static + * @param {google.cloud.dataproc.v1.IInstanceGroupConfig} message InstanceGroupConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.numInstances != null && Object.hasOwnProperty.call(message, "numInstances")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.numInstances); + if (message.instanceNames != null && message.instanceNames.length) + for (var i = 0; i < message.instanceNames.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceNames[i]); + if (message.imageUri != null && Object.hasOwnProperty.call(message, "imageUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.imageUri); + if (message.machineTypeUri != null && Object.hasOwnProperty.call(message, "machineTypeUri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.machineTypeUri); + if (message.diskConfig != null && Object.hasOwnProperty.call(message, "diskConfig")) + $root.google.cloud.dataproc.v1.DiskConfig.encode(message.diskConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.isPreemptible != null && Object.hasOwnProperty.call(message, "isPreemptible")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.isPreemptible); + if (message.managedGroupConfig != null && Object.hasOwnProperty.call(message, "managedGroupConfig")) + $root.google.cloud.dataproc.v1.ManagedGroupConfig.encode(message.managedGroupConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.accelerators != null && message.accelerators.length) + for (var i = 0; i < message.accelerators.length; ++i) + $root.google.cloud.dataproc.v1.AcceleratorConfig.encode(message.accelerators[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.minCpuPlatform != null && Object.hasOwnProperty.call(message, "minCpuPlatform")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.minCpuPlatform); + if (message.preemptibility != null && Object.hasOwnProperty.call(message, "preemptibility")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.preemptibility); + if (message.instanceReferences != null && message.instanceReferences.length) + for (var i = 0; i < message.instanceReferences.length; ++i) + $root.google.cloud.dataproc.v1.InstanceReference.encode(message.instanceReferences[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.minNumInstances != null && Object.hasOwnProperty.call(message, "minNumInstances")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.minNumInstances); + if (message.instanceFlexibilityPolicy != null && Object.hasOwnProperty.call(message, "instanceFlexibilityPolicy")) + $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.encode(message.instanceFlexibilityPolicy, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.startupConfig != null && Object.hasOwnProperty.call(message, "startupConfig")) + $root.google.cloud.dataproc.v1.StartupConfig.encode(message.startupConfig, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstanceGroupConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstanceGroupConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.InstanceGroupConfig + * @static + * @param {google.cloud.dataproc.v1.IInstanceGroupConfig} message InstanceGroupConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceGroupConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceGroupConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.InstanceGroupConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.InstanceGroupConfig} InstanceGroupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.InstanceGroupConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.numInstances = reader.int32(); + break; + } + case 2: { + if (!(message.instanceNames && message.instanceNames.length)) + message.instanceNames = []; + message.instanceNames.push(reader.string()); + break; + } + case 11: { + if (!(message.instanceReferences && message.instanceReferences.length)) + message.instanceReferences = []; + message.instanceReferences.push($root.google.cloud.dataproc.v1.InstanceReference.decode(reader, reader.uint32())); + break; + } + case 3: { + message.imageUri = reader.string(); + break; + } + case 4: { + message.machineTypeUri = reader.string(); + break; + } + case 5: { + message.diskConfig = $root.google.cloud.dataproc.v1.DiskConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.isPreemptible = reader.bool(); + break; + } + case 10: { + message.preemptibility = reader.int32(); + break; + } + case 7: { + message.managedGroupConfig = $root.google.cloud.dataproc.v1.ManagedGroupConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + if (!(message.accelerators && message.accelerators.length)) + message.accelerators = []; + message.accelerators.push($root.google.cloud.dataproc.v1.AcceleratorConfig.decode(reader, reader.uint32())); + break; + } + case 9: { + message.minCpuPlatform = reader.string(); + break; + } + case 12: { + message.minNumInstances = reader.int32(); + break; + } + case 13: { + message.instanceFlexibilityPolicy = $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.decode(reader, reader.uint32()); + break; + } + case 14: { + message.startupConfig = $root.google.cloud.dataproc.v1.StartupConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceGroupConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.InstanceGroupConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.InstanceGroupConfig} InstanceGroupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceGroupConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceGroupConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.InstanceGroupConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceGroupConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.numInstances != null && message.hasOwnProperty("numInstances")) + if (!$util.isInteger(message.numInstances)) + return "numInstances: integer expected"; + if (message.instanceNames != null && message.hasOwnProperty("instanceNames")) { + if (!Array.isArray(message.instanceNames)) + return "instanceNames: array expected"; + for (var i = 0; i < message.instanceNames.length; ++i) + if (!$util.isString(message.instanceNames[i])) + return "instanceNames: string[] expected"; + } + if (message.instanceReferences != null && message.hasOwnProperty("instanceReferences")) { + if (!Array.isArray(message.instanceReferences)) + return "instanceReferences: array expected"; + for (var i = 0; i < message.instanceReferences.length; ++i) { + var error = $root.google.cloud.dataproc.v1.InstanceReference.verify(message.instanceReferences[i]); + if (error) + return "instanceReferences." + error; + } + } + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + if (!$util.isString(message.imageUri)) + return "imageUri: string expected"; + if (message.machineTypeUri != null && message.hasOwnProperty("machineTypeUri")) + if (!$util.isString(message.machineTypeUri)) + return "machineTypeUri: string expected"; + if (message.diskConfig != null && message.hasOwnProperty("diskConfig")) { + var error = $root.google.cloud.dataproc.v1.DiskConfig.verify(message.diskConfig); + if (error) + return "diskConfig." + error; + } + if (message.isPreemptible != null && message.hasOwnProperty("isPreemptible")) + if (typeof message.isPreemptible !== "boolean") + return "isPreemptible: boolean expected"; + if (message.preemptibility != null && message.hasOwnProperty("preemptibility")) + switch (message.preemptibility) { + default: + return "preemptibility: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.managedGroupConfig != null && message.hasOwnProperty("managedGroupConfig")) { + var error = $root.google.cloud.dataproc.v1.ManagedGroupConfig.verify(message.managedGroupConfig); + if (error) + return "managedGroupConfig." + error; + } + if (message.accelerators != null && message.hasOwnProperty("accelerators")) { + if (!Array.isArray(message.accelerators)) + return "accelerators: array expected"; + for (var i = 0; i < message.accelerators.length; ++i) { + var error = $root.google.cloud.dataproc.v1.AcceleratorConfig.verify(message.accelerators[i]); + if (error) + return "accelerators." + error; + } + } + if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) + if (!$util.isString(message.minCpuPlatform)) + return "minCpuPlatform: string expected"; + if (message.minNumInstances != null && message.hasOwnProperty("minNumInstances")) + if (!$util.isInteger(message.minNumInstances)) + return "minNumInstances: integer expected"; + if (message.instanceFlexibilityPolicy != null && message.hasOwnProperty("instanceFlexibilityPolicy")) { + var error = $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.verify(message.instanceFlexibilityPolicy); + if (error) + return "instanceFlexibilityPolicy." + error; + } + if (message.startupConfig != null && message.hasOwnProperty("startupConfig")) { + var error = $root.google.cloud.dataproc.v1.StartupConfig.verify(message.startupConfig); + if (error) + return "startupConfig." + error; + } + return null; + }; + + /** + * Creates an InstanceGroupConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.InstanceGroupConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.InstanceGroupConfig} InstanceGroupConfig + */ + InstanceGroupConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.InstanceGroupConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.InstanceGroupConfig(); + if (object.numInstances != null) + message.numInstances = object.numInstances | 0; + if (object.instanceNames) { + if (!Array.isArray(object.instanceNames)) + throw TypeError(".google.cloud.dataproc.v1.InstanceGroupConfig.instanceNames: array expected"); + message.instanceNames = []; + for (var i = 0; i < object.instanceNames.length; ++i) + message.instanceNames[i] = String(object.instanceNames[i]); + } + if (object.instanceReferences) { + if (!Array.isArray(object.instanceReferences)) + throw TypeError(".google.cloud.dataproc.v1.InstanceGroupConfig.instanceReferences: array expected"); + message.instanceReferences = []; + for (var i = 0; i < object.instanceReferences.length; ++i) { + if (typeof object.instanceReferences[i] !== "object") + throw TypeError(".google.cloud.dataproc.v1.InstanceGroupConfig.instanceReferences: object expected"); + message.instanceReferences[i] = $root.google.cloud.dataproc.v1.InstanceReference.fromObject(object.instanceReferences[i]); + } + } + if (object.imageUri != null) + message.imageUri = String(object.imageUri); + if (object.machineTypeUri != null) + message.machineTypeUri = String(object.machineTypeUri); + if (object.diskConfig != null) { + if (typeof object.diskConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.InstanceGroupConfig.diskConfig: object expected"); + message.diskConfig = $root.google.cloud.dataproc.v1.DiskConfig.fromObject(object.diskConfig); + } + if (object.isPreemptible != null) + message.isPreemptible = Boolean(object.isPreemptible); + switch (object.preemptibility) { + default: + if (typeof object.preemptibility === "number") { + message.preemptibility = object.preemptibility; + break; + } + break; + case "PREEMPTIBILITY_UNSPECIFIED": + case 0: + message.preemptibility = 0; + break; + case "NON_PREEMPTIBLE": + case 1: + message.preemptibility = 1; + break; + case "PREEMPTIBLE": + case 2: + message.preemptibility = 2; + break; + case "SPOT": + case 3: + message.preemptibility = 3; + break; + } + if (object.managedGroupConfig != null) { + if (typeof object.managedGroupConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.InstanceGroupConfig.managedGroupConfig: object expected"); + message.managedGroupConfig = $root.google.cloud.dataproc.v1.ManagedGroupConfig.fromObject(object.managedGroupConfig); + } + if (object.accelerators) { + if (!Array.isArray(object.accelerators)) + throw TypeError(".google.cloud.dataproc.v1.InstanceGroupConfig.accelerators: array expected"); + message.accelerators = []; + for (var i = 0; i < object.accelerators.length; ++i) { + if (typeof object.accelerators[i] !== "object") + throw TypeError(".google.cloud.dataproc.v1.InstanceGroupConfig.accelerators: object expected"); + message.accelerators[i] = $root.google.cloud.dataproc.v1.AcceleratorConfig.fromObject(object.accelerators[i]); + } + } + if (object.minCpuPlatform != null) + message.minCpuPlatform = String(object.minCpuPlatform); + if (object.minNumInstances != null) + message.minNumInstances = object.minNumInstances | 0; + if (object.instanceFlexibilityPolicy != null) { + if (typeof object.instanceFlexibilityPolicy !== "object") + throw TypeError(".google.cloud.dataproc.v1.InstanceGroupConfig.instanceFlexibilityPolicy: object expected"); + message.instanceFlexibilityPolicy = $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.fromObject(object.instanceFlexibilityPolicy); + } + if (object.startupConfig != null) { + if (typeof object.startupConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.InstanceGroupConfig.startupConfig: object expected"); + message.startupConfig = $root.google.cloud.dataproc.v1.StartupConfig.fromObject(object.startupConfig); + } + return message; + }; + + /** + * Creates a plain object from an InstanceGroupConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.InstanceGroupConfig + * @static + * @param {google.cloud.dataproc.v1.InstanceGroupConfig} message InstanceGroupConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceGroupConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.instanceNames = []; + object.accelerators = []; + object.instanceReferences = []; + } + if (options.defaults) { + object.numInstances = 0; + object.imageUri = ""; + object.machineTypeUri = ""; + object.diskConfig = null; + object.isPreemptible = false; + object.managedGroupConfig = null; + object.minCpuPlatform = ""; + object.preemptibility = options.enums === String ? "PREEMPTIBILITY_UNSPECIFIED" : 0; + object.minNumInstances = 0; + object.instanceFlexibilityPolicy = null; + object.startupConfig = null; + } + if (message.numInstances != null && message.hasOwnProperty("numInstances")) + object.numInstances = message.numInstances; + if (message.instanceNames && message.instanceNames.length) { + object.instanceNames = []; + for (var j = 0; j < message.instanceNames.length; ++j) + object.instanceNames[j] = message.instanceNames[j]; + } + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + object.imageUri = message.imageUri; + if (message.machineTypeUri != null && message.hasOwnProperty("machineTypeUri")) + object.machineTypeUri = message.machineTypeUri; + if (message.diskConfig != null && message.hasOwnProperty("diskConfig")) + object.diskConfig = $root.google.cloud.dataproc.v1.DiskConfig.toObject(message.diskConfig, options); + if (message.isPreemptible != null && message.hasOwnProperty("isPreemptible")) + object.isPreemptible = message.isPreemptible; + if (message.managedGroupConfig != null && message.hasOwnProperty("managedGroupConfig")) + object.managedGroupConfig = $root.google.cloud.dataproc.v1.ManagedGroupConfig.toObject(message.managedGroupConfig, options); + if (message.accelerators && message.accelerators.length) { + object.accelerators = []; + for (var j = 0; j < message.accelerators.length; ++j) + object.accelerators[j] = $root.google.cloud.dataproc.v1.AcceleratorConfig.toObject(message.accelerators[j], options); + } + if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) + object.minCpuPlatform = message.minCpuPlatform; + if (message.preemptibility != null && message.hasOwnProperty("preemptibility")) + object.preemptibility = options.enums === String ? $root.google.cloud.dataproc.v1.InstanceGroupConfig.Preemptibility[message.preemptibility] === undefined ? message.preemptibility : $root.google.cloud.dataproc.v1.InstanceGroupConfig.Preemptibility[message.preemptibility] : message.preemptibility; + if (message.instanceReferences && message.instanceReferences.length) { + object.instanceReferences = []; + for (var j = 0; j < message.instanceReferences.length; ++j) + object.instanceReferences[j] = $root.google.cloud.dataproc.v1.InstanceReference.toObject(message.instanceReferences[j], options); + } + if (message.minNumInstances != null && message.hasOwnProperty("minNumInstances")) + object.minNumInstances = message.minNumInstances; + if (message.instanceFlexibilityPolicy != null && message.hasOwnProperty("instanceFlexibilityPolicy")) + object.instanceFlexibilityPolicy = $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.toObject(message.instanceFlexibilityPolicy, options); + if (message.startupConfig != null && message.hasOwnProperty("startupConfig")) + object.startupConfig = $root.google.cloud.dataproc.v1.StartupConfig.toObject(message.startupConfig, options); + return object; + }; + + /** + * Converts this InstanceGroupConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.InstanceGroupConfig + * @instance + * @returns {Object.} JSON object + */ + InstanceGroupConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstanceGroupConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.InstanceGroupConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstanceGroupConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.InstanceGroupConfig"; + }; + + /** + * Preemptibility enum. + * @name google.cloud.dataproc.v1.InstanceGroupConfig.Preemptibility + * @enum {number} + * @property {number} PREEMPTIBILITY_UNSPECIFIED=0 PREEMPTIBILITY_UNSPECIFIED value + * @property {number} NON_PREEMPTIBLE=1 NON_PREEMPTIBLE value + * @property {number} PREEMPTIBLE=2 PREEMPTIBLE value + * @property {number} SPOT=3 SPOT value + */ + InstanceGroupConfig.Preemptibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PREEMPTIBILITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "NON_PREEMPTIBLE"] = 1; + values[valuesById[2] = "PREEMPTIBLE"] = 2; + values[valuesById[3] = "SPOT"] = 3; + return values; + })(); + + return InstanceGroupConfig; + })(); + + v1.StartupConfig = (function() { + + /** + * Properties of a StartupConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IStartupConfig + * @property {number|null} [requiredRegistrationFraction] StartupConfig requiredRegistrationFraction + */ + + /** + * Constructs a new StartupConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a StartupConfig. + * @implements IStartupConfig + * @constructor + * @param {google.cloud.dataproc.v1.IStartupConfig=} [properties] Properties to set + */ + function StartupConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartupConfig requiredRegistrationFraction. + * @member {number|null|undefined} requiredRegistrationFraction + * @memberof google.cloud.dataproc.v1.StartupConfig + * @instance + */ + StartupConfig.prototype.requiredRegistrationFraction = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(StartupConfig.prototype, "_requiredRegistrationFraction", { + get: $util.oneOfGetter($oneOfFields = ["requiredRegistrationFraction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StartupConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.StartupConfig + * @static + * @param {google.cloud.dataproc.v1.IStartupConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.StartupConfig} StartupConfig instance + */ + StartupConfig.create = function create(properties) { + return new StartupConfig(properties); + }; + + /** + * Encodes the specified StartupConfig message. Does not implicitly {@link google.cloud.dataproc.v1.StartupConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.StartupConfig + * @static + * @param {google.cloud.dataproc.v1.IStartupConfig} message StartupConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartupConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requiredRegistrationFraction != null && Object.hasOwnProperty.call(message, "requiredRegistrationFraction")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.requiredRegistrationFraction); + return writer; + }; + + /** + * Encodes the specified StartupConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.StartupConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.StartupConfig + * @static + * @param {google.cloud.dataproc.v1.IStartupConfig} message StartupConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartupConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartupConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.StartupConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.StartupConfig} StartupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartupConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.StartupConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.requiredRegistrationFraction = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartupConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.StartupConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.StartupConfig} StartupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartupConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartupConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.StartupConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartupConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.requiredRegistrationFraction != null && message.hasOwnProperty("requiredRegistrationFraction")) { + properties._requiredRegistrationFraction = 1; + if (typeof message.requiredRegistrationFraction !== "number") + return "requiredRegistrationFraction: number expected"; + } + return null; + }; + + /** + * Creates a StartupConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.StartupConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.StartupConfig} StartupConfig + */ + StartupConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.StartupConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.StartupConfig(); + if (object.requiredRegistrationFraction != null) + message.requiredRegistrationFraction = Number(object.requiredRegistrationFraction); + return message; + }; + + /** + * Creates a plain object from a StartupConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.StartupConfig + * @static + * @param {google.cloud.dataproc.v1.StartupConfig} message StartupConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartupConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.requiredRegistrationFraction != null && message.hasOwnProperty("requiredRegistrationFraction")) { + object.requiredRegistrationFraction = options.json && !isFinite(message.requiredRegistrationFraction) ? String(message.requiredRegistrationFraction) : message.requiredRegistrationFraction; + if (options.oneofs) + object._requiredRegistrationFraction = "requiredRegistrationFraction"; + } + return object; + }; + + /** + * Converts this StartupConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.StartupConfig + * @instance + * @returns {Object.} JSON object + */ + StartupConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StartupConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.StartupConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StartupConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.StartupConfig"; + }; + + return StartupConfig; + })(); + + v1.InstanceReference = (function() { + + /** + * Properties of an InstanceReference. + * @memberof google.cloud.dataproc.v1 + * @interface IInstanceReference + * @property {string|null} [instanceName] InstanceReference instanceName + * @property {string|null} [instanceId] InstanceReference instanceId + * @property {string|null} [publicKey] InstanceReference publicKey + * @property {string|null} [publicEciesKey] InstanceReference publicEciesKey + */ + + /** + * Constructs a new InstanceReference. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents an InstanceReference. + * @implements IInstanceReference + * @constructor + * @param {google.cloud.dataproc.v1.IInstanceReference=} [properties] Properties to set + */ + function InstanceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceReference instanceName. + * @member {string} instanceName + * @memberof google.cloud.dataproc.v1.InstanceReference + * @instance + */ + InstanceReference.prototype.instanceName = ""; + + /** + * InstanceReference instanceId. + * @member {string} instanceId + * @memberof google.cloud.dataproc.v1.InstanceReference + * @instance + */ + InstanceReference.prototype.instanceId = ""; + + /** + * InstanceReference publicKey. + * @member {string} publicKey + * @memberof google.cloud.dataproc.v1.InstanceReference + * @instance + */ + InstanceReference.prototype.publicKey = ""; + + /** + * InstanceReference publicEciesKey. + * @member {string} publicEciesKey + * @memberof google.cloud.dataproc.v1.InstanceReference + * @instance + */ + InstanceReference.prototype.publicEciesKey = ""; + + /** + * Creates a new InstanceReference instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.InstanceReference + * @static + * @param {google.cloud.dataproc.v1.IInstanceReference=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.InstanceReference} InstanceReference instance + */ + InstanceReference.create = function create(properties) { + return new InstanceReference(properties); + }; + + /** + * Encodes the specified InstanceReference message. Does not implicitly {@link google.cloud.dataproc.v1.InstanceReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.InstanceReference + * @static + * @param {google.cloud.dataproc.v1.IInstanceReference} message InstanceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceName != null && Object.hasOwnProperty.call(message, "instanceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceName); + if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.publicKey); + if (message.publicEciesKey != null && Object.hasOwnProperty.call(message, "publicEciesKey")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.publicEciesKey); + return writer; + }; + + /** + * Encodes the specified InstanceReference message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstanceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.InstanceReference + * @static + * @param {google.cloud.dataproc.v1.IInstanceReference} message InstanceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.InstanceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.InstanceReference} InstanceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceReference.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.InstanceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instanceName = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.publicKey = reader.string(); + break; + } + case 4: { + message.publicEciesKey = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.InstanceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.InstanceReference} InstanceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceReference message. + * @function verify + * @memberof google.cloud.dataproc.v1.InstanceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instanceName != null && message.hasOwnProperty("instanceName")) + if (!$util.isString(message.instanceName)) + return "instanceName: string expected"; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.publicKey != null && message.hasOwnProperty("publicKey")) + if (!$util.isString(message.publicKey)) + return "publicKey: string expected"; + if (message.publicEciesKey != null && message.hasOwnProperty("publicEciesKey")) + if (!$util.isString(message.publicEciesKey)) + return "publicEciesKey: string expected"; + return null; + }; + + /** + * Creates an InstanceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.InstanceReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.InstanceReference} InstanceReference + */ + InstanceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.InstanceReference) + return object; + var message = new $root.google.cloud.dataproc.v1.InstanceReference(); + if (object.instanceName != null) + message.instanceName = String(object.instanceName); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.publicKey != null) + message.publicKey = String(object.publicKey); + if (object.publicEciesKey != null) + message.publicEciesKey = String(object.publicEciesKey); + return message; + }; + + /** + * Creates a plain object from an InstanceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.InstanceReference + * @static + * @param {google.cloud.dataproc.v1.InstanceReference} message InstanceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instanceName = ""; + object.instanceId = ""; + object.publicKey = ""; + object.publicEciesKey = ""; + } + if (message.instanceName != null && message.hasOwnProperty("instanceName")) + object.instanceName = message.instanceName; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.publicKey != null && message.hasOwnProperty("publicKey")) + object.publicKey = message.publicKey; + if (message.publicEciesKey != null && message.hasOwnProperty("publicEciesKey")) + object.publicEciesKey = message.publicEciesKey; + return object; + }; + + /** + * Converts this InstanceReference to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.InstanceReference + * @instance + * @returns {Object.} JSON object + */ + InstanceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstanceReference + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.InstanceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstanceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.InstanceReference"; + }; + + return InstanceReference; + })(); + + v1.ManagedGroupConfig = (function() { + + /** + * Properties of a ManagedGroupConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IManagedGroupConfig + * @property {string|null} [instanceTemplateName] ManagedGroupConfig instanceTemplateName + * @property {string|null} [instanceGroupManagerName] ManagedGroupConfig instanceGroupManagerName + * @property {string|null} [instanceGroupManagerUri] ManagedGroupConfig instanceGroupManagerUri + */ + + /** + * Constructs a new ManagedGroupConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a ManagedGroupConfig. + * @implements IManagedGroupConfig + * @constructor + * @param {google.cloud.dataproc.v1.IManagedGroupConfig=} [properties] Properties to set + */ + function ManagedGroupConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ManagedGroupConfig instanceTemplateName. + * @member {string} instanceTemplateName + * @memberof google.cloud.dataproc.v1.ManagedGroupConfig + * @instance + */ + ManagedGroupConfig.prototype.instanceTemplateName = ""; + + /** + * ManagedGroupConfig instanceGroupManagerName. + * @member {string} instanceGroupManagerName + * @memberof google.cloud.dataproc.v1.ManagedGroupConfig + * @instance + */ + ManagedGroupConfig.prototype.instanceGroupManagerName = ""; + + /** + * ManagedGroupConfig instanceGroupManagerUri. + * @member {string} instanceGroupManagerUri + * @memberof google.cloud.dataproc.v1.ManagedGroupConfig + * @instance + */ + ManagedGroupConfig.prototype.instanceGroupManagerUri = ""; + + /** + * Creates a new ManagedGroupConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.ManagedGroupConfig + * @static + * @param {google.cloud.dataproc.v1.IManagedGroupConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.ManagedGroupConfig} ManagedGroupConfig instance + */ + ManagedGroupConfig.create = function create(properties) { + return new ManagedGroupConfig(properties); + }; + + /** + * Encodes the specified ManagedGroupConfig message. Does not implicitly {@link google.cloud.dataproc.v1.ManagedGroupConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.ManagedGroupConfig + * @static + * @param {google.cloud.dataproc.v1.IManagedGroupConfig} message ManagedGroupConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ManagedGroupConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceTemplateName != null && Object.hasOwnProperty.call(message, "instanceTemplateName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceTemplateName); + if (message.instanceGroupManagerName != null && Object.hasOwnProperty.call(message, "instanceGroupManagerName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceGroupManagerName); + if (message.instanceGroupManagerUri != null && Object.hasOwnProperty.call(message, "instanceGroupManagerUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.instanceGroupManagerUri); + return writer; + }; + + /** + * Encodes the specified ManagedGroupConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ManagedGroupConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.ManagedGroupConfig + * @static + * @param {google.cloud.dataproc.v1.IManagedGroupConfig} message ManagedGroupConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ManagedGroupConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ManagedGroupConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.ManagedGroupConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.ManagedGroupConfig} ManagedGroupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ManagedGroupConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ManagedGroupConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instanceTemplateName = reader.string(); + break; + } + case 2: { + message.instanceGroupManagerName = reader.string(); + break; + } + case 3: { + message.instanceGroupManagerUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ManagedGroupConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.ManagedGroupConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.ManagedGroupConfig} ManagedGroupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ManagedGroupConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ManagedGroupConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.ManagedGroupConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ManagedGroupConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instanceTemplateName != null && message.hasOwnProperty("instanceTemplateName")) + if (!$util.isString(message.instanceTemplateName)) + return "instanceTemplateName: string expected"; + if (message.instanceGroupManagerName != null && message.hasOwnProperty("instanceGroupManagerName")) + if (!$util.isString(message.instanceGroupManagerName)) + return "instanceGroupManagerName: string expected"; + if (message.instanceGroupManagerUri != null && message.hasOwnProperty("instanceGroupManagerUri")) + if (!$util.isString(message.instanceGroupManagerUri)) + return "instanceGroupManagerUri: string expected"; + return null; + }; + + /** + * Creates a ManagedGroupConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.ManagedGroupConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.ManagedGroupConfig} ManagedGroupConfig + */ + ManagedGroupConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.ManagedGroupConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.ManagedGroupConfig(); + if (object.instanceTemplateName != null) + message.instanceTemplateName = String(object.instanceTemplateName); + if (object.instanceGroupManagerName != null) + message.instanceGroupManagerName = String(object.instanceGroupManagerName); + if (object.instanceGroupManagerUri != null) + message.instanceGroupManagerUri = String(object.instanceGroupManagerUri); + return message; + }; + + /** + * Creates a plain object from a ManagedGroupConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.ManagedGroupConfig + * @static + * @param {google.cloud.dataproc.v1.ManagedGroupConfig} message ManagedGroupConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ManagedGroupConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instanceTemplateName = ""; + object.instanceGroupManagerName = ""; + object.instanceGroupManagerUri = ""; + } + if (message.instanceTemplateName != null && message.hasOwnProperty("instanceTemplateName")) + object.instanceTemplateName = message.instanceTemplateName; + if (message.instanceGroupManagerName != null && message.hasOwnProperty("instanceGroupManagerName")) + object.instanceGroupManagerName = message.instanceGroupManagerName; + if (message.instanceGroupManagerUri != null && message.hasOwnProperty("instanceGroupManagerUri")) + object.instanceGroupManagerUri = message.instanceGroupManagerUri; + return object; + }; + + /** + * Converts this ManagedGroupConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.ManagedGroupConfig + * @instance + * @returns {Object.} JSON object + */ + ManagedGroupConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ManagedGroupConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.ManagedGroupConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ManagedGroupConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.ManagedGroupConfig"; + }; + + return ManagedGroupConfig; + })(); + + v1.InstanceFlexibilityPolicy = (function() { + + /** + * Properties of an InstanceFlexibilityPolicy. + * @memberof google.cloud.dataproc.v1 + * @interface IInstanceFlexibilityPolicy + * @property {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IProvisioningModelMix|null} [provisioningModelMix] InstanceFlexibilityPolicy provisioningModelMix + * @property {Array.|null} [instanceSelectionList] InstanceFlexibilityPolicy instanceSelectionList + * @property {Array.|null} [instanceSelectionResults] InstanceFlexibilityPolicy instanceSelectionResults + */ + + /** + * Constructs a new InstanceFlexibilityPolicy. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents an InstanceFlexibilityPolicy. + * @implements IInstanceFlexibilityPolicy + * @constructor + * @param {google.cloud.dataproc.v1.IInstanceFlexibilityPolicy=} [properties] Properties to set + */ + function InstanceFlexibilityPolicy(properties) { + this.instanceSelectionList = []; + this.instanceSelectionResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceFlexibilityPolicy provisioningModelMix. + * @member {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IProvisioningModelMix|null|undefined} provisioningModelMix + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy + * @instance + */ + InstanceFlexibilityPolicy.prototype.provisioningModelMix = null; + + /** + * InstanceFlexibilityPolicy instanceSelectionList. + * @member {Array.} instanceSelectionList + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy + * @instance + */ + InstanceFlexibilityPolicy.prototype.instanceSelectionList = $util.emptyArray; + + /** + * InstanceFlexibilityPolicy instanceSelectionResults. + * @member {Array.} instanceSelectionResults + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy + * @instance + */ + InstanceFlexibilityPolicy.prototype.instanceSelectionResults = $util.emptyArray; + + /** + * Creates a new InstanceFlexibilityPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy + * @static + * @param {google.cloud.dataproc.v1.IInstanceFlexibilityPolicy=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.InstanceFlexibilityPolicy} InstanceFlexibilityPolicy instance + */ + InstanceFlexibilityPolicy.create = function create(properties) { + return new InstanceFlexibilityPolicy(properties); + }; + + /** + * Encodes the specified InstanceFlexibilityPolicy message. Does not implicitly {@link google.cloud.dataproc.v1.InstanceFlexibilityPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy + * @static + * @param {google.cloud.dataproc.v1.IInstanceFlexibilityPolicy} message InstanceFlexibilityPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceFlexibilityPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.provisioningModelMix != null && Object.hasOwnProperty.call(message, "provisioningModelMix")) + $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix.encode(message.provisioningModelMix, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.instanceSelectionList != null && message.instanceSelectionList.length) + for (var i = 0; i < message.instanceSelectionList.length; ++i) + $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection.encode(message.instanceSelectionList[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.instanceSelectionResults != null && message.instanceSelectionResults.length) + for (var i = 0; i < message.instanceSelectionResults.length; ++i) + $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult.encode(message.instanceSelectionResults[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstanceFlexibilityPolicy message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstanceFlexibilityPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy + * @static + * @param {google.cloud.dataproc.v1.IInstanceFlexibilityPolicy} message InstanceFlexibilityPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceFlexibilityPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceFlexibilityPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.InstanceFlexibilityPolicy} InstanceFlexibilityPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceFlexibilityPolicy.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.provisioningModelMix = $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.instanceSelectionList && message.instanceSelectionList.length)) + message.instanceSelectionList = []; + message.instanceSelectionList.push($root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.instanceSelectionResults && message.instanceSelectionResults.length)) + message.instanceSelectionResults = []; + message.instanceSelectionResults.push($root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceFlexibilityPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.InstanceFlexibilityPolicy} InstanceFlexibilityPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceFlexibilityPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceFlexibilityPolicy message. + * @function verify + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceFlexibilityPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.provisioningModelMix != null && message.hasOwnProperty("provisioningModelMix")) { + var error = $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix.verify(message.provisioningModelMix); + if (error) + return "provisioningModelMix." + error; + } + if (message.instanceSelectionList != null && message.hasOwnProperty("instanceSelectionList")) { + if (!Array.isArray(message.instanceSelectionList)) + return "instanceSelectionList: array expected"; + for (var i = 0; i < message.instanceSelectionList.length; ++i) { + var error = $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection.verify(message.instanceSelectionList[i]); + if (error) + return "instanceSelectionList." + error; + } + } + if (message.instanceSelectionResults != null && message.hasOwnProperty("instanceSelectionResults")) { + if (!Array.isArray(message.instanceSelectionResults)) + return "instanceSelectionResults: array expected"; + for (var i = 0; i < message.instanceSelectionResults.length; ++i) { + var error = $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult.verify(message.instanceSelectionResults[i]); + if (error) + return "instanceSelectionResults." + error; + } + } + return null; + }; + + /** + * Creates an InstanceFlexibilityPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.InstanceFlexibilityPolicy} InstanceFlexibilityPolicy + */ + InstanceFlexibilityPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy) + return object; + var message = new $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy(); + if (object.provisioningModelMix != null) { + if (typeof object.provisioningModelMix !== "object") + throw TypeError(".google.cloud.dataproc.v1.InstanceFlexibilityPolicy.provisioningModelMix: object expected"); + message.provisioningModelMix = $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix.fromObject(object.provisioningModelMix); + } + if (object.instanceSelectionList) { + if (!Array.isArray(object.instanceSelectionList)) + throw TypeError(".google.cloud.dataproc.v1.InstanceFlexibilityPolicy.instanceSelectionList: array expected"); + message.instanceSelectionList = []; + for (var i = 0; i < object.instanceSelectionList.length; ++i) { + if (typeof object.instanceSelectionList[i] !== "object") + throw TypeError(".google.cloud.dataproc.v1.InstanceFlexibilityPolicy.instanceSelectionList: object expected"); + message.instanceSelectionList[i] = $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection.fromObject(object.instanceSelectionList[i]); + } + } + if (object.instanceSelectionResults) { + if (!Array.isArray(object.instanceSelectionResults)) + throw TypeError(".google.cloud.dataproc.v1.InstanceFlexibilityPolicy.instanceSelectionResults: array expected"); + message.instanceSelectionResults = []; + for (var i = 0; i < object.instanceSelectionResults.length; ++i) { + if (typeof object.instanceSelectionResults[i] !== "object") + throw TypeError(".google.cloud.dataproc.v1.InstanceFlexibilityPolicy.instanceSelectionResults: object expected"); + message.instanceSelectionResults[i] = $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult.fromObject(object.instanceSelectionResults[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an InstanceFlexibilityPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy + * @static + * @param {google.cloud.dataproc.v1.InstanceFlexibilityPolicy} message InstanceFlexibilityPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceFlexibilityPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.instanceSelectionList = []; + object.instanceSelectionResults = []; + } + if (options.defaults) + object.provisioningModelMix = null; + if (message.provisioningModelMix != null && message.hasOwnProperty("provisioningModelMix")) + object.provisioningModelMix = $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix.toObject(message.provisioningModelMix, options); + if (message.instanceSelectionList && message.instanceSelectionList.length) { + object.instanceSelectionList = []; + for (var j = 0; j < message.instanceSelectionList.length; ++j) + object.instanceSelectionList[j] = $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection.toObject(message.instanceSelectionList[j], options); + } + if (message.instanceSelectionResults && message.instanceSelectionResults.length) { + object.instanceSelectionResults = []; + for (var j = 0; j < message.instanceSelectionResults.length; ++j) + object.instanceSelectionResults[j] = $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult.toObject(message.instanceSelectionResults[j], options); + } + return object; + }; + + /** + * Converts this InstanceFlexibilityPolicy to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy + * @instance + * @returns {Object.} JSON object + */ + InstanceFlexibilityPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstanceFlexibilityPolicy + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstanceFlexibilityPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.InstanceFlexibilityPolicy"; + }; + + InstanceFlexibilityPolicy.ProvisioningModelMix = (function() { + + /** + * Properties of a ProvisioningModelMix. + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy + * @interface IProvisioningModelMix + * @property {number|null} [standardCapacityBase] ProvisioningModelMix standardCapacityBase + * @property {number|null} [standardCapacityPercentAboveBase] ProvisioningModelMix standardCapacityPercentAboveBase + */ + + /** + * Constructs a new ProvisioningModelMix. + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy + * @classdesc Represents a ProvisioningModelMix. + * @implements IProvisioningModelMix + * @constructor + * @param {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IProvisioningModelMix=} [properties] Properties to set + */ + function ProvisioningModelMix(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProvisioningModelMix standardCapacityBase. + * @member {number|null|undefined} standardCapacityBase + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix + * @instance + */ + ProvisioningModelMix.prototype.standardCapacityBase = null; + + /** + * ProvisioningModelMix standardCapacityPercentAboveBase. + * @member {number|null|undefined} standardCapacityPercentAboveBase + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix + * @instance + */ + ProvisioningModelMix.prototype.standardCapacityPercentAboveBase = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProvisioningModelMix.prototype, "_standardCapacityBase", { + get: $util.oneOfGetter($oneOfFields = ["standardCapacityBase"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ProvisioningModelMix.prototype, "_standardCapacityPercentAboveBase", { + get: $util.oneOfGetter($oneOfFields = ["standardCapacityPercentAboveBase"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ProvisioningModelMix instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix + * @static + * @param {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IProvisioningModelMix=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix} ProvisioningModelMix instance + */ + ProvisioningModelMix.create = function create(properties) { + return new ProvisioningModelMix(properties); + }; + + /** + * Encodes the specified ProvisioningModelMix message. Does not implicitly {@link google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix + * @static + * @param {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IProvisioningModelMix} message ProvisioningModelMix message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProvisioningModelMix.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.standardCapacityBase != null && Object.hasOwnProperty.call(message, "standardCapacityBase")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.standardCapacityBase); + if (message.standardCapacityPercentAboveBase != null && Object.hasOwnProperty.call(message, "standardCapacityPercentAboveBase")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.standardCapacityPercentAboveBase); + return writer; + }; + + /** + * Encodes the specified ProvisioningModelMix message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix + * @static + * @param {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IProvisioningModelMix} message ProvisioningModelMix message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProvisioningModelMix.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProvisioningModelMix message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix} ProvisioningModelMix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProvisioningModelMix.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.standardCapacityBase = reader.int32(); + break; + } + case 2: { + message.standardCapacityPercentAboveBase = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProvisioningModelMix message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix} ProvisioningModelMix + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProvisioningModelMix.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProvisioningModelMix message. + * @function verify + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProvisioningModelMix.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.standardCapacityBase != null && message.hasOwnProperty("standardCapacityBase")) { + properties._standardCapacityBase = 1; + if (!$util.isInteger(message.standardCapacityBase)) + return "standardCapacityBase: integer expected"; + } + if (message.standardCapacityPercentAboveBase != null && message.hasOwnProperty("standardCapacityPercentAboveBase")) { + properties._standardCapacityPercentAboveBase = 1; + if (!$util.isInteger(message.standardCapacityPercentAboveBase)) + return "standardCapacityPercentAboveBase: integer expected"; + } + return null; + }; + + /** + * Creates a ProvisioningModelMix message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix} ProvisioningModelMix + */ + ProvisioningModelMix.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix) + return object; + var message = new $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix(); + if (object.standardCapacityBase != null) + message.standardCapacityBase = object.standardCapacityBase | 0; + if (object.standardCapacityPercentAboveBase != null) + message.standardCapacityPercentAboveBase = object.standardCapacityPercentAboveBase | 0; + return message; + }; + + /** + * Creates a plain object from a ProvisioningModelMix message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix + * @static + * @param {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix} message ProvisioningModelMix + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProvisioningModelMix.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.standardCapacityBase != null && message.hasOwnProperty("standardCapacityBase")) { + object.standardCapacityBase = message.standardCapacityBase; + if (options.oneofs) + object._standardCapacityBase = "standardCapacityBase"; + } + if (message.standardCapacityPercentAboveBase != null && message.hasOwnProperty("standardCapacityPercentAboveBase")) { + object.standardCapacityPercentAboveBase = message.standardCapacityPercentAboveBase; + if (options.oneofs) + object._standardCapacityPercentAboveBase = "standardCapacityPercentAboveBase"; + } + return object; + }; + + /** + * Converts this ProvisioningModelMix to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix + * @instance + * @returns {Object.} JSON object + */ + ProvisioningModelMix.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ProvisioningModelMix + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ProvisioningModelMix.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix"; + }; + + return ProvisioningModelMix; + })(); + + InstanceFlexibilityPolicy.InstanceSelection = (function() { + + /** + * Properties of an InstanceSelection. + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy + * @interface IInstanceSelection + * @property {Array.|null} [machineTypes] InstanceSelection machineTypes + * @property {number|null} [rank] InstanceSelection rank + */ + + /** + * Constructs a new InstanceSelection. + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy + * @classdesc Represents an InstanceSelection. + * @implements IInstanceSelection + * @constructor + * @param {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelection=} [properties] Properties to set + */ + function InstanceSelection(properties) { + this.machineTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceSelection machineTypes. + * @member {Array.} machineTypes + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection + * @instance + */ + InstanceSelection.prototype.machineTypes = $util.emptyArray; + + /** + * InstanceSelection rank. + * @member {number} rank + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection + * @instance + */ + InstanceSelection.prototype.rank = 0; + + /** + * Creates a new InstanceSelection instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection + * @static + * @param {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelection=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection} InstanceSelection instance + */ + InstanceSelection.create = function create(properties) { + return new InstanceSelection(properties); + }; + + /** + * Encodes the specified InstanceSelection message. Does not implicitly {@link google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection + * @static + * @param {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelection} message InstanceSelection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceSelection.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.machineTypes != null && message.machineTypes.length) + for (var i = 0; i < message.machineTypes.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.machineTypes[i]); + if (message.rank != null && Object.hasOwnProperty.call(message, "rank")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.rank); + return writer; + }; + + /** + * Encodes the specified InstanceSelection message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection + * @static + * @param {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelection} message InstanceSelection message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceSelection.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceSelection message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection} InstanceSelection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceSelection.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.machineTypes && message.machineTypes.length)) + message.machineTypes = []; + message.machineTypes.push(reader.string()); + break; + } + case 2: { + message.rank = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceSelection message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection} InstanceSelection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceSelection.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceSelection message. + * @function verify + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceSelection.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.machineTypes != null && message.hasOwnProperty("machineTypes")) { + if (!Array.isArray(message.machineTypes)) + return "machineTypes: array expected"; + for (var i = 0; i < message.machineTypes.length; ++i) + if (!$util.isString(message.machineTypes[i])) + return "machineTypes: string[] expected"; + } + if (message.rank != null && message.hasOwnProperty("rank")) + if (!$util.isInteger(message.rank)) + return "rank: integer expected"; + return null; + }; + + /** + * Creates an InstanceSelection message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection} InstanceSelection + */ + InstanceSelection.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection) + return object; + var message = new $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection(); + if (object.machineTypes) { + if (!Array.isArray(object.machineTypes)) + throw TypeError(".google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection.machineTypes: array expected"); + message.machineTypes = []; + for (var i = 0; i < object.machineTypes.length; ++i) + message.machineTypes[i] = String(object.machineTypes[i]); + } + if (object.rank != null) + message.rank = object.rank | 0; + return message; + }; + + /** + * Creates a plain object from an InstanceSelection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection + * @static + * @param {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection} message InstanceSelection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceSelection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.machineTypes = []; + if (options.defaults) + object.rank = 0; + if (message.machineTypes && message.machineTypes.length) { + object.machineTypes = []; + for (var j = 0; j < message.machineTypes.length; ++j) + object.machineTypes[j] = message.machineTypes[j]; + } + if (message.rank != null && message.hasOwnProperty("rank")) + object.rank = message.rank; + return object; + }; + + /** + * Converts this InstanceSelection to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection + * @instance + * @returns {Object.} JSON object + */ + InstanceSelection.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstanceSelection + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstanceSelection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection"; + }; + + return InstanceSelection; + })(); + + InstanceFlexibilityPolicy.InstanceSelectionResult = (function() { + + /** + * Properties of an InstanceSelectionResult. + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy + * @interface IInstanceSelectionResult + * @property {string|null} [machineType] InstanceSelectionResult machineType + * @property {number|null} [vmCount] InstanceSelectionResult vmCount + */ + + /** + * Constructs a new InstanceSelectionResult. + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy + * @classdesc Represents an InstanceSelectionResult. + * @implements IInstanceSelectionResult + * @constructor + * @param {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelectionResult=} [properties] Properties to set + */ + function InstanceSelectionResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceSelectionResult machineType. + * @member {string|null|undefined} machineType + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult + * @instance + */ + InstanceSelectionResult.prototype.machineType = null; + + /** + * InstanceSelectionResult vmCount. + * @member {number|null|undefined} vmCount + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult + * @instance + */ + InstanceSelectionResult.prototype.vmCount = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(InstanceSelectionResult.prototype, "_machineType", { + get: $util.oneOfGetter($oneOfFields = ["machineType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(InstanceSelectionResult.prototype, "_vmCount", { + get: $util.oneOfGetter($oneOfFields = ["vmCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InstanceSelectionResult instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult + * @static + * @param {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelectionResult=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult} InstanceSelectionResult instance + */ + InstanceSelectionResult.create = function create(properties) { + return new InstanceSelectionResult(properties); + }; + + /** + * Encodes the specified InstanceSelectionResult message. Does not implicitly {@link google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult + * @static + * @param {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelectionResult} message InstanceSelectionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceSelectionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.machineType); + if (message.vmCount != null && Object.hasOwnProperty.call(message, "vmCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.vmCount); + return writer; + }; + + /** + * Encodes the specified InstanceSelectionResult message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult + * @static + * @param {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelectionResult} message InstanceSelectionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceSelectionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceSelectionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult} InstanceSelectionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceSelectionResult.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.machineType = reader.string(); + break; + } + case 2: { + message.vmCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceSelectionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult} InstanceSelectionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceSelectionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceSelectionResult message. + * @function verify + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceSelectionResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.machineType != null && message.hasOwnProperty("machineType")) { + properties._machineType = 1; + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + } + if (message.vmCount != null && message.hasOwnProperty("vmCount")) { + properties._vmCount = 1; + if (!$util.isInteger(message.vmCount)) + return "vmCount: integer expected"; + } + return null; + }; + + /** + * Creates an InstanceSelectionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult} InstanceSelectionResult + */ + InstanceSelectionResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult) + return object; + var message = new $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult(); + if (object.machineType != null) + message.machineType = String(object.machineType); + if (object.vmCount != null) + message.vmCount = object.vmCount | 0; + return message; + }; + + /** + * Creates a plain object from an InstanceSelectionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult + * @static + * @param {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult} message InstanceSelectionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceSelectionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.machineType != null && message.hasOwnProperty("machineType")) { + object.machineType = message.machineType; + if (options.oneofs) + object._machineType = "machineType"; + } + if (message.vmCount != null && message.hasOwnProperty("vmCount")) { + object.vmCount = message.vmCount; + if (options.oneofs) + object._vmCount = "vmCount"; + } + return object; + }; + + /** + * Converts this InstanceSelectionResult to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult + * @instance + * @returns {Object.} JSON object + */ + InstanceSelectionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstanceSelectionResult + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstanceSelectionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult"; + }; + + return InstanceSelectionResult; + })(); + + return InstanceFlexibilityPolicy; + })(); + + v1.AcceleratorConfig = (function() { + + /** + * Properties of an AcceleratorConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IAcceleratorConfig + * @property {string|null} [acceleratorTypeUri] AcceleratorConfig acceleratorTypeUri + * @property {number|null} [acceleratorCount] AcceleratorConfig acceleratorCount + */ + + /** + * Constructs a new AcceleratorConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents an AcceleratorConfig. + * @implements IAcceleratorConfig + * @constructor + * @param {google.cloud.dataproc.v1.IAcceleratorConfig=} [properties] Properties to set + */ + function AcceleratorConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AcceleratorConfig acceleratorTypeUri. + * @member {string} acceleratorTypeUri + * @memberof google.cloud.dataproc.v1.AcceleratorConfig + * @instance + */ + AcceleratorConfig.prototype.acceleratorTypeUri = ""; + + /** + * AcceleratorConfig acceleratorCount. + * @member {number} acceleratorCount + * @memberof google.cloud.dataproc.v1.AcceleratorConfig + * @instance + */ + AcceleratorConfig.prototype.acceleratorCount = 0; + + /** + * Creates a new AcceleratorConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.AcceleratorConfig + * @static + * @param {google.cloud.dataproc.v1.IAcceleratorConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.AcceleratorConfig} AcceleratorConfig instance + */ + AcceleratorConfig.create = function create(properties) { + return new AcceleratorConfig(properties); + }; + + /** + * Encodes the specified AcceleratorConfig message. Does not implicitly {@link google.cloud.dataproc.v1.AcceleratorConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.AcceleratorConfig + * @static + * @param {google.cloud.dataproc.v1.IAcceleratorConfig} message AcceleratorConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcceleratorConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.acceleratorTypeUri != null && Object.hasOwnProperty.call(message, "acceleratorTypeUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.acceleratorTypeUri); + if (message.acceleratorCount != null && Object.hasOwnProperty.call(message, "acceleratorCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.acceleratorCount); + return writer; + }; + + /** + * Encodes the specified AcceleratorConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.AcceleratorConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.AcceleratorConfig + * @static + * @param {google.cloud.dataproc.v1.IAcceleratorConfig} message AcceleratorConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcceleratorConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AcceleratorConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.AcceleratorConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.AcceleratorConfig} AcceleratorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcceleratorConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.AcceleratorConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.acceleratorTypeUri = reader.string(); + break; + } + case 2: { + message.acceleratorCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AcceleratorConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.AcceleratorConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.AcceleratorConfig} AcceleratorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcceleratorConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AcceleratorConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.AcceleratorConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AcceleratorConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.acceleratorTypeUri != null && message.hasOwnProperty("acceleratorTypeUri")) + if (!$util.isString(message.acceleratorTypeUri)) + return "acceleratorTypeUri: string expected"; + if (message.acceleratorCount != null && message.hasOwnProperty("acceleratorCount")) + if (!$util.isInteger(message.acceleratorCount)) + return "acceleratorCount: integer expected"; + return null; + }; + + /** + * Creates an AcceleratorConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.AcceleratorConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.AcceleratorConfig} AcceleratorConfig + */ + AcceleratorConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.AcceleratorConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.AcceleratorConfig(); + if (object.acceleratorTypeUri != null) + message.acceleratorTypeUri = String(object.acceleratorTypeUri); + if (object.acceleratorCount != null) + message.acceleratorCount = object.acceleratorCount | 0; + return message; + }; + + /** + * Creates a plain object from an AcceleratorConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.AcceleratorConfig + * @static + * @param {google.cloud.dataproc.v1.AcceleratorConfig} message AcceleratorConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AcceleratorConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.acceleratorTypeUri = ""; + object.acceleratorCount = 0; + } + if (message.acceleratorTypeUri != null && message.hasOwnProperty("acceleratorTypeUri")) + object.acceleratorTypeUri = message.acceleratorTypeUri; + if (message.acceleratorCount != null && message.hasOwnProperty("acceleratorCount")) + object.acceleratorCount = message.acceleratorCount; + return object; + }; + + /** + * Converts this AcceleratorConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.AcceleratorConfig + * @instance + * @returns {Object.} JSON object + */ + AcceleratorConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AcceleratorConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.AcceleratorConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AcceleratorConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.AcceleratorConfig"; + }; + + return AcceleratorConfig; + })(); + + v1.DiskConfig = (function() { + + /** + * Properties of a DiskConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IDiskConfig + * @property {string|null} [bootDiskType] DiskConfig bootDiskType + * @property {number|null} [bootDiskSizeGb] DiskConfig bootDiskSizeGb + * @property {number|null} [numLocalSsds] DiskConfig numLocalSsds + * @property {string|null} [localSsdInterface] DiskConfig localSsdInterface + * @property {number|Long|null} [bootDiskProvisionedIops] DiskConfig bootDiskProvisionedIops + * @property {number|Long|null} [bootDiskProvisionedThroughput] DiskConfig bootDiskProvisionedThroughput + */ + + /** + * Constructs a new DiskConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a DiskConfig. + * @implements IDiskConfig + * @constructor + * @param {google.cloud.dataproc.v1.IDiskConfig=} [properties] Properties to set + */ + function DiskConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DiskConfig bootDiskType. + * @member {string} bootDiskType + * @memberof google.cloud.dataproc.v1.DiskConfig + * @instance + */ + DiskConfig.prototype.bootDiskType = ""; + + /** + * DiskConfig bootDiskSizeGb. + * @member {number} bootDiskSizeGb + * @memberof google.cloud.dataproc.v1.DiskConfig + * @instance + */ + DiskConfig.prototype.bootDiskSizeGb = 0; + + /** + * DiskConfig numLocalSsds. + * @member {number} numLocalSsds + * @memberof google.cloud.dataproc.v1.DiskConfig + * @instance + */ + DiskConfig.prototype.numLocalSsds = 0; + + /** + * DiskConfig localSsdInterface. + * @member {string} localSsdInterface + * @memberof google.cloud.dataproc.v1.DiskConfig + * @instance + */ + DiskConfig.prototype.localSsdInterface = ""; + + /** + * DiskConfig bootDiskProvisionedIops. + * @member {number|Long|null|undefined} bootDiskProvisionedIops + * @memberof google.cloud.dataproc.v1.DiskConfig + * @instance + */ + DiskConfig.prototype.bootDiskProvisionedIops = null; + + /** + * DiskConfig bootDiskProvisionedThroughput. + * @member {number|Long|null|undefined} bootDiskProvisionedThroughput + * @memberof google.cloud.dataproc.v1.DiskConfig + * @instance + */ + DiskConfig.prototype.bootDiskProvisionedThroughput = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DiskConfig.prototype, "_bootDiskProvisionedIops", { + get: $util.oneOfGetter($oneOfFields = ["bootDiskProvisionedIops"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DiskConfig.prototype, "_bootDiskProvisionedThroughput", { + get: $util.oneOfGetter($oneOfFields = ["bootDiskProvisionedThroughput"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DiskConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.DiskConfig + * @static + * @param {google.cloud.dataproc.v1.IDiskConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.DiskConfig} DiskConfig instance + */ + DiskConfig.create = function create(properties) { + return new DiskConfig(properties); + }; + + /** + * Encodes the specified DiskConfig message. Does not implicitly {@link google.cloud.dataproc.v1.DiskConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.DiskConfig + * @static + * @param {google.cloud.dataproc.v1.IDiskConfig} message DiskConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiskConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bootDiskSizeGb != null && Object.hasOwnProperty.call(message, "bootDiskSizeGb")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.bootDiskSizeGb); + if (message.numLocalSsds != null && Object.hasOwnProperty.call(message, "numLocalSsds")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.numLocalSsds); + if (message.bootDiskType != null && Object.hasOwnProperty.call(message, "bootDiskType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.bootDiskType); + if (message.localSsdInterface != null && Object.hasOwnProperty.call(message, "localSsdInterface")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.localSsdInterface); + if (message.bootDiskProvisionedIops != null && Object.hasOwnProperty.call(message, "bootDiskProvisionedIops")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.bootDiskProvisionedIops); + if (message.bootDiskProvisionedThroughput != null && Object.hasOwnProperty.call(message, "bootDiskProvisionedThroughput")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.bootDiskProvisionedThroughput); + return writer; + }; + + /** + * Encodes the specified DiskConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DiskConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.DiskConfig + * @static + * @param {google.cloud.dataproc.v1.IDiskConfig} message DiskConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiskConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DiskConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.DiskConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.DiskConfig} DiskConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiskConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.DiskConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.bootDiskType = reader.string(); + break; + } + case 1: { + message.bootDiskSizeGb = reader.int32(); + break; + } + case 2: { + message.numLocalSsds = reader.int32(); + break; + } + case 4: { + message.localSsdInterface = reader.string(); + break; + } + case 5: { + message.bootDiskProvisionedIops = reader.int64(); + break; + } + case 6: { + message.bootDiskProvisionedThroughput = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DiskConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.DiskConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.DiskConfig} DiskConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiskConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DiskConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.DiskConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DiskConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bootDiskType != null && message.hasOwnProperty("bootDiskType")) + if (!$util.isString(message.bootDiskType)) + return "bootDiskType: string expected"; + if (message.bootDiskSizeGb != null && message.hasOwnProperty("bootDiskSizeGb")) + if (!$util.isInteger(message.bootDiskSizeGb)) + return "bootDiskSizeGb: integer expected"; + if (message.numLocalSsds != null && message.hasOwnProperty("numLocalSsds")) + if (!$util.isInteger(message.numLocalSsds)) + return "numLocalSsds: integer expected"; + if (message.localSsdInterface != null && message.hasOwnProperty("localSsdInterface")) + if (!$util.isString(message.localSsdInterface)) + return "localSsdInterface: string expected"; + if (message.bootDiskProvisionedIops != null && message.hasOwnProperty("bootDiskProvisionedIops")) { + properties._bootDiskProvisionedIops = 1; + if (!$util.isInteger(message.bootDiskProvisionedIops) && !(message.bootDiskProvisionedIops && $util.isInteger(message.bootDiskProvisionedIops.low) && $util.isInteger(message.bootDiskProvisionedIops.high))) + return "bootDiskProvisionedIops: integer|Long expected"; + } + if (message.bootDiskProvisionedThroughput != null && message.hasOwnProperty("bootDiskProvisionedThroughput")) { + properties._bootDiskProvisionedThroughput = 1; + if (!$util.isInteger(message.bootDiskProvisionedThroughput) && !(message.bootDiskProvisionedThroughput && $util.isInteger(message.bootDiskProvisionedThroughput.low) && $util.isInteger(message.bootDiskProvisionedThroughput.high))) + return "bootDiskProvisionedThroughput: integer|Long expected"; + } + return null; + }; + + /** + * Creates a DiskConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.DiskConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.DiskConfig} DiskConfig + */ + DiskConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.DiskConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.DiskConfig(); + if (object.bootDiskType != null) + message.bootDiskType = String(object.bootDiskType); + if (object.bootDiskSizeGb != null) + message.bootDiskSizeGb = object.bootDiskSizeGb | 0; + if (object.numLocalSsds != null) + message.numLocalSsds = object.numLocalSsds | 0; + if (object.localSsdInterface != null) + message.localSsdInterface = String(object.localSsdInterface); + if (object.bootDiskProvisionedIops != null) + if ($util.Long) + (message.bootDiskProvisionedIops = $util.Long.fromValue(object.bootDiskProvisionedIops)).unsigned = false; + else if (typeof object.bootDiskProvisionedIops === "string") + message.bootDiskProvisionedIops = parseInt(object.bootDiskProvisionedIops, 10); + else if (typeof object.bootDiskProvisionedIops === "number") + message.bootDiskProvisionedIops = object.bootDiskProvisionedIops; + else if (typeof object.bootDiskProvisionedIops === "object") + message.bootDiskProvisionedIops = new $util.LongBits(object.bootDiskProvisionedIops.low >>> 0, object.bootDiskProvisionedIops.high >>> 0).toNumber(); + if (object.bootDiskProvisionedThroughput != null) + if ($util.Long) + (message.bootDiskProvisionedThroughput = $util.Long.fromValue(object.bootDiskProvisionedThroughput)).unsigned = false; + else if (typeof object.bootDiskProvisionedThroughput === "string") + message.bootDiskProvisionedThroughput = parseInt(object.bootDiskProvisionedThroughput, 10); + else if (typeof object.bootDiskProvisionedThroughput === "number") + message.bootDiskProvisionedThroughput = object.bootDiskProvisionedThroughput; + else if (typeof object.bootDiskProvisionedThroughput === "object") + message.bootDiskProvisionedThroughput = new $util.LongBits(object.bootDiskProvisionedThroughput.low >>> 0, object.bootDiskProvisionedThroughput.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a DiskConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.DiskConfig + * @static + * @param {google.cloud.dataproc.v1.DiskConfig} message DiskConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DiskConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.bootDiskSizeGb = 0; + object.numLocalSsds = 0; + object.bootDiskType = ""; + object.localSsdInterface = ""; + } + if (message.bootDiskSizeGb != null && message.hasOwnProperty("bootDiskSizeGb")) + object.bootDiskSizeGb = message.bootDiskSizeGb; + if (message.numLocalSsds != null && message.hasOwnProperty("numLocalSsds")) + object.numLocalSsds = message.numLocalSsds; + if (message.bootDiskType != null && message.hasOwnProperty("bootDiskType")) + object.bootDiskType = message.bootDiskType; + if (message.localSsdInterface != null && message.hasOwnProperty("localSsdInterface")) + object.localSsdInterface = message.localSsdInterface; + if (message.bootDiskProvisionedIops != null && message.hasOwnProperty("bootDiskProvisionedIops")) { + if (typeof message.bootDiskProvisionedIops === "number") + object.bootDiskProvisionedIops = options.longs === String ? String(message.bootDiskProvisionedIops) : message.bootDiskProvisionedIops; + else + object.bootDiskProvisionedIops = options.longs === String ? $util.Long.prototype.toString.call(message.bootDiskProvisionedIops) : options.longs === Number ? new $util.LongBits(message.bootDiskProvisionedIops.low >>> 0, message.bootDiskProvisionedIops.high >>> 0).toNumber() : message.bootDiskProvisionedIops; + if (options.oneofs) + object._bootDiskProvisionedIops = "bootDiskProvisionedIops"; + } + if (message.bootDiskProvisionedThroughput != null && message.hasOwnProperty("bootDiskProvisionedThroughput")) { + if (typeof message.bootDiskProvisionedThroughput === "number") + object.bootDiskProvisionedThroughput = options.longs === String ? String(message.bootDiskProvisionedThroughput) : message.bootDiskProvisionedThroughput; + else + object.bootDiskProvisionedThroughput = options.longs === String ? $util.Long.prototype.toString.call(message.bootDiskProvisionedThroughput) : options.longs === Number ? new $util.LongBits(message.bootDiskProvisionedThroughput.low >>> 0, message.bootDiskProvisionedThroughput.high >>> 0).toNumber() : message.bootDiskProvisionedThroughput; + if (options.oneofs) + object._bootDiskProvisionedThroughput = "bootDiskProvisionedThroughput"; + } + return object; + }; + + /** + * Converts this DiskConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.DiskConfig + * @instance + * @returns {Object.} JSON object + */ + DiskConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DiskConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.DiskConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DiskConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.DiskConfig"; + }; + + return DiskConfig; + })(); + + v1.AuxiliaryNodeGroup = (function() { + + /** + * Properties of an AuxiliaryNodeGroup. + * @memberof google.cloud.dataproc.v1 + * @interface IAuxiliaryNodeGroup + * @property {google.cloud.dataproc.v1.INodeGroup|null} [nodeGroup] AuxiliaryNodeGroup nodeGroup + * @property {string|null} [nodeGroupId] AuxiliaryNodeGroup nodeGroupId + */ + + /** + * Constructs a new AuxiliaryNodeGroup. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents an AuxiliaryNodeGroup. + * @implements IAuxiliaryNodeGroup + * @constructor + * @param {google.cloud.dataproc.v1.IAuxiliaryNodeGroup=} [properties] Properties to set + */ + function AuxiliaryNodeGroup(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuxiliaryNodeGroup nodeGroup. + * @member {google.cloud.dataproc.v1.INodeGroup|null|undefined} nodeGroup + * @memberof google.cloud.dataproc.v1.AuxiliaryNodeGroup + * @instance + */ + AuxiliaryNodeGroup.prototype.nodeGroup = null; + + /** + * AuxiliaryNodeGroup nodeGroupId. + * @member {string} nodeGroupId + * @memberof google.cloud.dataproc.v1.AuxiliaryNodeGroup + * @instance + */ + AuxiliaryNodeGroup.prototype.nodeGroupId = ""; + + /** + * Creates a new AuxiliaryNodeGroup instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.AuxiliaryNodeGroup + * @static + * @param {google.cloud.dataproc.v1.IAuxiliaryNodeGroup=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.AuxiliaryNodeGroup} AuxiliaryNodeGroup instance + */ + AuxiliaryNodeGroup.create = function create(properties) { + return new AuxiliaryNodeGroup(properties); + }; + + /** + * Encodes the specified AuxiliaryNodeGroup message. Does not implicitly {@link google.cloud.dataproc.v1.AuxiliaryNodeGroup.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.AuxiliaryNodeGroup + * @static + * @param {google.cloud.dataproc.v1.IAuxiliaryNodeGroup} message AuxiliaryNodeGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuxiliaryNodeGroup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodeGroup != null && Object.hasOwnProperty.call(message, "nodeGroup")) + $root.google.cloud.dataproc.v1.NodeGroup.encode(message.nodeGroup, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nodeGroupId != null && Object.hasOwnProperty.call(message, "nodeGroupId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nodeGroupId); + return writer; + }; + + /** + * Encodes the specified AuxiliaryNodeGroup message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.AuxiliaryNodeGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.AuxiliaryNodeGroup + * @static + * @param {google.cloud.dataproc.v1.IAuxiliaryNodeGroup} message AuxiliaryNodeGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuxiliaryNodeGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuxiliaryNodeGroup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.AuxiliaryNodeGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.AuxiliaryNodeGroup} AuxiliaryNodeGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuxiliaryNodeGroup.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.AuxiliaryNodeGroup(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.nodeGroup = $root.google.cloud.dataproc.v1.NodeGroup.decode(reader, reader.uint32()); + break; + } + case 2: { + message.nodeGroupId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuxiliaryNodeGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.AuxiliaryNodeGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.AuxiliaryNodeGroup} AuxiliaryNodeGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuxiliaryNodeGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuxiliaryNodeGroup message. + * @function verify + * @memberof google.cloud.dataproc.v1.AuxiliaryNodeGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuxiliaryNodeGroup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeGroup != null && message.hasOwnProperty("nodeGroup")) { + var error = $root.google.cloud.dataproc.v1.NodeGroup.verify(message.nodeGroup); + if (error) + return "nodeGroup." + error; + } + if (message.nodeGroupId != null && message.hasOwnProperty("nodeGroupId")) + if (!$util.isString(message.nodeGroupId)) + return "nodeGroupId: string expected"; + return null; + }; + + /** + * Creates an AuxiliaryNodeGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.AuxiliaryNodeGroup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.AuxiliaryNodeGroup} AuxiliaryNodeGroup + */ + AuxiliaryNodeGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.AuxiliaryNodeGroup) + return object; + var message = new $root.google.cloud.dataproc.v1.AuxiliaryNodeGroup(); + if (object.nodeGroup != null) { + if (typeof object.nodeGroup !== "object") + throw TypeError(".google.cloud.dataproc.v1.AuxiliaryNodeGroup.nodeGroup: object expected"); + message.nodeGroup = $root.google.cloud.dataproc.v1.NodeGroup.fromObject(object.nodeGroup); + } + if (object.nodeGroupId != null) + message.nodeGroupId = String(object.nodeGroupId); + return message; + }; + + /** + * Creates a plain object from an AuxiliaryNodeGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.AuxiliaryNodeGroup + * @static + * @param {google.cloud.dataproc.v1.AuxiliaryNodeGroup} message AuxiliaryNodeGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuxiliaryNodeGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.nodeGroup = null; + object.nodeGroupId = ""; + } + if (message.nodeGroup != null && message.hasOwnProperty("nodeGroup")) + object.nodeGroup = $root.google.cloud.dataproc.v1.NodeGroup.toObject(message.nodeGroup, options); + if (message.nodeGroupId != null && message.hasOwnProperty("nodeGroupId")) + object.nodeGroupId = message.nodeGroupId; + return object; + }; + + /** + * Converts this AuxiliaryNodeGroup to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.AuxiliaryNodeGroup + * @instance + * @returns {Object.} JSON object + */ + AuxiliaryNodeGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuxiliaryNodeGroup + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.AuxiliaryNodeGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuxiliaryNodeGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.AuxiliaryNodeGroup"; + }; + + return AuxiliaryNodeGroup; + })(); + + v1.NodeGroup = (function() { + + /** + * Properties of a NodeGroup. + * @memberof google.cloud.dataproc.v1 + * @interface INodeGroup + * @property {string|null} [name] NodeGroup name + * @property {Array.|null} [roles] NodeGroup roles + * @property {google.cloud.dataproc.v1.IInstanceGroupConfig|null} [nodeGroupConfig] NodeGroup nodeGroupConfig + * @property {Object.|null} [labels] NodeGroup labels + */ + + /** + * Constructs a new NodeGroup. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a NodeGroup. + * @implements INodeGroup + * @constructor + * @param {google.cloud.dataproc.v1.INodeGroup=} [properties] Properties to set + */ + function NodeGroup(properties) { + this.roles = []; + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeGroup name. + * @member {string} name + * @memberof google.cloud.dataproc.v1.NodeGroup + * @instance + */ + NodeGroup.prototype.name = ""; + + /** + * NodeGroup roles. + * @member {Array.} roles + * @memberof google.cloud.dataproc.v1.NodeGroup + * @instance + */ + NodeGroup.prototype.roles = $util.emptyArray; + + /** + * NodeGroup nodeGroupConfig. + * @member {google.cloud.dataproc.v1.IInstanceGroupConfig|null|undefined} nodeGroupConfig + * @memberof google.cloud.dataproc.v1.NodeGroup + * @instance + */ + NodeGroup.prototype.nodeGroupConfig = null; + + /** + * NodeGroup labels. + * @member {Object.} labels + * @memberof google.cloud.dataproc.v1.NodeGroup + * @instance + */ + NodeGroup.prototype.labels = $util.emptyObject; + + /** + * Creates a new NodeGroup instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.NodeGroup + * @static + * @param {google.cloud.dataproc.v1.INodeGroup=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.NodeGroup} NodeGroup instance + */ + NodeGroup.create = function create(properties) { + return new NodeGroup(properties); + }; + + /** + * Encodes the specified NodeGroup message. Does not implicitly {@link google.cloud.dataproc.v1.NodeGroup.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.NodeGroup + * @static + * @param {google.cloud.dataproc.v1.INodeGroup} message NodeGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeGroup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.roles != null && message.roles.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.roles.length; ++i) + writer.int32(message.roles[i]); + writer.ldelim(); + } + if (message.nodeGroupConfig != null && Object.hasOwnProperty.call(message, "nodeGroupConfig")) + $root.google.cloud.dataproc.v1.InstanceGroupConfig.encode(message.nodeGroupConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeGroup message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.NodeGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.NodeGroup + * @static + * @param {google.cloud.dataproc.v1.INodeGroup} message NodeGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeGroup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.NodeGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.NodeGroup} NodeGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeGroup.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.NodeGroup(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.roles && message.roles.length)) + message.roles = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.roles.push(reader.int32()); + } else + message.roles.push(reader.int32()); + break; + } + case 3: { + message.nodeGroupConfig = $root.google.cloud.dataproc.v1.InstanceGroupConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.NodeGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.NodeGroup} NodeGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeGroup message. + * @function verify + * @memberof google.cloud.dataproc.v1.NodeGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeGroup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.roles != null && message.hasOwnProperty("roles")) { + if (!Array.isArray(message.roles)) + return "roles: array expected"; + for (var i = 0; i < message.roles.length; ++i) + switch (message.roles[i]) { + default: + return "roles: enum value[] expected"; + case 0: + case 1: + break; + } + } + if (message.nodeGroupConfig != null && message.hasOwnProperty("nodeGroupConfig")) { + var error = $root.google.cloud.dataproc.v1.InstanceGroupConfig.verify(message.nodeGroupConfig); + if (error) + return "nodeGroupConfig." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a NodeGroup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.NodeGroup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.NodeGroup} NodeGroup + */ + NodeGroup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.NodeGroup) + return object; + var message = new $root.google.cloud.dataproc.v1.NodeGroup(); + if (object.name != null) + message.name = String(object.name); + if (object.roles) { + if (!Array.isArray(object.roles)) + throw TypeError(".google.cloud.dataproc.v1.NodeGroup.roles: array expected"); + message.roles = []; + for (var i = 0; i < object.roles.length; ++i) + switch (object.roles[i]) { + default: + if (typeof object.roles[i] === "number") { + message.roles[i] = object.roles[i]; + break; + } + case "ROLE_UNSPECIFIED": + case 0: + message.roles[i] = 0; + break; + case "DRIVER": + case 1: + message.roles[i] = 1; + break; + } + } + if (object.nodeGroupConfig != null) { + if (typeof object.nodeGroupConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.NodeGroup.nodeGroupConfig: object expected"); + message.nodeGroupConfig = $root.google.cloud.dataproc.v1.InstanceGroupConfig.fromObject(object.nodeGroupConfig); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.dataproc.v1.NodeGroup.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a NodeGroup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.NodeGroup + * @static + * @param {google.cloud.dataproc.v1.NodeGroup} message NodeGroup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeGroup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.roles = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.nodeGroupConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.roles && message.roles.length) { + object.roles = []; + for (var j = 0; j < message.roles.length; ++j) + object.roles[j] = options.enums === String ? $root.google.cloud.dataproc.v1.NodeGroup.Role[message.roles[j]] === undefined ? message.roles[j] : $root.google.cloud.dataproc.v1.NodeGroup.Role[message.roles[j]] : message.roles[j]; + } + if (message.nodeGroupConfig != null && message.hasOwnProperty("nodeGroupConfig")) + object.nodeGroupConfig = $root.google.cloud.dataproc.v1.InstanceGroupConfig.toObject(message.nodeGroupConfig, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this NodeGroup to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.NodeGroup + * @instance + * @returns {Object.} JSON object + */ + NodeGroup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeGroup + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.NodeGroup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.NodeGroup"; + }; + + /** + * Role enum. + * @name google.cloud.dataproc.v1.NodeGroup.Role + * @enum {number} + * @property {number} ROLE_UNSPECIFIED=0 ROLE_UNSPECIFIED value + * @property {number} DRIVER=1 DRIVER value + */ + NodeGroup.Role = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ROLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DRIVER"] = 1; + return values; + })(); + + return NodeGroup; + })(); + + v1.NodeInitializationAction = (function() { + + /** + * Properties of a NodeInitializationAction. + * @memberof google.cloud.dataproc.v1 + * @interface INodeInitializationAction + * @property {string|null} [executableFile] NodeInitializationAction executableFile + * @property {google.protobuf.IDuration|null} [executionTimeout] NodeInitializationAction executionTimeout + */ + + /** + * Constructs a new NodeInitializationAction. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a NodeInitializationAction. + * @implements INodeInitializationAction + * @constructor + * @param {google.cloud.dataproc.v1.INodeInitializationAction=} [properties] Properties to set + */ + function NodeInitializationAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeInitializationAction executableFile. + * @member {string} executableFile + * @memberof google.cloud.dataproc.v1.NodeInitializationAction + * @instance + */ + NodeInitializationAction.prototype.executableFile = ""; + + /** + * NodeInitializationAction executionTimeout. + * @member {google.protobuf.IDuration|null|undefined} executionTimeout + * @memberof google.cloud.dataproc.v1.NodeInitializationAction + * @instance + */ + NodeInitializationAction.prototype.executionTimeout = null; + + /** + * Creates a new NodeInitializationAction instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.NodeInitializationAction + * @static + * @param {google.cloud.dataproc.v1.INodeInitializationAction=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.NodeInitializationAction} NodeInitializationAction instance + */ + NodeInitializationAction.create = function create(properties) { + return new NodeInitializationAction(properties); + }; + + /** + * Encodes the specified NodeInitializationAction message. Does not implicitly {@link google.cloud.dataproc.v1.NodeInitializationAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.NodeInitializationAction + * @static + * @param {google.cloud.dataproc.v1.INodeInitializationAction} message NodeInitializationAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeInitializationAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.executableFile != null && Object.hasOwnProperty.call(message, "executableFile")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.executableFile); + if (message.executionTimeout != null && Object.hasOwnProperty.call(message, "executionTimeout")) + $root.google.protobuf.Duration.encode(message.executionTimeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeInitializationAction message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.NodeInitializationAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.NodeInitializationAction + * @static + * @param {google.cloud.dataproc.v1.INodeInitializationAction} message NodeInitializationAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeInitializationAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeInitializationAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.NodeInitializationAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.NodeInitializationAction} NodeInitializationAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeInitializationAction.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.NodeInitializationAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.executableFile = reader.string(); + break; + } + case 2: { + message.executionTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeInitializationAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.NodeInitializationAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.NodeInitializationAction} NodeInitializationAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeInitializationAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeInitializationAction message. + * @function verify + * @memberof google.cloud.dataproc.v1.NodeInitializationAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeInitializationAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.executableFile != null && message.hasOwnProperty("executableFile")) + if (!$util.isString(message.executableFile)) + return "executableFile: string expected"; + if (message.executionTimeout != null && message.hasOwnProperty("executionTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.executionTimeout); + if (error) + return "executionTimeout." + error; + } + return null; + }; + + /** + * Creates a NodeInitializationAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.NodeInitializationAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.NodeInitializationAction} NodeInitializationAction + */ + NodeInitializationAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.NodeInitializationAction) + return object; + var message = new $root.google.cloud.dataproc.v1.NodeInitializationAction(); + if (object.executableFile != null) + message.executableFile = String(object.executableFile); + if (object.executionTimeout != null) { + if (typeof object.executionTimeout !== "object") + throw TypeError(".google.cloud.dataproc.v1.NodeInitializationAction.executionTimeout: object expected"); + message.executionTimeout = $root.google.protobuf.Duration.fromObject(object.executionTimeout); + } + return message; + }; + + /** + * Creates a plain object from a NodeInitializationAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.NodeInitializationAction + * @static + * @param {google.cloud.dataproc.v1.NodeInitializationAction} message NodeInitializationAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeInitializationAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.executableFile = ""; + object.executionTimeout = null; + } + if (message.executableFile != null && message.hasOwnProperty("executableFile")) + object.executableFile = message.executableFile; + if (message.executionTimeout != null && message.hasOwnProperty("executionTimeout")) + object.executionTimeout = $root.google.protobuf.Duration.toObject(message.executionTimeout, options); + return object; + }; + + /** + * Converts this NodeInitializationAction to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.NodeInitializationAction + * @instance + * @returns {Object.} JSON object + */ + NodeInitializationAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeInitializationAction + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.NodeInitializationAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeInitializationAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.NodeInitializationAction"; + }; + + return NodeInitializationAction; + })(); + + v1.ClusterStatus = (function() { + + /** + * Properties of a ClusterStatus. + * @memberof google.cloud.dataproc.v1 + * @interface IClusterStatus + * @property {google.cloud.dataproc.v1.ClusterStatus.State|null} [state] ClusterStatus state + * @property {string|null} [detail] ClusterStatus detail + * @property {google.protobuf.ITimestamp|null} [stateStartTime] ClusterStatus stateStartTime + * @property {google.cloud.dataproc.v1.ClusterStatus.Substate|null} [substate] ClusterStatus substate + */ + + /** + * Constructs a new ClusterStatus. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a ClusterStatus. + * @implements IClusterStatus + * @constructor + * @param {google.cloud.dataproc.v1.IClusterStatus=} [properties] Properties to set + */ + function ClusterStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClusterStatus state. + * @member {google.cloud.dataproc.v1.ClusterStatus.State} state + * @memberof google.cloud.dataproc.v1.ClusterStatus + * @instance + */ + ClusterStatus.prototype.state = 0; + + /** + * ClusterStatus detail. + * @member {string} detail + * @memberof google.cloud.dataproc.v1.ClusterStatus + * @instance + */ + ClusterStatus.prototype.detail = ""; + + /** + * ClusterStatus stateStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} stateStartTime + * @memberof google.cloud.dataproc.v1.ClusterStatus + * @instance + */ + ClusterStatus.prototype.stateStartTime = null; + + /** + * ClusterStatus substate. + * @member {google.cloud.dataproc.v1.ClusterStatus.Substate} substate + * @memberof google.cloud.dataproc.v1.ClusterStatus + * @instance + */ + ClusterStatus.prototype.substate = 0; + + /** + * Creates a new ClusterStatus instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.ClusterStatus + * @static + * @param {google.cloud.dataproc.v1.IClusterStatus=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.ClusterStatus} ClusterStatus instance + */ + ClusterStatus.create = function create(properties) { + return new ClusterStatus(properties); + }; + + /** + * Encodes the specified ClusterStatus message. Does not implicitly {@link google.cloud.dataproc.v1.ClusterStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.ClusterStatus + * @static + * @param {google.cloud.dataproc.v1.IClusterStatus} message ClusterStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.detail != null && Object.hasOwnProperty.call(message, "detail")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.detail); + if (message.stateStartTime != null && Object.hasOwnProperty.call(message, "stateStartTime")) + $root.google.protobuf.Timestamp.encode(message.stateStartTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.substate != null && Object.hasOwnProperty.call(message, "substate")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.substate); + return writer; + }; + + /** + * Encodes the specified ClusterStatus message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ClusterStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.ClusterStatus + * @static + * @param {google.cloud.dataproc.v1.IClusterStatus} message ClusterStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClusterStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.ClusterStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.ClusterStatus} ClusterStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterStatus.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ClusterStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.detail = reader.string(); + break; + } + case 3: { + message.stateStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.substate = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClusterStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.ClusterStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.ClusterStatus} ClusterStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClusterStatus message. + * @function verify + * @memberof google.cloud.dataproc.v1.ClusterStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClusterStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 9: + case 4: + case 5: + case 6: + case 7: + case 8: + case 10: + break; + } + if (message.detail != null && message.hasOwnProperty("detail")) + if (!$util.isString(message.detail)) + return "detail: string expected"; + if (message.stateStartTime != null && message.hasOwnProperty("stateStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.stateStartTime); + if (error) + return "stateStartTime." + error; + } + if (message.substate != null && message.hasOwnProperty("substate")) + switch (message.substate) { + default: + return "substate: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ClusterStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.ClusterStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.ClusterStatus} ClusterStatus + */ + ClusterStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.ClusterStatus) + return object; + var message = new $root.google.cloud.dataproc.v1.ClusterStatus(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "UNKNOWN": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "RUNNING": + case 2: + message.state = 2; + break; + case "ERROR": + case 3: + message.state = 3; + break; + case "ERROR_DUE_TO_UPDATE": + case 9: + message.state = 9; + break; + case "DELETING": + case 4: + message.state = 4; + break; + case "UPDATING": + case 5: + message.state = 5; + break; + case "STOPPING": + case 6: + message.state = 6; + break; + case "STOPPED": + case 7: + message.state = 7; + break; + case "STARTING": + case 8: + message.state = 8; + break; + case "REPAIRING": + case 10: + message.state = 10; + break; + } + if (object.detail != null) + message.detail = String(object.detail); + if (object.stateStartTime != null) { + if (typeof object.stateStartTime !== "object") + throw TypeError(".google.cloud.dataproc.v1.ClusterStatus.stateStartTime: object expected"); + message.stateStartTime = $root.google.protobuf.Timestamp.fromObject(object.stateStartTime); + } + switch (object.substate) { + default: + if (typeof object.substate === "number") { + message.substate = object.substate; + break; + } + break; + case "UNSPECIFIED": + case 0: + message.substate = 0; + break; + case "UNHEALTHY": + case 1: + message.substate = 1; + break; + case "STALE_STATUS": + case 2: + message.substate = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ClusterStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.ClusterStatus + * @static + * @param {google.cloud.dataproc.v1.ClusterStatus} message ClusterStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClusterStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "UNKNOWN" : 0; + object.detail = ""; + object.stateStartTime = null; + object.substate = options.enums === String ? "UNSPECIFIED" : 0; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.dataproc.v1.ClusterStatus.State[message.state] === undefined ? message.state : $root.google.cloud.dataproc.v1.ClusterStatus.State[message.state] : message.state; + if (message.detail != null && message.hasOwnProperty("detail")) + object.detail = message.detail; + if (message.stateStartTime != null && message.hasOwnProperty("stateStartTime")) + object.stateStartTime = $root.google.protobuf.Timestamp.toObject(message.stateStartTime, options); + if (message.substate != null && message.hasOwnProperty("substate")) + object.substate = options.enums === String ? $root.google.cloud.dataproc.v1.ClusterStatus.Substate[message.substate] === undefined ? message.substate : $root.google.cloud.dataproc.v1.ClusterStatus.Substate[message.substate] : message.substate; + return object; + }; + + /** + * Converts this ClusterStatus to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.ClusterStatus + * @instance + * @returns {Object.} JSON object + */ + ClusterStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClusterStatus + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.ClusterStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClusterStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.ClusterStatus"; + }; + + /** + * State enum. + * @name google.cloud.dataproc.v1.ClusterStatus.State + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} CREATING=1 CREATING value + * @property {number} RUNNING=2 RUNNING value + * @property {number} ERROR=3 ERROR value + * @property {number} ERROR_DUE_TO_UPDATE=9 ERROR_DUE_TO_UPDATE value + * @property {number} DELETING=4 DELETING value + * @property {number} UPDATING=5 UPDATING value + * @property {number} STOPPING=6 STOPPING value + * @property {number} STOPPED=7 STOPPED value + * @property {number} STARTING=8 STARTING value + * @property {number} REPAIRING=10 REPAIRING value + */ + ClusterStatus.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "RUNNING"] = 2; + values[valuesById[3] = "ERROR"] = 3; + values[valuesById[9] = "ERROR_DUE_TO_UPDATE"] = 9; + values[valuesById[4] = "DELETING"] = 4; + values[valuesById[5] = "UPDATING"] = 5; + values[valuesById[6] = "STOPPING"] = 6; + values[valuesById[7] = "STOPPED"] = 7; + values[valuesById[8] = "STARTING"] = 8; + values[valuesById[10] = "REPAIRING"] = 10; + return values; + })(); + + /** + * Substate enum. + * @name google.cloud.dataproc.v1.ClusterStatus.Substate + * @enum {number} + * @property {number} UNSPECIFIED=0 UNSPECIFIED value + * @property {number} UNHEALTHY=1 UNHEALTHY value + * @property {number} STALE_STATUS=2 STALE_STATUS value + */ + ClusterStatus.Substate = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNSPECIFIED"] = 0; + values[valuesById[1] = "UNHEALTHY"] = 1; + values[valuesById[2] = "STALE_STATUS"] = 2; + return values; + })(); + + return ClusterStatus; + })(); + + v1.SecurityConfig = (function() { + + /** + * Properties of a SecurityConfig. + * @memberof google.cloud.dataproc.v1 + * @interface ISecurityConfig + * @property {google.cloud.dataproc.v1.IKerberosConfig|null} [kerberosConfig] SecurityConfig kerberosConfig + * @property {google.cloud.dataproc.v1.IIdentityConfig|null} [identityConfig] SecurityConfig identityConfig + */ + + /** + * Constructs a new SecurityConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a SecurityConfig. + * @implements ISecurityConfig + * @constructor + * @param {google.cloud.dataproc.v1.ISecurityConfig=} [properties] Properties to set + */ + function SecurityConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecurityConfig kerberosConfig. + * @member {google.cloud.dataproc.v1.IKerberosConfig|null|undefined} kerberosConfig + * @memberof google.cloud.dataproc.v1.SecurityConfig + * @instance + */ + SecurityConfig.prototype.kerberosConfig = null; + + /** + * SecurityConfig identityConfig. + * @member {google.cloud.dataproc.v1.IIdentityConfig|null|undefined} identityConfig + * @memberof google.cloud.dataproc.v1.SecurityConfig + * @instance + */ + SecurityConfig.prototype.identityConfig = null; + + /** + * Creates a new SecurityConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.SecurityConfig + * @static + * @param {google.cloud.dataproc.v1.ISecurityConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.SecurityConfig} SecurityConfig instance + */ + SecurityConfig.create = function create(properties) { + return new SecurityConfig(properties); + }; + + /** + * Encodes the specified SecurityConfig message. Does not implicitly {@link google.cloud.dataproc.v1.SecurityConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.SecurityConfig + * @static + * @param {google.cloud.dataproc.v1.ISecurityConfig} message SecurityConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kerberosConfig != null && Object.hasOwnProperty.call(message, "kerberosConfig")) + $root.google.cloud.dataproc.v1.KerberosConfig.encode(message.kerberosConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.identityConfig != null && Object.hasOwnProperty.call(message, "identityConfig")) + $root.google.cloud.dataproc.v1.IdentityConfig.encode(message.identityConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SecurityConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SecurityConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.SecurityConfig + * @static + * @param {google.cloud.dataproc.v1.ISecurityConfig} message SecurityConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.SecurityConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.SecurityConfig} SecurityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.SecurityConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kerberosConfig = $root.google.cloud.dataproc.v1.KerberosConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.identityConfig = $root.google.cloud.dataproc.v1.IdentityConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.SecurityConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.SecurityConfig} SecurityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.SecurityConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kerberosConfig != null && message.hasOwnProperty("kerberosConfig")) { + var error = $root.google.cloud.dataproc.v1.KerberosConfig.verify(message.kerberosConfig); + if (error) + return "kerberosConfig." + error; + } + if (message.identityConfig != null && message.hasOwnProperty("identityConfig")) { + var error = $root.google.cloud.dataproc.v1.IdentityConfig.verify(message.identityConfig); + if (error) + return "identityConfig." + error; + } + return null; + }; + + /** + * Creates a SecurityConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.SecurityConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.SecurityConfig} SecurityConfig + */ + SecurityConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.SecurityConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.SecurityConfig(); + if (object.kerberosConfig != null) { + if (typeof object.kerberosConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.SecurityConfig.kerberosConfig: object expected"); + message.kerberosConfig = $root.google.cloud.dataproc.v1.KerberosConfig.fromObject(object.kerberosConfig); + } + if (object.identityConfig != null) { + if (typeof object.identityConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.SecurityConfig.identityConfig: object expected"); + message.identityConfig = $root.google.cloud.dataproc.v1.IdentityConfig.fromObject(object.identityConfig); + } + return message; + }; + + /** + * Creates a plain object from a SecurityConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.SecurityConfig + * @static + * @param {google.cloud.dataproc.v1.SecurityConfig} message SecurityConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kerberosConfig = null; + object.identityConfig = null; + } + if (message.kerberosConfig != null && message.hasOwnProperty("kerberosConfig")) + object.kerberosConfig = $root.google.cloud.dataproc.v1.KerberosConfig.toObject(message.kerberosConfig, options); + if (message.identityConfig != null && message.hasOwnProperty("identityConfig")) + object.identityConfig = $root.google.cloud.dataproc.v1.IdentityConfig.toObject(message.identityConfig, options); + return object; + }; + + /** + * Converts this SecurityConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.SecurityConfig + * @instance + * @returns {Object.} JSON object + */ + SecurityConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SecurityConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.SecurityConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SecurityConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.SecurityConfig"; + }; + + return SecurityConfig; + })(); + + v1.KerberosConfig = (function() { + + /** + * Properties of a KerberosConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IKerberosConfig + * @property {boolean|null} [enableKerberos] KerberosConfig enableKerberos + * @property {string|null} [rootPrincipalPasswordUri] KerberosConfig rootPrincipalPasswordUri + * @property {string|null} [kmsKeyUri] KerberosConfig kmsKeyUri + * @property {string|null} [keystoreUri] KerberosConfig keystoreUri + * @property {string|null} [truststoreUri] KerberosConfig truststoreUri + * @property {string|null} [keystorePasswordUri] KerberosConfig keystorePasswordUri + * @property {string|null} [keyPasswordUri] KerberosConfig keyPasswordUri + * @property {string|null} [truststorePasswordUri] KerberosConfig truststorePasswordUri + * @property {string|null} [crossRealmTrustRealm] KerberosConfig crossRealmTrustRealm + * @property {string|null} [crossRealmTrustKdc] KerberosConfig crossRealmTrustKdc + * @property {string|null} [crossRealmTrustAdminServer] KerberosConfig crossRealmTrustAdminServer + * @property {string|null} [crossRealmTrustSharedPasswordUri] KerberosConfig crossRealmTrustSharedPasswordUri + * @property {string|null} [kdcDbKeyUri] KerberosConfig kdcDbKeyUri + * @property {number|null} [tgtLifetimeHours] KerberosConfig tgtLifetimeHours + * @property {string|null} [realm] KerberosConfig realm + */ + + /** + * Constructs a new KerberosConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a KerberosConfig. + * @implements IKerberosConfig + * @constructor + * @param {google.cloud.dataproc.v1.IKerberosConfig=} [properties] Properties to set + */ + function KerberosConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KerberosConfig enableKerberos. + * @member {boolean} enableKerberos + * @memberof google.cloud.dataproc.v1.KerberosConfig + * @instance + */ + KerberosConfig.prototype.enableKerberos = false; + + /** + * KerberosConfig rootPrincipalPasswordUri. + * @member {string} rootPrincipalPasswordUri + * @memberof google.cloud.dataproc.v1.KerberosConfig + * @instance + */ + KerberosConfig.prototype.rootPrincipalPasswordUri = ""; + + /** + * KerberosConfig kmsKeyUri. + * @member {string} kmsKeyUri + * @memberof google.cloud.dataproc.v1.KerberosConfig + * @instance + */ + KerberosConfig.prototype.kmsKeyUri = ""; + + /** + * KerberosConfig keystoreUri. + * @member {string} keystoreUri + * @memberof google.cloud.dataproc.v1.KerberosConfig + * @instance + */ + KerberosConfig.prototype.keystoreUri = ""; + + /** + * KerberosConfig truststoreUri. + * @member {string} truststoreUri + * @memberof google.cloud.dataproc.v1.KerberosConfig + * @instance + */ + KerberosConfig.prototype.truststoreUri = ""; + + /** + * KerberosConfig keystorePasswordUri. + * @member {string} keystorePasswordUri + * @memberof google.cloud.dataproc.v1.KerberosConfig + * @instance + */ + KerberosConfig.prototype.keystorePasswordUri = ""; + + /** + * KerberosConfig keyPasswordUri. + * @member {string} keyPasswordUri + * @memberof google.cloud.dataproc.v1.KerberosConfig + * @instance + */ + KerberosConfig.prototype.keyPasswordUri = ""; + + /** + * KerberosConfig truststorePasswordUri. + * @member {string} truststorePasswordUri + * @memberof google.cloud.dataproc.v1.KerberosConfig + * @instance + */ + KerberosConfig.prototype.truststorePasswordUri = ""; + + /** + * KerberosConfig crossRealmTrustRealm. + * @member {string} crossRealmTrustRealm + * @memberof google.cloud.dataproc.v1.KerberosConfig + * @instance + */ + KerberosConfig.prototype.crossRealmTrustRealm = ""; + + /** + * KerberosConfig crossRealmTrustKdc. + * @member {string} crossRealmTrustKdc + * @memberof google.cloud.dataproc.v1.KerberosConfig + * @instance + */ + KerberosConfig.prototype.crossRealmTrustKdc = ""; + + /** + * KerberosConfig crossRealmTrustAdminServer. + * @member {string} crossRealmTrustAdminServer + * @memberof google.cloud.dataproc.v1.KerberosConfig + * @instance + */ + KerberosConfig.prototype.crossRealmTrustAdminServer = ""; + + /** + * KerberosConfig crossRealmTrustSharedPasswordUri. + * @member {string} crossRealmTrustSharedPasswordUri + * @memberof google.cloud.dataproc.v1.KerberosConfig + * @instance + */ + KerberosConfig.prototype.crossRealmTrustSharedPasswordUri = ""; + + /** + * KerberosConfig kdcDbKeyUri. + * @member {string} kdcDbKeyUri + * @memberof google.cloud.dataproc.v1.KerberosConfig + * @instance + */ + KerberosConfig.prototype.kdcDbKeyUri = ""; + + /** + * KerberosConfig tgtLifetimeHours. + * @member {number} tgtLifetimeHours + * @memberof google.cloud.dataproc.v1.KerberosConfig + * @instance + */ + KerberosConfig.prototype.tgtLifetimeHours = 0; + + /** + * KerberosConfig realm. + * @member {string} realm + * @memberof google.cloud.dataproc.v1.KerberosConfig + * @instance + */ + KerberosConfig.prototype.realm = ""; + + /** + * Creates a new KerberosConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.KerberosConfig + * @static + * @param {google.cloud.dataproc.v1.IKerberosConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.KerberosConfig} KerberosConfig instance + */ + KerberosConfig.create = function create(properties) { + return new KerberosConfig(properties); + }; + + /** + * Encodes the specified KerberosConfig message. Does not implicitly {@link google.cloud.dataproc.v1.KerberosConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.KerberosConfig + * @static + * @param {google.cloud.dataproc.v1.IKerberosConfig} message KerberosConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KerberosConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableKerberos != null && Object.hasOwnProperty.call(message, "enableKerberos")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableKerberos); + if (message.rootPrincipalPasswordUri != null && Object.hasOwnProperty.call(message, "rootPrincipalPasswordUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.rootPrincipalPasswordUri); + if (message.kmsKeyUri != null && Object.hasOwnProperty.call(message, "kmsKeyUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.kmsKeyUri); + if (message.keystoreUri != null && Object.hasOwnProperty.call(message, "keystoreUri")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.keystoreUri); + if (message.truststoreUri != null && Object.hasOwnProperty.call(message, "truststoreUri")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.truststoreUri); + if (message.keystorePasswordUri != null && Object.hasOwnProperty.call(message, "keystorePasswordUri")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.keystorePasswordUri); + if (message.keyPasswordUri != null && Object.hasOwnProperty.call(message, "keyPasswordUri")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.keyPasswordUri); + if (message.truststorePasswordUri != null && Object.hasOwnProperty.call(message, "truststorePasswordUri")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.truststorePasswordUri); + if (message.crossRealmTrustRealm != null && Object.hasOwnProperty.call(message, "crossRealmTrustRealm")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.crossRealmTrustRealm); + if (message.crossRealmTrustKdc != null && Object.hasOwnProperty.call(message, "crossRealmTrustKdc")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.crossRealmTrustKdc); + if (message.crossRealmTrustAdminServer != null && Object.hasOwnProperty.call(message, "crossRealmTrustAdminServer")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.crossRealmTrustAdminServer); + if (message.crossRealmTrustSharedPasswordUri != null && Object.hasOwnProperty.call(message, "crossRealmTrustSharedPasswordUri")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.crossRealmTrustSharedPasswordUri); + if (message.kdcDbKeyUri != null && Object.hasOwnProperty.call(message, "kdcDbKeyUri")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.kdcDbKeyUri); + if (message.tgtLifetimeHours != null && Object.hasOwnProperty.call(message, "tgtLifetimeHours")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.tgtLifetimeHours); + if (message.realm != null && Object.hasOwnProperty.call(message, "realm")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.realm); + return writer; + }; + + /** + * Encodes the specified KerberosConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.KerberosConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.KerberosConfig + * @static + * @param {google.cloud.dataproc.v1.IKerberosConfig} message KerberosConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KerberosConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KerberosConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.KerberosConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.KerberosConfig} KerberosConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KerberosConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.KerberosConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enableKerberos = reader.bool(); + break; + } + case 2: { + message.rootPrincipalPasswordUri = reader.string(); + break; + } + case 3: { + message.kmsKeyUri = reader.string(); + break; + } + case 4: { + message.keystoreUri = reader.string(); + break; + } + case 5: { + message.truststoreUri = reader.string(); + break; + } + case 6: { + message.keystorePasswordUri = reader.string(); + break; + } + case 7: { + message.keyPasswordUri = reader.string(); + break; + } + case 8: { + message.truststorePasswordUri = reader.string(); + break; + } + case 9: { + message.crossRealmTrustRealm = reader.string(); + break; + } + case 10: { + message.crossRealmTrustKdc = reader.string(); + break; + } + case 11: { + message.crossRealmTrustAdminServer = reader.string(); + break; + } + case 12: { + message.crossRealmTrustSharedPasswordUri = reader.string(); + break; + } + case 13: { + message.kdcDbKeyUri = reader.string(); + break; + } + case 14: { + message.tgtLifetimeHours = reader.int32(); + break; + } + case 15: { + message.realm = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KerberosConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.KerberosConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.KerberosConfig} KerberosConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KerberosConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KerberosConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.KerberosConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KerberosConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableKerberos != null && message.hasOwnProperty("enableKerberos")) + if (typeof message.enableKerberos !== "boolean") + return "enableKerberos: boolean expected"; + if (message.rootPrincipalPasswordUri != null && message.hasOwnProperty("rootPrincipalPasswordUri")) + if (!$util.isString(message.rootPrincipalPasswordUri)) + return "rootPrincipalPasswordUri: string expected"; + if (message.kmsKeyUri != null && message.hasOwnProperty("kmsKeyUri")) + if (!$util.isString(message.kmsKeyUri)) + return "kmsKeyUri: string expected"; + if (message.keystoreUri != null && message.hasOwnProperty("keystoreUri")) + if (!$util.isString(message.keystoreUri)) + return "keystoreUri: string expected"; + if (message.truststoreUri != null && message.hasOwnProperty("truststoreUri")) + if (!$util.isString(message.truststoreUri)) + return "truststoreUri: string expected"; + if (message.keystorePasswordUri != null && message.hasOwnProperty("keystorePasswordUri")) + if (!$util.isString(message.keystorePasswordUri)) + return "keystorePasswordUri: string expected"; + if (message.keyPasswordUri != null && message.hasOwnProperty("keyPasswordUri")) + if (!$util.isString(message.keyPasswordUri)) + return "keyPasswordUri: string expected"; + if (message.truststorePasswordUri != null && message.hasOwnProperty("truststorePasswordUri")) + if (!$util.isString(message.truststorePasswordUri)) + return "truststorePasswordUri: string expected"; + if (message.crossRealmTrustRealm != null && message.hasOwnProperty("crossRealmTrustRealm")) + if (!$util.isString(message.crossRealmTrustRealm)) + return "crossRealmTrustRealm: string expected"; + if (message.crossRealmTrustKdc != null && message.hasOwnProperty("crossRealmTrustKdc")) + if (!$util.isString(message.crossRealmTrustKdc)) + return "crossRealmTrustKdc: string expected"; + if (message.crossRealmTrustAdminServer != null && message.hasOwnProperty("crossRealmTrustAdminServer")) + if (!$util.isString(message.crossRealmTrustAdminServer)) + return "crossRealmTrustAdminServer: string expected"; + if (message.crossRealmTrustSharedPasswordUri != null && message.hasOwnProperty("crossRealmTrustSharedPasswordUri")) + if (!$util.isString(message.crossRealmTrustSharedPasswordUri)) + return "crossRealmTrustSharedPasswordUri: string expected"; + if (message.kdcDbKeyUri != null && message.hasOwnProperty("kdcDbKeyUri")) + if (!$util.isString(message.kdcDbKeyUri)) + return "kdcDbKeyUri: string expected"; + if (message.tgtLifetimeHours != null && message.hasOwnProperty("tgtLifetimeHours")) + if (!$util.isInteger(message.tgtLifetimeHours)) + return "tgtLifetimeHours: integer expected"; + if (message.realm != null && message.hasOwnProperty("realm")) + if (!$util.isString(message.realm)) + return "realm: string expected"; + return null; + }; + + /** + * Creates a KerberosConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.KerberosConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.KerberosConfig} KerberosConfig + */ + KerberosConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.KerberosConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.KerberosConfig(); + if (object.enableKerberos != null) + message.enableKerberos = Boolean(object.enableKerberos); + if (object.rootPrincipalPasswordUri != null) + message.rootPrincipalPasswordUri = String(object.rootPrincipalPasswordUri); + if (object.kmsKeyUri != null) + message.kmsKeyUri = String(object.kmsKeyUri); + if (object.keystoreUri != null) + message.keystoreUri = String(object.keystoreUri); + if (object.truststoreUri != null) + message.truststoreUri = String(object.truststoreUri); + if (object.keystorePasswordUri != null) + message.keystorePasswordUri = String(object.keystorePasswordUri); + if (object.keyPasswordUri != null) + message.keyPasswordUri = String(object.keyPasswordUri); + if (object.truststorePasswordUri != null) + message.truststorePasswordUri = String(object.truststorePasswordUri); + if (object.crossRealmTrustRealm != null) + message.crossRealmTrustRealm = String(object.crossRealmTrustRealm); + if (object.crossRealmTrustKdc != null) + message.crossRealmTrustKdc = String(object.crossRealmTrustKdc); + if (object.crossRealmTrustAdminServer != null) + message.crossRealmTrustAdminServer = String(object.crossRealmTrustAdminServer); + if (object.crossRealmTrustSharedPasswordUri != null) + message.crossRealmTrustSharedPasswordUri = String(object.crossRealmTrustSharedPasswordUri); + if (object.kdcDbKeyUri != null) + message.kdcDbKeyUri = String(object.kdcDbKeyUri); + if (object.tgtLifetimeHours != null) + message.tgtLifetimeHours = object.tgtLifetimeHours | 0; + if (object.realm != null) + message.realm = String(object.realm); + return message; + }; + + /** + * Creates a plain object from a KerberosConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.KerberosConfig + * @static + * @param {google.cloud.dataproc.v1.KerberosConfig} message KerberosConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KerberosConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enableKerberos = false; + object.rootPrincipalPasswordUri = ""; + object.kmsKeyUri = ""; + object.keystoreUri = ""; + object.truststoreUri = ""; + object.keystorePasswordUri = ""; + object.keyPasswordUri = ""; + object.truststorePasswordUri = ""; + object.crossRealmTrustRealm = ""; + object.crossRealmTrustKdc = ""; + object.crossRealmTrustAdminServer = ""; + object.crossRealmTrustSharedPasswordUri = ""; + object.kdcDbKeyUri = ""; + object.tgtLifetimeHours = 0; + object.realm = ""; + } + if (message.enableKerberos != null && message.hasOwnProperty("enableKerberos")) + object.enableKerberos = message.enableKerberos; + if (message.rootPrincipalPasswordUri != null && message.hasOwnProperty("rootPrincipalPasswordUri")) + object.rootPrincipalPasswordUri = message.rootPrincipalPasswordUri; + if (message.kmsKeyUri != null && message.hasOwnProperty("kmsKeyUri")) + object.kmsKeyUri = message.kmsKeyUri; + if (message.keystoreUri != null && message.hasOwnProperty("keystoreUri")) + object.keystoreUri = message.keystoreUri; + if (message.truststoreUri != null && message.hasOwnProperty("truststoreUri")) + object.truststoreUri = message.truststoreUri; + if (message.keystorePasswordUri != null && message.hasOwnProperty("keystorePasswordUri")) + object.keystorePasswordUri = message.keystorePasswordUri; + if (message.keyPasswordUri != null && message.hasOwnProperty("keyPasswordUri")) + object.keyPasswordUri = message.keyPasswordUri; + if (message.truststorePasswordUri != null && message.hasOwnProperty("truststorePasswordUri")) + object.truststorePasswordUri = message.truststorePasswordUri; + if (message.crossRealmTrustRealm != null && message.hasOwnProperty("crossRealmTrustRealm")) + object.crossRealmTrustRealm = message.crossRealmTrustRealm; + if (message.crossRealmTrustKdc != null && message.hasOwnProperty("crossRealmTrustKdc")) + object.crossRealmTrustKdc = message.crossRealmTrustKdc; + if (message.crossRealmTrustAdminServer != null && message.hasOwnProperty("crossRealmTrustAdminServer")) + object.crossRealmTrustAdminServer = message.crossRealmTrustAdminServer; + if (message.crossRealmTrustSharedPasswordUri != null && message.hasOwnProperty("crossRealmTrustSharedPasswordUri")) + object.crossRealmTrustSharedPasswordUri = message.crossRealmTrustSharedPasswordUri; + if (message.kdcDbKeyUri != null && message.hasOwnProperty("kdcDbKeyUri")) + object.kdcDbKeyUri = message.kdcDbKeyUri; + if (message.tgtLifetimeHours != null && message.hasOwnProperty("tgtLifetimeHours")) + object.tgtLifetimeHours = message.tgtLifetimeHours; + if (message.realm != null && message.hasOwnProperty("realm")) + object.realm = message.realm; + return object; + }; + + /** + * Converts this KerberosConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.KerberosConfig + * @instance + * @returns {Object.} JSON object + */ + KerberosConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KerberosConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.KerberosConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KerberosConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.KerberosConfig"; + }; + + return KerberosConfig; + })(); + + v1.IdentityConfig = (function() { + + /** + * Properties of an IdentityConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IIdentityConfig + * @property {Object.|null} [userServiceAccountMapping] IdentityConfig userServiceAccountMapping + */ + + /** + * Constructs a new IdentityConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents an IdentityConfig. + * @implements IIdentityConfig + * @constructor + * @param {google.cloud.dataproc.v1.IIdentityConfig=} [properties] Properties to set + */ + function IdentityConfig(properties) { + this.userServiceAccountMapping = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IdentityConfig userServiceAccountMapping. + * @member {Object.} userServiceAccountMapping + * @memberof google.cloud.dataproc.v1.IdentityConfig + * @instance + */ + IdentityConfig.prototype.userServiceAccountMapping = $util.emptyObject; + + /** + * Creates a new IdentityConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.IdentityConfig + * @static + * @param {google.cloud.dataproc.v1.IIdentityConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.IdentityConfig} IdentityConfig instance + */ + IdentityConfig.create = function create(properties) { + return new IdentityConfig(properties); + }; + + /** + * Encodes the specified IdentityConfig message. Does not implicitly {@link google.cloud.dataproc.v1.IdentityConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.IdentityConfig + * @static + * @param {google.cloud.dataproc.v1.IIdentityConfig} message IdentityConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.userServiceAccountMapping != null && Object.hasOwnProperty.call(message, "userServiceAccountMapping")) + for (var keys = Object.keys(message.userServiceAccountMapping), 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.userServiceAccountMapping[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified IdentityConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.IdentityConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.IdentityConfig + * @static + * @param {google.cloud.dataproc.v1.IIdentityConfig} message IdentityConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IdentityConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IdentityConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.IdentityConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.IdentityConfig} IdentityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.IdentityConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.userServiceAccountMapping === $util.emptyObject) + message.userServiceAccountMapping = {}; + 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.userServiceAccountMapping[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IdentityConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.IdentityConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.IdentityConfig} IdentityConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IdentityConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IdentityConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.IdentityConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IdentityConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.userServiceAccountMapping != null && message.hasOwnProperty("userServiceAccountMapping")) { + if (!$util.isObject(message.userServiceAccountMapping)) + return "userServiceAccountMapping: object expected"; + var key = Object.keys(message.userServiceAccountMapping); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.userServiceAccountMapping[key[i]])) + return "userServiceAccountMapping: string{k:string} expected"; + } + return null; + }; + + /** + * Creates an IdentityConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.IdentityConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.IdentityConfig} IdentityConfig + */ + IdentityConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.IdentityConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.IdentityConfig(); + if (object.userServiceAccountMapping) { + if (typeof object.userServiceAccountMapping !== "object") + throw TypeError(".google.cloud.dataproc.v1.IdentityConfig.userServiceAccountMapping: object expected"); + message.userServiceAccountMapping = {}; + for (var keys = Object.keys(object.userServiceAccountMapping), i = 0; i < keys.length; ++i) + message.userServiceAccountMapping[keys[i]] = String(object.userServiceAccountMapping[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from an IdentityConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.IdentityConfig + * @static + * @param {google.cloud.dataproc.v1.IdentityConfig} message IdentityConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IdentityConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.userServiceAccountMapping = {}; + var keys2; + if (message.userServiceAccountMapping && (keys2 = Object.keys(message.userServiceAccountMapping)).length) { + object.userServiceAccountMapping = {}; + for (var j = 0; j < keys2.length; ++j) + object.userServiceAccountMapping[keys2[j]] = message.userServiceAccountMapping[keys2[j]]; + } + return object; + }; + + /** + * Converts this IdentityConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.IdentityConfig + * @instance + * @returns {Object.} JSON object + */ + IdentityConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IdentityConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.IdentityConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IdentityConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.IdentityConfig"; + }; + + return IdentityConfig; + })(); + + v1.SoftwareConfig = (function() { + + /** + * Properties of a SoftwareConfig. + * @memberof google.cloud.dataproc.v1 + * @interface ISoftwareConfig + * @property {string|null} [imageVersion] SoftwareConfig imageVersion + * @property {Object.|null} [properties] SoftwareConfig properties + * @property {Array.|null} [optionalComponents] SoftwareConfig optionalComponents + */ + + /** + * Constructs a new SoftwareConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a SoftwareConfig. + * @implements ISoftwareConfig + * @constructor + * @param {google.cloud.dataproc.v1.ISoftwareConfig=} [properties] Properties to set + */ + function SoftwareConfig(properties) { + this.properties = {}; + this.optionalComponents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SoftwareConfig imageVersion. + * @member {string} imageVersion + * @memberof google.cloud.dataproc.v1.SoftwareConfig + * @instance + */ + SoftwareConfig.prototype.imageVersion = ""; + + /** + * SoftwareConfig properties. + * @member {Object.} properties + * @memberof google.cloud.dataproc.v1.SoftwareConfig + * @instance + */ + SoftwareConfig.prototype.properties = $util.emptyObject; + + /** + * SoftwareConfig optionalComponents. + * @member {Array.} optionalComponents + * @memberof google.cloud.dataproc.v1.SoftwareConfig + * @instance + */ + SoftwareConfig.prototype.optionalComponents = $util.emptyArray; + + /** + * Creates a new SoftwareConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.SoftwareConfig + * @static + * @param {google.cloud.dataproc.v1.ISoftwareConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.SoftwareConfig} SoftwareConfig instance + */ + SoftwareConfig.create = function create(properties) { + return new SoftwareConfig(properties); + }; + + /** + * Encodes the specified SoftwareConfig message. Does not implicitly {@link google.cloud.dataproc.v1.SoftwareConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.SoftwareConfig + * @static + * @param {google.cloud.dataproc.v1.ISoftwareConfig} message SoftwareConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SoftwareConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.imageVersion != null && Object.hasOwnProperty.call(message, "imageVersion")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.imageVersion); + if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) + for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.properties[keys[i]]).ldelim(); + if (message.optionalComponents != null && message.optionalComponents.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.optionalComponents.length; ++i) + writer.int32(message.optionalComponents[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified SoftwareConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SoftwareConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.SoftwareConfig + * @static + * @param {google.cloud.dataproc.v1.ISoftwareConfig} message SoftwareConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SoftwareConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SoftwareConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.SoftwareConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.SoftwareConfig} SoftwareConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SoftwareConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.SoftwareConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.imageVersion = reader.string(); + break; + } + case 2: { + if (message.properties === $util.emptyObject) + message.properties = {}; + 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.properties[key] = value; + break; + } + case 3: { + if (!(message.optionalComponents && message.optionalComponents.length)) + message.optionalComponents = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.optionalComponents.push(reader.int32()); + } else + message.optionalComponents.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SoftwareConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.SoftwareConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.SoftwareConfig} SoftwareConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SoftwareConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SoftwareConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.SoftwareConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SoftwareConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.imageVersion != null && message.hasOwnProperty("imageVersion")) + if (!$util.isString(message.imageVersion)) + return "imageVersion: string expected"; + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!$util.isObject(message.properties)) + return "properties: object expected"; + var key = Object.keys(message.properties); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.properties[key[i]])) + return "properties: string{k:string} expected"; + } + if (message.optionalComponents != null && message.hasOwnProperty("optionalComponents")) { + if (!Array.isArray(message.optionalComponents)) + return "optionalComponents: array expected"; + for (var i = 0; i < message.optionalComponents.length; ++i) + switch (message.optionalComponents[i]) { + default: + return "optionalComponents: enum value[] expected"; + case 0: + case 5: + case 20: + case 13: + case 9: + case 14: + case 11: + case 3: + case 18: + case 19: + case 1: + case 22: + case 21: + case 6: + case 17: + case 12: + case 10: + case 4: + case 8: + break; + } + } + return null; + }; + + /** + * Creates a SoftwareConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.SoftwareConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.SoftwareConfig} SoftwareConfig + */ + SoftwareConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.SoftwareConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.SoftwareConfig(); + if (object.imageVersion != null) + message.imageVersion = String(object.imageVersion); + if (object.properties) { + if (typeof object.properties !== "object") + throw TypeError(".google.cloud.dataproc.v1.SoftwareConfig.properties: object expected"); + message.properties = {}; + for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) + message.properties[keys[i]] = String(object.properties[keys[i]]); + } + if (object.optionalComponents) { + if (!Array.isArray(object.optionalComponents)) + throw TypeError(".google.cloud.dataproc.v1.SoftwareConfig.optionalComponents: array expected"); + message.optionalComponents = []; + for (var i = 0; i < object.optionalComponents.length; ++i) + switch (object.optionalComponents[i]) { + default: + if (typeof object.optionalComponents[i] === "number") { + message.optionalComponents[i] = object.optionalComponents[i]; + break; + } + case "COMPONENT_UNSPECIFIED": + case 0: + message.optionalComponents[i] = 0; + break; + case "ANACONDA": + case 5: + message.optionalComponents[i] = 5; + break; + case "DELTA": + case 20: + message.optionalComponents[i] = 20; + break; + case "DOCKER": + case 13: + message.optionalComponents[i] = 13; + break; + case "DRUID": + case 9: + message.optionalComponents[i] = 9; + break; + case "FLINK": + case 14: + message.optionalComponents[i] = 14; + break; + case "HBASE": + case 11: + message.optionalComponents[i] = 11; + break; + case "HIVE_WEBHCAT": + case 3: + message.optionalComponents[i] = 3; + break; + case "HUDI": + case 18: + message.optionalComponents[i] = 18; + break; + case "ICEBERG": + case 19: + message.optionalComponents[i] = 19; + break; + case "JUPYTER": + case 1: + message.optionalComponents[i] = 1; + break; + case "JUPYTER_KERNEL_GATEWAY": + case 22: + message.optionalComponents[i] = 22; + break; + case "PIG": + case 21: + message.optionalComponents[i] = 21; + break; + case "PRESTO": + case 6: + message.optionalComponents[i] = 6; + break; + case "TRINO": + case 17: + message.optionalComponents[i] = 17; + break; + case "RANGER": + case 12: + message.optionalComponents[i] = 12; + break; + case "SOLR": + case 10: + message.optionalComponents[i] = 10; + break; + case "ZEPPELIN": + case 4: + message.optionalComponents[i] = 4; + break; + case "ZOOKEEPER": + case 8: + message.optionalComponents[i] = 8; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a SoftwareConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.SoftwareConfig + * @static + * @param {google.cloud.dataproc.v1.SoftwareConfig} message SoftwareConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SoftwareConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.optionalComponents = []; + if (options.objects || options.defaults) + object.properties = {}; + if (options.defaults) + object.imageVersion = ""; + if (message.imageVersion != null && message.hasOwnProperty("imageVersion")) + object.imageVersion = message.imageVersion; + var keys2; + if (message.properties && (keys2 = Object.keys(message.properties)).length) { + object.properties = {}; + for (var j = 0; j < keys2.length; ++j) + object.properties[keys2[j]] = message.properties[keys2[j]]; + } + if (message.optionalComponents && message.optionalComponents.length) { + object.optionalComponents = []; + for (var j = 0; j < message.optionalComponents.length; ++j) + object.optionalComponents[j] = options.enums === String ? $root.google.cloud.dataproc.v1.Component[message.optionalComponents[j]] === undefined ? message.optionalComponents[j] : $root.google.cloud.dataproc.v1.Component[message.optionalComponents[j]] : message.optionalComponents[j]; + } + return object; + }; + + /** + * Converts this SoftwareConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.SoftwareConfig + * @instance + * @returns {Object.} JSON object + */ + SoftwareConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SoftwareConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.SoftwareConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SoftwareConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.SoftwareConfig"; + }; + + return SoftwareConfig; + })(); + + v1.LifecycleConfig = (function() { + + /** + * Properties of a LifecycleConfig. + * @memberof google.cloud.dataproc.v1 + * @interface ILifecycleConfig + * @property {google.protobuf.IDuration|null} [idleDeleteTtl] LifecycleConfig idleDeleteTtl + * @property {google.protobuf.ITimestamp|null} [autoDeleteTime] LifecycleConfig autoDeleteTime + * @property {google.protobuf.IDuration|null} [autoDeleteTtl] LifecycleConfig autoDeleteTtl + * @property {google.protobuf.IDuration|null} [idleStopTtl] LifecycleConfig idleStopTtl + * @property {google.protobuf.ITimestamp|null} [autoStopTime] LifecycleConfig autoStopTime + * @property {google.protobuf.IDuration|null} [autoStopTtl] LifecycleConfig autoStopTtl + * @property {google.protobuf.ITimestamp|null} [idleStartTime] LifecycleConfig idleStartTime + */ + + /** + * Constructs a new LifecycleConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a LifecycleConfig. + * @implements ILifecycleConfig + * @constructor + * @param {google.cloud.dataproc.v1.ILifecycleConfig=} [properties] Properties to set + */ + function LifecycleConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LifecycleConfig idleDeleteTtl. + * @member {google.protobuf.IDuration|null|undefined} idleDeleteTtl + * @memberof google.cloud.dataproc.v1.LifecycleConfig + * @instance + */ + LifecycleConfig.prototype.idleDeleteTtl = null; + + /** + * LifecycleConfig autoDeleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} autoDeleteTime + * @memberof google.cloud.dataproc.v1.LifecycleConfig + * @instance + */ + LifecycleConfig.prototype.autoDeleteTime = null; + + /** + * LifecycleConfig autoDeleteTtl. + * @member {google.protobuf.IDuration|null|undefined} autoDeleteTtl + * @memberof google.cloud.dataproc.v1.LifecycleConfig + * @instance + */ + LifecycleConfig.prototype.autoDeleteTtl = null; + + /** + * LifecycleConfig idleStopTtl. + * @member {google.protobuf.IDuration|null|undefined} idleStopTtl + * @memberof google.cloud.dataproc.v1.LifecycleConfig + * @instance + */ + LifecycleConfig.prototype.idleStopTtl = null; + + /** + * LifecycleConfig autoStopTime. + * @member {google.protobuf.ITimestamp|null|undefined} autoStopTime + * @memberof google.cloud.dataproc.v1.LifecycleConfig + * @instance + */ + LifecycleConfig.prototype.autoStopTime = null; + + /** + * LifecycleConfig autoStopTtl. + * @member {google.protobuf.IDuration|null|undefined} autoStopTtl + * @memberof google.cloud.dataproc.v1.LifecycleConfig + * @instance + */ + LifecycleConfig.prototype.autoStopTtl = null; + + /** + * LifecycleConfig idleStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} idleStartTime + * @memberof google.cloud.dataproc.v1.LifecycleConfig + * @instance + */ + LifecycleConfig.prototype.idleStartTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LifecycleConfig ttl. + * @member {"autoDeleteTime"|"autoDeleteTtl"|undefined} ttl + * @memberof google.cloud.dataproc.v1.LifecycleConfig + * @instance + */ + Object.defineProperty(LifecycleConfig.prototype, "ttl", { + get: $util.oneOfGetter($oneOfFields = ["autoDeleteTime", "autoDeleteTtl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * LifecycleConfig stopTtl. + * @member {"autoStopTime"|"autoStopTtl"|undefined} stopTtl + * @memberof google.cloud.dataproc.v1.LifecycleConfig + * @instance + */ + Object.defineProperty(LifecycleConfig.prototype, "stopTtl", { + get: $util.oneOfGetter($oneOfFields = ["autoStopTime", "autoStopTtl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LifecycleConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.LifecycleConfig + * @static + * @param {google.cloud.dataproc.v1.ILifecycleConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.LifecycleConfig} LifecycleConfig instance + */ + LifecycleConfig.create = function create(properties) { + return new LifecycleConfig(properties); + }; + + /** + * Encodes the specified LifecycleConfig message. Does not implicitly {@link google.cloud.dataproc.v1.LifecycleConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.LifecycleConfig + * @static + * @param {google.cloud.dataproc.v1.ILifecycleConfig} message LifecycleConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LifecycleConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.idleDeleteTtl != null && Object.hasOwnProperty.call(message, "idleDeleteTtl")) + $root.google.protobuf.Duration.encode(message.idleDeleteTtl, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.autoDeleteTime != null && Object.hasOwnProperty.call(message, "autoDeleteTime")) + $root.google.protobuf.Timestamp.encode(message.autoDeleteTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoDeleteTtl != null && Object.hasOwnProperty.call(message, "autoDeleteTtl")) + $root.google.protobuf.Duration.encode(message.autoDeleteTtl, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.idleStartTime != null && Object.hasOwnProperty.call(message, "idleStartTime")) + $root.google.protobuf.Timestamp.encode(message.idleStartTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.idleStopTtl != null && Object.hasOwnProperty.call(message, "idleStopTtl")) + $root.google.protobuf.Duration.encode(message.idleStopTtl, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.autoStopTime != null && Object.hasOwnProperty.call(message, "autoStopTime")) + $root.google.protobuf.Timestamp.encode(message.autoStopTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.autoStopTtl != null && Object.hasOwnProperty.call(message, "autoStopTtl")) + $root.google.protobuf.Duration.encode(message.autoStopTtl, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LifecycleConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.LifecycleConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.LifecycleConfig + * @static + * @param {google.cloud.dataproc.v1.ILifecycleConfig} message LifecycleConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LifecycleConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LifecycleConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.LifecycleConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.LifecycleConfig} LifecycleConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LifecycleConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.LifecycleConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.idleDeleteTtl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.autoDeleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.autoDeleteTtl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 5: { + message.idleStopTtl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 6: { + message.autoStopTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.autoStopTtl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.idleStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LifecycleConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.LifecycleConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.LifecycleConfig} LifecycleConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LifecycleConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LifecycleConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.LifecycleConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LifecycleConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.idleDeleteTtl != null && message.hasOwnProperty("idleDeleteTtl")) { + var error = $root.google.protobuf.Duration.verify(message.idleDeleteTtl); + if (error) + return "idleDeleteTtl." + error; + } + if (message.autoDeleteTime != null && message.hasOwnProperty("autoDeleteTime")) { + properties.ttl = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.autoDeleteTime); + if (error) + return "autoDeleteTime." + error; + } + } + if (message.autoDeleteTtl != null && message.hasOwnProperty("autoDeleteTtl")) { + if (properties.ttl === 1) + return "ttl: multiple values"; + properties.ttl = 1; + { + var error = $root.google.protobuf.Duration.verify(message.autoDeleteTtl); + if (error) + return "autoDeleteTtl." + error; + } + } + if (message.idleStopTtl != null && message.hasOwnProperty("idleStopTtl")) { + var error = $root.google.protobuf.Duration.verify(message.idleStopTtl); + if (error) + return "idleStopTtl." + error; + } + if (message.autoStopTime != null && message.hasOwnProperty("autoStopTime")) { + properties.stopTtl = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.autoStopTime); + if (error) + return "autoStopTime." + error; + } + } + if (message.autoStopTtl != null && message.hasOwnProperty("autoStopTtl")) { + if (properties.stopTtl === 1) + return "stopTtl: multiple values"; + properties.stopTtl = 1; + { + var error = $root.google.protobuf.Duration.verify(message.autoStopTtl); + if (error) + return "autoStopTtl." + error; + } + } + if (message.idleStartTime != null && message.hasOwnProperty("idleStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.idleStartTime); + if (error) + return "idleStartTime." + error; + } + return null; + }; + + /** + * Creates a LifecycleConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.LifecycleConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.LifecycleConfig} LifecycleConfig + */ + LifecycleConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.LifecycleConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.LifecycleConfig(); + if (object.idleDeleteTtl != null) { + if (typeof object.idleDeleteTtl !== "object") + throw TypeError(".google.cloud.dataproc.v1.LifecycleConfig.idleDeleteTtl: object expected"); + message.idleDeleteTtl = $root.google.protobuf.Duration.fromObject(object.idleDeleteTtl); + } + if (object.autoDeleteTime != null) { + if (typeof object.autoDeleteTime !== "object") + throw TypeError(".google.cloud.dataproc.v1.LifecycleConfig.autoDeleteTime: object expected"); + message.autoDeleteTime = $root.google.protobuf.Timestamp.fromObject(object.autoDeleteTime); + } + if (object.autoDeleteTtl != null) { + if (typeof object.autoDeleteTtl !== "object") + throw TypeError(".google.cloud.dataproc.v1.LifecycleConfig.autoDeleteTtl: object expected"); + message.autoDeleteTtl = $root.google.protobuf.Duration.fromObject(object.autoDeleteTtl); + } + if (object.idleStopTtl != null) { + if (typeof object.idleStopTtl !== "object") + throw TypeError(".google.cloud.dataproc.v1.LifecycleConfig.idleStopTtl: object expected"); + message.idleStopTtl = $root.google.protobuf.Duration.fromObject(object.idleStopTtl); + } + if (object.autoStopTime != null) { + if (typeof object.autoStopTime !== "object") + throw TypeError(".google.cloud.dataproc.v1.LifecycleConfig.autoStopTime: object expected"); + message.autoStopTime = $root.google.protobuf.Timestamp.fromObject(object.autoStopTime); + } + if (object.autoStopTtl != null) { + if (typeof object.autoStopTtl !== "object") + throw TypeError(".google.cloud.dataproc.v1.LifecycleConfig.autoStopTtl: object expected"); + message.autoStopTtl = $root.google.protobuf.Duration.fromObject(object.autoStopTtl); + } + if (object.idleStartTime != null) { + if (typeof object.idleStartTime !== "object") + throw TypeError(".google.cloud.dataproc.v1.LifecycleConfig.idleStartTime: object expected"); + message.idleStartTime = $root.google.protobuf.Timestamp.fromObject(object.idleStartTime); + } + return message; + }; + + /** + * Creates a plain object from a LifecycleConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.LifecycleConfig + * @static + * @param {google.cloud.dataproc.v1.LifecycleConfig} message LifecycleConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LifecycleConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.idleDeleteTtl = null; + object.idleStartTime = null; + object.idleStopTtl = null; + } + if (message.idleDeleteTtl != null && message.hasOwnProperty("idleDeleteTtl")) + object.idleDeleteTtl = $root.google.protobuf.Duration.toObject(message.idleDeleteTtl, options); + if (message.autoDeleteTime != null && message.hasOwnProperty("autoDeleteTime")) { + object.autoDeleteTime = $root.google.protobuf.Timestamp.toObject(message.autoDeleteTime, options); + if (options.oneofs) + object.ttl = "autoDeleteTime"; + } + if (message.autoDeleteTtl != null && message.hasOwnProperty("autoDeleteTtl")) { + object.autoDeleteTtl = $root.google.protobuf.Duration.toObject(message.autoDeleteTtl, options); + if (options.oneofs) + object.ttl = "autoDeleteTtl"; + } + if (message.idleStartTime != null && message.hasOwnProperty("idleStartTime")) + object.idleStartTime = $root.google.protobuf.Timestamp.toObject(message.idleStartTime, options); + if (message.idleStopTtl != null && message.hasOwnProperty("idleStopTtl")) + object.idleStopTtl = $root.google.protobuf.Duration.toObject(message.idleStopTtl, options); + if (message.autoStopTime != null && message.hasOwnProperty("autoStopTime")) { + object.autoStopTime = $root.google.protobuf.Timestamp.toObject(message.autoStopTime, options); + if (options.oneofs) + object.stopTtl = "autoStopTime"; + } + if (message.autoStopTtl != null && message.hasOwnProperty("autoStopTtl")) { + object.autoStopTtl = $root.google.protobuf.Duration.toObject(message.autoStopTtl, options); + if (options.oneofs) + object.stopTtl = "autoStopTtl"; + } + return object; + }; + + /** + * Converts this LifecycleConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.LifecycleConfig + * @instance + * @returns {Object.} JSON object + */ + LifecycleConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LifecycleConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.LifecycleConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LifecycleConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.LifecycleConfig"; + }; + + return LifecycleConfig; + })(); + + v1.MetastoreConfig = (function() { + + /** + * Properties of a MetastoreConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IMetastoreConfig + * @property {string|null} [dataprocMetastoreService] MetastoreConfig dataprocMetastoreService + */ + + /** + * Constructs a new MetastoreConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a MetastoreConfig. + * @implements IMetastoreConfig + * @constructor + * @param {google.cloud.dataproc.v1.IMetastoreConfig=} [properties] Properties to set + */ + function MetastoreConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MetastoreConfig dataprocMetastoreService. + * @member {string} dataprocMetastoreService + * @memberof google.cloud.dataproc.v1.MetastoreConfig + * @instance + */ + MetastoreConfig.prototype.dataprocMetastoreService = ""; + + /** + * Creates a new MetastoreConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.MetastoreConfig + * @static + * @param {google.cloud.dataproc.v1.IMetastoreConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.MetastoreConfig} MetastoreConfig instance + */ + MetastoreConfig.create = function create(properties) { + return new MetastoreConfig(properties); + }; + + /** + * Encodes the specified MetastoreConfig message. Does not implicitly {@link google.cloud.dataproc.v1.MetastoreConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.MetastoreConfig + * @static + * @param {google.cloud.dataproc.v1.IMetastoreConfig} message MetastoreConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetastoreConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataprocMetastoreService != null && Object.hasOwnProperty.call(message, "dataprocMetastoreService")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataprocMetastoreService); + return writer; + }; + + /** + * Encodes the specified MetastoreConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.MetastoreConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.MetastoreConfig + * @static + * @param {google.cloud.dataproc.v1.IMetastoreConfig} message MetastoreConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetastoreConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetastoreConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.MetastoreConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.MetastoreConfig} MetastoreConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetastoreConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.MetastoreConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.dataprocMetastoreService = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetastoreConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.MetastoreConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.MetastoreConfig} MetastoreConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetastoreConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetastoreConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.MetastoreConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetastoreConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataprocMetastoreService != null && message.hasOwnProperty("dataprocMetastoreService")) + if (!$util.isString(message.dataprocMetastoreService)) + return "dataprocMetastoreService: string expected"; + return null; + }; + + /** + * Creates a MetastoreConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.MetastoreConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.MetastoreConfig} MetastoreConfig + */ + MetastoreConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.MetastoreConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.MetastoreConfig(); + if (object.dataprocMetastoreService != null) + message.dataprocMetastoreService = String(object.dataprocMetastoreService); + return message; + }; + + /** + * Creates a plain object from a MetastoreConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.MetastoreConfig + * @static + * @param {google.cloud.dataproc.v1.MetastoreConfig} message MetastoreConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetastoreConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.dataprocMetastoreService = ""; + if (message.dataprocMetastoreService != null && message.hasOwnProperty("dataprocMetastoreService")) + object.dataprocMetastoreService = message.dataprocMetastoreService; + return object; + }; + + /** + * Converts this MetastoreConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.MetastoreConfig + * @instance + * @returns {Object.} JSON object + */ + MetastoreConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetastoreConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.MetastoreConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetastoreConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.MetastoreConfig"; + }; + + return MetastoreConfig; + })(); + + v1.ClusterMetrics = (function() { + + /** + * Properties of a ClusterMetrics. + * @memberof google.cloud.dataproc.v1 + * @interface IClusterMetrics + * @property {Object.|null} [hdfsMetrics] ClusterMetrics hdfsMetrics + * @property {Object.|null} [yarnMetrics] ClusterMetrics yarnMetrics + */ + + /** + * Constructs a new ClusterMetrics. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a ClusterMetrics. + * @implements IClusterMetrics + * @constructor + * @param {google.cloud.dataproc.v1.IClusterMetrics=} [properties] Properties to set + */ + function ClusterMetrics(properties) { + this.hdfsMetrics = {}; + this.yarnMetrics = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClusterMetrics hdfsMetrics. + * @member {Object.} hdfsMetrics + * @memberof google.cloud.dataproc.v1.ClusterMetrics + * @instance + */ + ClusterMetrics.prototype.hdfsMetrics = $util.emptyObject; + + /** + * ClusterMetrics yarnMetrics. + * @member {Object.} yarnMetrics + * @memberof google.cloud.dataproc.v1.ClusterMetrics + * @instance + */ + ClusterMetrics.prototype.yarnMetrics = $util.emptyObject; + + /** + * Creates a new ClusterMetrics instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.ClusterMetrics + * @static + * @param {google.cloud.dataproc.v1.IClusterMetrics=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.ClusterMetrics} ClusterMetrics instance + */ + ClusterMetrics.create = function create(properties) { + return new ClusterMetrics(properties); + }; + + /** + * Encodes the specified ClusterMetrics message. Does not implicitly {@link google.cloud.dataproc.v1.ClusterMetrics.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.ClusterMetrics + * @static + * @param {google.cloud.dataproc.v1.IClusterMetrics} message ClusterMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterMetrics.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hdfsMetrics != null && Object.hasOwnProperty.call(message, "hdfsMetrics")) + for (var keys = Object.keys(message.hdfsMetrics), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int64(message.hdfsMetrics[keys[i]]).ldelim(); + if (message.yarnMetrics != null && Object.hasOwnProperty.call(message, "yarnMetrics")) + for (var keys = Object.keys(message.yarnMetrics), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int64(message.yarnMetrics[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClusterMetrics message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ClusterMetrics.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.ClusterMetrics + * @static + * @param {google.cloud.dataproc.v1.IClusterMetrics} message ClusterMetrics message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterMetrics.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClusterMetrics message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.ClusterMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.ClusterMetrics} ClusterMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterMetrics.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ClusterMetrics(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.hdfsMetrics === $util.emptyObject) + message.hdfsMetrics = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = 0; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.int64(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.hdfsMetrics[key] = value; + break; + } + case 2: { + if (message.yarnMetrics === $util.emptyObject) + message.yarnMetrics = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = 0; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.int64(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.yarnMetrics[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClusterMetrics message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.ClusterMetrics + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.ClusterMetrics} ClusterMetrics + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterMetrics.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClusterMetrics message. + * @function verify + * @memberof google.cloud.dataproc.v1.ClusterMetrics + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClusterMetrics.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hdfsMetrics != null && message.hasOwnProperty("hdfsMetrics")) { + if (!$util.isObject(message.hdfsMetrics)) + return "hdfsMetrics: object expected"; + var key = Object.keys(message.hdfsMetrics); + for (var i = 0; i < key.length; ++i) + if (!$util.isInteger(message.hdfsMetrics[key[i]]) && !(message.hdfsMetrics[key[i]] && $util.isInteger(message.hdfsMetrics[key[i]].low) && $util.isInteger(message.hdfsMetrics[key[i]].high))) + return "hdfsMetrics: integer|Long{k:string} expected"; + } + if (message.yarnMetrics != null && message.hasOwnProperty("yarnMetrics")) { + if (!$util.isObject(message.yarnMetrics)) + return "yarnMetrics: object expected"; + var key = Object.keys(message.yarnMetrics); + for (var i = 0; i < key.length; ++i) + if (!$util.isInteger(message.yarnMetrics[key[i]]) && !(message.yarnMetrics[key[i]] && $util.isInteger(message.yarnMetrics[key[i]].low) && $util.isInteger(message.yarnMetrics[key[i]].high))) + return "yarnMetrics: integer|Long{k:string} expected"; + } + return null; + }; + + /** + * Creates a ClusterMetrics message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.ClusterMetrics + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.ClusterMetrics} ClusterMetrics + */ + ClusterMetrics.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.ClusterMetrics) + return object; + var message = new $root.google.cloud.dataproc.v1.ClusterMetrics(); + if (object.hdfsMetrics) { + if (typeof object.hdfsMetrics !== "object") + throw TypeError(".google.cloud.dataproc.v1.ClusterMetrics.hdfsMetrics: object expected"); + message.hdfsMetrics = {}; + for (var keys = Object.keys(object.hdfsMetrics), i = 0; i < keys.length; ++i) + if ($util.Long) + (message.hdfsMetrics[keys[i]] = $util.Long.fromValue(object.hdfsMetrics[keys[i]])).unsigned = false; + else if (typeof object.hdfsMetrics[keys[i]] === "string") + message.hdfsMetrics[keys[i]] = parseInt(object.hdfsMetrics[keys[i]], 10); + else if (typeof object.hdfsMetrics[keys[i]] === "number") + message.hdfsMetrics[keys[i]] = object.hdfsMetrics[keys[i]]; + else if (typeof object.hdfsMetrics[keys[i]] === "object") + message.hdfsMetrics[keys[i]] = new $util.LongBits(object.hdfsMetrics[keys[i]].low >>> 0, object.hdfsMetrics[keys[i]].high >>> 0).toNumber(); + } + if (object.yarnMetrics) { + if (typeof object.yarnMetrics !== "object") + throw TypeError(".google.cloud.dataproc.v1.ClusterMetrics.yarnMetrics: object expected"); + message.yarnMetrics = {}; + for (var keys = Object.keys(object.yarnMetrics), i = 0; i < keys.length; ++i) + if ($util.Long) + (message.yarnMetrics[keys[i]] = $util.Long.fromValue(object.yarnMetrics[keys[i]])).unsigned = false; + else if (typeof object.yarnMetrics[keys[i]] === "string") + message.yarnMetrics[keys[i]] = parseInt(object.yarnMetrics[keys[i]], 10); + else if (typeof object.yarnMetrics[keys[i]] === "number") + message.yarnMetrics[keys[i]] = object.yarnMetrics[keys[i]]; + else if (typeof object.yarnMetrics[keys[i]] === "object") + message.yarnMetrics[keys[i]] = new $util.LongBits(object.yarnMetrics[keys[i]].low >>> 0, object.yarnMetrics[keys[i]].high >>> 0).toNumber(); + } + return message; + }; + + /** + * Creates a plain object from a ClusterMetrics message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.ClusterMetrics + * @static + * @param {google.cloud.dataproc.v1.ClusterMetrics} message ClusterMetrics + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClusterMetrics.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.hdfsMetrics = {}; + object.yarnMetrics = {}; + } + var keys2; + if (message.hdfsMetrics && (keys2 = Object.keys(message.hdfsMetrics)).length) { + object.hdfsMetrics = {}; + for (var j = 0; j < keys2.length; ++j) + if (typeof message.hdfsMetrics[keys2[j]] === "number") + object.hdfsMetrics[keys2[j]] = options.longs === String ? String(message.hdfsMetrics[keys2[j]]) : message.hdfsMetrics[keys2[j]]; + else + object.hdfsMetrics[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.hdfsMetrics[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.hdfsMetrics[keys2[j]].low >>> 0, message.hdfsMetrics[keys2[j]].high >>> 0).toNumber() : message.hdfsMetrics[keys2[j]]; + } + if (message.yarnMetrics && (keys2 = Object.keys(message.yarnMetrics)).length) { + object.yarnMetrics = {}; + for (var j = 0; j < keys2.length; ++j) + if (typeof message.yarnMetrics[keys2[j]] === "number") + object.yarnMetrics[keys2[j]] = options.longs === String ? String(message.yarnMetrics[keys2[j]]) : message.yarnMetrics[keys2[j]]; + else + object.yarnMetrics[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.yarnMetrics[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.yarnMetrics[keys2[j]].low >>> 0, message.yarnMetrics[keys2[j]].high >>> 0).toNumber() : message.yarnMetrics[keys2[j]]; + } + return object; + }; + + /** + * Converts this ClusterMetrics to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.ClusterMetrics + * @instance + * @returns {Object.} JSON object + */ + ClusterMetrics.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClusterMetrics + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.ClusterMetrics + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClusterMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.ClusterMetrics"; + }; + + return ClusterMetrics; + })(); + + v1.DataprocMetricConfig = (function() { + + /** + * Properties of a DataprocMetricConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IDataprocMetricConfig + * @property {Array.|null} [metrics] DataprocMetricConfig metrics + */ + + /** + * Constructs a new DataprocMetricConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a DataprocMetricConfig. + * @implements IDataprocMetricConfig + * @constructor + * @param {google.cloud.dataproc.v1.IDataprocMetricConfig=} [properties] Properties to set + */ + function DataprocMetricConfig(properties) { + this.metrics = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataprocMetricConfig metrics. + * @member {Array.} metrics + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig + * @instance + */ + DataprocMetricConfig.prototype.metrics = $util.emptyArray; + + /** + * Creates a new DataprocMetricConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig + * @static + * @param {google.cloud.dataproc.v1.IDataprocMetricConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.DataprocMetricConfig} DataprocMetricConfig instance + */ + DataprocMetricConfig.create = function create(properties) { + return new DataprocMetricConfig(properties); + }; + + /** + * Encodes the specified DataprocMetricConfig message. Does not implicitly {@link google.cloud.dataproc.v1.DataprocMetricConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig + * @static + * @param {google.cloud.dataproc.v1.IDataprocMetricConfig} message DataprocMetricConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataprocMetricConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metrics != null && message.metrics.length) + for (var i = 0; i < message.metrics.length; ++i) + $root.google.cloud.dataproc.v1.DataprocMetricConfig.Metric.encode(message.metrics[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataprocMetricConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DataprocMetricConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig + * @static + * @param {google.cloud.dataproc.v1.IDataprocMetricConfig} message DataprocMetricConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataprocMetricConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataprocMetricConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.DataprocMetricConfig} DataprocMetricConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataprocMetricConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.DataprocMetricConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.metrics && message.metrics.length)) + message.metrics = []; + message.metrics.push($root.google.cloud.dataproc.v1.DataprocMetricConfig.Metric.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataprocMetricConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.DataprocMetricConfig} DataprocMetricConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataprocMetricConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataprocMetricConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataprocMetricConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metrics != null && message.hasOwnProperty("metrics")) { + if (!Array.isArray(message.metrics)) + return "metrics: array expected"; + for (var i = 0; i < message.metrics.length; ++i) { + var error = $root.google.cloud.dataproc.v1.DataprocMetricConfig.Metric.verify(message.metrics[i]); + if (error) + return "metrics." + error; + } + } + return null; + }; + + /** + * Creates a DataprocMetricConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.DataprocMetricConfig} DataprocMetricConfig + */ + DataprocMetricConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.DataprocMetricConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.DataprocMetricConfig(); + if (object.metrics) { + if (!Array.isArray(object.metrics)) + throw TypeError(".google.cloud.dataproc.v1.DataprocMetricConfig.metrics: array expected"); + message.metrics = []; + for (var i = 0; i < object.metrics.length; ++i) { + if (typeof object.metrics[i] !== "object") + throw TypeError(".google.cloud.dataproc.v1.DataprocMetricConfig.metrics: object expected"); + message.metrics[i] = $root.google.cloud.dataproc.v1.DataprocMetricConfig.Metric.fromObject(object.metrics[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DataprocMetricConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig + * @static + * @param {google.cloud.dataproc.v1.DataprocMetricConfig} message DataprocMetricConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataprocMetricConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.metrics = []; + if (message.metrics && message.metrics.length) { + object.metrics = []; + for (var j = 0; j < message.metrics.length; ++j) + object.metrics[j] = $root.google.cloud.dataproc.v1.DataprocMetricConfig.Metric.toObject(message.metrics[j], options); + } + return object; + }; + + /** + * Converts this DataprocMetricConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig + * @instance + * @returns {Object.} JSON object + */ + DataprocMetricConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataprocMetricConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataprocMetricConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.DataprocMetricConfig"; + }; + + /** + * MetricSource enum. + * @name google.cloud.dataproc.v1.DataprocMetricConfig.MetricSource + * @enum {number} + * @property {number} METRIC_SOURCE_UNSPECIFIED=0 METRIC_SOURCE_UNSPECIFIED value + * @property {number} MONITORING_AGENT_DEFAULTS=1 MONITORING_AGENT_DEFAULTS value + * @property {number} HDFS=2 HDFS value + * @property {number} SPARK=3 SPARK value + * @property {number} YARN=4 YARN value + * @property {number} SPARK_HISTORY_SERVER=5 SPARK_HISTORY_SERVER value + * @property {number} HIVESERVER2=6 HIVESERVER2 value + * @property {number} HIVEMETASTORE=7 HIVEMETASTORE value + * @property {number} FLINK=8 FLINK value + */ + DataprocMetricConfig.MetricSource = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "METRIC_SOURCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MONITORING_AGENT_DEFAULTS"] = 1; + values[valuesById[2] = "HDFS"] = 2; + values[valuesById[3] = "SPARK"] = 3; + values[valuesById[4] = "YARN"] = 4; + values[valuesById[5] = "SPARK_HISTORY_SERVER"] = 5; + values[valuesById[6] = "HIVESERVER2"] = 6; + values[valuesById[7] = "HIVEMETASTORE"] = 7; + values[valuesById[8] = "FLINK"] = 8; + return values; + })(); + + DataprocMetricConfig.Metric = (function() { + + /** + * Properties of a Metric. + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig + * @interface IMetric + * @property {google.cloud.dataproc.v1.DataprocMetricConfig.MetricSource|null} [metricSource] Metric metricSource + * @property {Array.|null} [metricOverrides] Metric metricOverrides + */ + + /** + * Constructs a new Metric. + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig + * @classdesc Represents a Metric. + * @implements IMetric + * @constructor + * @param {google.cloud.dataproc.v1.DataprocMetricConfig.IMetric=} [properties] Properties to set + */ + function Metric(properties) { + this.metricOverrides = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Metric metricSource. + * @member {google.cloud.dataproc.v1.DataprocMetricConfig.MetricSource} metricSource + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig.Metric + * @instance + */ + Metric.prototype.metricSource = 0; + + /** + * Metric metricOverrides. + * @member {Array.} metricOverrides + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig.Metric + * @instance + */ + Metric.prototype.metricOverrides = $util.emptyArray; + + /** + * Creates a new Metric instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig.Metric + * @static + * @param {google.cloud.dataproc.v1.DataprocMetricConfig.IMetric=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.DataprocMetricConfig.Metric} Metric instance + */ + Metric.create = function create(properties) { + return new Metric(properties); + }; + + /** + * Encodes the specified Metric message. Does not implicitly {@link google.cloud.dataproc.v1.DataprocMetricConfig.Metric.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig.Metric + * @static + * @param {google.cloud.dataproc.v1.DataprocMetricConfig.IMetric} message Metric message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metric.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metricSource != null && Object.hasOwnProperty.call(message, "metricSource")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.metricSource); + if (message.metricOverrides != null && message.metricOverrides.length) + for (var i = 0; i < message.metricOverrides.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metricOverrides[i]); + return writer; + }; + + /** + * Encodes the specified Metric message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DataprocMetricConfig.Metric.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig.Metric + * @static + * @param {google.cloud.dataproc.v1.DataprocMetricConfig.IMetric} message Metric message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metric.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Metric message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig.Metric + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.DataprocMetricConfig.Metric} Metric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metric.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.DataprocMetricConfig.Metric(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.metricSource = reader.int32(); + break; + } + case 2: { + if (!(message.metricOverrides && message.metricOverrides.length)) + message.metricOverrides = []; + message.metricOverrides.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Metric message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig.Metric + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.DataprocMetricConfig.Metric} Metric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metric.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Metric message. + * @function verify + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig.Metric + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Metric.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metricSource != null && message.hasOwnProperty("metricSource")) + switch (message.metricSource) { + default: + return "metricSource: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + if (message.metricOverrides != null && message.hasOwnProperty("metricOverrides")) { + if (!Array.isArray(message.metricOverrides)) + return "metricOverrides: array expected"; + for (var i = 0; i < message.metricOverrides.length; ++i) + if (!$util.isString(message.metricOverrides[i])) + return "metricOverrides: string[] expected"; + } + return null; + }; + + /** + * Creates a Metric message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig.Metric + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.DataprocMetricConfig.Metric} Metric + */ + Metric.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.DataprocMetricConfig.Metric) + return object; + var message = new $root.google.cloud.dataproc.v1.DataprocMetricConfig.Metric(); + switch (object.metricSource) { + default: + if (typeof object.metricSource === "number") { + message.metricSource = object.metricSource; + break; + } + break; + case "METRIC_SOURCE_UNSPECIFIED": + case 0: + message.metricSource = 0; + break; + case "MONITORING_AGENT_DEFAULTS": + case 1: + message.metricSource = 1; + break; + case "HDFS": + case 2: + message.metricSource = 2; + break; + case "SPARK": + case 3: + message.metricSource = 3; + break; + case "YARN": + case 4: + message.metricSource = 4; + break; + case "SPARK_HISTORY_SERVER": + case 5: + message.metricSource = 5; + break; + case "HIVESERVER2": + case 6: + message.metricSource = 6; + break; + case "HIVEMETASTORE": + case 7: + message.metricSource = 7; + break; + case "FLINK": + case 8: + message.metricSource = 8; + break; + } + if (object.metricOverrides) { + if (!Array.isArray(object.metricOverrides)) + throw TypeError(".google.cloud.dataproc.v1.DataprocMetricConfig.Metric.metricOverrides: array expected"); + message.metricOverrides = []; + for (var i = 0; i < object.metricOverrides.length; ++i) + message.metricOverrides[i] = String(object.metricOverrides[i]); + } + return message; + }; + + /** + * Creates a plain object from a Metric message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig.Metric + * @static + * @param {google.cloud.dataproc.v1.DataprocMetricConfig.Metric} message Metric + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Metric.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.metricOverrides = []; + if (options.defaults) + object.metricSource = options.enums === String ? "METRIC_SOURCE_UNSPECIFIED" : 0; + if (message.metricSource != null && message.hasOwnProperty("metricSource")) + object.metricSource = options.enums === String ? $root.google.cloud.dataproc.v1.DataprocMetricConfig.MetricSource[message.metricSource] === undefined ? message.metricSource : $root.google.cloud.dataproc.v1.DataprocMetricConfig.MetricSource[message.metricSource] : message.metricSource; + if (message.metricOverrides && message.metricOverrides.length) { + object.metricOverrides = []; + for (var j = 0; j < message.metricOverrides.length; ++j) + object.metricOverrides[j] = message.metricOverrides[j]; + } + return object; + }; + + /** + * Converts this Metric to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig.Metric + * @instance + * @returns {Object.} JSON object + */ + Metric.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Metric + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.DataprocMetricConfig.Metric + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Metric.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.DataprocMetricConfig.Metric"; + }; + + return Metric; + })(); + + return DataprocMetricConfig; + })(); + + v1.CreateClusterRequest = (function() { + + /** + * Properties of a CreateClusterRequest. + * @memberof google.cloud.dataproc.v1 + * @interface ICreateClusterRequest + * @property {string|null} [projectId] CreateClusterRequest projectId + * @property {string|null} [region] CreateClusterRequest region + * @property {google.cloud.dataproc.v1.ICluster|null} [cluster] CreateClusterRequest cluster + * @property {string|null} [requestId] CreateClusterRequest requestId + * @property {google.cloud.dataproc.v1.FailureAction|null} [actionOnFailedPrimaryWorkers] CreateClusterRequest actionOnFailedPrimaryWorkers + */ + + /** + * Constructs a new CreateClusterRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a CreateClusterRequest. + * @implements ICreateClusterRequest + * @constructor + * @param {google.cloud.dataproc.v1.ICreateClusterRequest=} [properties] Properties to set + */ + function CreateClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateClusterRequest projectId. + * @member {string} projectId + * @memberof google.cloud.dataproc.v1.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.projectId = ""; + + /** + * CreateClusterRequest region. + * @member {string} region + * @memberof google.cloud.dataproc.v1.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.region = ""; + + /** + * CreateClusterRequest cluster. + * @member {google.cloud.dataproc.v1.ICluster|null|undefined} cluster + * @memberof google.cloud.dataproc.v1.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.cluster = null; + + /** + * CreateClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.dataproc.v1.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.requestId = ""; + + /** + * CreateClusterRequest actionOnFailedPrimaryWorkers. + * @member {google.cloud.dataproc.v1.FailureAction} actionOnFailedPrimaryWorkers + * @memberof google.cloud.dataproc.v1.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.actionOnFailedPrimaryWorkers = 0; + + /** + * Creates a new CreateClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.CreateClusterRequest + * @static + * @param {google.cloud.dataproc.v1.ICreateClusterRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.CreateClusterRequest} CreateClusterRequest instance + */ + CreateClusterRequest.create = function create(properties) { + return new CreateClusterRequest(properties); + }; + + /** + * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.cloud.dataproc.v1.CreateClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.CreateClusterRequest + * @static + * @param {google.cloud.dataproc.v1.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.cloud.dataproc.v1.Cluster.encode(message.cluster, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.region); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.actionOnFailedPrimaryWorkers != null && Object.hasOwnProperty.call(message, "actionOnFailedPrimaryWorkers")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.actionOnFailedPrimaryWorkers); + return writer; + }; + + /** + * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.CreateClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.CreateClusterRequest + * @static + * @param {google.cloud.dataproc.v1.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.CreateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.CreateClusterRequest} CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.CreateClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 3: { + message.region = reader.string(); + break; + } + case 2: { + message.cluster = $root.google.cloud.dataproc.v1.Cluster.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.actionOnFailedPrimaryWorkers = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.CreateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.CreateClusterRequest} CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateClusterRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.CreateClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.cloud.dataproc.v1.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.actionOnFailedPrimaryWorkers != null && message.hasOwnProperty("actionOnFailedPrimaryWorkers")) + switch (message.actionOnFailedPrimaryWorkers) { + default: + return "actionOnFailedPrimaryWorkers: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.CreateClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.CreateClusterRequest} CreateClusterRequest + */ + CreateClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.CreateClusterRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.CreateClusterRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.region != null) + message.region = String(object.region); + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.cloud.dataproc.v1.CreateClusterRequest.cluster: object expected"); + message.cluster = $root.google.cloud.dataproc.v1.Cluster.fromObject(object.cluster); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + switch (object.actionOnFailedPrimaryWorkers) { + default: + if (typeof object.actionOnFailedPrimaryWorkers === "number") { + message.actionOnFailedPrimaryWorkers = object.actionOnFailedPrimaryWorkers; + break; + } + break; + case "FAILURE_ACTION_UNSPECIFIED": + case 0: + message.actionOnFailedPrimaryWorkers = 0; + break; + case "NO_ACTION": + case 1: + message.actionOnFailedPrimaryWorkers = 1; + break; + case "DELETE": + case 2: + message.actionOnFailedPrimaryWorkers = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.CreateClusterRequest + * @static + * @param {google.cloud.dataproc.v1.CreateClusterRequest} message CreateClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.cluster = null; + object.region = ""; + object.requestId = ""; + object.actionOnFailedPrimaryWorkers = options.enums === String ? "FAILURE_ACTION_UNSPECIFIED" : 0; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.cloud.dataproc.v1.Cluster.toObject(message.cluster, options); + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.actionOnFailedPrimaryWorkers != null && message.hasOwnProperty("actionOnFailedPrimaryWorkers")) + object.actionOnFailedPrimaryWorkers = options.enums === String ? $root.google.cloud.dataproc.v1.FailureAction[message.actionOnFailedPrimaryWorkers] === undefined ? message.actionOnFailedPrimaryWorkers : $root.google.cloud.dataproc.v1.FailureAction[message.actionOnFailedPrimaryWorkers] : message.actionOnFailedPrimaryWorkers; + return object; + }; + + /** + * Converts this CreateClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.CreateClusterRequest + * @instance + * @returns {Object.} JSON object + */ + CreateClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateClusterRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.CreateClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.CreateClusterRequest"; + }; + + return CreateClusterRequest; + })(); + + v1.UpdateClusterRequest = (function() { + + /** + * Properties of an UpdateClusterRequest. + * @memberof google.cloud.dataproc.v1 + * @interface IUpdateClusterRequest + * @property {string|null} [projectId] UpdateClusterRequest projectId + * @property {string|null} [region] UpdateClusterRequest region + * @property {string|null} [clusterName] UpdateClusterRequest clusterName + * @property {google.cloud.dataproc.v1.ICluster|null} [cluster] UpdateClusterRequest cluster + * @property {google.protobuf.IDuration|null} [gracefulDecommissionTimeout] UpdateClusterRequest gracefulDecommissionTimeout + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateClusterRequest updateMask + * @property {string|null} [requestId] UpdateClusterRequest requestId + */ + + /** + * Constructs a new UpdateClusterRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents an UpdateClusterRequest. + * @implements IUpdateClusterRequest + * @constructor + * @param {google.cloud.dataproc.v1.IUpdateClusterRequest=} [properties] Properties to set + */ + function UpdateClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateClusterRequest projectId. + * @member {string} projectId + * @memberof google.cloud.dataproc.v1.UpdateClusterRequest + * @instance + */ + UpdateClusterRequest.prototype.projectId = ""; + + /** + * UpdateClusterRequest region. + * @member {string} region + * @memberof google.cloud.dataproc.v1.UpdateClusterRequest + * @instance + */ + UpdateClusterRequest.prototype.region = ""; + + /** + * UpdateClusterRequest clusterName. + * @member {string} clusterName + * @memberof google.cloud.dataproc.v1.UpdateClusterRequest + * @instance + */ + UpdateClusterRequest.prototype.clusterName = ""; + + /** + * UpdateClusterRequest cluster. + * @member {google.cloud.dataproc.v1.ICluster|null|undefined} cluster + * @memberof google.cloud.dataproc.v1.UpdateClusterRequest + * @instance + */ + UpdateClusterRequest.prototype.cluster = null; + + /** + * UpdateClusterRequest gracefulDecommissionTimeout. + * @member {google.protobuf.IDuration|null|undefined} gracefulDecommissionTimeout + * @memberof google.cloud.dataproc.v1.UpdateClusterRequest + * @instance + */ + UpdateClusterRequest.prototype.gracefulDecommissionTimeout = null; + + /** + * UpdateClusterRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dataproc.v1.UpdateClusterRequest + * @instance + */ + UpdateClusterRequest.prototype.updateMask = null; + + /** + * UpdateClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.dataproc.v1.UpdateClusterRequest + * @instance + */ + UpdateClusterRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.UpdateClusterRequest + * @static + * @param {google.cloud.dataproc.v1.IUpdateClusterRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.UpdateClusterRequest} UpdateClusterRequest instance + */ + UpdateClusterRequest.create = function create(properties) { + return new UpdateClusterRequest(properties); + }; + + /** + * Encodes the specified UpdateClusterRequest message. Does not implicitly {@link google.cloud.dataproc.v1.UpdateClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.UpdateClusterRequest + * @static + * @param {google.cloud.dataproc.v1.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterName); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.cloud.dataproc.v1.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.region); + if (message.gracefulDecommissionTimeout != null && Object.hasOwnProperty.call(message, "gracefulDecommissionTimeout")) + $root.google.protobuf.Duration.encode(message.gracefulDecommissionTimeout, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.UpdateClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.UpdateClusterRequest + * @static + * @param {google.cloud.dataproc.v1.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.UpdateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.UpdateClusterRequest} UpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.UpdateClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 5: { + message.region = reader.string(); + break; + } + case 2: { + message.clusterName = reader.string(); + break; + } + case 3: { + message.cluster = $root.google.cloud.dataproc.v1.Cluster.decode(reader, reader.uint32()); + break; + } + case 6: { + message.gracefulDecommissionTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 7: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.UpdateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.UpdateClusterRequest} UpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateClusterRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.UpdateClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + if (!$util.isString(message.clusterName)) + return "clusterName: string expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.cloud.dataproc.v1.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; + } + if (message.gracefulDecommissionTimeout != null && message.hasOwnProperty("gracefulDecommissionTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.gracefulDecommissionTimeout); + if (error) + return "gracefulDecommissionTimeout." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.UpdateClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.UpdateClusterRequest} UpdateClusterRequest + */ + UpdateClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.UpdateClusterRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.UpdateClusterRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.region != null) + message.region = String(object.region); + if (object.clusterName != null) + message.clusterName = String(object.clusterName); + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.cloud.dataproc.v1.UpdateClusterRequest.cluster: object expected"); + message.cluster = $root.google.cloud.dataproc.v1.Cluster.fromObject(object.cluster); + } + if (object.gracefulDecommissionTimeout != null) { + if (typeof object.gracefulDecommissionTimeout !== "object") + throw TypeError(".google.cloud.dataproc.v1.UpdateClusterRequest.gracefulDecommissionTimeout: object expected"); + message.gracefulDecommissionTimeout = $root.google.protobuf.Duration.fromObject(object.gracefulDecommissionTimeout); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dataproc.v1.UpdateClusterRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.UpdateClusterRequest + * @static + * @param {google.cloud.dataproc.v1.UpdateClusterRequest} message UpdateClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.clusterName = ""; + object.cluster = null; + object.updateMask = null; + object.region = ""; + object.gracefulDecommissionTimeout = null; + object.requestId = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + object.clusterName = message.clusterName; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.cloud.dataproc.v1.Cluster.toObject(message.cluster, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.gracefulDecommissionTimeout != null && message.hasOwnProperty("gracefulDecommissionTimeout")) + object.gracefulDecommissionTimeout = $root.google.protobuf.Duration.toObject(message.gracefulDecommissionTimeout, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.UpdateClusterRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateClusterRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.UpdateClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.UpdateClusterRequest"; + }; + + return UpdateClusterRequest; + })(); + + v1.StopClusterRequest = (function() { + + /** + * Properties of a StopClusterRequest. + * @memberof google.cloud.dataproc.v1 + * @interface IStopClusterRequest + * @property {string|null} [projectId] StopClusterRequest projectId + * @property {string|null} [region] StopClusterRequest region + * @property {string|null} [clusterName] StopClusterRequest clusterName + * @property {string|null} [clusterUuid] StopClusterRequest clusterUuid + * @property {string|null} [requestId] StopClusterRequest requestId + */ + + /** + * Constructs a new StopClusterRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a StopClusterRequest. + * @implements IStopClusterRequest + * @constructor + * @param {google.cloud.dataproc.v1.IStopClusterRequest=} [properties] Properties to set + */ + function StopClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StopClusterRequest projectId. + * @member {string} projectId + * @memberof google.cloud.dataproc.v1.StopClusterRequest + * @instance + */ + StopClusterRequest.prototype.projectId = ""; + + /** + * StopClusterRequest region. + * @member {string} region + * @memberof google.cloud.dataproc.v1.StopClusterRequest + * @instance + */ + StopClusterRequest.prototype.region = ""; + + /** + * StopClusterRequest clusterName. + * @member {string} clusterName + * @memberof google.cloud.dataproc.v1.StopClusterRequest + * @instance + */ + StopClusterRequest.prototype.clusterName = ""; + + /** + * StopClusterRequest clusterUuid. + * @member {string} clusterUuid + * @memberof google.cloud.dataproc.v1.StopClusterRequest + * @instance + */ + StopClusterRequest.prototype.clusterUuid = ""; + + /** + * StopClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.dataproc.v1.StopClusterRequest + * @instance + */ + StopClusterRequest.prototype.requestId = ""; + + /** + * Creates a new StopClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.StopClusterRequest + * @static + * @param {google.cloud.dataproc.v1.IStopClusterRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.StopClusterRequest} StopClusterRequest instance + */ + StopClusterRequest.create = function create(properties) { + return new StopClusterRequest(properties); + }; + + /** + * Encodes the specified StopClusterRequest message. Does not implicitly {@link google.cloud.dataproc.v1.StopClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.StopClusterRequest + * @static + * @param {google.cloud.dataproc.v1.IStopClusterRequest} message StopClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StopClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.region); + if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.clusterName); + if (message.clusterUuid != null && Object.hasOwnProperty.call(message, "clusterUuid")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.clusterUuid); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified StopClusterRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.StopClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.StopClusterRequest + * @static + * @param {google.cloud.dataproc.v1.IStopClusterRequest} message StopClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StopClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StopClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.StopClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.StopClusterRequest} StopClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StopClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.StopClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.region = reader.string(); + break; + } + case 3: { + message.clusterName = reader.string(); + break; + } + case 4: { + message.clusterUuid = reader.string(); + break; + } + case 5: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StopClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.StopClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.StopClusterRequest} StopClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StopClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StopClusterRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.StopClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StopClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + if (!$util.isString(message.clusterName)) + return "clusterName: string expected"; + if (message.clusterUuid != null && message.hasOwnProperty("clusterUuid")) + if (!$util.isString(message.clusterUuid)) + return "clusterUuid: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a StopClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.StopClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.StopClusterRequest} StopClusterRequest + */ + StopClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.StopClusterRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.StopClusterRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.region != null) + message.region = String(object.region); + if (object.clusterName != null) + message.clusterName = String(object.clusterName); + if (object.clusterUuid != null) + message.clusterUuid = String(object.clusterUuid); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a StopClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.StopClusterRequest + * @static + * @param {google.cloud.dataproc.v1.StopClusterRequest} message StopClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StopClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.region = ""; + object.clusterName = ""; + object.clusterUuid = ""; + object.requestId = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + object.clusterName = message.clusterName; + if (message.clusterUuid != null && message.hasOwnProperty("clusterUuid")) + object.clusterUuid = message.clusterUuid; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this StopClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.StopClusterRequest + * @instance + * @returns {Object.} JSON object + */ + StopClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StopClusterRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.StopClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StopClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.StopClusterRequest"; + }; + + return StopClusterRequest; + })(); + + v1.StartClusterRequest = (function() { + + /** + * Properties of a StartClusterRequest. + * @memberof google.cloud.dataproc.v1 + * @interface IStartClusterRequest + * @property {string|null} [projectId] StartClusterRequest projectId + * @property {string|null} [region] StartClusterRequest region + * @property {string|null} [clusterName] StartClusterRequest clusterName + * @property {string|null} [clusterUuid] StartClusterRequest clusterUuid + * @property {string|null} [requestId] StartClusterRequest requestId + */ + + /** + * Constructs a new StartClusterRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a StartClusterRequest. + * @implements IStartClusterRequest + * @constructor + * @param {google.cloud.dataproc.v1.IStartClusterRequest=} [properties] Properties to set + */ + function StartClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartClusterRequest projectId. + * @member {string} projectId + * @memberof google.cloud.dataproc.v1.StartClusterRequest + * @instance + */ + StartClusterRequest.prototype.projectId = ""; + + /** + * StartClusterRequest region. + * @member {string} region + * @memberof google.cloud.dataproc.v1.StartClusterRequest + * @instance + */ + StartClusterRequest.prototype.region = ""; + + /** + * StartClusterRequest clusterName. + * @member {string} clusterName + * @memberof google.cloud.dataproc.v1.StartClusterRequest + * @instance + */ + StartClusterRequest.prototype.clusterName = ""; + + /** + * StartClusterRequest clusterUuid. + * @member {string} clusterUuid + * @memberof google.cloud.dataproc.v1.StartClusterRequest + * @instance + */ + StartClusterRequest.prototype.clusterUuid = ""; + + /** + * StartClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.dataproc.v1.StartClusterRequest + * @instance + */ + StartClusterRequest.prototype.requestId = ""; + + /** + * Creates a new StartClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.StartClusterRequest + * @static + * @param {google.cloud.dataproc.v1.IStartClusterRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.StartClusterRequest} StartClusterRequest instance + */ + StartClusterRequest.create = function create(properties) { + return new StartClusterRequest(properties); + }; + + /** + * Encodes the specified StartClusterRequest message. Does not implicitly {@link google.cloud.dataproc.v1.StartClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.StartClusterRequest + * @static + * @param {google.cloud.dataproc.v1.IStartClusterRequest} message StartClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.region); + if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.clusterName); + if (message.clusterUuid != null && Object.hasOwnProperty.call(message, "clusterUuid")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.clusterUuid); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified StartClusterRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.StartClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.StartClusterRequest + * @static + * @param {google.cloud.dataproc.v1.IStartClusterRequest} message StartClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.StartClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.StartClusterRequest} StartClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.StartClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.region = reader.string(); + break; + } + case 3: { + message.clusterName = reader.string(); + break; + } + case 4: { + message.clusterUuid = reader.string(); + break; + } + case 5: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.StartClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.StartClusterRequest} StartClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartClusterRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.StartClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + if (!$util.isString(message.clusterName)) + return "clusterName: string expected"; + if (message.clusterUuid != null && message.hasOwnProperty("clusterUuid")) + if (!$util.isString(message.clusterUuid)) + return "clusterUuid: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a StartClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.StartClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.StartClusterRequest} StartClusterRequest + */ + StartClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.StartClusterRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.StartClusterRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.region != null) + message.region = String(object.region); + if (object.clusterName != null) + message.clusterName = String(object.clusterName); + if (object.clusterUuid != null) + message.clusterUuid = String(object.clusterUuid); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a StartClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.StartClusterRequest + * @static + * @param {google.cloud.dataproc.v1.StartClusterRequest} message StartClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.region = ""; + object.clusterName = ""; + object.clusterUuid = ""; + object.requestId = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + object.clusterName = message.clusterName; + if (message.clusterUuid != null && message.hasOwnProperty("clusterUuid")) + object.clusterUuid = message.clusterUuid; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this StartClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.StartClusterRequest + * @instance + * @returns {Object.} JSON object + */ + StartClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StartClusterRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.StartClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StartClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.StartClusterRequest"; + }; + + return StartClusterRequest; + })(); + + v1.DeleteClusterRequest = (function() { + + /** + * Properties of a DeleteClusterRequest. + * @memberof google.cloud.dataproc.v1 + * @interface IDeleteClusterRequest + * @property {string|null} [projectId] DeleteClusterRequest projectId + * @property {string|null} [region] DeleteClusterRequest region + * @property {string|null} [clusterName] DeleteClusterRequest clusterName + * @property {string|null} [clusterUuid] DeleteClusterRequest clusterUuid + * @property {string|null} [requestId] DeleteClusterRequest requestId + */ + + /** + * Constructs a new DeleteClusterRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a DeleteClusterRequest. + * @implements IDeleteClusterRequest + * @constructor + * @param {google.cloud.dataproc.v1.IDeleteClusterRequest=} [properties] Properties to set + */ + function DeleteClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteClusterRequest projectId. + * @member {string} projectId + * @memberof google.cloud.dataproc.v1.DeleteClusterRequest + * @instance + */ + DeleteClusterRequest.prototype.projectId = ""; + + /** + * DeleteClusterRequest region. + * @member {string} region + * @memberof google.cloud.dataproc.v1.DeleteClusterRequest + * @instance + */ + DeleteClusterRequest.prototype.region = ""; + + /** + * DeleteClusterRequest clusterName. + * @member {string} clusterName + * @memberof google.cloud.dataproc.v1.DeleteClusterRequest + * @instance + */ + DeleteClusterRequest.prototype.clusterName = ""; + + /** + * DeleteClusterRequest clusterUuid. + * @member {string} clusterUuid + * @memberof google.cloud.dataproc.v1.DeleteClusterRequest + * @instance + */ + DeleteClusterRequest.prototype.clusterUuid = ""; + + /** + * DeleteClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.dataproc.v1.DeleteClusterRequest + * @instance + */ + DeleteClusterRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.DeleteClusterRequest + * @static + * @param {google.cloud.dataproc.v1.IDeleteClusterRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.DeleteClusterRequest} DeleteClusterRequest instance + */ + DeleteClusterRequest.create = function create(properties) { + return new DeleteClusterRequest(properties); + }; + + /** + * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.cloud.dataproc.v1.DeleteClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.DeleteClusterRequest + * @static + * @param {google.cloud.dataproc.v1.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterName); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.region); + if (message.clusterUuid != null && Object.hasOwnProperty.call(message, "clusterUuid")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.clusterUuid); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DeleteClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.DeleteClusterRequest + * @static + * @param {google.cloud.dataproc.v1.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.DeleteClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.DeleteClusterRequest} DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.DeleteClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 3: { + message.region = reader.string(); + break; + } + case 2: { + message.clusterName = reader.string(); + break; + } + case 4: { + message.clusterUuid = reader.string(); + break; + } + case 5: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.DeleteClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.DeleteClusterRequest} DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteClusterRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.DeleteClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + if (!$util.isString(message.clusterName)) + return "clusterName: string expected"; + if (message.clusterUuid != null && message.hasOwnProperty("clusterUuid")) + if (!$util.isString(message.clusterUuid)) + return "clusterUuid: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.DeleteClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.DeleteClusterRequest} DeleteClusterRequest + */ + DeleteClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.DeleteClusterRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.DeleteClusterRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.region != null) + message.region = String(object.region); + if (object.clusterName != null) + message.clusterName = String(object.clusterName); + if (object.clusterUuid != null) + message.clusterUuid = String(object.clusterUuid); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.DeleteClusterRequest + * @static + * @param {google.cloud.dataproc.v1.DeleteClusterRequest} message DeleteClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.clusterName = ""; + object.region = ""; + object.clusterUuid = ""; + object.requestId = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + object.clusterName = message.clusterName; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.clusterUuid != null && message.hasOwnProperty("clusterUuid")) + object.clusterUuid = message.clusterUuid; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.DeleteClusterRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteClusterRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.DeleteClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.DeleteClusterRequest"; + }; + + return DeleteClusterRequest; + })(); + + v1.GetClusterRequest = (function() { + + /** + * Properties of a GetClusterRequest. + * @memberof google.cloud.dataproc.v1 + * @interface IGetClusterRequest + * @property {string|null} [projectId] GetClusterRequest projectId + * @property {string|null} [region] GetClusterRequest region + * @property {string|null} [clusterName] GetClusterRequest clusterName + */ + + /** + * Constructs a new GetClusterRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a GetClusterRequest. + * @implements IGetClusterRequest + * @constructor + * @param {google.cloud.dataproc.v1.IGetClusterRequest=} [properties] Properties to set + */ + function GetClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetClusterRequest projectId. + * @member {string} projectId + * @memberof google.cloud.dataproc.v1.GetClusterRequest + * @instance + */ + GetClusterRequest.prototype.projectId = ""; + + /** + * GetClusterRequest region. + * @member {string} region + * @memberof google.cloud.dataproc.v1.GetClusterRequest + * @instance + */ + GetClusterRequest.prototype.region = ""; + + /** + * GetClusterRequest clusterName. + * @member {string} clusterName + * @memberof google.cloud.dataproc.v1.GetClusterRequest + * @instance + */ + GetClusterRequest.prototype.clusterName = ""; + + /** + * Creates a new GetClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.GetClusterRequest + * @static + * @param {google.cloud.dataproc.v1.IGetClusterRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.GetClusterRequest} GetClusterRequest instance + */ + GetClusterRequest.create = function create(properties) { + return new GetClusterRequest(properties); + }; + + /** + * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.cloud.dataproc.v1.GetClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.GetClusterRequest + * @static + * @param {google.cloud.dataproc.v1.IGetClusterRequest} message GetClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterName); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.region); + return writer; + }; + + /** + * Encodes the specified GetClusterRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GetClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.GetClusterRequest + * @static + * @param {google.cloud.dataproc.v1.IGetClusterRequest} message GetClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.GetClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.GetClusterRequest} GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.GetClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 3: { + message.region = reader.string(); + break; + } + case 2: { + message.clusterName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.GetClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.GetClusterRequest} GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetClusterRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.GetClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + if (!$util.isString(message.clusterName)) + return "clusterName: string expected"; + return null; + }; + + /** + * Creates a GetClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.GetClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.GetClusterRequest} GetClusterRequest + */ + GetClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.GetClusterRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.GetClusterRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.region != null) + message.region = String(object.region); + if (object.clusterName != null) + message.clusterName = String(object.clusterName); + return message; + }; + + /** + * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.GetClusterRequest + * @static + * @param {google.cloud.dataproc.v1.GetClusterRequest} message GetClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.clusterName = ""; + object.region = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + object.clusterName = message.clusterName; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + return object; + }; + + /** + * Converts this GetClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.GetClusterRequest + * @instance + * @returns {Object.} JSON object + */ + GetClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetClusterRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.GetClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.GetClusterRequest"; + }; + + return GetClusterRequest; + })(); + + v1.ListClustersRequest = (function() { + + /** + * Properties of a ListClustersRequest. + * @memberof google.cloud.dataproc.v1 + * @interface IListClustersRequest + * @property {string|null} [projectId] ListClustersRequest projectId + * @property {string|null} [region] ListClustersRequest region + * @property {string|null} [filter] ListClustersRequest filter + * @property {number|null} [pageSize] ListClustersRequest pageSize + * @property {string|null} [pageToken] ListClustersRequest pageToken + */ + + /** + * Constructs a new ListClustersRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a ListClustersRequest. + * @implements IListClustersRequest + * @constructor + * @param {google.cloud.dataproc.v1.IListClustersRequest=} [properties] Properties to set + */ + function ListClustersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListClustersRequest projectId. + * @member {string} projectId + * @memberof google.cloud.dataproc.v1.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.projectId = ""; + + /** + * ListClustersRequest region. + * @member {string} region + * @memberof google.cloud.dataproc.v1.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.region = ""; + + /** + * ListClustersRequest filter. + * @member {string} filter + * @memberof google.cloud.dataproc.v1.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.filter = ""; + + /** + * ListClustersRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dataproc.v1.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.pageSize = 0; + + /** + * ListClustersRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dataproc.v1.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.pageToken = ""; + + /** + * Creates a new ListClustersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.ListClustersRequest + * @static + * @param {google.cloud.dataproc.v1.IListClustersRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.ListClustersRequest} ListClustersRequest instance + */ + ListClustersRequest.create = function create(properties) { + return new ListClustersRequest(properties); + }; + + /** + * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.cloud.dataproc.v1.ListClustersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.ListClustersRequest + * @static + * @param {google.cloud.dataproc.v1.IListClustersRequest} message ListClustersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.region); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListClustersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.ListClustersRequest + * @static + * @param {google.cloud.dataproc.v1.IListClustersRequest} message ListClustersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.ListClustersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.ListClustersRequest} ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ListClustersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 4: { + message.region = reader.string(); + break; + } + case 5: { + 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 ListClustersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.ListClustersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.ListClustersRequest} ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListClustersRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.ListClustersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListClustersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: 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 ListClustersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.ListClustersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.ListClustersRequest} ListClustersRequest + */ + ListClustersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.ListClustersRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.ListClustersRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.region != null) + message.region = String(object.region); + 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 ListClustersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.ListClustersRequest + * @static + * @param {google.cloud.dataproc.v1.ListClustersRequest} message ListClustersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListClustersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.pageSize = 0; + object.pageToken = ""; + object.region = ""; + object.filter = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListClustersRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.ListClustersRequest + * @instance + * @returns {Object.} JSON object + */ + ListClustersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListClustersRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.ListClustersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListClustersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.ListClustersRequest"; + }; + + return ListClustersRequest; + })(); + + v1.ListClustersResponse = (function() { + + /** + * Properties of a ListClustersResponse. + * @memberof google.cloud.dataproc.v1 + * @interface IListClustersResponse + * @property {Array.|null} [clusters] ListClustersResponse clusters + * @property {string|null} [nextPageToken] ListClustersResponse nextPageToken + */ + + /** + * Constructs a new ListClustersResponse. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a ListClustersResponse. + * @implements IListClustersResponse + * @constructor + * @param {google.cloud.dataproc.v1.IListClustersResponse=} [properties] Properties to set + */ + function ListClustersResponse(properties) { + this.clusters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListClustersResponse clusters. + * @member {Array.} clusters + * @memberof google.cloud.dataproc.v1.ListClustersResponse + * @instance + */ + ListClustersResponse.prototype.clusters = $util.emptyArray; + + /** + * ListClustersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dataproc.v1.ListClustersResponse + * @instance + */ + ListClustersResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListClustersResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.ListClustersResponse + * @static + * @param {google.cloud.dataproc.v1.IListClustersResponse=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.ListClustersResponse} ListClustersResponse instance + */ + ListClustersResponse.create = function create(properties) { + return new ListClustersResponse(properties); + }; + + /** + * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.cloud.dataproc.v1.ListClustersResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.ListClustersResponse + * @static + * @param {google.cloud.dataproc.v1.IListClustersResponse} message ListClustersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clusters != null && message.clusters.length) + for (var i = 0; i < message.clusters.length; ++i) + $root.google.cloud.dataproc.v1.Cluster.encode(message.clusters[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 ListClustersResponse message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListClustersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.ListClustersResponse + * @static + * @param {google.cloud.dataproc.v1.IListClustersResponse} message ListClustersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.ListClustersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.ListClustersResponse} ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ListClustersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.clusters && message.clusters.length)) + message.clusters = []; + message.clusters.push($root.google.cloud.dataproc.v1.Cluster.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.ListClustersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.ListClustersResponse} ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListClustersResponse message. + * @function verify + * @memberof google.cloud.dataproc.v1.ListClustersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListClustersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clusters != null && message.hasOwnProperty("clusters")) { + if (!Array.isArray(message.clusters)) + return "clusters: array expected"; + for (var i = 0; i < message.clusters.length; ++i) { + var error = $root.google.cloud.dataproc.v1.Cluster.verify(message.clusters[i]); + if (error) + return "clusters." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.ListClustersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.ListClustersResponse} ListClustersResponse + */ + ListClustersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.ListClustersResponse) + return object; + var message = new $root.google.cloud.dataproc.v1.ListClustersResponse(); + if (object.clusters) { + if (!Array.isArray(object.clusters)) + throw TypeError(".google.cloud.dataproc.v1.ListClustersResponse.clusters: array expected"); + message.clusters = []; + for (var i = 0; i < object.clusters.length; ++i) { + if (typeof object.clusters[i] !== "object") + throw TypeError(".google.cloud.dataproc.v1.ListClustersResponse.clusters: object expected"); + message.clusters[i] = $root.google.cloud.dataproc.v1.Cluster.fromObject(object.clusters[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.ListClustersResponse + * @static + * @param {google.cloud.dataproc.v1.ListClustersResponse} message ListClustersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListClustersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.clusters = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.clusters && message.clusters.length) { + object.clusters = []; + for (var j = 0; j < message.clusters.length; ++j) + object.clusters[j] = $root.google.cloud.dataproc.v1.Cluster.toObject(message.clusters[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListClustersResponse to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.ListClustersResponse + * @instance + * @returns {Object.} JSON object + */ + ListClustersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListClustersResponse + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.ListClustersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListClustersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.ListClustersResponse"; + }; + + return ListClustersResponse; + })(); + + v1.DiagnoseClusterRequest = (function() { + + /** + * Properties of a DiagnoseClusterRequest. + * @memberof google.cloud.dataproc.v1 + * @interface IDiagnoseClusterRequest + * @property {string|null} [projectId] DiagnoseClusterRequest projectId + * @property {string|null} [region] DiagnoseClusterRequest region + * @property {string|null} [clusterName] DiagnoseClusterRequest clusterName + * @property {string|null} [tarballGcsDir] DiagnoseClusterRequest tarballGcsDir + * @property {google.cloud.dataproc.v1.DiagnoseClusterRequest.TarballAccess|null} [tarballAccess] DiagnoseClusterRequest tarballAccess + * @property {google.type.IInterval|null} [diagnosisInterval] DiagnoseClusterRequest diagnosisInterval + * @property {Array.|null} [jobs] DiagnoseClusterRequest jobs + * @property {Array.|null} [yarnApplicationIds] DiagnoseClusterRequest yarnApplicationIds + */ + + /** + * Constructs a new DiagnoseClusterRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a DiagnoseClusterRequest. + * @implements IDiagnoseClusterRequest + * @constructor + * @param {google.cloud.dataproc.v1.IDiagnoseClusterRequest=} [properties] Properties to set + */ + function DiagnoseClusterRequest(properties) { + this.jobs = []; + this.yarnApplicationIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DiagnoseClusterRequest projectId. + * @member {string} projectId + * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest + * @instance + */ + DiagnoseClusterRequest.prototype.projectId = ""; + + /** + * DiagnoseClusterRequest region. + * @member {string} region + * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest + * @instance + */ + DiagnoseClusterRequest.prototype.region = ""; + + /** + * DiagnoseClusterRequest clusterName. + * @member {string} clusterName + * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest + * @instance + */ + DiagnoseClusterRequest.prototype.clusterName = ""; + + /** + * DiagnoseClusterRequest tarballGcsDir. + * @member {string} tarballGcsDir + * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest + * @instance + */ + DiagnoseClusterRequest.prototype.tarballGcsDir = ""; + + /** + * DiagnoseClusterRequest tarballAccess. + * @member {google.cloud.dataproc.v1.DiagnoseClusterRequest.TarballAccess} tarballAccess + * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest + * @instance + */ + DiagnoseClusterRequest.prototype.tarballAccess = 0; + + /** + * DiagnoseClusterRequest diagnosisInterval. + * @member {google.type.IInterval|null|undefined} diagnosisInterval + * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest + * @instance + */ + DiagnoseClusterRequest.prototype.diagnosisInterval = null; + + /** + * DiagnoseClusterRequest jobs. + * @member {Array.} jobs + * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest + * @instance + */ + DiagnoseClusterRequest.prototype.jobs = $util.emptyArray; + + /** + * DiagnoseClusterRequest yarnApplicationIds. + * @member {Array.} yarnApplicationIds + * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest + * @instance + */ + DiagnoseClusterRequest.prototype.yarnApplicationIds = $util.emptyArray; + + /** + * Creates a new DiagnoseClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest + * @static + * @param {google.cloud.dataproc.v1.IDiagnoseClusterRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.DiagnoseClusterRequest} DiagnoseClusterRequest instance + */ + DiagnoseClusterRequest.create = function create(properties) { + return new DiagnoseClusterRequest(properties); + }; + + /** + * Encodes the specified DiagnoseClusterRequest message. Does not implicitly {@link google.cloud.dataproc.v1.DiagnoseClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest + * @static + * @param {google.cloud.dataproc.v1.IDiagnoseClusterRequest} message DiagnoseClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiagnoseClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterName); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.region); + if (message.tarballGcsDir != null && Object.hasOwnProperty.call(message, "tarballGcsDir")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.tarballGcsDir); + if (message.tarballAccess != null && Object.hasOwnProperty.call(message, "tarballAccess")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.tarballAccess); + if (message.diagnosisInterval != null && Object.hasOwnProperty.call(message, "diagnosisInterval")) + $root.google.type.Interval.encode(message.diagnosisInterval, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.jobs != null && message.jobs.length) + for (var i = 0; i < message.jobs.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jobs[i]); + if (message.yarnApplicationIds != null && message.yarnApplicationIds.length) + for (var i = 0; i < message.yarnApplicationIds.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.yarnApplicationIds[i]); + return writer; + }; + + /** + * Encodes the specified DiagnoseClusterRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DiagnoseClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest + * @static + * @param {google.cloud.dataproc.v1.IDiagnoseClusterRequest} message DiagnoseClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiagnoseClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DiagnoseClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.DiagnoseClusterRequest} DiagnoseClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiagnoseClusterRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.DiagnoseClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 3: { + message.region = reader.string(); + break; + } + case 2: { + message.clusterName = reader.string(); + break; + } + case 4: { + message.tarballGcsDir = reader.string(); + break; + } + case 5: { + message.tarballAccess = reader.int32(); + break; + } + case 6: { + message.diagnosisInterval = $root.google.type.Interval.decode(reader, reader.uint32()); + break; + } + case 10: { + if (!(message.jobs && message.jobs.length)) + message.jobs = []; + message.jobs.push(reader.string()); + break; + } + case 11: { + if (!(message.yarnApplicationIds && message.yarnApplicationIds.length)) + message.yarnApplicationIds = []; + message.yarnApplicationIds.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DiagnoseClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.DiagnoseClusterRequest} DiagnoseClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiagnoseClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DiagnoseClusterRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DiagnoseClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + if (!$util.isString(message.clusterName)) + return "clusterName: string expected"; + if (message.tarballGcsDir != null && message.hasOwnProperty("tarballGcsDir")) + if (!$util.isString(message.tarballGcsDir)) + return "tarballGcsDir: string expected"; + if (message.tarballAccess != null && message.hasOwnProperty("tarballAccess")) + switch (message.tarballAccess) { + default: + return "tarballAccess: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.diagnosisInterval != null && message.hasOwnProperty("diagnosisInterval")) { + var error = $root.google.type.Interval.verify(message.diagnosisInterval); + if (error) + return "diagnosisInterval." + error; + } + 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) + if (!$util.isString(message.jobs[i])) + return "jobs: string[] expected"; + } + if (message.yarnApplicationIds != null && message.hasOwnProperty("yarnApplicationIds")) { + if (!Array.isArray(message.yarnApplicationIds)) + return "yarnApplicationIds: array expected"; + for (var i = 0; i < message.yarnApplicationIds.length; ++i) + if (!$util.isString(message.yarnApplicationIds[i])) + return "yarnApplicationIds: string[] expected"; + } + return null; + }; + + /** + * Creates a DiagnoseClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.DiagnoseClusterRequest} DiagnoseClusterRequest + */ + DiagnoseClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.DiagnoseClusterRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.DiagnoseClusterRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.region != null) + message.region = String(object.region); + if (object.clusterName != null) + message.clusterName = String(object.clusterName); + if (object.tarballGcsDir != null) + message.tarballGcsDir = String(object.tarballGcsDir); + switch (object.tarballAccess) { + default: + if (typeof object.tarballAccess === "number") { + message.tarballAccess = object.tarballAccess; + break; + } + break; + case "TARBALL_ACCESS_UNSPECIFIED": + case 0: + message.tarballAccess = 0; + break; + case "GOOGLE_CLOUD_SUPPORT": + case 1: + message.tarballAccess = 1; + break; + case "GOOGLE_DATAPROC_DIAGNOSE": + case 2: + message.tarballAccess = 2; + break; + } + if (object.diagnosisInterval != null) { + if (typeof object.diagnosisInterval !== "object") + throw TypeError(".google.cloud.dataproc.v1.DiagnoseClusterRequest.diagnosisInterval: object expected"); + message.diagnosisInterval = $root.google.type.Interval.fromObject(object.diagnosisInterval); + } + if (object.jobs) { + if (!Array.isArray(object.jobs)) + throw TypeError(".google.cloud.dataproc.v1.DiagnoseClusterRequest.jobs: array expected"); + message.jobs = []; + for (var i = 0; i < object.jobs.length; ++i) + message.jobs[i] = String(object.jobs[i]); + } + if (object.yarnApplicationIds) { + if (!Array.isArray(object.yarnApplicationIds)) + throw TypeError(".google.cloud.dataproc.v1.DiagnoseClusterRequest.yarnApplicationIds: array expected"); + message.yarnApplicationIds = []; + for (var i = 0; i < object.yarnApplicationIds.length; ++i) + message.yarnApplicationIds[i] = String(object.yarnApplicationIds[i]); + } + return message; + }; + + /** + * Creates a plain object from a DiagnoseClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest + * @static + * @param {google.cloud.dataproc.v1.DiagnoseClusterRequest} message DiagnoseClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DiagnoseClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.jobs = []; + object.yarnApplicationIds = []; + } + if (options.defaults) { + object.projectId = ""; + object.clusterName = ""; + object.region = ""; + object.tarballGcsDir = ""; + object.tarballAccess = options.enums === String ? "TARBALL_ACCESS_UNSPECIFIED" : 0; + object.diagnosisInterval = null; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + object.clusterName = message.clusterName; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.tarballGcsDir != null && message.hasOwnProperty("tarballGcsDir")) + object.tarballGcsDir = message.tarballGcsDir; + if (message.tarballAccess != null && message.hasOwnProperty("tarballAccess")) + object.tarballAccess = options.enums === String ? $root.google.cloud.dataproc.v1.DiagnoseClusterRequest.TarballAccess[message.tarballAccess] === undefined ? message.tarballAccess : $root.google.cloud.dataproc.v1.DiagnoseClusterRequest.TarballAccess[message.tarballAccess] : message.tarballAccess; + if (message.diagnosisInterval != null && message.hasOwnProperty("diagnosisInterval")) + object.diagnosisInterval = $root.google.type.Interval.toObject(message.diagnosisInterval, options); + if (message.jobs && message.jobs.length) { + object.jobs = []; + for (var j = 0; j < message.jobs.length; ++j) + object.jobs[j] = message.jobs[j]; + } + if (message.yarnApplicationIds && message.yarnApplicationIds.length) { + object.yarnApplicationIds = []; + for (var j = 0; j < message.yarnApplicationIds.length; ++j) + object.yarnApplicationIds[j] = message.yarnApplicationIds[j]; + } + return object; + }; + + /** + * Converts this DiagnoseClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest + * @instance + * @returns {Object.} JSON object + */ + DiagnoseClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DiagnoseClusterRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DiagnoseClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.DiagnoseClusterRequest"; + }; + + /** + * TarballAccess enum. + * @name google.cloud.dataproc.v1.DiagnoseClusterRequest.TarballAccess + * @enum {number} + * @property {number} TARBALL_ACCESS_UNSPECIFIED=0 TARBALL_ACCESS_UNSPECIFIED value + * @property {number} GOOGLE_CLOUD_SUPPORT=1 GOOGLE_CLOUD_SUPPORT value + * @property {number} GOOGLE_DATAPROC_DIAGNOSE=2 GOOGLE_DATAPROC_DIAGNOSE value + */ + DiagnoseClusterRequest.TarballAccess = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARBALL_ACCESS_UNSPECIFIED"] = 0; + values[valuesById[1] = "GOOGLE_CLOUD_SUPPORT"] = 1; + values[valuesById[2] = "GOOGLE_DATAPROC_DIAGNOSE"] = 2; + return values; + })(); + + return DiagnoseClusterRequest; + })(); + + v1.DiagnoseClusterResults = (function() { + + /** + * Properties of a DiagnoseClusterResults. + * @memberof google.cloud.dataproc.v1 + * @interface IDiagnoseClusterResults + * @property {string|null} [outputUri] DiagnoseClusterResults outputUri + */ + + /** + * Constructs a new DiagnoseClusterResults. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a DiagnoseClusterResults. + * @implements IDiagnoseClusterResults + * @constructor + * @param {google.cloud.dataproc.v1.IDiagnoseClusterResults=} [properties] Properties to set + */ + function DiagnoseClusterResults(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DiagnoseClusterResults outputUri. + * @member {string} outputUri + * @memberof google.cloud.dataproc.v1.DiagnoseClusterResults + * @instance + */ + DiagnoseClusterResults.prototype.outputUri = ""; + + /** + * Creates a new DiagnoseClusterResults instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.DiagnoseClusterResults + * @static + * @param {google.cloud.dataproc.v1.IDiagnoseClusterResults=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.DiagnoseClusterResults} DiagnoseClusterResults instance + */ + DiagnoseClusterResults.create = function create(properties) { + return new DiagnoseClusterResults(properties); + }; + + /** + * Encodes the specified DiagnoseClusterResults message. Does not implicitly {@link google.cloud.dataproc.v1.DiagnoseClusterResults.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.DiagnoseClusterResults + * @static + * @param {google.cloud.dataproc.v1.IDiagnoseClusterResults} message DiagnoseClusterResults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiagnoseClusterResults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputUri != null && Object.hasOwnProperty.call(message, "outputUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.outputUri); + return writer; + }; + + /** + * Encodes the specified DiagnoseClusterResults message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DiagnoseClusterResults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.DiagnoseClusterResults + * @static + * @param {google.cloud.dataproc.v1.IDiagnoseClusterResults} message DiagnoseClusterResults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiagnoseClusterResults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DiagnoseClusterResults message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.DiagnoseClusterResults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.DiagnoseClusterResults} DiagnoseClusterResults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiagnoseClusterResults.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.DiagnoseClusterResults(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.outputUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DiagnoseClusterResults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.DiagnoseClusterResults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.DiagnoseClusterResults} DiagnoseClusterResults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiagnoseClusterResults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DiagnoseClusterResults message. + * @function verify + * @memberof google.cloud.dataproc.v1.DiagnoseClusterResults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DiagnoseClusterResults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outputUri != null && message.hasOwnProperty("outputUri")) + if (!$util.isString(message.outputUri)) + return "outputUri: string expected"; + return null; + }; + + /** + * Creates a DiagnoseClusterResults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.DiagnoseClusterResults + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.DiagnoseClusterResults} DiagnoseClusterResults + */ + DiagnoseClusterResults.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.DiagnoseClusterResults) + return object; + var message = new $root.google.cloud.dataproc.v1.DiagnoseClusterResults(); + if (object.outputUri != null) + message.outputUri = String(object.outputUri); + return message; + }; + + /** + * Creates a plain object from a DiagnoseClusterResults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.DiagnoseClusterResults + * @static + * @param {google.cloud.dataproc.v1.DiagnoseClusterResults} message DiagnoseClusterResults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DiagnoseClusterResults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputUri = ""; + if (message.outputUri != null && message.hasOwnProperty("outputUri")) + object.outputUri = message.outputUri; + return object; + }; + + /** + * Converts this DiagnoseClusterResults to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.DiagnoseClusterResults + * @instance + * @returns {Object.} JSON object + */ + DiagnoseClusterResults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DiagnoseClusterResults + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.DiagnoseClusterResults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DiagnoseClusterResults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.DiagnoseClusterResults"; + }; + + return DiagnoseClusterResults; + })(); + + v1.ReservationAffinity = (function() { + + /** + * Properties of a ReservationAffinity. + * @memberof google.cloud.dataproc.v1 + * @interface IReservationAffinity + * @property {google.cloud.dataproc.v1.ReservationAffinity.Type|null} [consumeReservationType] ReservationAffinity consumeReservationType + * @property {string|null} [key] ReservationAffinity key + * @property {Array.|null} [values] ReservationAffinity values + */ + + /** + * Constructs a new ReservationAffinity. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a ReservationAffinity. + * @implements IReservationAffinity + * @constructor + * @param {google.cloud.dataproc.v1.IReservationAffinity=} [properties] Properties to set + */ + function ReservationAffinity(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservationAffinity consumeReservationType. + * @member {google.cloud.dataproc.v1.ReservationAffinity.Type} consumeReservationType + * @memberof google.cloud.dataproc.v1.ReservationAffinity + * @instance + */ + ReservationAffinity.prototype.consumeReservationType = 0; + + /** + * ReservationAffinity key. + * @member {string} key + * @memberof google.cloud.dataproc.v1.ReservationAffinity + * @instance + */ + ReservationAffinity.prototype.key = ""; + + /** + * ReservationAffinity values. + * @member {Array.} values + * @memberof google.cloud.dataproc.v1.ReservationAffinity + * @instance + */ + ReservationAffinity.prototype.values = $util.emptyArray; + + /** + * Creates a new ReservationAffinity instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.ReservationAffinity + * @static + * @param {google.cloud.dataproc.v1.IReservationAffinity=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.ReservationAffinity} ReservationAffinity instance + */ + ReservationAffinity.create = function create(properties) { + return new ReservationAffinity(properties); + }; + + /** + * Encodes the specified ReservationAffinity message. Does not implicitly {@link google.cloud.dataproc.v1.ReservationAffinity.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.ReservationAffinity + * @static + * @param {google.cloud.dataproc.v1.IReservationAffinity} message ReservationAffinity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservationAffinity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.consumeReservationType != null && Object.hasOwnProperty.call(message, "consumeReservationType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.consumeReservationType); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.key); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.values[i]); + return writer; + }; + + /** + * Encodes the specified ReservationAffinity message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ReservationAffinity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.ReservationAffinity + * @static + * @param {google.cloud.dataproc.v1.IReservationAffinity} message ReservationAffinity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservationAffinity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservationAffinity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.ReservationAffinity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.ReservationAffinity} ReservationAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservationAffinity.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ReservationAffinity(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.consumeReservationType = reader.int32(); + break; + } + case 2: { + message.key = reader.string(); + break; + } + case 3: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservationAffinity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.ReservationAffinity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.ReservationAffinity} ReservationAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservationAffinity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservationAffinity message. + * @function verify + * @memberof google.cloud.dataproc.v1.ReservationAffinity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservationAffinity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.consumeReservationType != null && message.hasOwnProperty("consumeReservationType")) + switch (message.consumeReservationType) { + default: + return "consumeReservationType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) + if (!$util.isString(message.values[i])) + return "values: string[] expected"; + } + return null; + }; + + /** + * Creates a ReservationAffinity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.ReservationAffinity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.ReservationAffinity} ReservationAffinity + */ + ReservationAffinity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.ReservationAffinity) + return object; + var message = new $root.google.cloud.dataproc.v1.ReservationAffinity(); + switch (object.consumeReservationType) { + default: + if (typeof object.consumeReservationType === "number") { + message.consumeReservationType = object.consumeReservationType; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.consumeReservationType = 0; + break; + case "NO_RESERVATION": + case 1: + message.consumeReservationType = 1; + break; + case "ANY_RESERVATION": + case 2: + message.consumeReservationType = 2; + break; + case "SPECIFIC_RESERVATION": + case 3: + message.consumeReservationType = 3; + break; + } + if (object.key != null) + message.key = String(object.key); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.dataproc.v1.ReservationAffinity.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) + message.values[i] = String(object.values[i]); + } + return message; + }; + + /** + * Creates a plain object from a ReservationAffinity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.ReservationAffinity + * @static + * @param {google.cloud.dataproc.v1.ReservationAffinity} message ReservationAffinity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservationAffinity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (options.defaults) { + object.consumeReservationType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.key = ""; + } + if (message.consumeReservationType != null && message.hasOwnProperty("consumeReservationType")) + object.consumeReservationType = options.enums === String ? $root.google.cloud.dataproc.v1.ReservationAffinity.Type[message.consumeReservationType] === undefined ? message.consumeReservationType : $root.google.cloud.dataproc.v1.ReservationAffinity.Type[message.consumeReservationType] : message.consumeReservationType; + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = message.values[j]; + } + return object; + }; + + /** + * Converts this ReservationAffinity to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.ReservationAffinity + * @instance + * @returns {Object.} JSON object + */ + ReservationAffinity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservationAffinity + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.ReservationAffinity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservationAffinity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.ReservationAffinity"; + }; + + /** + * Type enum. + * @name google.cloud.dataproc.v1.ReservationAffinity.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} NO_RESERVATION=1 NO_RESERVATION value + * @property {number} ANY_RESERVATION=2 ANY_RESERVATION value + * @property {number} SPECIFIC_RESERVATION=3 SPECIFIC_RESERVATION value + */ + ReservationAffinity.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NO_RESERVATION"] = 1; + values[valuesById[2] = "ANY_RESERVATION"] = 2; + values[valuesById[3] = "SPECIFIC_RESERVATION"] = 3; + return values; + })(); + + return ReservationAffinity; + })(); + + v1.BatchOperationMetadata = (function() { + + /** + * Properties of a BatchOperationMetadata. + * @memberof google.cloud.dataproc.v1 + * @interface IBatchOperationMetadata + * @property {string|null} [batch] BatchOperationMetadata batch + * @property {string|null} [batchUuid] BatchOperationMetadata batchUuid + * @property {google.protobuf.ITimestamp|null} [createTime] BatchOperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [doneTime] BatchOperationMetadata doneTime + * @property {google.cloud.dataproc.v1.BatchOperationMetadata.BatchOperationType|null} [operationType] BatchOperationMetadata operationType + * @property {string|null} [description] BatchOperationMetadata description + * @property {Object.|null} [labels] BatchOperationMetadata labels + * @property {Array.|null} [warnings] BatchOperationMetadata warnings + */ + + /** + * Constructs a new BatchOperationMetadata. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a BatchOperationMetadata. + * @implements IBatchOperationMetadata + * @constructor + * @param {google.cloud.dataproc.v1.IBatchOperationMetadata=} [properties] Properties to set + */ + function BatchOperationMetadata(properties) { + this.labels = {}; + this.warnings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchOperationMetadata batch. + * @member {string} batch + * @memberof google.cloud.dataproc.v1.BatchOperationMetadata + * @instance + */ + BatchOperationMetadata.prototype.batch = ""; + + /** + * BatchOperationMetadata batchUuid. + * @member {string} batchUuid + * @memberof google.cloud.dataproc.v1.BatchOperationMetadata + * @instance + */ + BatchOperationMetadata.prototype.batchUuid = ""; + + /** + * BatchOperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.dataproc.v1.BatchOperationMetadata + * @instance + */ + BatchOperationMetadata.prototype.createTime = null; + + /** + * BatchOperationMetadata doneTime. + * @member {google.protobuf.ITimestamp|null|undefined} doneTime + * @memberof google.cloud.dataproc.v1.BatchOperationMetadata + * @instance + */ + BatchOperationMetadata.prototype.doneTime = null; + + /** + * BatchOperationMetadata operationType. + * @member {google.cloud.dataproc.v1.BatchOperationMetadata.BatchOperationType} operationType + * @memberof google.cloud.dataproc.v1.BatchOperationMetadata + * @instance + */ + BatchOperationMetadata.prototype.operationType = 0; + + /** + * BatchOperationMetadata description. + * @member {string} description + * @memberof google.cloud.dataproc.v1.BatchOperationMetadata + * @instance + */ + BatchOperationMetadata.prototype.description = ""; + + /** + * BatchOperationMetadata labels. + * @member {Object.} labels + * @memberof google.cloud.dataproc.v1.BatchOperationMetadata + * @instance + */ + BatchOperationMetadata.prototype.labels = $util.emptyObject; + + /** + * BatchOperationMetadata warnings. + * @member {Array.} warnings + * @memberof google.cloud.dataproc.v1.BatchOperationMetadata + * @instance + */ + BatchOperationMetadata.prototype.warnings = $util.emptyArray; + + /** + * Creates a new BatchOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.BatchOperationMetadata + * @static + * @param {google.cloud.dataproc.v1.IBatchOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.BatchOperationMetadata} BatchOperationMetadata instance + */ + BatchOperationMetadata.create = function create(properties) { + return new BatchOperationMetadata(properties); + }; + + /** + * Encodes the specified BatchOperationMetadata message. Does not implicitly {@link google.cloud.dataproc.v1.BatchOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.BatchOperationMetadata + * @static + * @param {google.cloud.dataproc.v1.IBatchOperationMetadata} message BatchOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.batch != null && Object.hasOwnProperty.call(message, "batch")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.batch); + if (message.batchUuid != null && Object.hasOwnProperty.call(message, "batchUuid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.batchUuid); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.doneTime != null && Object.hasOwnProperty.call(message, "doneTime")) + $root.google.protobuf.Timestamp.encode(message.doneTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.operationType != null && Object.hasOwnProperty.call(message, "operationType")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.operationType); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.description); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.warnings != null && message.warnings.length) + for (var i = 0; i < message.warnings.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.warnings[i]); + return writer; + }; + + /** + * Encodes the specified BatchOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.BatchOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.BatchOperationMetadata + * @static + * @param {google.cloud.dataproc.v1.IBatchOperationMetadata} message BatchOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.BatchOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.BatchOperationMetadata} BatchOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchOperationMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.BatchOperationMetadata(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.batch = reader.string(); + break; + } + case 2: { + message.batchUuid = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.doneTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.operationType = reader.int32(); + break; + } + case 7: { + message.description = reader.string(); + break; + } + case 8: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 9: { + if (!(message.warnings && message.warnings.length)) + message.warnings = []; + message.warnings.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.BatchOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.BatchOperationMetadata} BatchOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchOperationMetadata message. + * @function verify + * @memberof google.cloud.dataproc.v1.BatchOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.batch != null && message.hasOwnProperty("batch")) + if (!$util.isString(message.batch)) + return "batch: string expected"; + if (message.batchUuid != null && message.hasOwnProperty("batchUuid")) + if (!$util.isString(message.batchUuid)) + return "batchUuid: 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.doneTime != null && message.hasOwnProperty("doneTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.doneTime); + if (error) + return "doneTime." + error; + } + if (message.operationType != null && message.hasOwnProperty("operationType")) + switch (message.operationType) { + default: + return "operationType: enum value expected"; + case 0: + case 1: + break; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: 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.warnings != null && message.hasOwnProperty("warnings")) { + if (!Array.isArray(message.warnings)) + return "warnings: array expected"; + for (var i = 0; i < message.warnings.length; ++i) + if (!$util.isString(message.warnings[i])) + return "warnings: string[] expected"; + } + return null; + }; + + /** + * Creates a BatchOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.BatchOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.BatchOperationMetadata} BatchOperationMetadata + */ + BatchOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.BatchOperationMetadata) + return object; + var message = new $root.google.cloud.dataproc.v1.BatchOperationMetadata(); + if (object.batch != null) + message.batch = String(object.batch); + if (object.batchUuid != null) + message.batchUuid = String(object.batchUuid); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.dataproc.v1.BatchOperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.doneTime != null) { + if (typeof object.doneTime !== "object") + throw TypeError(".google.cloud.dataproc.v1.BatchOperationMetadata.doneTime: object expected"); + message.doneTime = $root.google.protobuf.Timestamp.fromObject(object.doneTime); + } + switch (object.operationType) { + default: + if (typeof object.operationType === "number") { + message.operationType = object.operationType; + break; + } + break; + case "BATCH_OPERATION_TYPE_UNSPECIFIED": + case 0: + message.operationType = 0; + break; + case "BATCH": + case 1: + message.operationType = 1; + break; + } + if (object.description != null) + message.description = String(object.description); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.dataproc.v1.BatchOperationMetadata.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.warnings) { + if (!Array.isArray(object.warnings)) + throw TypeError(".google.cloud.dataproc.v1.BatchOperationMetadata.warnings: array expected"); + message.warnings = []; + for (var i = 0; i < object.warnings.length; ++i) + message.warnings[i] = String(object.warnings[i]); + } + return message; + }; + + /** + * Creates a plain object from a BatchOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.BatchOperationMetadata + * @static + * @param {google.cloud.dataproc.v1.BatchOperationMetadata} message BatchOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.warnings = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.batch = ""; + object.batchUuid = ""; + object.createTime = null; + object.doneTime = null; + object.operationType = options.enums === String ? "BATCH_OPERATION_TYPE_UNSPECIFIED" : 0; + object.description = ""; + } + if (message.batch != null && message.hasOwnProperty("batch")) + object.batch = message.batch; + if (message.batchUuid != null && message.hasOwnProperty("batchUuid")) + object.batchUuid = message.batchUuid; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.doneTime != null && message.hasOwnProperty("doneTime")) + object.doneTime = $root.google.protobuf.Timestamp.toObject(message.doneTime, options); + if (message.operationType != null && message.hasOwnProperty("operationType")) + object.operationType = options.enums === String ? $root.google.cloud.dataproc.v1.BatchOperationMetadata.BatchOperationType[message.operationType] === undefined ? message.operationType : $root.google.cloud.dataproc.v1.BatchOperationMetadata.BatchOperationType[message.operationType] : message.operationType; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + 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.warnings && message.warnings.length) { + object.warnings = []; + for (var j = 0; j < message.warnings.length; ++j) + object.warnings[j] = message.warnings[j]; + } + return object; + }; + + /** + * Converts this BatchOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.BatchOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + BatchOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.BatchOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.BatchOperationMetadata"; + }; + + /** + * BatchOperationType enum. + * @name google.cloud.dataproc.v1.BatchOperationMetadata.BatchOperationType + * @enum {number} + * @property {number} BATCH_OPERATION_TYPE_UNSPECIFIED=0 BATCH_OPERATION_TYPE_UNSPECIFIED value + * @property {number} BATCH=1 BATCH value + */ + BatchOperationMetadata.BatchOperationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BATCH_OPERATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "BATCH"] = 1; + return values; + })(); + + return BatchOperationMetadata; + })(); + + v1.SessionOperationMetadata = (function() { + + /** + * Properties of a SessionOperationMetadata. + * @memberof google.cloud.dataproc.v1 + * @interface ISessionOperationMetadata + * @property {string|null} [session] SessionOperationMetadata session + * @property {string|null} [sessionUuid] SessionOperationMetadata sessionUuid + * @property {google.protobuf.ITimestamp|null} [createTime] SessionOperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [doneTime] SessionOperationMetadata doneTime + * @property {google.cloud.dataproc.v1.SessionOperationMetadata.SessionOperationType|null} [operationType] SessionOperationMetadata operationType + * @property {string|null} [description] SessionOperationMetadata description + * @property {Object.|null} [labels] SessionOperationMetadata labels + * @property {Array.|null} [warnings] SessionOperationMetadata warnings + */ + + /** + * Constructs a new SessionOperationMetadata. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a SessionOperationMetadata. + * @implements ISessionOperationMetadata + * @constructor + * @param {google.cloud.dataproc.v1.ISessionOperationMetadata=} [properties] Properties to set + */ + function SessionOperationMetadata(properties) { + this.labels = {}; + this.warnings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SessionOperationMetadata session. + * @member {string} session + * @memberof google.cloud.dataproc.v1.SessionOperationMetadata + * @instance + */ + SessionOperationMetadata.prototype.session = ""; + + /** + * SessionOperationMetadata sessionUuid. + * @member {string} sessionUuid + * @memberof google.cloud.dataproc.v1.SessionOperationMetadata + * @instance + */ + SessionOperationMetadata.prototype.sessionUuid = ""; + + /** + * SessionOperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.dataproc.v1.SessionOperationMetadata + * @instance + */ + SessionOperationMetadata.prototype.createTime = null; + + /** + * SessionOperationMetadata doneTime. + * @member {google.protobuf.ITimestamp|null|undefined} doneTime + * @memberof google.cloud.dataproc.v1.SessionOperationMetadata + * @instance + */ + SessionOperationMetadata.prototype.doneTime = null; + + /** + * SessionOperationMetadata operationType. + * @member {google.cloud.dataproc.v1.SessionOperationMetadata.SessionOperationType} operationType + * @memberof google.cloud.dataproc.v1.SessionOperationMetadata + * @instance + */ + SessionOperationMetadata.prototype.operationType = 0; + + /** + * SessionOperationMetadata description. + * @member {string} description + * @memberof google.cloud.dataproc.v1.SessionOperationMetadata + * @instance + */ + SessionOperationMetadata.prototype.description = ""; + + /** + * SessionOperationMetadata labels. + * @member {Object.} labels + * @memberof google.cloud.dataproc.v1.SessionOperationMetadata + * @instance + */ + SessionOperationMetadata.prototype.labels = $util.emptyObject; + + /** + * SessionOperationMetadata warnings. + * @member {Array.} warnings + * @memberof google.cloud.dataproc.v1.SessionOperationMetadata + * @instance + */ + SessionOperationMetadata.prototype.warnings = $util.emptyArray; + + /** + * Creates a new SessionOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.SessionOperationMetadata + * @static + * @param {google.cloud.dataproc.v1.ISessionOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.SessionOperationMetadata} SessionOperationMetadata instance + */ + SessionOperationMetadata.create = function create(properties) { + return new SessionOperationMetadata(properties); + }; + + /** + * Encodes the specified SessionOperationMetadata message. Does not implicitly {@link google.cloud.dataproc.v1.SessionOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.SessionOperationMetadata + * @static + * @param {google.cloud.dataproc.v1.ISessionOperationMetadata} message SessionOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.sessionUuid != null && Object.hasOwnProperty.call(message, "sessionUuid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sessionUuid); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.doneTime != null && Object.hasOwnProperty.call(message, "doneTime")) + $root.google.protobuf.Timestamp.encode(message.doneTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.operationType != null && Object.hasOwnProperty.call(message, "operationType")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.operationType); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.description); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.warnings != null && message.warnings.length) + for (var i = 0; i < message.warnings.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.warnings[i]); + return writer; + }; + + /** + * Encodes the specified SessionOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SessionOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.SessionOperationMetadata + * @static + * @param {google.cloud.dataproc.v1.ISessionOperationMetadata} message SessionOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SessionOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.SessionOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.SessionOperationMetadata} SessionOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionOperationMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.SessionOperationMetadata(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.session = reader.string(); + break; + } + case 2: { + message.sessionUuid = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.doneTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.operationType = reader.int32(); + break; + } + case 7: { + message.description = reader.string(); + break; + } + case 8: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 9: { + if (!(message.warnings && message.warnings.length)) + message.warnings = []; + message.warnings.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SessionOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.SessionOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.SessionOperationMetadata} SessionOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SessionOperationMetadata message. + * @function verify + * @memberof google.cloud.dataproc.v1.SessionOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SessionOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.sessionUuid != null && message.hasOwnProperty("sessionUuid")) + if (!$util.isString(message.sessionUuid)) + return "sessionUuid: 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.doneTime != null && message.hasOwnProperty("doneTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.doneTime); + if (error) + return "doneTime." + error; + } + if (message.operationType != null && message.hasOwnProperty("operationType")) + switch (message.operationType) { + default: + return "operationType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: 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.warnings != null && message.hasOwnProperty("warnings")) { + if (!Array.isArray(message.warnings)) + return "warnings: array expected"; + for (var i = 0; i < message.warnings.length; ++i) + if (!$util.isString(message.warnings[i])) + return "warnings: string[] expected"; + } + return null; + }; + + /** + * Creates a SessionOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.SessionOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.SessionOperationMetadata} SessionOperationMetadata + */ + SessionOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.SessionOperationMetadata) + return object; + var message = new $root.google.cloud.dataproc.v1.SessionOperationMetadata(); + if (object.session != null) + message.session = String(object.session); + if (object.sessionUuid != null) + message.sessionUuid = String(object.sessionUuid); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.dataproc.v1.SessionOperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.doneTime != null) { + if (typeof object.doneTime !== "object") + throw TypeError(".google.cloud.dataproc.v1.SessionOperationMetadata.doneTime: object expected"); + message.doneTime = $root.google.protobuf.Timestamp.fromObject(object.doneTime); + } + switch (object.operationType) { + default: + if (typeof object.operationType === "number") { + message.operationType = object.operationType; + break; + } + break; + case "SESSION_OPERATION_TYPE_UNSPECIFIED": + case 0: + message.operationType = 0; + break; + case "CREATE": + case 1: + message.operationType = 1; + break; + case "TERMINATE": + case 2: + message.operationType = 2; + break; + case "DELETE": + case 3: + message.operationType = 3; + break; + } + if (object.description != null) + message.description = String(object.description); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.dataproc.v1.SessionOperationMetadata.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.warnings) { + if (!Array.isArray(object.warnings)) + throw TypeError(".google.cloud.dataproc.v1.SessionOperationMetadata.warnings: array expected"); + message.warnings = []; + for (var i = 0; i < object.warnings.length; ++i) + message.warnings[i] = String(object.warnings[i]); + } + return message; + }; + + /** + * Creates a plain object from a SessionOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.SessionOperationMetadata + * @static + * @param {google.cloud.dataproc.v1.SessionOperationMetadata} message SessionOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SessionOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.warnings = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.session = ""; + object.sessionUuid = ""; + object.createTime = null; + object.doneTime = null; + object.operationType = options.enums === String ? "SESSION_OPERATION_TYPE_UNSPECIFIED" : 0; + object.description = ""; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.sessionUuid != null && message.hasOwnProperty("sessionUuid")) + object.sessionUuid = message.sessionUuid; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.doneTime != null && message.hasOwnProperty("doneTime")) + object.doneTime = $root.google.protobuf.Timestamp.toObject(message.doneTime, options); + if (message.operationType != null && message.hasOwnProperty("operationType")) + object.operationType = options.enums === String ? $root.google.cloud.dataproc.v1.SessionOperationMetadata.SessionOperationType[message.operationType] === undefined ? message.operationType : $root.google.cloud.dataproc.v1.SessionOperationMetadata.SessionOperationType[message.operationType] : message.operationType; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + 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.warnings && message.warnings.length) { + object.warnings = []; + for (var j = 0; j < message.warnings.length; ++j) + object.warnings[j] = message.warnings[j]; + } + return object; + }; + + /** + * Converts this SessionOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.SessionOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + SessionOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SessionOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.SessionOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SessionOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.SessionOperationMetadata"; + }; + + /** + * SessionOperationType enum. + * @name google.cloud.dataproc.v1.SessionOperationMetadata.SessionOperationType + * @enum {number} + * @property {number} SESSION_OPERATION_TYPE_UNSPECIFIED=0 SESSION_OPERATION_TYPE_UNSPECIFIED value + * @property {number} CREATE=1 CREATE value + * @property {number} TERMINATE=2 TERMINATE value + * @property {number} DELETE=3 DELETE value + */ + SessionOperationMetadata.SessionOperationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SESSION_OPERATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATE"] = 1; + values[valuesById[2] = "TERMINATE"] = 2; + values[valuesById[3] = "DELETE"] = 3; + return values; + })(); + + return SessionOperationMetadata; + })(); + + v1.ClusterOperationStatus = (function() { + + /** + * Properties of a ClusterOperationStatus. + * @memberof google.cloud.dataproc.v1 + * @interface IClusterOperationStatus + * @property {google.cloud.dataproc.v1.ClusterOperationStatus.State|null} [state] ClusterOperationStatus state + * @property {string|null} [innerState] ClusterOperationStatus innerState + * @property {string|null} [details] ClusterOperationStatus details + * @property {google.protobuf.ITimestamp|null} [stateStartTime] ClusterOperationStatus stateStartTime + */ + + /** + * Constructs a new ClusterOperationStatus. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a ClusterOperationStatus. + * @implements IClusterOperationStatus + * @constructor + * @param {google.cloud.dataproc.v1.IClusterOperationStatus=} [properties] Properties to set + */ + function ClusterOperationStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClusterOperationStatus state. + * @member {google.cloud.dataproc.v1.ClusterOperationStatus.State} state + * @memberof google.cloud.dataproc.v1.ClusterOperationStatus + * @instance + */ + ClusterOperationStatus.prototype.state = 0; + + /** + * ClusterOperationStatus innerState. + * @member {string} innerState + * @memberof google.cloud.dataproc.v1.ClusterOperationStatus + * @instance + */ + ClusterOperationStatus.prototype.innerState = ""; + + /** + * ClusterOperationStatus details. + * @member {string} details + * @memberof google.cloud.dataproc.v1.ClusterOperationStatus + * @instance + */ + ClusterOperationStatus.prototype.details = ""; + + /** + * ClusterOperationStatus stateStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} stateStartTime + * @memberof google.cloud.dataproc.v1.ClusterOperationStatus + * @instance + */ + ClusterOperationStatus.prototype.stateStartTime = null; + + /** + * Creates a new ClusterOperationStatus instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.ClusterOperationStatus + * @static + * @param {google.cloud.dataproc.v1.IClusterOperationStatus=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.ClusterOperationStatus} ClusterOperationStatus instance + */ + ClusterOperationStatus.create = function create(properties) { + return new ClusterOperationStatus(properties); + }; + + /** + * Encodes the specified ClusterOperationStatus message. Does not implicitly {@link google.cloud.dataproc.v1.ClusterOperationStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.ClusterOperationStatus + * @static + * @param {google.cloud.dataproc.v1.IClusterOperationStatus} message ClusterOperationStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterOperationStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.innerState != null && Object.hasOwnProperty.call(message, "innerState")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.innerState); + if (message.details != null && Object.hasOwnProperty.call(message, "details")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.details); + if (message.stateStartTime != null && Object.hasOwnProperty.call(message, "stateStartTime")) + $root.google.protobuf.Timestamp.encode(message.stateStartTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClusterOperationStatus message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ClusterOperationStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.ClusterOperationStatus + * @static + * @param {google.cloud.dataproc.v1.IClusterOperationStatus} message ClusterOperationStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterOperationStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClusterOperationStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.ClusterOperationStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.ClusterOperationStatus} ClusterOperationStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterOperationStatus.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ClusterOperationStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.innerState = reader.string(); + break; + } + case 3: { + message.details = reader.string(); + break; + } + case 4: { + message.stateStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClusterOperationStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.ClusterOperationStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.ClusterOperationStatus} ClusterOperationStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterOperationStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClusterOperationStatus message. + * @function verify + * @memberof google.cloud.dataproc.v1.ClusterOperationStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClusterOperationStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.innerState != null && message.hasOwnProperty("innerState")) + if (!$util.isString(message.innerState)) + return "innerState: string expected"; + if (message.details != null && message.hasOwnProperty("details")) + if (!$util.isString(message.details)) + return "details: string expected"; + if (message.stateStartTime != null && message.hasOwnProperty("stateStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.stateStartTime); + if (error) + return "stateStartTime." + error; + } + return null; + }; + + /** + * Creates a ClusterOperationStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.ClusterOperationStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.ClusterOperationStatus} ClusterOperationStatus + */ + ClusterOperationStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.ClusterOperationStatus) + return object; + var message = new $root.google.cloud.dataproc.v1.ClusterOperationStatus(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "UNKNOWN": + case 0: + message.state = 0; + break; + case "PENDING": + case 1: + message.state = 1; + break; + case "RUNNING": + case 2: + message.state = 2; + break; + case "DONE": + case 3: + message.state = 3; + break; + } + if (object.innerState != null) + message.innerState = String(object.innerState); + if (object.details != null) + message.details = String(object.details); + if (object.stateStartTime != null) { + if (typeof object.stateStartTime !== "object") + throw TypeError(".google.cloud.dataproc.v1.ClusterOperationStatus.stateStartTime: object expected"); + message.stateStartTime = $root.google.protobuf.Timestamp.fromObject(object.stateStartTime); + } + return message; + }; + + /** + * Creates a plain object from a ClusterOperationStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.ClusterOperationStatus + * @static + * @param {google.cloud.dataproc.v1.ClusterOperationStatus} message ClusterOperationStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClusterOperationStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "UNKNOWN" : 0; + object.innerState = ""; + object.details = ""; + object.stateStartTime = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.dataproc.v1.ClusterOperationStatus.State[message.state] === undefined ? message.state : $root.google.cloud.dataproc.v1.ClusterOperationStatus.State[message.state] : message.state; + if (message.innerState != null && message.hasOwnProperty("innerState")) + object.innerState = message.innerState; + if (message.details != null && message.hasOwnProperty("details")) + object.details = message.details; + if (message.stateStartTime != null && message.hasOwnProperty("stateStartTime")) + object.stateStartTime = $root.google.protobuf.Timestamp.toObject(message.stateStartTime, options); + return object; + }; + + /** + * Converts this ClusterOperationStatus to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.ClusterOperationStatus + * @instance + * @returns {Object.} JSON object + */ + ClusterOperationStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClusterOperationStatus + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.ClusterOperationStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClusterOperationStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.ClusterOperationStatus"; + }; + + /** + * State enum. + * @name google.cloud.dataproc.v1.ClusterOperationStatus.State + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} PENDING=1 PENDING value + * @property {number} RUNNING=2 RUNNING value + * @property {number} DONE=3 DONE value + */ + ClusterOperationStatus.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "RUNNING"] = 2; + values[valuesById[3] = "DONE"] = 3; + return values; + })(); + + return ClusterOperationStatus; + })(); + + v1.ClusterOperationMetadata = (function() { + + /** + * Properties of a ClusterOperationMetadata. + * @memberof google.cloud.dataproc.v1 + * @interface IClusterOperationMetadata + * @property {string|null} [clusterName] ClusterOperationMetadata clusterName + * @property {string|null} [clusterUuid] ClusterOperationMetadata clusterUuid + * @property {google.cloud.dataproc.v1.IClusterOperationStatus|null} [status] ClusterOperationMetadata status + * @property {Array.|null} [statusHistory] ClusterOperationMetadata statusHistory + * @property {string|null} [operationType] ClusterOperationMetadata operationType + * @property {string|null} [description] ClusterOperationMetadata description + * @property {Object.|null} [labels] ClusterOperationMetadata labels + * @property {Array.|null} [warnings] ClusterOperationMetadata warnings + * @property {Array.|null} [childOperationIds] ClusterOperationMetadata childOperationIds + */ + + /** + * Constructs a new ClusterOperationMetadata. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a ClusterOperationMetadata. + * @implements IClusterOperationMetadata + * @constructor + * @param {google.cloud.dataproc.v1.IClusterOperationMetadata=} [properties] Properties to set + */ + function ClusterOperationMetadata(properties) { + this.statusHistory = []; + this.labels = {}; + this.warnings = []; + this.childOperationIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClusterOperationMetadata clusterName. + * @member {string} clusterName + * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata + * @instance + */ + ClusterOperationMetadata.prototype.clusterName = ""; + + /** + * ClusterOperationMetadata clusterUuid. + * @member {string} clusterUuid + * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata + * @instance + */ + ClusterOperationMetadata.prototype.clusterUuid = ""; + + /** + * ClusterOperationMetadata status. + * @member {google.cloud.dataproc.v1.IClusterOperationStatus|null|undefined} status + * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata + * @instance + */ + ClusterOperationMetadata.prototype.status = null; + + /** + * ClusterOperationMetadata statusHistory. + * @member {Array.} statusHistory + * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata + * @instance + */ + ClusterOperationMetadata.prototype.statusHistory = $util.emptyArray; + + /** + * ClusterOperationMetadata operationType. + * @member {string} operationType + * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata + * @instance + */ + ClusterOperationMetadata.prototype.operationType = ""; + + /** + * ClusterOperationMetadata description. + * @member {string} description + * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata + * @instance + */ + ClusterOperationMetadata.prototype.description = ""; + + /** + * ClusterOperationMetadata labels. + * @member {Object.} labels + * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata + * @instance + */ + ClusterOperationMetadata.prototype.labels = $util.emptyObject; + + /** + * ClusterOperationMetadata warnings. + * @member {Array.} warnings + * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata + * @instance + */ + ClusterOperationMetadata.prototype.warnings = $util.emptyArray; + + /** + * ClusterOperationMetadata childOperationIds. + * @member {Array.} childOperationIds + * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata + * @instance + */ + ClusterOperationMetadata.prototype.childOperationIds = $util.emptyArray; + + /** + * Creates a new ClusterOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata + * @static + * @param {google.cloud.dataproc.v1.IClusterOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.ClusterOperationMetadata} ClusterOperationMetadata instance + */ + ClusterOperationMetadata.create = function create(properties) { + return new ClusterOperationMetadata(properties); + }; + + /** + * Encodes the specified ClusterOperationMetadata message. Does not implicitly {@link google.cloud.dataproc.v1.ClusterOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata + * @static + * @param {google.cloud.dataproc.v1.IClusterOperationMetadata} message ClusterOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.clusterName); + if (message.clusterUuid != null && Object.hasOwnProperty.call(message, "clusterUuid")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.clusterUuid); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.cloud.dataproc.v1.ClusterOperationStatus.encode(message.status, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.statusHistory != null && message.statusHistory.length) + for (var i = 0; i < message.statusHistory.length; ++i) + $root.google.cloud.dataproc.v1.ClusterOperationStatus.encode(message.statusHistory[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.operationType != null && Object.hasOwnProperty.call(message, "operationType")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.operationType); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.description); + 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 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.warnings != null && message.warnings.length) + for (var i = 0; i < message.warnings.length; ++i) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.warnings[i]); + if (message.childOperationIds != null && message.childOperationIds.length) + for (var i = 0; i < message.childOperationIds.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.childOperationIds[i]); + return writer; + }; + + /** + * Encodes the specified ClusterOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ClusterOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata + * @static + * @param {google.cloud.dataproc.v1.IClusterOperationMetadata} message ClusterOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClusterOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.ClusterOperationMetadata} ClusterOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterOperationMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ClusterOperationMetadata(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 7: { + message.clusterName = reader.string(); + break; + } + case 8: { + message.clusterUuid = reader.string(); + break; + } + case 9: { + message.status = $root.google.cloud.dataproc.v1.ClusterOperationStatus.decode(reader, reader.uint32()); + break; + } + case 10: { + if (!(message.statusHistory && message.statusHistory.length)) + message.statusHistory = []; + message.statusHistory.push($root.google.cloud.dataproc.v1.ClusterOperationStatus.decode(reader, reader.uint32())); + break; + } + case 11: { + message.operationType = reader.string(); + break; + } + case 12: { + message.description = reader.string(); + break; + } + case 13: { + 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 14: { + if (!(message.warnings && message.warnings.length)) + message.warnings = []; + message.warnings.push(reader.string()); + break; + } + case 15: { + if (!(message.childOperationIds && message.childOperationIds.length)) + message.childOperationIds = []; + message.childOperationIds.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClusterOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.ClusterOperationMetadata} ClusterOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClusterOperationMetadata message. + * @function verify + * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClusterOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + if (!$util.isString(message.clusterName)) + return "clusterName: string expected"; + if (message.clusterUuid != null && message.hasOwnProperty("clusterUuid")) + if (!$util.isString(message.clusterUuid)) + return "clusterUuid: string expected"; + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.cloud.dataproc.v1.ClusterOperationStatus.verify(message.status); + if (error) + return "status." + error; + } + if (message.statusHistory != null && message.hasOwnProperty("statusHistory")) { + if (!Array.isArray(message.statusHistory)) + return "statusHistory: array expected"; + for (var i = 0; i < message.statusHistory.length; ++i) { + var error = $root.google.cloud.dataproc.v1.ClusterOperationStatus.verify(message.statusHistory[i]); + if (error) + return "statusHistory." + error; + } + } + if (message.operationType != null && message.hasOwnProperty("operationType")) + if (!$util.isString(message.operationType)) + return "operationType: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: 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.warnings != null && message.hasOwnProperty("warnings")) { + if (!Array.isArray(message.warnings)) + return "warnings: array expected"; + for (var i = 0; i < message.warnings.length; ++i) + if (!$util.isString(message.warnings[i])) + return "warnings: string[] expected"; + } + if (message.childOperationIds != null && message.hasOwnProperty("childOperationIds")) { + if (!Array.isArray(message.childOperationIds)) + return "childOperationIds: array expected"; + for (var i = 0; i < message.childOperationIds.length; ++i) + if (!$util.isString(message.childOperationIds[i])) + return "childOperationIds: string[] expected"; + } + return null; + }; + + /** + * Creates a ClusterOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.ClusterOperationMetadata} ClusterOperationMetadata + */ + ClusterOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.ClusterOperationMetadata) + return object; + var message = new $root.google.cloud.dataproc.v1.ClusterOperationMetadata(); + if (object.clusterName != null) + message.clusterName = String(object.clusterName); + if (object.clusterUuid != null) + message.clusterUuid = String(object.clusterUuid); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.dataproc.v1.ClusterOperationMetadata.status: object expected"); + message.status = $root.google.cloud.dataproc.v1.ClusterOperationStatus.fromObject(object.status); + } + if (object.statusHistory) { + if (!Array.isArray(object.statusHistory)) + throw TypeError(".google.cloud.dataproc.v1.ClusterOperationMetadata.statusHistory: array expected"); + message.statusHistory = []; + for (var i = 0; i < object.statusHistory.length; ++i) { + if (typeof object.statusHistory[i] !== "object") + throw TypeError(".google.cloud.dataproc.v1.ClusterOperationMetadata.statusHistory: object expected"); + message.statusHistory[i] = $root.google.cloud.dataproc.v1.ClusterOperationStatus.fromObject(object.statusHistory[i]); + } + } + if (object.operationType != null) + message.operationType = String(object.operationType); + if (object.description != null) + message.description = String(object.description); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.dataproc.v1.ClusterOperationMetadata.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.warnings) { + if (!Array.isArray(object.warnings)) + throw TypeError(".google.cloud.dataproc.v1.ClusterOperationMetadata.warnings: array expected"); + message.warnings = []; + for (var i = 0; i < object.warnings.length; ++i) + message.warnings[i] = String(object.warnings[i]); + } + if (object.childOperationIds) { + if (!Array.isArray(object.childOperationIds)) + throw TypeError(".google.cloud.dataproc.v1.ClusterOperationMetadata.childOperationIds: array expected"); + message.childOperationIds = []; + for (var i = 0; i < object.childOperationIds.length; ++i) + message.childOperationIds[i] = String(object.childOperationIds[i]); + } + return message; + }; + + /** + * Creates a plain object from a ClusterOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata + * @static + * @param {google.cloud.dataproc.v1.ClusterOperationMetadata} message ClusterOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClusterOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.statusHistory = []; + object.warnings = []; + object.childOperationIds = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.clusterName = ""; + object.clusterUuid = ""; + object.status = null; + object.operationType = ""; + object.description = ""; + } + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + object.clusterName = message.clusterName; + if (message.clusterUuid != null && message.hasOwnProperty("clusterUuid")) + object.clusterUuid = message.clusterUuid; + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.cloud.dataproc.v1.ClusterOperationStatus.toObject(message.status, options); + if (message.statusHistory && message.statusHistory.length) { + object.statusHistory = []; + for (var j = 0; j < message.statusHistory.length; ++j) + object.statusHistory[j] = $root.google.cloud.dataproc.v1.ClusterOperationStatus.toObject(message.statusHistory[j], options); + } + if (message.operationType != null && message.hasOwnProperty("operationType")) + object.operationType = message.operationType; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + 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.warnings && message.warnings.length) { + object.warnings = []; + for (var j = 0; j < message.warnings.length; ++j) + object.warnings[j] = message.warnings[j]; + } + if (message.childOperationIds && message.childOperationIds.length) { + object.childOperationIds = []; + for (var j = 0; j < message.childOperationIds.length; ++j) + object.childOperationIds[j] = message.childOperationIds[j]; + } + return object; + }; + + /** + * Converts this ClusterOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + ClusterOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClusterOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClusterOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.ClusterOperationMetadata"; + }; + + return ClusterOperationMetadata; + })(); + + v1.NodeGroupOperationMetadata = (function() { + + /** + * Properties of a NodeGroupOperationMetadata. + * @memberof google.cloud.dataproc.v1 + * @interface INodeGroupOperationMetadata + * @property {string|null} [nodeGroupId] NodeGroupOperationMetadata nodeGroupId + * @property {string|null} [clusterUuid] NodeGroupOperationMetadata clusterUuid + * @property {google.cloud.dataproc.v1.IClusterOperationStatus|null} [status] NodeGroupOperationMetadata status + * @property {Array.|null} [statusHistory] NodeGroupOperationMetadata statusHistory + * @property {google.cloud.dataproc.v1.NodeGroupOperationMetadata.NodeGroupOperationType|null} [operationType] NodeGroupOperationMetadata operationType + * @property {string|null} [description] NodeGroupOperationMetadata description + * @property {Object.|null} [labels] NodeGroupOperationMetadata labels + * @property {Array.|null} [warnings] NodeGroupOperationMetadata warnings + */ + + /** + * Constructs a new NodeGroupOperationMetadata. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a NodeGroupOperationMetadata. + * @implements INodeGroupOperationMetadata + * @constructor + * @param {google.cloud.dataproc.v1.INodeGroupOperationMetadata=} [properties] Properties to set + */ + function NodeGroupOperationMetadata(properties) { + this.statusHistory = []; + this.labels = {}; + this.warnings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeGroupOperationMetadata nodeGroupId. + * @member {string} nodeGroupId + * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata + * @instance + */ + NodeGroupOperationMetadata.prototype.nodeGroupId = ""; + + /** + * NodeGroupOperationMetadata clusterUuid. + * @member {string} clusterUuid + * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata + * @instance + */ + NodeGroupOperationMetadata.prototype.clusterUuid = ""; + + /** + * NodeGroupOperationMetadata status. + * @member {google.cloud.dataproc.v1.IClusterOperationStatus|null|undefined} status + * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata + * @instance + */ + NodeGroupOperationMetadata.prototype.status = null; + + /** + * NodeGroupOperationMetadata statusHistory. + * @member {Array.} statusHistory + * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata + * @instance + */ + NodeGroupOperationMetadata.prototype.statusHistory = $util.emptyArray; + + /** + * NodeGroupOperationMetadata operationType. + * @member {google.cloud.dataproc.v1.NodeGroupOperationMetadata.NodeGroupOperationType} operationType + * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata + * @instance + */ + NodeGroupOperationMetadata.prototype.operationType = 0; + + /** + * NodeGroupOperationMetadata description. + * @member {string} description + * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata + * @instance + */ + NodeGroupOperationMetadata.prototype.description = ""; + + /** + * NodeGroupOperationMetadata labels. + * @member {Object.} labels + * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata + * @instance + */ + NodeGroupOperationMetadata.prototype.labels = $util.emptyObject; + + /** + * NodeGroupOperationMetadata warnings. + * @member {Array.} warnings + * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata + * @instance + */ + NodeGroupOperationMetadata.prototype.warnings = $util.emptyArray; + + /** + * Creates a new NodeGroupOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata + * @static + * @param {google.cloud.dataproc.v1.INodeGroupOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.NodeGroupOperationMetadata} NodeGroupOperationMetadata instance + */ + NodeGroupOperationMetadata.create = function create(properties) { + return new NodeGroupOperationMetadata(properties); + }; + + /** + * Encodes the specified NodeGroupOperationMetadata message. Does not implicitly {@link google.cloud.dataproc.v1.NodeGroupOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata + * @static + * @param {google.cloud.dataproc.v1.INodeGroupOperationMetadata} message NodeGroupOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeGroupOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodeGroupId != null && Object.hasOwnProperty.call(message, "nodeGroupId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.nodeGroupId); + if (message.clusterUuid != null && Object.hasOwnProperty.call(message, "clusterUuid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterUuid); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.cloud.dataproc.v1.ClusterOperationStatus.encode(message.status, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.statusHistory != null && message.statusHistory.length) + for (var i = 0; i < message.statusHistory.length; ++i) + $root.google.cloud.dataproc.v1.ClusterOperationStatus.encode(message.statusHistory[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.operationType != null && Object.hasOwnProperty.call(message, "operationType")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.operationType); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.warnings != null && message.warnings.length) + for (var i = 0; i < message.warnings.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.warnings[i]); + return writer; + }; + + /** + * Encodes the specified NodeGroupOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.NodeGroupOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata + * @static + * @param {google.cloud.dataproc.v1.INodeGroupOperationMetadata} message NodeGroupOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeGroupOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeGroupOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.NodeGroupOperationMetadata} NodeGroupOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeGroupOperationMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.NodeGroupOperationMetadata(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.nodeGroupId = reader.string(); + break; + } + case 2: { + message.clusterUuid = reader.string(); + break; + } + case 3: { + message.status = $root.google.cloud.dataproc.v1.ClusterOperationStatus.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.statusHistory && message.statusHistory.length)) + message.statusHistory = []; + message.statusHistory.push($root.google.cloud.dataproc.v1.ClusterOperationStatus.decode(reader, reader.uint32())); + break; + } + case 5: { + message.operationType = reader.int32(); + break; + } + case 6: { + message.description = reader.string(); + break; + } + case 7: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 8: { + if (!(message.warnings && message.warnings.length)) + message.warnings = []; + message.warnings.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeGroupOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.NodeGroupOperationMetadata} NodeGroupOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeGroupOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeGroupOperationMetadata message. + * @function verify + * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeGroupOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeGroupId != null && message.hasOwnProperty("nodeGroupId")) + if (!$util.isString(message.nodeGroupId)) + return "nodeGroupId: string expected"; + if (message.clusterUuid != null && message.hasOwnProperty("clusterUuid")) + if (!$util.isString(message.clusterUuid)) + return "clusterUuid: string expected"; + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.cloud.dataproc.v1.ClusterOperationStatus.verify(message.status); + if (error) + return "status." + error; + } + if (message.statusHistory != null && message.hasOwnProperty("statusHistory")) { + if (!Array.isArray(message.statusHistory)) + return "statusHistory: array expected"; + for (var i = 0; i < message.statusHistory.length; ++i) { + var error = $root.google.cloud.dataproc.v1.ClusterOperationStatus.verify(message.statusHistory[i]); + if (error) + return "statusHistory." + error; + } + } + if (message.operationType != null && message.hasOwnProperty("operationType")) + switch (message.operationType) { + default: + return "operationType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: 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.warnings != null && message.hasOwnProperty("warnings")) { + if (!Array.isArray(message.warnings)) + return "warnings: array expected"; + for (var i = 0; i < message.warnings.length; ++i) + if (!$util.isString(message.warnings[i])) + return "warnings: string[] expected"; + } + return null; + }; + + /** + * Creates a NodeGroupOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.NodeGroupOperationMetadata} NodeGroupOperationMetadata + */ + NodeGroupOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.NodeGroupOperationMetadata) + return object; + var message = new $root.google.cloud.dataproc.v1.NodeGroupOperationMetadata(); + if (object.nodeGroupId != null) + message.nodeGroupId = String(object.nodeGroupId); + if (object.clusterUuid != null) + message.clusterUuid = String(object.clusterUuid); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.dataproc.v1.NodeGroupOperationMetadata.status: object expected"); + message.status = $root.google.cloud.dataproc.v1.ClusterOperationStatus.fromObject(object.status); + } + if (object.statusHistory) { + if (!Array.isArray(object.statusHistory)) + throw TypeError(".google.cloud.dataproc.v1.NodeGroupOperationMetadata.statusHistory: array expected"); + message.statusHistory = []; + for (var i = 0; i < object.statusHistory.length; ++i) { + if (typeof object.statusHistory[i] !== "object") + throw TypeError(".google.cloud.dataproc.v1.NodeGroupOperationMetadata.statusHistory: object expected"); + message.statusHistory[i] = $root.google.cloud.dataproc.v1.ClusterOperationStatus.fromObject(object.statusHistory[i]); + } + } + switch (object.operationType) { + default: + if (typeof object.operationType === "number") { + message.operationType = object.operationType; + break; + } + break; + case "NODE_GROUP_OPERATION_TYPE_UNSPECIFIED": + case 0: + message.operationType = 0; + break; + case "CREATE": + case 1: + message.operationType = 1; + break; + case "UPDATE": + case 2: + message.operationType = 2; + break; + case "DELETE": + case 3: + message.operationType = 3; + break; + case "RESIZE": + case 4: + message.operationType = 4; + break; + } + if (object.description != null) + message.description = String(object.description); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.dataproc.v1.NodeGroupOperationMetadata.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.warnings) { + if (!Array.isArray(object.warnings)) + throw TypeError(".google.cloud.dataproc.v1.NodeGroupOperationMetadata.warnings: array expected"); + message.warnings = []; + for (var i = 0; i < object.warnings.length; ++i) + message.warnings[i] = String(object.warnings[i]); + } + return message; + }; + + /** + * Creates a plain object from a NodeGroupOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata + * @static + * @param {google.cloud.dataproc.v1.NodeGroupOperationMetadata} message NodeGroupOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeGroupOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.statusHistory = []; + object.warnings = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.nodeGroupId = ""; + object.clusterUuid = ""; + object.status = null; + object.operationType = options.enums === String ? "NODE_GROUP_OPERATION_TYPE_UNSPECIFIED" : 0; + object.description = ""; + } + if (message.nodeGroupId != null && message.hasOwnProperty("nodeGroupId")) + object.nodeGroupId = message.nodeGroupId; + if (message.clusterUuid != null && message.hasOwnProperty("clusterUuid")) + object.clusterUuid = message.clusterUuid; + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.cloud.dataproc.v1.ClusterOperationStatus.toObject(message.status, options); + if (message.statusHistory && message.statusHistory.length) { + object.statusHistory = []; + for (var j = 0; j < message.statusHistory.length; ++j) + object.statusHistory[j] = $root.google.cloud.dataproc.v1.ClusterOperationStatus.toObject(message.statusHistory[j], options); + } + if (message.operationType != null && message.hasOwnProperty("operationType")) + object.operationType = options.enums === String ? $root.google.cloud.dataproc.v1.NodeGroupOperationMetadata.NodeGroupOperationType[message.operationType] === undefined ? message.operationType : $root.google.cloud.dataproc.v1.NodeGroupOperationMetadata.NodeGroupOperationType[message.operationType] : message.operationType; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + 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.warnings && message.warnings.length) { + object.warnings = []; + for (var j = 0; j < message.warnings.length; ++j) + object.warnings[j] = message.warnings[j]; + } + return object; + }; + + /** + * Converts this NodeGroupOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + NodeGroupOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeGroupOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeGroupOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.NodeGroupOperationMetadata"; + }; + + /** + * NodeGroupOperationType enum. + * @name google.cloud.dataproc.v1.NodeGroupOperationMetadata.NodeGroupOperationType + * @enum {number} + * @property {number} NODE_GROUP_OPERATION_TYPE_UNSPECIFIED=0 NODE_GROUP_OPERATION_TYPE_UNSPECIFIED value + * @property {number} CREATE=1 CREATE value + * @property {number} UPDATE=2 UPDATE value + * @property {number} DELETE=3 DELETE value + * @property {number} RESIZE=4 RESIZE value + */ + NodeGroupOperationMetadata.NodeGroupOperationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NODE_GROUP_OPERATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATE"] = 1; + values[valuesById[2] = "UPDATE"] = 2; + values[valuesById[3] = "DELETE"] = 3; + values[valuesById[4] = "RESIZE"] = 4; + return values; + })(); + + return NodeGroupOperationMetadata; + })(); + + v1.JobController = (function() { + + /** + * Constructs a new JobController service. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a JobController + * @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 JobController(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (JobController.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = JobController; + + /** + * Creates new JobController service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dataproc.v1.JobController + * @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 {JobController} RPC service. Useful where requests and/or responses are streamed. + */ + JobController.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.JobController|submitJob}. + * @memberof google.cloud.dataproc.v1.JobController + * @typedef SubmitJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataproc.v1.Job} [response] Job + */ + + /** + * Calls SubmitJob. + * @function submitJob + * @memberof google.cloud.dataproc.v1.JobController + * @instance + * @param {google.cloud.dataproc.v1.ISubmitJobRequest} request SubmitJobRequest message or plain object + * @param {google.cloud.dataproc.v1.JobController.SubmitJobCallback} callback Node-style callback called with the error, if any, and Job + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobController.prototype.submitJob = function submitJob(request, callback) { + return this.rpcCall(submitJob, $root.google.cloud.dataproc.v1.SubmitJobRequest, $root.google.cloud.dataproc.v1.Job, request, callback); + }, "name", { value: "SubmitJob" }); + + /** + * Calls SubmitJob. + * @function submitJob + * @memberof google.cloud.dataproc.v1.JobController + * @instance + * @param {google.cloud.dataproc.v1.ISubmitJobRequest} request SubmitJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.JobController|submitJobAsOperation}. + * @memberof google.cloud.dataproc.v1.JobController + * @typedef SubmitJobAsOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls SubmitJobAsOperation. + * @function submitJobAsOperation + * @memberof google.cloud.dataproc.v1.JobController + * @instance + * @param {google.cloud.dataproc.v1.ISubmitJobRequest} request SubmitJobRequest message or plain object + * @param {google.cloud.dataproc.v1.JobController.SubmitJobAsOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobController.prototype.submitJobAsOperation = function submitJobAsOperation(request, callback) { + return this.rpcCall(submitJobAsOperation, $root.google.cloud.dataproc.v1.SubmitJobRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "SubmitJobAsOperation" }); + + /** + * Calls SubmitJobAsOperation. + * @function submitJobAsOperation + * @memberof google.cloud.dataproc.v1.JobController + * @instance + * @param {google.cloud.dataproc.v1.ISubmitJobRequest} request SubmitJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.JobController|getJob}. + * @memberof google.cloud.dataproc.v1.JobController + * @typedef GetJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataproc.v1.Job} [response] Job + */ + + /** + * Calls GetJob. + * @function getJob + * @memberof google.cloud.dataproc.v1.JobController + * @instance + * @param {google.cloud.dataproc.v1.IGetJobRequest} request GetJobRequest message or plain object + * @param {google.cloud.dataproc.v1.JobController.GetJobCallback} callback Node-style callback called with the error, if any, and Job + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobController.prototype.getJob = function getJob(request, callback) { + return this.rpcCall(getJob, $root.google.cloud.dataproc.v1.GetJobRequest, $root.google.cloud.dataproc.v1.Job, request, callback); + }, "name", { value: "GetJob" }); + + /** + * Calls GetJob. + * @function getJob + * @memberof google.cloud.dataproc.v1.JobController + * @instance + * @param {google.cloud.dataproc.v1.IGetJobRequest} request GetJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.JobController|listJobs}. + * @memberof google.cloud.dataproc.v1.JobController + * @typedef ListJobsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataproc.v1.ListJobsResponse} [response] ListJobsResponse + */ + + /** + * Calls ListJobs. + * @function listJobs + * @memberof google.cloud.dataproc.v1.JobController + * @instance + * @param {google.cloud.dataproc.v1.IListJobsRequest} request ListJobsRequest message or plain object + * @param {google.cloud.dataproc.v1.JobController.ListJobsCallback} callback Node-style callback called with the error, if any, and ListJobsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobController.prototype.listJobs = function listJobs(request, callback) { + return this.rpcCall(listJobs, $root.google.cloud.dataproc.v1.ListJobsRequest, $root.google.cloud.dataproc.v1.ListJobsResponse, request, callback); + }, "name", { value: "ListJobs" }); + + /** + * Calls ListJobs. + * @function listJobs + * @memberof google.cloud.dataproc.v1.JobController + * @instance + * @param {google.cloud.dataproc.v1.IListJobsRequest} request ListJobsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.JobController|updateJob}. + * @memberof google.cloud.dataproc.v1.JobController + * @typedef UpdateJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataproc.v1.Job} [response] Job + */ + + /** + * Calls UpdateJob. + * @function updateJob + * @memberof google.cloud.dataproc.v1.JobController + * @instance + * @param {google.cloud.dataproc.v1.IUpdateJobRequest} request UpdateJobRequest message or plain object + * @param {google.cloud.dataproc.v1.JobController.UpdateJobCallback} callback Node-style callback called with the error, if any, and Job + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobController.prototype.updateJob = function updateJob(request, callback) { + return this.rpcCall(updateJob, $root.google.cloud.dataproc.v1.UpdateJobRequest, $root.google.cloud.dataproc.v1.Job, request, callback); + }, "name", { value: "UpdateJob" }); + + /** + * Calls UpdateJob. + * @function updateJob + * @memberof google.cloud.dataproc.v1.JobController + * @instance + * @param {google.cloud.dataproc.v1.IUpdateJobRequest} request UpdateJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.JobController|cancelJob}. + * @memberof google.cloud.dataproc.v1.JobController + * @typedef CancelJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataproc.v1.Job} [response] Job + */ + + /** + * Calls CancelJob. + * @function cancelJob + * @memberof google.cloud.dataproc.v1.JobController + * @instance + * @param {google.cloud.dataproc.v1.ICancelJobRequest} request CancelJobRequest message or plain object + * @param {google.cloud.dataproc.v1.JobController.CancelJobCallback} callback Node-style callback called with the error, if any, and Job + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobController.prototype.cancelJob = function cancelJob(request, callback) { + return this.rpcCall(cancelJob, $root.google.cloud.dataproc.v1.CancelJobRequest, $root.google.cloud.dataproc.v1.Job, request, callback); + }, "name", { value: "CancelJob" }); + + /** + * Calls CancelJob. + * @function cancelJob + * @memberof google.cloud.dataproc.v1.JobController + * @instance + * @param {google.cloud.dataproc.v1.ICancelJobRequest} request CancelJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.JobController|deleteJob}. + * @memberof google.cloud.dataproc.v1.JobController + * @typedef DeleteJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteJob. + * @function deleteJob + * @memberof google.cloud.dataproc.v1.JobController + * @instance + * @param {google.cloud.dataproc.v1.IDeleteJobRequest} request DeleteJobRequest message or plain object + * @param {google.cloud.dataproc.v1.JobController.DeleteJobCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(JobController.prototype.deleteJob = function deleteJob(request, callback) { + return this.rpcCall(deleteJob, $root.google.cloud.dataproc.v1.DeleteJobRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteJob" }); + + /** + * Calls DeleteJob. + * @function deleteJob + * @memberof google.cloud.dataproc.v1.JobController + * @instance + * @param {google.cloud.dataproc.v1.IDeleteJobRequest} request DeleteJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return JobController; + })(); + + v1.LoggingConfig = (function() { + + /** + * Properties of a LoggingConfig. + * @memberof google.cloud.dataproc.v1 + * @interface ILoggingConfig + * @property {Object.|null} [driverLogLevels] LoggingConfig driverLogLevels + */ + + /** + * Constructs a new LoggingConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a LoggingConfig. + * @implements ILoggingConfig + * @constructor + * @param {google.cloud.dataproc.v1.ILoggingConfig=} [properties] Properties to set + */ + function LoggingConfig(properties) { + this.driverLogLevels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LoggingConfig driverLogLevels. + * @member {Object.} driverLogLevels + * @memberof google.cloud.dataproc.v1.LoggingConfig + * @instance + */ + LoggingConfig.prototype.driverLogLevels = $util.emptyObject; + + /** + * Creates a new LoggingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.LoggingConfig + * @static + * @param {google.cloud.dataproc.v1.ILoggingConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.LoggingConfig} LoggingConfig instance + */ + LoggingConfig.create = function create(properties) { + return new LoggingConfig(properties); + }; + + /** + * Encodes the specified LoggingConfig message. Does not implicitly {@link google.cloud.dataproc.v1.LoggingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.LoggingConfig + * @static + * @param {google.cloud.dataproc.v1.ILoggingConfig} message LoggingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoggingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.driverLogLevels != null && Object.hasOwnProperty.call(message, "driverLogLevels")) + for (var keys = Object.keys(message.driverLogLevels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.driverLogLevels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified LoggingConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.LoggingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.LoggingConfig + * @static + * @param {google.cloud.dataproc.v1.ILoggingConfig} message LoggingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoggingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LoggingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.LoggingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.LoggingConfig} LoggingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoggingConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.LoggingConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (message.driverLogLevels === $util.emptyObject) + message.driverLogLevels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = 0; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.int32(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.driverLogLevels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LoggingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.LoggingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.LoggingConfig} LoggingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoggingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LoggingConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.LoggingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LoggingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.driverLogLevels != null && message.hasOwnProperty("driverLogLevels")) { + if (!$util.isObject(message.driverLogLevels)) + return "driverLogLevels: object expected"; + var key = Object.keys(message.driverLogLevels); + for (var i = 0; i < key.length; ++i) + switch (message.driverLogLevels[key[i]]) { + default: + return "driverLogLevels: enum value{k:string} expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + return null; + }; + + /** + * Creates a LoggingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.LoggingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.LoggingConfig} LoggingConfig + */ + LoggingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.LoggingConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.LoggingConfig(); + if (object.driverLogLevels) { + if (typeof object.driverLogLevels !== "object") + throw TypeError(".google.cloud.dataproc.v1.LoggingConfig.driverLogLevels: object expected"); + message.driverLogLevels = {}; + for (var keys = Object.keys(object.driverLogLevels), i = 0; i < keys.length; ++i) + switch (object.driverLogLevels[keys[i]]) { + default: + if (typeof object.driverLogLevels[keys[i]] === "number") { + message.driverLogLevels[keys[i]] = object.driverLogLevels[keys[i]]; + break; + } + break; + case "LEVEL_UNSPECIFIED": + case 0: + message.driverLogLevels[keys[i]] = 0; + break; + case "ALL": + case 1: + message.driverLogLevels[keys[i]] = 1; + break; + case "TRACE": + case 2: + message.driverLogLevels[keys[i]] = 2; + break; + case "DEBUG": + case 3: + message.driverLogLevels[keys[i]] = 3; + break; + case "INFO": + case 4: + message.driverLogLevels[keys[i]] = 4; + break; + case "WARN": + case 5: + message.driverLogLevels[keys[i]] = 5; + break; + case "ERROR": + case 6: + message.driverLogLevels[keys[i]] = 6; + break; + case "FATAL": + case 7: + message.driverLogLevels[keys[i]] = 7; + break; + case "OFF": + case 8: + message.driverLogLevels[keys[i]] = 8; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a LoggingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.LoggingConfig + * @static + * @param {google.cloud.dataproc.v1.LoggingConfig} message LoggingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LoggingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.driverLogLevels = {}; + var keys2; + if (message.driverLogLevels && (keys2 = Object.keys(message.driverLogLevels)).length) { + object.driverLogLevels = {}; + for (var j = 0; j < keys2.length; ++j) + object.driverLogLevels[keys2[j]] = options.enums === String ? $root.google.cloud.dataproc.v1.LoggingConfig.Level[message.driverLogLevels[keys2[j]]] === undefined ? message.driverLogLevels[keys2[j]] : $root.google.cloud.dataproc.v1.LoggingConfig.Level[message.driverLogLevels[keys2[j]]] : message.driverLogLevels[keys2[j]]; + } + return object; + }; + + /** + * Converts this LoggingConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.LoggingConfig + * @instance + * @returns {Object.} JSON object + */ + LoggingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LoggingConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.LoggingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LoggingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.LoggingConfig"; + }; + + /** + * Level enum. + * @name google.cloud.dataproc.v1.LoggingConfig.Level + * @enum {number} + * @property {number} LEVEL_UNSPECIFIED=0 LEVEL_UNSPECIFIED value + * @property {number} ALL=1 ALL value + * @property {number} TRACE=2 TRACE value + * @property {number} DEBUG=3 DEBUG value + * @property {number} INFO=4 INFO value + * @property {number} WARN=5 WARN value + * @property {number} ERROR=6 ERROR value + * @property {number} FATAL=7 FATAL value + * @property {number} OFF=8 OFF value + */ + LoggingConfig.Level = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LEVEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALL"] = 1; + values[valuesById[2] = "TRACE"] = 2; + values[valuesById[3] = "DEBUG"] = 3; + values[valuesById[4] = "INFO"] = 4; + values[valuesById[5] = "WARN"] = 5; + values[valuesById[6] = "ERROR"] = 6; + values[valuesById[7] = "FATAL"] = 7; + values[valuesById[8] = "OFF"] = 8; + return values; + })(); + + return LoggingConfig; + })(); + + v1.HadoopJob = (function() { + + /** + * Properties of a HadoopJob. + * @memberof google.cloud.dataproc.v1 + * @interface IHadoopJob + * @property {string|null} [mainJarFileUri] HadoopJob mainJarFileUri + * @property {string|null} [mainClass] HadoopJob mainClass + * @property {Array.|null} [args] HadoopJob args + * @property {Array.|null} [jarFileUris] HadoopJob jarFileUris + * @property {Array.|null} [fileUris] HadoopJob fileUris + * @property {Array.|null} [archiveUris] HadoopJob archiveUris + * @property {Object.|null} [properties] HadoopJob properties + * @property {google.cloud.dataproc.v1.ILoggingConfig|null} [loggingConfig] HadoopJob loggingConfig + */ + + /** + * Constructs a new HadoopJob. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a HadoopJob. + * @implements IHadoopJob + * @constructor + * @param {google.cloud.dataproc.v1.IHadoopJob=} [properties] Properties to set + */ + function HadoopJob(properties) { + this.args = []; + this.jarFileUris = []; + this.fileUris = []; + this.archiveUris = []; + this.properties = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HadoopJob mainJarFileUri. + * @member {string|null|undefined} mainJarFileUri + * @memberof google.cloud.dataproc.v1.HadoopJob + * @instance + */ + HadoopJob.prototype.mainJarFileUri = null; + + /** + * HadoopJob mainClass. + * @member {string|null|undefined} mainClass + * @memberof google.cloud.dataproc.v1.HadoopJob + * @instance + */ + HadoopJob.prototype.mainClass = null; + + /** + * HadoopJob args. + * @member {Array.} args + * @memberof google.cloud.dataproc.v1.HadoopJob + * @instance + */ + HadoopJob.prototype.args = $util.emptyArray; + + /** + * HadoopJob jarFileUris. + * @member {Array.} jarFileUris + * @memberof google.cloud.dataproc.v1.HadoopJob + * @instance + */ + HadoopJob.prototype.jarFileUris = $util.emptyArray; + + /** + * HadoopJob fileUris. + * @member {Array.} fileUris + * @memberof google.cloud.dataproc.v1.HadoopJob + * @instance + */ + HadoopJob.prototype.fileUris = $util.emptyArray; + + /** + * HadoopJob archiveUris. + * @member {Array.} archiveUris + * @memberof google.cloud.dataproc.v1.HadoopJob + * @instance + */ + HadoopJob.prototype.archiveUris = $util.emptyArray; + + /** + * HadoopJob properties. + * @member {Object.} properties + * @memberof google.cloud.dataproc.v1.HadoopJob + * @instance + */ + HadoopJob.prototype.properties = $util.emptyObject; + + /** + * HadoopJob loggingConfig. + * @member {google.cloud.dataproc.v1.ILoggingConfig|null|undefined} loggingConfig + * @memberof google.cloud.dataproc.v1.HadoopJob + * @instance + */ + HadoopJob.prototype.loggingConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HadoopJob driver. + * @member {"mainJarFileUri"|"mainClass"|undefined} driver + * @memberof google.cloud.dataproc.v1.HadoopJob + * @instance + */ + Object.defineProperty(HadoopJob.prototype, "driver", { + get: $util.oneOfGetter($oneOfFields = ["mainJarFileUri", "mainClass"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HadoopJob instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.HadoopJob + * @static + * @param {google.cloud.dataproc.v1.IHadoopJob=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.HadoopJob} HadoopJob instance + */ + HadoopJob.create = function create(properties) { + return new HadoopJob(properties); + }; + + /** + * Encodes the specified HadoopJob message. Does not implicitly {@link google.cloud.dataproc.v1.HadoopJob.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.HadoopJob + * @static + * @param {google.cloud.dataproc.v1.IHadoopJob} message HadoopJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HadoopJob.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mainJarFileUri != null && Object.hasOwnProperty.call(message, "mainJarFileUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mainJarFileUri); + if (message.mainClass != null && Object.hasOwnProperty.call(message, "mainClass")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mainClass); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.args[i]); + if (message.jarFileUris != null && message.jarFileUris.length) + for (var i = 0; i < message.jarFileUris.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.jarFileUris[i]); + if (message.fileUris != null && message.fileUris.length) + for (var i = 0; i < message.fileUris.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.fileUris[i]); + if (message.archiveUris != null && message.archiveUris.length) + for (var i = 0; i < message.archiveUris.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.archiveUris[i]); + if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) + for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.properties[keys[i]]).ldelim(); + if (message.loggingConfig != null && Object.hasOwnProperty.call(message, "loggingConfig")) + $root.google.cloud.dataproc.v1.LoggingConfig.encode(message.loggingConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HadoopJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.HadoopJob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.HadoopJob + * @static + * @param {google.cloud.dataproc.v1.IHadoopJob} message HadoopJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HadoopJob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HadoopJob message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.HadoopJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.HadoopJob} HadoopJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HadoopJob.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.HadoopJob(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.mainJarFileUri = reader.string(); + break; + } + case 2: { + message.mainClass = reader.string(); + break; + } + case 3: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push(reader.string()); + break; + } + case 4: { + if (!(message.jarFileUris && message.jarFileUris.length)) + message.jarFileUris = []; + message.jarFileUris.push(reader.string()); + break; + } + case 5: { + if (!(message.fileUris && message.fileUris.length)) + message.fileUris = []; + message.fileUris.push(reader.string()); + break; + } + case 6: { + if (!(message.archiveUris && message.archiveUris.length)) + message.archiveUris = []; + message.archiveUris.push(reader.string()); + break; + } + case 7: { + if (message.properties === $util.emptyObject) + message.properties = {}; + 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.properties[key] = value; + break; + } + case 8: { + message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HadoopJob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.HadoopJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.HadoopJob} HadoopJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HadoopJob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HadoopJob message. + * @function verify + * @memberof google.cloud.dataproc.v1.HadoopJob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HadoopJob.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.mainJarFileUri != null && message.hasOwnProperty("mainJarFileUri")) { + properties.driver = 1; + if (!$util.isString(message.mainJarFileUri)) + return "mainJarFileUri: string expected"; + } + if (message.mainClass != null && message.hasOwnProperty("mainClass")) { + if (properties.driver === 1) + return "driver: multiple values"; + properties.driver = 1; + if (!$util.isString(message.mainClass)) + return "mainClass: 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.jarFileUris != null && message.hasOwnProperty("jarFileUris")) { + if (!Array.isArray(message.jarFileUris)) + return "jarFileUris: array expected"; + for (var i = 0; i < message.jarFileUris.length; ++i) + if (!$util.isString(message.jarFileUris[i])) + return "jarFileUris: string[] expected"; + } + if (message.fileUris != null && message.hasOwnProperty("fileUris")) { + if (!Array.isArray(message.fileUris)) + return "fileUris: array expected"; + for (var i = 0; i < message.fileUris.length; ++i) + if (!$util.isString(message.fileUris[i])) + return "fileUris: string[] expected"; + } + if (message.archiveUris != null && message.hasOwnProperty("archiveUris")) { + if (!Array.isArray(message.archiveUris)) + return "archiveUris: array expected"; + for (var i = 0; i < message.archiveUris.length; ++i) + if (!$util.isString(message.archiveUris[i])) + return "archiveUris: string[] expected"; + } + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!$util.isObject(message.properties)) + return "properties: object expected"; + var key = Object.keys(message.properties); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.properties[key[i]])) + return "properties: string{k:string} expected"; + } + if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) { + var error = $root.google.cloud.dataproc.v1.LoggingConfig.verify(message.loggingConfig); + if (error) + return "loggingConfig." + error; + } + return null; + }; + + /** + * Creates a HadoopJob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.HadoopJob + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.HadoopJob} HadoopJob + */ + HadoopJob.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.HadoopJob) + return object; + var message = new $root.google.cloud.dataproc.v1.HadoopJob(); + if (object.mainJarFileUri != null) + message.mainJarFileUri = String(object.mainJarFileUri); + if (object.mainClass != null) + message.mainClass = String(object.mainClass); + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".google.cloud.dataproc.v1.HadoopJob.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) + message.args[i] = String(object.args[i]); + } + if (object.jarFileUris) { + if (!Array.isArray(object.jarFileUris)) + throw TypeError(".google.cloud.dataproc.v1.HadoopJob.jarFileUris: array expected"); + message.jarFileUris = []; + for (var i = 0; i < object.jarFileUris.length; ++i) + message.jarFileUris[i] = String(object.jarFileUris[i]); + } + if (object.fileUris) { + if (!Array.isArray(object.fileUris)) + throw TypeError(".google.cloud.dataproc.v1.HadoopJob.fileUris: array expected"); + message.fileUris = []; + for (var i = 0; i < object.fileUris.length; ++i) + message.fileUris[i] = String(object.fileUris[i]); + } + if (object.archiveUris) { + if (!Array.isArray(object.archiveUris)) + throw TypeError(".google.cloud.dataproc.v1.HadoopJob.archiveUris: array expected"); + message.archiveUris = []; + for (var i = 0; i < object.archiveUris.length; ++i) + message.archiveUris[i] = String(object.archiveUris[i]); + } + if (object.properties) { + if (typeof object.properties !== "object") + throw TypeError(".google.cloud.dataproc.v1.HadoopJob.properties: object expected"); + message.properties = {}; + for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) + message.properties[keys[i]] = String(object.properties[keys[i]]); + } + if (object.loggingConfig != null) { + if (typeof object.loggingConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.HadoopJob.loggingConfig: object expected"); + message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.fromObject(object.loggingConfig); + } + return message; + }; + + /** + * Creates a plain object from a HadoopJob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.HadoopJob + * @static + * @param {google.cloud.dataproc.v1.HadoopJob} message HadoopJob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HadoopJob.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.args = []; + object.jarFileUris = []; + object.fileUris = []; + object.archiveUris = []; + } + if (options.objects || options.defaults) + object.properties = {}; + if (options.defaults) + object.loggingConfig = null; + if (message.mainJarFileUri != null && message.hasOwnProperty("mainJarFileUri")) { + object.mainJarFileUri = message.mainJarFileUri; + if (options.oneofs) + object.driver = "mainJarFileUri"; + } + if (message.mainClass != null && message.hasOwnProperty("mainClass")) { + object.mainClass = message.mainClass; + if (options.oneofs) + object.driver = "mainClass"; + } + 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.jarFileUris && message.jarFileUris.length) { + object.jarFileUris = []; + for (var j = 0; j < message.jarFileUris.length; ++j) + object.jarFileUris[j] = message.jarFileUris[j]; + } + if (message.fileUris && message.fileUris.length) { + object.fileUris = []; + for (var j = 0; j < message.fileUris.length; ++j) + object.fileUris[j] = message.fileUris[j]; + } + if (message.archiveUris && message.archiveUris.length) { + object.archiveUris = []; + for (var j = 0; j < message.archiveUris.length; ++j) + object.archiveUris[j] = message.archiveUris[j]; + } + var keys2; + if (message.properties && (keys2 = Object.keys(message.properties)).length) { + object.properties = {}; + for (var j = 0; j < keys2.length; ++j) + object.properties[keys2[j]] = message.properties[keys2[j]]; + } + if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) + object.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.toObject(message.loggingConfig, options); + return object; + }; + + /** + * Converts this HadoopJob to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.HadoopJob + * @instance + * @returns {Object.} JSON object + */ + HadoopJob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HadoopJob + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.HadoopJob + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HadoopJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.HadoopJob"; + }; + + return HadoopJob; + })(); + + v1.SparkJob = (function() { + + /** + * Properties of a SparkJob. + * @memberof google.cloud.dataproc.v1 + * @interface ISparkJob + * @property {string|null} [mainJarFileUri] SparkJob mainJarFileUri + * @property {string|null} [mainClass] SparkJob mainClass + * @property {Array.|null} [args] SparkJob args + * @property {Array.|null} [jarFileUris] SparkJob jarFileUris + * @property {Array.|null} [fileUris] SparkJob fileUris + * @property {Array.|null} [archiveUris] SparkJob archiveUris + * @property {Object.|null} [properties] SparkJob properties + * @property {google.cloud.dataproc.v1.ILoggingConfig|null} [loggingConfig] SparkJob loggingConfig + */ + + /** + * Constructs a new SparkJob. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a SparkJob. + * @implements ISparkJob + * @constructor + * @param {google.cloud.dataproc.v1.ISparkJob=} [properties] Properties to set + */ + function SparkJob(properties) { + this.args = []; + this.jarFileUris = []; + this.fileUris = []; + this.archiveUris = []; + this.properties = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SparkJob mainJarFileUri. + * @member {string|null|undefined} mainJarFileUri + * @memberof google.cloud.dataproc.v1.SparkJob + * @instance + */ + SparkJob.prototype.mainJarFileUri = null; + + /** + * SparkJob mainClass. + * @member {string|null|undefined} mainClass + * @memberof google.cloud.dataproc.v1.SparkJob + * @instance + */ + SparkJob.prototype.mainClass = null; + + /** + * SparkJob args. + * @member {Array.} args + * @memberof google.cloud.dataproc.v1.SparkJob + * @instance + */ + SparkJob.prototype.args = $util.emptyArray; + + /** + * SparkJob jarFileUris. + * @member {Array.} jarFileUris + * @memberof google.cloud.dataproc.v1.SparkJob + * @instance + */ + SparkJob.prototype.jarFileUris = $util.emptyArray; + + /** + * SparkJob fileUris. + * @member {Array.} fileUris + * @memberof google.cloud.dataproc.v1.SparkJob + * @instance + */ + SparkJob.prototype.fileUris = $util.emptyArray; + + /** + * SparkJob archiveUris. + * @member {Array.} archiveUris + * @memberof google.cloud.dataproc.v1.SparkJob + * @instance + */ + SparkJob.prototype.archiveUris = $util.emptyArray; + + /** + * SparkJob properties. + * @member {Object.} properties + * @memberof google.cloud.dataproc.v1.SparkJob + * @instance + */ + SparkJob.prototype.properties = $util.emptyObject; + + /** + * SparkJob loggingConfig. + * @member {google.cloud.dataproc.v1.ILoggingConfig|null|undefined} loggingConfig + * @memberof google.cloud.dataproc.v1.SparkJob + * @instance + */ + SparkJob.prototype.loggingConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SparkJob driver. + * @member {"mainJarFileUri"|"mainClass"|undefined} driver + * @memberof google.cloud.dataproc.v1.SparkJob + * @instance + */ + Object.defineProperty(SparkJob.prototype, "driver", { + get: $util.oneOfGetter($oneOfFields = ["mainJarFileUri", "mainClass"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SparkJob instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.SparkJob + * @static + * @param {google.cloud.dataproc.v1.ISparkJob=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.SparkJob} SparkJob instance + */ + SparkJob.create = function create(properties) { + return new SparkJob(properties); + }; + + /** + * Encodes the specified SparkJob message. Does not implicitly {@link google.cloud.dataproc.v1.SparkJob.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.SparkJob + * @static + * @param {google.cloud.dataproc.v1.ISparkJob} message SparkJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SparkJob.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mainJarFileUri != null && Object.hasOwnProperty.call(message, "mainJarFileUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mainJarFileUri); + if (message.mainClass != null && Object.hasOwnProperty.call(message, "mainClass")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mainClass); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.args[i]); + if (message.jarFileUris != null && message.jarFileUris.length) + for (var i = 0; i < message.jarFileUris.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.jarFileUris[i]); + if (message.fileUris != null && message.fileUris.length) + for (var i = 0; i < message.fileUris.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.fileUris[i]); + if (message.archiveUris != null && message.archiveUris.length) + for (var i = 0; i < message.archiveUris.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.archiveUris[i]); + if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) + for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.properties[keys[i]]).ldelim(); + if (message.loggingConfig != null && Object.hasOwnProperty.call(message, "loggingConfig")) + $root.google.cloud.dataproc.v1.LoggingConfig.encode(message.loggingConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SparkJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SparkJob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.SparkJob + * @static + * @param {google.cloud.dataproc.v1.ISparkJob} message SparkJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SparkJob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SparkJob message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.SparkJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.SparkJob} SparkJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SparkJob.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.SparkJob(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.mainJarFileUri = reader.string(); + break; + } + case 2: { + message.mainClass = reader.string(); + break; + } + case 3: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push(reader.string()); + break; + } + case 4: { + if (!(message.jarFileUris && message.jarFileUris.length)) + message.jarFileUris = []; + message.jarFileUris.push(reader.string()); + break; + } + case 5: { + if (!(message.fileUris && message.fileUris.length)) + message.fileUris = []; + message.fileUris.push(reader.string()); + break; + } + case 6: { + if (!(message.archiveUris && message.archiveUris.length)) + message.archiveUris = []; + message.archiveUris.push(reader.string()); + break; + } + case 7: { + if (message.properties === $util.emptyObject) + message.properties = {}; + 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.properties[key] = value; + break; + } + case 8: { + message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SparkJob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.SparkJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.SparkJob} SparkJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SparkJob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SparkJob message. + * @function verify + * @memberof google.cloud.dataproc.v1.SparkJob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SparkJob.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.mainJarFileUri != null && message.hasOwnProperty("mainJarFileUri")) { + properties.driver = 1; + if (!$util.isString(message.mainJarFileUri)) + return "mainJarFileUri: string expected"; + } + if (message.mainClass != null && message.hasOwnProperty("mainClass")) { + if (properties.driver === 1) + return "driver: multiple values"; + properties.driver = 1; + if (!$util.isString(message.mainClass)) + return "mainClass: 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.jarFileUris != null && message.hasOwnProperty("jarFileUris")) { + if (!Array.isArray(message.jarFileUris)) + return "jarFileUris: array expected"; + for (var i = 0; i < message.jarFileUris.length; ++i) + if (!$util.isString(message.jarFileUris[i])) + return "jarFileUris: string[] expected"; + } + if (message.fileUris != null && message.hasOwnProperty("fileUris")) { + if (!Array.isArray(message.fileUris)) + return "fileUris: array expected"; + for (var i = 0; i < message.fileUris.length; ++i) + if (!$util.isString(message.fileUris[i])) + return "fileUris: string[] expected"; + } + if (message.archiveUris != null && message.hasOwnProperty("archiveUris")) { + if (!Array.isArray(message.archiveUris)) + return "archiveUris: array expected"; + for (var i = 0; i < message.archiveUris.length; ++i) + if (!$util.isString(message.archiveUris[i])) + return "archiveUris: string[] expected"; + } + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!$util.isObject(message.properties)) + return "properties: object expected"; + var key = Object.keys(message.properties); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.properties[key[i]])) + return "properties: string{k:string} expected"; + } + if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) { + var error = $root.google.cloud.dataproc.v1.LoggingConfig.verify(message.loggingConfig); + if (error) + return "loggingConfig." + error; + } + return null; + }; + + /** + * Creates a SparkJob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.SparkJob + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.SparkJob} SparkJob + */ + SparkJob.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.SparkJob) + return object; + var message = new $root.google.cloud.dataproc.v1.SparkJob(); + if (object.mainJarFileUri != null) + message.mainJarFileUri = String(object.mainJarFileUri); + if (object.mainClass != null) + message.mainClass = String(object.mainClass); + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".google.cloud.dataproc.v1.SparkJob.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) + message.args[i] = String(object.args[i]); + } + if (object.jarFileUris) { + if (!Array.isArray(object.jarFileUris)) + throw TypeError(".google.cloud.dataproc.v1.SparkJob.jarFileUris: array expected"); + message.jarFileUris = []; + for (var i = 0; i < object.jarFileUris.length; ++i) + message.jarFileUris[i] = String(object.jarFileUris[i]); + } + if (object.fileUris) { + if (!Array.isArray(object.fileUris)) + throw TypeError(".google.cloud.dataproc.v1.SparkJob.fileUris: array expected"); + message.fileUris = []; + for (var i = 0; i < object.fileUris.length; ++i) + message.fileUris[i] = String(object.fileUris[i]); + } + if (object.archiveUris) { + if (!Array.isArray(object.archiveUris)) + throw TypeError(".google.cloud.dataproc.v1.SparkJob.archiveUris: array expected"); + message.archiveUris = []; + for (var i = 0; i < object.archiveUris.length; ++i) + message.archiveUris[i] = String(object.archiveUris[i]); + } + if (object.properties) { + if (typeof object.properties !== "object") + throw TypeError(".google.cloud.dataproc.v1.SparkJob.properties: object expected"); + message.properties = {}; + for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) + message.properties[keys[i]] = String(object.properties[keys[i]]); + } + if (object.loggingConfig != null) { + if (typeof object.loggingConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.SparkJob.loggingConfig: object expected"); + message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.fromObject(object.loggingConfig); + } + return message; + }; + + /** + * Creates a plain object from a SparkJob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.SparkJob + * @static + * @param {google.cloud.dataproc.v1.SparkJob} message SparkJob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SparkJob.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.args = []; + object.jarFileUris = []; + object.fileUris = []; + object.archiveUris = []; + } + if (options.objects || options.defaults) + object.properties = {}; + if (options.defaults) + object.loggingConfig = null; + if (message.mainJarFileUri != null && message.hasOwnProperty("mainJarFileUri")) { + object.mainJarFileUri = message.mainJarFileUri; + if (options.oneofs) + object.driver = "mainJarFileUri"; + } + if (message.mainClass != null && message.hasOwnProperty("mainClass")) { + object.mainClass = message.mainClass; + if (options.oneofs) + object.driver = "mainClass"; + } + 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.jarFileUris && message.jarFileUris.length) { + object.jarFileUris = []; + for (var j = 0; j < message.jarFileUris.length; ++j) + object.jarFileUris[j] = message.jarFileUris[j]; + } + if (message.fileUris && message.fileUris.length) { + object.fileUris = []; + for (var j = 0; j < message.fileUris.length; ++j) + object.fileUris[j] = message.fileUris[j]; + } + if (message.archiveUris && message.archiveUris.length) { + object.archiveUris = []; + for (var j = 0; j < message.archiveUris.length; ++j) + object.archiveUris[j] = message.archiveUris[j]; + } + var keys2; + if (message.properties && (keys2 = Object.keys(message.properties)).length) { + object.properties = {}; + for (var j = 0; j < keys2.length; ++j) + object.properties[keys2[j]] = message.properties[keys2[j]]; + } + if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) + object.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.toObject(message.loggingConfig, options); + return object; + }; + + /** + * Converts this SparkJob to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.SparkJob + * @instance + * @returns {Object.} JSON object + */ + SparkJob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SparkJob + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.SparkJob + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SparkJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.SparkJob"; + }; + + return SparkJob; + })(); + + v1.PySparkJob = (function() { + + /** + * Properties of a PySparkJob. + * @memberof google.cloud.dataproc.v1 + * @interface IPySparkJob + * @property {string|null} [mainPythonFileUri] PySparkJob mainPythonFileUri + * @property {Array.|null} [args] PySparkJob args + * @property {Array.|null} [pythonFileUris] PySparkJob pythonFileUris + * @property {Array.|null} [jarFileUris] PySparkJob jarFileUris + * @property {Array.|null} [fileUris] PySparkJob fileUris + * @property {Array.|null} [archiveUris] PySparkJob archiveUris + * @property {Object.|null} [properties] PySparkJob properties + * @property {google.cloud.dataproc.v1.ILoggingConfig|null} [loggingConfig] PySparkJob loggingConfig + */ + + /** + * Constructs a new PySparkJob. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a PySparkJob. + * @implements IPySparkJob + * @constructor + * @param {google.cloud.dataproc.v1.IPySparkJob=} [properties] Properties to set + */ + function PySparkJob(properties) { + this.args = []; + this.pythonFileUris = []; + this.jarFileUris = []; + this.fileUris = []; + this.archiveUris = []; + this.properties = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PySparkJob mainPythonFileUri. + * @member {string} mainPythonFileUri + * @memberof google.cloud.dataproc.v1.PySparkJob + * @instance + */ + PySparkJob.prototype.mainPythonFileUri = ""; + + /** + * PySparkJob args. + * @member {Array.} args + * @memberof google.cloud.dataproc.v1.PySparkJob + * @instance + */ + PySparkJob.prototype.args = $util.emptyArray; + + /** + * PySparkJob pythonFileUris. + * @member {Array.} pythonFileUris + * @memberof google.cloud.dataproc.v1.PySparkJob + * @instance + */ + PySparkJob.prototype.pythonFileUris = $util.emptyArray; + + /** + * PySparkJob jarFileUris. + * @member {Array.} jarFileUris + * @memberof google.cloud.dataproc.v1.PySparkJob + * @instance + */ + PySparkJob.prototype.jarFileUris = $util.emptyArray; + + /** + * PySparkJob fileUris. + * @member {Array.} fileUris + * @memberof google.cloud.dataproc.v1.PySparkJob + * @instance + */ + PySparkJob.prototype.fileUris = $util.emptyArray; + + /** + * PySparkJob archiveUris. + * @member {Array.} archiveUris + * @memberof google.cloud.dataproc.v1.PySparkJob + * @instance + */ + PySparkJob.prototype.archiveUris = $util.emptyArray; + + /** + * PySparkJob properties. + * @member {Object.} properties + * @memberof google.cloud.dataproc.v1.PySparkJob + * @instance + */ + PySparkJob.prototype.properties = $util.emptyObject; + + /** + * PySparkJob loggingConfig. + * @member {google.cloud.dataproc.v1.ILoggingConfig|null|undefined} loggingConfig + * @memberof google.cloud.dataproc.v1.PySparkJob + * @instance + */ + PySparkJob.prototype.loggingConfig = null; + + /** + * Creates a new PySparkJob instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.PySparkJob + * @static + * @param {google.cloud.dataproc.v1.IPySparkJob=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.PySparkJob} PySparkJob instance + */ + PySparkJob.create = function create(properties) { + return new PySparkJob(properties); + }; + + /** + * Encodes the specified PySparkJob message. Does not implicitly {@link google.cloud.dataproc.v1.PySparkJob.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.PySparkJob + * @static + * @param {google.cloud.dataproc.v1.IPySparkJob} message PySparkJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PySparkJob.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mainPythonFileUri != null && Object.hasOwnProperty.call(message, "mainPythonFileUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mainPythonFileUri); + 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.pythonFileUris != null && message.pythonFileUris.length) + for (var i = 0; i < message.pythonFileUris.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pythonFileUris[i]); + if (message.jarFileUris != null && message.jarFileUris.length) + for (var i = 0; i < message.jarFileUris.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.jarFileUris[i]); + if (message.fileUris != null && message.fileUris.length) + for (var i = 0; i < message.fileUris.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.fileUris[i]); + if (message.archiveUris != null && message.archiveUris.length) + for (var i = 0; i < message.archiveUris.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.archiveUris[i]); + if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) + for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.properties[keys[i]]).ldelim(); + if (message.loggingConfig != null && Object.hasOwnProperty.call(message, "loggingConfig")) + $root.google.cloud.dataproc.v1.LoggingConfig.encode(message.loggingConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PySparkJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.PySparkJob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.PySparkJob + * @static + * @param {google.cloud.dataproc.v1.IPySparkJob} message PySparkJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PySparkJob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PySparkJob message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.PySparkJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.PySparkJob} PySparkJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PySparkJob.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.PySparkJob(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.mainPythonFileUri = reader.string(); + break; + } + case 2: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push(reader.string()); + break; + } + case 3: { + if (!(message.pythonFileUris && message.pythonFileUris.length)) + message.pythonFileUris = []; + message.pythonFileUris.push(reader.string()); + break; + } + case 4: { + if (!(message.jarFileUris && message.jarFileUris.length)) + message.jarFileUris = []; + message.jarFileUris.push(reader.string()); + break; + } + case 5: { + if (!(message.fileUris && message.fileUris.length)) + message.fileUris = []; + message.fileUris.push(reader.string()); + break; + } + case 6: { + if (!(message.archiveUris && message.archiveUris.length)) + message.archiveUris = []; + message.archiveUris.push(reader.string()); + break; + } + case 7: { + if (message.properties === $util.emptyObject) + message.properties = {}; + 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.properties[key] = value; + break; + } + case 8: { + message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PySparkJob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.PySparkJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.PySparkJob} PySparkJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PySparkJob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PySparkJob message. + * @function verify + * @memberof google.cloud.dataproc.v1.PySparkJob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PySparkJob.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mainPythonFileUri != null && message.hasOwnProperty("mainPythonFileUri")) + if (!$util.isString(message.mainPythonFileUri)) + return "mainPythonFileUri: 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.pythonFileUris != null && message.hasOwnProperty("pythonFileUris")) { + if (!Array.isArray(message.pythonFileUris)) + return "pythonFileUris: array expected"; + for (var i = 0; i < message.pythonFileUris.length; ++i) + if (!$util.isString(message.pythonFileUris[i])) + return "pythonFileUris: string[] expected"; + } + if (message.jarFileUris != null && message.hasOwnProperty("jarFileUris")) { + if (!Array.isArray(message.jarFileUris)) + return "jarFileUris: array expected"; + for (var i = 0; i < message.jarFileUris.length; ++i) + if (!$util.isString(message.jarFileUris[i])) + return "jarFileUris: string[] expected"; + } + if (message.fileUris != null && message.hasOwnProperty("fileUris")) { + if (!Array.isArray(message.fileUris)) + return "fileUris: array expected"; + for (var i = 0; i < message.fileUris.length; ++i) + if (!$util.isString(message.fileUris[i])) + return "fileUris: string[] expected"; + } + if (message.archiveUris != null && message.hasOwnProperty("archiveUris")) { + if (!Array.isArray(message.archiveUris)) + return "archiveUris: array expected"; + for (var i = 0; i < message.archiveUris.length; ++i) + if (!$util.isString(message.archiveUris[i])) + return "archiveUris: string[] expected"; + } + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!$util.isObject(message.properties)) + return "properties: object expected"; + var key = Object.keys(message.properties); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.properties[key[i]])) + return "properties: string{k:string} expected"; + } + if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) { + var error = $root.google.cloud.dataproc.v1.LoggingConfig.verify(message.loggingConfig); + if (error) + return "loggingConfig." + error; + } + return null; + }; + + /** + * Creates a PySparkJob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.PySparkJob + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.PySparkJob} PySparkJob + */ + PySparkJob.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.PySparkJob) + return object; + var message = new $root.google.cloud.dataproc.v1.PySparkJob(); + if (object.mainPythonFileUri != null) + message.mainPythonFileUri = String(object.mainPythonFileUri); + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".google.cloud.dataproc.v1.PySparkJob.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) + message.args[i] = String(object.args[i]); + } + if (object.pythonFileUris) { + if (!Array.isArray(object.pythonFileUris)) + throw TypeError(".google.cloud.dataproc.v1.PySparkJob.pythonFileUris: array expected"); + message.pythonFileUris = []; + for (var i = 0; i < object.pythonFileUris.length; ++i) + message.pythonFileUris[i] = String(object.pythonFileUris[i]); + } + if (object.jarFileUris) { + if (!Array.isArray(object.jarFileUris)) + throw TypeError(".google.cloud.dataproc.v1.PySparkJob.jarFileUris: array expected"); + message.jarFileUris = []; + for (var i = 0; i < object.jarFileUris.length; ++i) + message.jarFileUris[i] = String(object.jarFileUris[i]); + } + if (object.fileUris) { + if (!Array.isArray(object.fileUris)) + throw TypeError(".google.cloud.dataproc.v1.PySparkJob.fileUris: array expected"); + message.fileUris = []; + for (var i = 0; i < object.fileUris.length; ++i) + message.fileUris[i] = String(object.fileUris[i]); + } + if (object.archiveUris) { + if (!Array.isArray(object.archiveUris)) + throw TypeError(".google.cloud.dataproc.v1.PySparkJob.archiveUris: array expected"); + message.archiveUris = []; + for (var i = 0; i < object.archiveUris.length; ++i) + message.archiveUris[i] = String(object.archiveUris[i]); + } + if (object.properties) { + if (typeof object.properties !== "object") + throw TypeError(".google.cloud.dataproc.v1.PySparkJob.properties: object expected"); + message.properties = {}; + for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) + message.properties[keys[i]] = String(object.properties[keys[i]]); + } + if (object.loggingConfig != null) { + if (typeof object.loggingConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.PySparkJob.loggingConfig: object expected"); + message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.fromObject(object.loggingConfig); + } + return message; + }; + + /** + * Creates a plain object from a PySparkJob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.PySparkJob + * @static + * @param {google.cloud.dataproc.v1.PySparkJob} message PySparkJob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PySparkJob.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.args = []; + object.pythonFileUris = []; + object.jarFileUris = []; + object.fileUris = []; + object.archiveUris = []; + } + if (options.objects || options.defaults) + object.properties = {}; + if (options.defaults) { + object.mainPythonFileUri = ""; + object.loggingConfig = null; + } + if (message.mainPythonFileUri != null && message.hasOwnProperty("mainPythonFileUri")) + object.mainPythonFileUri = message.mainPythonFileUri; + 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.pythonFileUris && message.pythonFileUris.length) { + object.pythonFileUris = []; + for (var j = 0; j < message.pythonFileUris.length; ++j) + object.pythonFileUris[j] = message.pythonFileUris[j]; + } + if (message.jarFileUris && message.jarFileUris.length) { + object.jarFileUris = []; + for (var j = 0; j < message.jarFileUris.length; ++j) + object.jarFileUris[j] = message.jarFileUris[j]; + } + if (message.fileUris && message.fileUris.length) { + object.fileUris = []; + for (var j = 0; j < message.fileUris.length; ++j) + object.fileUris[j] = message.fileUris[j]; + } + if (message.archiveUris && message.archiveUris.length) { + object.archiveUris = []; + for (var j = 0; j < message.archiveUris.length; ++j) + object.archiveUris[j] = message.archiveUris[j]; + } + var keys2; + if (message.properties && (keys2 = Object.keys(message.properties)).length) { + object.properties = {}; + for (var j = 0; j < keys2.length; ++j) + object.properties[keys2[j]] = message.properties[keys2[j]]; + } + if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) + object.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.toObject(message.loggingConfig, options); + return object; + }; + + /** + * Converts this PySparkJob to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.PySparkJob + * @instance + * @returns {Object.} JSON object + */ + PySparkJob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PySparkJob + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.PySparkJob + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PySparkJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.PySparkJob"; + }; + + return PySparkJob; + })(); + + v1.QueryList = (function() { + + /** + * Properties of a QueryList. + * @memberof google.cloud.dataproc.v1 + * @interface IQueryList + * @property {Array.|null} [queries] QueryList queries + */ + + /** + * Constructs a new QueryList. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a QueryList. + * @implements IQueryList + * @constructor + * @param {google.cloud.dataproc.v1.IQueryList=} [properties] Properties to set + */ + function QueryList(properties) { + this.queries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryList queries. + * @member {Array.} queries + * @memberof google.cloud.dataproc.v1.QueryList + * @instance + */ + QueryList.prototype.queries = $util.emptyArray; + + /** + * Creates a new QueryList instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.QueryList + * @static + * @param {google.cloud.dataproc.v1.IQueryList=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.QueryList} QueryList instance + */ + QueryList.create = function create(properties) { + return new QueryList(properties); + }; + + /** + * Encodes the specified QueryList message. Does not implicitly {@link google.cloud.dataproc.v1.QueryList.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.QueryList + * @static + * @param {google.cloud.dataproc.v1.IQueryList} message QueryList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryList.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.queries != null && message.queries.length) + for (var i = 0; i < message.queries.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.queries[i]); + return writer; + }; + + /** + * Encodes the specified QueryList message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.QueryList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.QueryList + * @static + * @param {google.cloud.dataproc.v1.IQueryList} message QueryList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryList message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.QueryList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.QueryList} QueryList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryList.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.QueryList(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.queries && message.queries.length)) + message.queries = []; + message.queries.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.QueryList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.QueryList} QueryList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryList message. + * @function verify + * @memberof google.cloud.dataproc.v1.QueryList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryList.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.queries != null && message.hasOwnProperty("queries")) { + if (!Array.isArray(message.queries)) + return "queries: array expected"; + for (var i = 0; i < message.queries.length; ++i) + if (!$util.isString(message.queries[i])) + return "queries: string[] expected"; + } + return null; + }; + + /** + * Creates a QueryList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.QueryList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.QueryList} QueryList + */ + QueryList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.QueryList) + return object; + var message = new $root.google.cloud.dataproc.v1.QueryList(); + if (object.queries) { + if (!Array.isArray(object.queries)) + throw TypeError(".google.cloud.dataproc.v1.QueryList.queries: array expected"); + message.queries = []; + for (var i = 0; i < object.queries.length; ++i) + message.queries[i] = String(object.queries[i]); + } + return message; + }; + + /** + * Creates a plain object from a QueryList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.QueryList + * @static + * @param {google.cloud.dataproc.v1.QueryList} message QueryList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.queries = []; + if (message.queries && message.queries.length) { + object.queries = []; + for (var j = 0; j < message.queries.length; ++j) + object.queries[j] = message.queries[j]; + } + return object; + }; + + /** + * Converts this QueryList to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.QueryList + * @instance + * @returns {Object.} JSON object + */ + QueryList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryList + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.QueryList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.QueryList"; + }; + + return QueryList; + })(); + + v1.HiveJob = (function() { + + /** + * Properties of a HiveJob. + * @memberof google.cloud.dataproc.v1 + * @interface IHiveJob + * @property {string|null} [queryFileUri] HiveJob queryFileUri + * @property {google.cloud.dataproc.v1.IQueryList|null} [queryList] HiveJob queryList + * @property {boolean|null} [continueOnFailure] HiveJob continueOnFailure + * @property {Object.|null} [scriptVariables] HiveJob scriptVariables + * @property {Object.|null} [properties] HiveJob properties + * @property {Array.|null} [jarFileUris] HiveJob jarFileUris + */ + + /** + * Constructs a new HiveJob. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a HiveJob. + * @implements IHiveJob + * @constructor + * @param {google.cloud.dataproc.v1.IHiveJob=} [properties] Properties to set + */ + function HiveJob(properties) { + this.scriptVariables = {}; + this.properties = {}; + this.jarFileUris = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HiveJob queryFileUri. + * @member {string|null|undefined} queryFileUri + * @memberof google.cloud.dataproc.v1.HiveJob + * @instance + */ + HiveJob.prototype.queryFileUri = null; + + /** + * HiveJob queryList. + * @member {google.cloud.dataproc.v1.IQueryList|null|undefined} queryList + * @memberof google.cloud.dataproc.v1.HiveJob + * @instance + */ + HiveJob.prototype.queryList = null; + + /** + * HiveJob continueOnFailure. + * @member {boolean} continueOnFailure + * @memberof google.cloud.dataproc.v1.HiveJob + * @instance + */ + HiveJob.prototype.continueOnFailure = false; + + /** + * HiveJob scriptVariables. + * @member {Object.} scriptVariables + * @memberof google.cloud.dataproc.v1.HiveJob + * @instance + */ + HiveJob.prototype.scriptVariables = $util.emptyObject; + + /** + * HiveJob properties. + * @member {Object.} properties + * @memberof google.cloud.dataproc.v1.HiveJob + * @instance + */ + HiveJob.prototype.properties = $util.emptyObject; + + /** + * HiveJob jarFileUris. + * @member {Array.} jarFileUris + * @memberof google.cloud.dataproc.v1.HiveJob + * @instance + */ + HiveJob.prototype.jarFileUris = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HiveJob queries. + * @member {"queryFileUri"|"queryList"|undefined} queries + * @memberof google.cloud.dataproc.v1.HiveJob + * @instance + */ + Object.defineProperty(HiveJob.prototype, "queries", { + get: $util.oneOfGetter($oneOfFields = ["queryFileUri", "queryList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HiveJob instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.HiveJob + * @static + * @param {google.cloud.dataproc.v1.IHiveJob=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.HiveJob} HiveJob instance + */ + HiveJob.create = function create(properties) { + return new HiveJob(properties); + }; + + /** + * Encodes the specified HiveJob message. Does not implicitly {@link google.cloud.dataproc.v1.HiveJob.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.HiveJob + * @static + * @param {google.cloud.dataproc.v1.IHiveJob} message HiveJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HiveJob.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.queryFileUri != null && Object.hasOwnProperty.call(message, "queryFileUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.queryFileUri); + if (message.queryList != null && Object.hasOwnProperty.call(message, "queryList")) + $root.google.cloud.dataproc.v1.QueryList.encode(message.queryList, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.continueOnFailure != null && Object.hasOwnProperty.call(message, "continueOnFailure")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.continueOnFailure); + if (message.scriptVariables != null && Object.hasOwnProperty.call(message, "scriptVariables")) + for (var keys = Object.keys(message.scriptVariables), 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.scriptVariables[keys[i]]).ldelim(); + if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) + for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.properties[keys[i]]).ldelim(); + if (message.jarFileUris != null && message.jarFileUris.length) + for (var i = 0; i < message.jarFileUris.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.jarFileUris[i]); + return writer; + }; + + /** + * Encodes the specified HiveJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.HiveJob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.HiveJob + * @static + * @param {google.cloud.dataproc.v1.IHiveJob} message HiveJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HiveJob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HiveJob message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.HiveJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.HiveJob} HiveJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HiveJob.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.HiveJob(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.queryFileUri = reader.string(); + break; + } + case 2: { + message.queryList = $root.google.cloud.dataproc.v1.QueryList.decode(reader, reader.uint32()); + break; + } + case 3: { + message.continueOnFailure = reader.bool(); + break; + } + case 4: { + if (message.scriptVariables === $util.emptyObject) + message.scriptVariables = {}; + 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.scriptVariables[key] = value; + break; + } + case 5: { + if (message.properties === $util.emptyObject) + message.properties = {}; + 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.properties[key] = value; + break; + } + case 6: { + if (!(message.jarFileUris && message.jarFileUris.length)) + message.jarFileUris = []; + message.jarFileUris.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HiveJob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.HiveJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.HiveJob} HiveJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HiveJob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HiveJob message. + * @function verify + * @memberof google.cloud.dataproc.v1.HiveJob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HiveJob.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.queryFileUri != null && message.hasOwnProperty("queryFileUri")) { + properties.queries = 1; + if (!$util.isString(message.queryFileUri)) + return "queryFileUri: string expected"; + } + if (message.queryList != null && message.hasOwnProperty("queryList")) { + if (properties.queries === 1) + return "queries: multiple values"; + properties.queries = 1; + { + var error = $root.google.cloud.dataproc.v1.QueryList.verify(message.queryList); + if (error) + return "queryList." + error; + } + } + if (message.continueOnFailure != null && message.hasOwnProperty("continueOnFailure")) + if (typeof message.continueOnFailure !== "boolean") + return "continueOnFailure: boolean expected"; + if (message.scriptVariables != null && message.hasOwnProperty("scriptVariables")) { + if (!$util.isObject(message.scriptVariables)) + return "scriptVariables: object expected"; + var key = Object.keys(message.scriptVariables); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.scriptVariables[key[i]])) + return "scriptVariables: string{k:string} expected"; + } + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!$util.isObject(message.properties)) + return "properties: object expected"; + var key = Object.keys(message.properties); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.properties[key[i]])) + return "properties: string{k:string} expected"; + } + if (message.jarFileUris != null && message.hasOwnProperty("jarFileUris")) { + if (!Array.isArray(message.jarFileUris)) + return "jarFileUris: array expected"; + for (var i = 0; i < message.jarFileUris.length; ++i) + if (!$util.isString(message.jarFileUris[i])) + return "jarFileUris: string[] expected"; + } + return null; + }; + + /** + * Creates a HiveJob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.HiveJob + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.HiveJob} HiveJob + */ + HiveJob.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.HiveJob) + return object; + var message = new $root.google.cloud.dataproc.v1.HiveJob(); + if (object.queryFileUri != null) + message.queryFileUri = String(object.queryFileUri); + if (object.queryList != null) { + if (typeof object.queryList !== "object") + throw TypeError(".google.cloud.dataproc.v1.HiveJob.queryList: object expected"); + message.queryList = $root.google.cloud.dataproc.v1.QueryList.fromObject(object.queryList); + } + if (object.continueOnFailure != null) + message.continueOnFailure = Boolean(object.continueOnFailure); + if (object.scriptVariables) { + if (typeof object.scriptVariables !== "object") + throw TypeError(".google.cloud.dataproc.v1.HiveJob.scriptVariables: object expected"); + message.scriptVariables = {}; + for (var keys = Object.keys(object.scriptVariables), i = 0; i < keys.length; ++i) + message.scriptVariables[keys[i]] = String(object.scriptVariables[keys[i]]); + } + if (object.properties) { + if (typeof object.properties !== "object") + throw TypeError(".google.cloud.dataproc.v1.HiveJob.properties: object expected"); + message.properties = {}; + for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) + message.properties[keys[i]] = String(object.properties[keys[i]]); + } + if (object.jarFileUris) { + if (!Array.isArray(object.jarFileUris)) + throw TypeError(".google.cloud.dataproc.v1.HiveJob.jarFileUris: array expected"); + message.jarFileUris = []; + for (var i = 0; i < object.jarFileUris.length; ++i) + message.jarFileUris[i] = String(object.jarFileUris[i]); + } + return message; + }; + + /** + * Creates a plain object from a HiveJob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.HiveJob + * @static + * @param {google.cloud.dataproc.v1.HiveJob} message HiveJob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HiveJob.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.jarFileUris = []; + if (options.objects || options.defaults) { + object.scriptVariables = {}; + object.properties = {}; + } + if (options.defaults) + object.continueOnFailure = false; + if (message.queryFileUri != null && message.hasOwnProperty("queryFileUri")) { + object.queryFileUri = message.queryFileUri; + if (options.oneofs) + object.queries = "queryFileUri"; + } + if (message.queryList != null && message.hasOwnProperty("queryList")) { + object.queryList = $root.google.cloud.dataproc.v1.QueryList.toObject(message.queryList, options); + if (options.oneofs) + object.queries = "queryList"; + } + if (message.continueOnFailure != null && message.hasOwnProperty("continueOnFailure")) + object.continueOnFailure = message.continueOnFailure; + var keys2; + if (message.scriptVariables && (keys2 = Object.keys(message.scriptVariables)).length) { + object.scriptVariables = {}; + for (var j = 0; j < keys2.length; ++j) + object.scriptVariables[keys2[j]] = message.scriptVariables[keys2[j]]; + } + if (message.properties && (keys2 = Object.keys(message.properties)).length) { + object.properties = {}; + for (var j = 0; j < keys2.length; ++j) + object.properties[keys2[j]] = message.properties[keys2[j]]; + } + if (message.jarFileUris && message.jarFileUris.length) { + object.jarFileUris = []; + for (var j = 0; j < message.jarFileUris.length; ++j) + object.jarFileUris[j] = message.jarFileUris[j]; + } + return object; + }; + + /** + * Converts this HiveJob to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.HiveJob + * @instance + * @returns {Object.} JSON object + */ + HiveJob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HiveJob + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.HiveJob + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HiveJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.HiveJob"; + }; + + return HiveJob; + })(); + + v1.SparkSqlJob = (function() { + + /** + * Properties of a SparkSqlJob. + * @memberof google.cloud.dataproc.v1 + * @interface ISparkSqlJob + * @property {string|null} [queryFileUri] SparkSqlJob queryFileUri + * @property {google.cloud.dataproc.v1.IQueryList|null} [queryList] SparkSqlJob queryList + * @property {Object.|null} [scriptVariables] SparkSqlJob scriptVariables + * @property {Object.|null} [properties] SparkSqlJob properties + * @property {Array.|null} [jarFileUris] SparkSqlJob jarFileUris + * @property {google.cloud.dataproc.v1.ILoggingConfig|null} [loggingConfig] SparkSqlJob loggingConfig + */ + + /** + * Constructs a new SparkSqlJob. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a SparkSqlJob. + * @implements ISparkSqlJob + * @constructor + * @param {google.cloud.dataproc.v1.ISparkSqlJob=} [properties] Properties to set + */ + function SparkSqlJob(properties) { + this.scriptVariables = {}; + this.properties = {}; + this.jarFileUris = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SparkSqlJob queryFileUri. + * @member {string|null|undefined} queryFileUri + * @memberof google.cloud.dataproc.v1.SparkSqlJob + * @instance + */ + SparkSqlJob.prototype.queryFileUri = null; + + /** + * SparkSqlJob queryList. + * @member {google.cloud.dataproc.v1.IQueryList|null|undefined} queryList + * @memberof google.cloud.dataproc.v1.SparkSqlJob + * @instance + */ + SparkSqlJob.prototype.queryList = null; + + /** + * SparkSqlJob scriptVariables. + * @member {Object.} scriptVariables + * @memberof google.cloud.dataproc.v1.SparkSqlJob + * @instance + */ + SparkSqlJob.prototype.scriptVariables = $util.emptyObject; + + /** + * SparkSqlJob properties. + * @member {Object.} properties + * @memberof google.cloud.dataproc.v1.SparkSqlJob + * @instance + */ + SparkSqlJob.prototype.properties = $util.emptyObject; + + /** + * SparkSqlJob jarFileUris. + * @member {Array.} jarFileUris + * @memberof google.cloud.dataproc.v1.SparkSqlJob + * @instance + */ + SparkSqlJob.prototype.jarFileUris = $util.emptyArray; + + /** + * SparkSqlJob loggingConfig. + * @member {google.cloud.dataproc.v1.ILoggingConfig|null|undefined} loggingConfig + * @memberof google.cloud.dataproc.v1.SparkSqlJob + * @instance + */ + SparkSqlJob.prototype.loggingConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SparkSqlJob queries. + * @member {"queryFileUri"|"queryList"|undefined} queries + * @memberof google.cloud.dataproc.v1.SparkSqlJob + * @instance + */ + Object.defineProperty(SparkSqlJob.prototype, "queries", { + get: $util.oneOfGetter($oneOfFields = ["queryFileUri", "queryList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SparkSqlJob instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.SparkSqlJob + * @static + * @param {google.cloud.dataproc.v1.ISparkSqlJob=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.SparkSqlJob} SparkSqlJob instance + */ + SparkSqlJob.create = function create(properties) { + return new SparkSqlJob(properties); + }; + + /** + * Encodes the specified SparkSqlJob message. Does not implicitly {@link google.cloud.dataproc.v1.SparkSqlJob.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.SparkSqlJob + * @static + * @param {google.cloud.dataproc.v1.ISparkSqlJob} message SparkSqlJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SparkSqlJob.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.queryFileUri != null && Object.hasOwnProperty.call(message, "queryFileUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.queryFileUri); + if (message.queryList != null && Object.hasOwnProperty.call(message, "queryList")) + $root.google.cloud.dataproc.v1.QueryList.encode(message.queryList, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.scriptVariables != null && Object.hasOwnProperty.call(message, "scriptVariables")) + for (var keys = Object.keys(message.scriptVariables), 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.scriptVariables[keys[i]]).ldelim(); + if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) + for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.properties[keys[i]]).ldelim(); + if (message.loggingConfig != null && Object.hasOwnProperty.call(message, "loggingConfig")) + $root.google.cloud.dataproc.v1.LoggingConfig.encode(message.loggingConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.jarFileUris != null && message.jarFileUris.length) + for (var i = 0; i < message.jarFileUris.length; ++i) + writer.uint32(/* id 56, wireType 2 =*/450).string(message.jarFileUris[i]); + return writer; + }; + + /** + * Encodes the specified SparkSqlJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SparkSqlJob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.SparkSqlJob + * @static + * @param {google.cloud.dataproc.v1.ISparkSqlJob} message SparkSqlJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SparkSqlJob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SparkSqlJob message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.SparkSqlJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.SparkSqlJob} SparkSqlJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SparkSqlJob.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.SparkSqlJob(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.queryFileUri = reader.string(); + break; + } + case 2: { + message.queryList = $root.google.cloud.dataproc.v1.QueryList.decode(reader, reader.uint32()); + break; + } + case 3: { + if (message.scriptVariables === $util.emptyObject) + message.scriptVariables = {}; + 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.scriptVariables[key] = value; + break; + } + case 4: { + if (message.properties === $util.emptyObject) + message.properties = {}; + 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.properties[key] = value; + break; + } + case 56: { + if (!(message.jarFileUris && message.jarFileUris.length)) + message.jarFileUris = []; + message.jarFileUris.push(reader.string()); + break; + } + case 6: { + message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SparkSqlJob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.SparkSqlJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.SparkSqlJob} SparkSqlJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SparkSqlJob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SparkSqlJob message. + * @function verify + * @memberof google.cloud.dataproc.v1.SparkSqlJob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SparkSqlJob.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.queryFileUri != null && message.hasOwnProperty("queryFileUri")) { + properties.queries = 1; + if (!$util.isString(message.queryFileUri)) + return "queryFileUri: string expected"; + } + if (message.queryList != null && message.hasOwnProperty("queryList")) { + if (properties.queries === 1) + return "queries: multiple values"; + properties.queries = 1; + { + var error = $root.google.cloud.dataproc.v1.QueryList.verify(message.queryList); + if (error) + return "queryList." + error; + } + } + if (message.scriptVariables != null && message.hasOwnProperty("scriptVariables")) { + if (!$util.isObject(message.scriptVariables)) + return "scriptVariables: object expected"; + var key = Object.keys(message.scriptVariables); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.scriptVariables[key[i]])) + return "scriptVariables: string{k:string} expected"; + } + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!$util.isObject(message.properties)) + return "properties: object expected"; + var key = Object.keys(message.properties); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.properties[key[i]])) + return "properties: string{k:string} expected"; + } + if (message.jarFileUris != null && message.hasOwnProperty("jarFileUris")) { + if (!Array.isArray(message.jarFileUris)) + return "jarFileUris: array expected"; + for (var i = 0; i < message.jarFileUris.length; ++i) + if (!$util.isString(message.jarFileUris[i])) + return "jarFileUris: string[] expected"; + } + if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) { + var error = $root.google.cloud.dataproc.v1.LoggingConfig.verify(message.loggingConfig); + if (error) + return "loggingConfig." + error; + } + return null; + }; + + /** + * Creates a SparkSqlJob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.SparkSqlJob + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.SparkSqlJob} SparkSqlJob + */ + SparkSqlJob.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.SparkSqlJob) + return object; + var message = new $root.google.cloud.dataproc.v1.SparkSqlJob(); + if (object.queryFileUri != null) + message.queryFileUri = String(object.queryFileUri); + if (object.queryList != null) { + if (typeof object.queryList !== "object") + throw TypeError(".google.cloud.dataproc.v1.SparkSqlJob.queryList: object expected"); + message.queryList = $root.google.cloud.dataproc.v1.QueryList.fromObject(object.queryList); + } + if (object.scriptVariables) { + if (typeof object.scriptVariables !== "object") + throw TypeError(".google.cloud.dataproc.v1.SparkSqlJob.scriptVariables: object expected"); + message.scriptVariables = {}; + for (var keys = Object.keys(object.scriptVariables), i = 0; i < keys.length; ++i) + message.scriptVariables[keys[i]] = String(object.scriptVariables[keys[i]]); + } + if (object.properties) { + if (typeof object.properties !== "object") + throw TypeError(".google.cloud.dataproc.v1.SparkSqlJob.properties: object expected"); + message.properties = {}; + for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) + message.properties[keys[i]] = String(object.properties[keys[i]]); + } + if (object.jarFileUris) { + if (!Array.isArray(object.jarFileUris)) + throw TypeError(".google.cloud.dataproc.v1.SparkSqlJob.jarFileUris: array expected"); + message.jarFileUris = []; + for (var i = 0; i < object.jarFileUris.length; ++i) + message.jarFileUris[i] = String(object.jarFileUris[i]); + } + if (object.loggingConfig != null) { + if (typeof object.loggingConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.SparkSqlJob.loggingConfig: object expected"); + message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.fromObject(object.loggingConfig); + } + return message; + }; + + /** + * Creates a plain object from a SparkSqlJob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.SparkSqlJob + * @static + * @param {google.cloud.dataproc.v1.SparkSqlJob} message SparkSqlJob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SparkSqlJob.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.jarFileUris = []; + if (options.objects || options.defaults) { + object.scriptVariables = {}; + object.properties = {}; + } + if (options.defaults) + object.loggingConfig = null; + if (message.queryFileUri != null && message.hasOwnProperty("queryFileUri")) { + object.queryFileUri = message.queryFileUri; + if (options.oneofs) + object.queries = "queryFileUri"; + } + if (message.queryList != null && message.hasOwnProperty("queryList")) { + object.queryList = $root.google.cloud.dataproc.v1.QueryList.toObject(message.queryList, options); + if (options.oneofs) + object.queries = "queryList"; + } + var keys2; + if (message.scriptVariables && (keys2 = Object.keys(message.scriptVariables)).length) { + object.scriptVariables = {}; + for (var j = 0; j < keys2.length; ++j) + object.scriptVariables[keys2[j]] = message.scriptVariables[keys2[j]]; + } + if (message.properties && (keys2 = Object.keys(message.properties)).length) { + object.properties = {}; + for (var j = 0; j < keys2.length; ++j) + object.properties[keys2[j]] = message.properties[keys2[j]]; + } + if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) + object.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.toObject(message.loggingConfig, options); + if (message.jarFileUris && message.jarFileUris.length) { + object.jarFileUris = []; + for (var j = 0; j < message.jarFileUris.length; ++j) + object.jarFileUris[j] = message.jarFileUris[j]; + } + return object; + }; + + /** + * Converts this SparkSqlJob to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.SparkSqlJob + * @instance + * @returns {Object.} JSON object + */ + SparkSqlJob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SparkSqlJob + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.SparkSqlJob + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SparkSqlJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.SparkSqlJob"; + }; + + return SparkSqlJob; + })(); + + v1.PigJob = (function() { + + /** + * Properties of a PigJob. + * @memberof google.cloud.dataproc.v1 + * @interface IPigJob + * @property {string|null} [queryFileUri] PigJob queryFileUri + * @property {google.cloud.dataproc.v1.IQueryList|null} [queryList] PigJob queryList + * @property {boolean|null} [continueOnFailure] PigJob continueOnFailure + * @property {Object.|null} [scriptVariables] PigJob scriptVariables + * @property {Object.|null} [properties] PigJob properties + * @property {Array.|null} [jarFileUris] PigJob jarFileUris + * @property {google.cloud.dataproc.v1.ILoggingConfig|null} [loggingConfig] PigJob loggingConfig + */ + + /** + * Constructs a new PigJob. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a PigJob. + * @implements IPigJob + * @constructor + * @param {google.cloud.dataproc.v1.IPigJob=} [properties] Properties to set + */ + function PigJob(properties) { + this.scriptVariables = {}; + this.properties = {}; + this.jarFileUris = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PigJob queryFileUri. + * @member {string|null|undefined} queryFileUri + * @memberof google.cloud.dataproc.v1.PigJob + * @instance + */ + PigJob.prototype.queryFileUri = null; + + /** + * PigJob queryList. + * @member {google.cloud.dataproc.v1.IQueryList|null|undefined} queryList + * @memberof google.cloud.dataproc.v1.PigJob + * @instance + */ + PigJob.prototype.queryList = null; + + /** + * PigJob continueOnFailure. + * @member {boolean} continueOnFailure + * @memberof google.cloud.dataproc.v1.PigJob + * @instance + */ + PigJob.prototype.continueOnFailure = false; + + /** + * PigJob scriptVariables. + * @member {Object.} scriptVariables + * @memberof google.cloud.dataproc.v1.PigJob + * @instance + */ + PigJob.prototype.scriptVariables = $util.emptyObject; + + /** + * PigJob properties. + * @member {Object.} properties + * @memberof google.cloud.dataproc.v1.PigJob + * @instance + */ + PigJob.prototype.properties = $util.emptyObject; + + /** + * PigJob jarFileUris. + * @member {Array.} jarFileUris + * @memberof google.cloud.dataproc.v1.PigJob + * @instance + */ + PigJob.prototype.jarFileUris = $util.emptyArray; + + /** + * PigJob loggingConfig. + * @member {google.cloud.dataproc.v1.ILoggingConfig|null|undefined} loggingConfig + * @memberof google.cloud.dataproc.v1.PigJob + * @instance + */ + PigJob.prototype.loggingConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PigJob queries. + * @member {"queryFileUri"|"queryList"|undefined} queries + * @memberof google.cloud.dataproc.v1.PigJob + * @instance + */ + Object.defineProperty(PigJob.prototype, "queries", { + get: $util.oneOfGetter($oneOfFields = ["queryFileUri", "queryList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PigJob instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.PigJob + * @static + * @param {google.cloud.dataproc.v1.IPigJob=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.PigJob} PigJob instance + */ + PigJob.create = function create(properties) { + return new PigJob(properties); + }; + + /** + * Encodes the specified PigJob message. Does not implicitly {@link google.cloud.dataproc.v1.PigJob.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.PigJob + * @static + * @param {google.cloud.dataproc.v1.IPigJob} message PigJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PigJob.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.queryFileUri != null && Object.hasOwnProperty.call(message, "queryFileUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.queryFileUri); + if (message.queryList != null && Object.hasOwnProperty.call(message, "queryList")) + $root.google.cloud.dataproc.v1.QueryList.encode(message.queryList, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.continueOnFailure != null && Object.hasOwnProperty.call(message, "continueOnFailure")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.continueOnFailure); + if (message.scriptVariables != null && Object.hasOwnProperty.call(message, "scriptVariables")) + for (var keys = Object.keys(message.scriptVariables), 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.scriptVariables[keys[i]]).ldelim(); + if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) + for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.properties[keys[i]]).ldelim(); + if (message.jarFileUris != null && message.jarFileUris.length) + for (var i = 0; i < message.jarFileUris.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.jarFileUris[i]); + if (message.loggingConfig != null && Object.hasOwnProperty.call(message, "loggingConfig")) + $root.google.cloud.dataproc.v1.LoggingConfig.encode(message.loggingConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PigJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.PigJob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.PigJob + * @static + * @param {google.cloud.dataproc.v1.IPigJob} message PigJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PigJob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PigJob message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.PigJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.PigJob} PigJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PigJob.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.PigJob(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.queryFileUri = reader.string(); + break; + } + case 2: { + message.queryList = $root.google.cloud.dataproc.v1.QueryList.decode(reader, reader.uint32()); + break; + } + case 3: { + message.continueOnFailure = reader.bool(); + break; + } + case 4: { + if (message.scriptVariables === $util.emptyObject) + message.scriptVariables = {}; + 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.scriptVariables[key] = value; + break; + } + case 5: { + if (message.properties === $util.emptyObject) + message.properties = {}; + 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.properties[key] = value; + break; + } + case 6: { + if (!(message.jarFileUris && message.jarFileUris.length)) + message.jarFileUris = []; + message.jarFileUris.push(reader.string()); + break; + } + case 7: { + message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PigJob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.PigJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.PigJob} PigJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PigJob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PigJob message. + * @function verify + * @memberof google.cloud.dataproc.v1.PigJob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PigJob.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.queryFileUri != null && message.hasOwnProperty("queryFileUri")) { + properties.queries = 1; + if (!$util.isString(message.queryFileUri)) + return "queryFileUri: string expected"; + } + if (message.queryList != null && message.hasOwnProperty("queryList")) { + if (properties.queries === 1) + return "queries: multiple values"; + properties.queries = 1; + { + var error = $root.google.cloud.dataproc.v1.QueryList.verify(message.queryList); + if (error) + return "queryList." + error; + } + } + if (message.continueOnFailure != null && message.hasOwnProperty("continueOnFailure")) + if (typeof message.continueOnFailure !== "boolean") + return "continueOnFailure: boolean expected"; + if (message.scriptVariables != null && message.hasOwnProperty("scriptVariables")) { + if (!$util.isObject(message.scriptVariables)) + return "scriptVariables: object expected"; + var key = Object.keys(message.scriptVariables); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.scriptVariables[key[i]])) + return "scriptVariables: string{k:string} expected"; + } + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!$util.isObject(message.properties)) + return "properties: object expected"; + var key = Object.keys(message.properties); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.properties[key[i]])) + return "properties: string{k:string} expected"; + } + if (message.jarFileUris != null && message.hasOwnProperty("jarFileUris")) { + if (!Array.isArray(message.jarFileUris)) + return "jarFileUris: array expected"; + for (var i = 0; i < message.jarFileUris.length; ++i) + if (!$util.isString(message.jarFileUris[i])) + return "jarFileUris: string[] expected"; + } + if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) { + var error = $root.google.cloud.dataproc.v1.LoggingConfig.verify(message.loggingConfig); + if (error) + return "loggingConfig." + error; + } + return null; + }; + + /** + * Creates a PigJob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.PigJob + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.PigJob} PigJob + */ + PigJob.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.PigJob) + return object; + var message = new $root.google.cloud.dataproc.v1.PigJob(); + if (object.queryFileUri != null) + message.queryFileUri = String(object.queryFileUri); + if (object.queryList != null) { + if (typeof object.queryList !== "object") + throw TypeError(".google.cloud.dataproc.v1.PigJob.queryList: object expected"); + message.queryList = $root.google.cloud.dataproc.v1.QueryList.fromObject(object.queryList); + } + if (object.continueOnFailure != null) + message.continueOnFailure = Boolean(object.continueOnFailure); + if (object.scriptVariables) { + if (typeof object.scriptVariables !== "object") + throw TypeError(".google.cloud.dataproc.v1.PigJob.scriptVariables: object expected"); + message.scriptVariables = {}; + for (var keys = Object.keys(object.scriptVariables), i = 0; i < keys.length; ++i) + message.scriptVariables[keys[i]] = String(object.scriptVariables[keys[i]]); + } + if (object.properties) { + if (typeof object.properties !== "object") + throw TypeError(".google.cloud.dataproc.v1.PigJob.properties: object expected"); + message.properties = {}; + for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) + message.properties[keys[i]] = String(object.properties[keys[i]]); + } + if (object.jarFileUris) { + if (!Array.isArray(object.jarFileUris)) + throw TypeError(".google.cloud.dataproc.v1.PigJob.jarFileUris: array expected"); + message.jarFileUris = []; + for (var i = 0; i < object.jarFileUris.length; ++i) + message.jarFileUris[i] = String(object.jarFileUris[i]); + } + if (object.loggingConfig != null) { + if (typeof object.loggingConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.PigJob.loggingConfig: object expected"); + message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.fromObject(object.loggingConfig); + } + return message; + }; + + /** + * Creates a plain object from a PigJob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.PigJob + * @static + * @param {google.cloud.dataproc.v1.PigJob} message PigJob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PigJob.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.jarFileUris = []; + if (options.objects || options.defaults) { + object.scriptVariables = {}; + object.properties = {}; + } + if (options.defaults) { + object.continueOnFailure = false; + object.loggingConfig = null; + } + if (message.queryFileUri != null && message.hasOwnProperty("queryFileUri")) { + object.queryFileUri = message.queryFileUri; + if (options.oneofs) + object.queries = "queryFileUri"; + } + if (message.queryList != null && message.hasOwnProperty("queryList")) { + object.queryList = $root.google.cloud.dataproc.v1.QueryList.toObject(message.queryList, options); + if (options.oneofs) + object.queries = "queryList"; + } + if (message.continueOnFailure != null && message.hasOwnProperty("continueOnFailure")) + object.continueOnFailure = message.continueOnFailure; + var keys2; + if (message.scriptVariables && (keys2 = Object.keys(message.scriptVariables)).length) { + object.scriptVariables = {}; + for (var j = 0; j < keys2.length; ++j) + object.scriptVariables[keys2[j]] = message.scriptVariables[keys2[j]]; + } + if (message.properties && (keys2 = Object.keys(message.properties)).length) { + object.properties = {}; + for (var j = 0; j < keys2.length; ++j) + object.properties[keys2[j]] = message.properties[keys2[j]]; + } + if (message.jarFileUris && message.jarFileUris.length) { + object.jarFileUris = []; + for (var j = 0; j < message.jarFileUris.length; ++j) + object.jarFileUris[j] = message.jarFileUris[j]; + } + if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) + object.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.toObject(message.loggingConfig, options); + return object; + }; + + /** + * Converts this PigJob to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.PigJob + * @instance + * @returns {Object.} JSON object + */ + PigJob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PigJob + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.PigJob + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PigJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.PigJob"; + }; + + return PigJob; + })(); + + v1.SparkRJob = (function() { + + /** + * Properties of a SparkRJob. + * @memberof google.cloud.dataproc.v1 + * @interface ISparkRJob + * @property {string|null} [mainRFileUri] SparkRJob mainRFileUri + * @property {Array.|null} [args] SparkRJob args + * @property {Array.|null} [fileUris] SparkRJob fileUris + * @property {Array.|null} [archiveUris] SparkRJob archiveUris + * @property {Object.|null} [properties] SparkRJob properties + * @property {google.cloud.dataproc.v1.ILoggingConfig|null} [loggingConfig] SparkRJob loggingConfig + */ + + /** + * Constructs a new SparkRJob. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a SparkRJob. + * @implements ISparkRJob + * @constructor + * @param {google.cloud.dataproc.v1.ISparkRJob=} [properties] Properties to set + */ + function SparkRJob(properties) { + this.args = []; + this.fileUris = []; + this.archiveUris = []; + this.properties = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SparkRJob mainRFileUri. + * @member {string} mainRFileUri + * @memberof google.cloud.dataproc.v1.SparkRJob + * @instance + */ + SparkRJob.prototype.mainRFileUri = ""; + + /** + * SparkRJob args. + * @member {Array.} args + * @memberof google.cloud.dataproc.v1.SparkRJob + * @instance + */ + SparkRJob.prototype.args = $util.emptyArray; + + /** + * SparkRJob fileUris. + * @member {Array.} fileUris + * @memberof google.cloud.dataproc.v1.SparkRJob + * @instance + */ + SparkRJob.prototype.fileUris = $util.emptyArray; + + /** + * SparkRJob archiveUris. + * @member {Array.} archiveUris + * @memberof google.cloud.dataproc.v1.SparkRJob + * @instance + */ + SparkRJob.prototype.archiveUris = $util.emptyArray; + + /** + * SparkRJob properties. + * @member {Object.} properties + * @memberof google.cloud.dataproc.v1.SparkRJob + * @instance + */ + SparkRJob.prototype.properties = $util.emptyObject; + + /** + * SparkRJob loggingConfig. + * @member {google.cloud.dataproc.v1.ILoggingConfig|null|undefined} loggingConfig + * @memberof google.cloud.dataproc.v1.SparkRJob + * @instance + */ + SparkRJob.prototype.loggingConfig = null; + + /** + * Creates a new SparkRJob instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.SparkRJob + * @static + * @param {google.cloud.dataproc.v1.ISparkRJob=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.SparkRJob} SparkRJob instance + */ + SparkRJob.create = function create(properties) { + return new SparkRJob(properties); + }; + + /** + * Encodes the specified SparkRJob message. Does not implicitly {@link google.cloud.dataproc.v1.SparkRJob.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.SparkRJob + * @static + * @param {google.cloud.dataproc.v1.ISparkRJob} message SparkRJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SparkRJob.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mainRFileUri != null && Object.hasOwnProperty.call(message, "mainRFileUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mainRFileUri); + 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.fileUris != null && message.fileUris.length) + for (var i = 0; i < message.fileUris.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.fileUris[i]); + if (message.archiveUris != null && message.archiveUris.length) + for (var i = 0; i < message.archiveUris.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.archiveUris[i]); + if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) + for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.properties[keys[i]]).ldelim(); + if (message.loggingConfig != null && Object.hasOwnProperty.call(message, "loggingConfig")) + $root.google.cloud.dataproc.v1.LoggingConfig.encode(message.loggingConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SparkRJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SparkRJob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.SparkRJob + * @static + * @param {google.cloud.dataproc.v1.ISparkRJob} message SparkRJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SparkRJob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SparkRJob message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.SparkRJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.SparkRJob} SparkRJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SparkRJob.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.SparkRJob(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.mainRFileUri = reader.string(); + break; + } + case 2: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push(reader.string()); + break; + } + case 3: { + if (!(message.fileUris && message.fileUris.length)) + message.fileUris = []; + message.fileUris.push(reader.string()); + break; + } + case 4: { + if (!(message.archiveUris && message.archiveUris.length)) + message.archiveUris = []; + message.archiveUris.push(reader.string()); + break; + } + case 5: { + if (message.properties === $util.emptyObject) + message.properties = {}; + 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.properties[key] = value; + break; + } + case 6: { + message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SparkRJob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.SparkRJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.SparkRJob} SparkRJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SparkRJob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SparkRJob message. + * @function verify + * @memberof google.cloud.dataproc.v1.SparkRJob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SparkRJob.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mainRFileUri != null && message.hasOwnProperty("mainRFileUri")) + if (!$util.isString(message.mainRFileUri)) + return "mainRFileUri: 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.fileUris != null && message.hasOwnProperty("fileUris")) { + if (!Array.isArray(message.fileUris)) + return "fileUris: array expected"; + for (var i = 0; i < message.fileUris.length; ++i) + if (!$util.isString(message.fileUris[i])) + return "fileUris: string[] expected"; + } + if (message.archiveUris != null && message.hasOwnProperty("archiveUris")) { + if (!Array.isArray(message.archiveUris)) + return "archiveUris: array expected"; + for (var i = 0; i < message.archiveUris.length; ++i) + if (!$util.isString(message.archiveUris[i])) + return "archiveUris: string[] expected"; + } + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!$util.isObject(message.properties)) + return "properties: object expected"; + var key = Object.keys(message.properties); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.properties[key[i]])) + return "properties: string{k:string} expected"; + } + if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) { + var error = $root.google.cloud.dataproc.v1.LoggingConfig.verify(message.loggingConfig); + if (error) + return "loggingConfig." + error; + } + return null; + }; + + /** + * Creates a SparkRJob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.SparkRJob + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.SparkRJob} SparkRJob + */ + SparkRJob.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.SparkRJob) + return object; + var message = new $root.google.cloud.dataproc.v1.SparkRJob(); + if (object.mainRFileUri != null) + message.mainRFileUri = String(object.mainRFileUri); + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".google.cloud.dataproc.v1.SparkRJob.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) + message.args[i] = String(object.args[i]); + } + if (object.fileUris) { + if (!Array.isArray(object.fileUris)) + throw TypeError(".google.cloud.dataproc.v1.SparkRJob.fileUris: array expected"); + message.fileUris = []; + for (var i = 0; i < object.fileUris.length; ++i) + message.fileUris[i] = String(object.fileUris[i]); + } + if (object.archiveUris) { + if (!Array.isArray(object.archiveUris)) + throw TypeError(".google.cloud.dataproc.v1.SparkRJob.archiveUris: array expected"); + message.archiveUris = []; + for (var i = 0; i < object.archiveUris.length; ++i) + message.archiveUris[i] = String(object.archiveUris[i]); + } + if (object.properties) { + if (typeof object.properties !== "object") + throw TypeError(".google.cloud.dataproc.v1.SparkRJob.properties: object expected"); + message.properties = {}; + for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) + message.properties[keys[i]] = String(object.properties[keys[i]]); + } + if (object.loggingConfig != null) { + if (typeof object.loggingConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.SparkRJob.loggingConfig: object expected"); + message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.fromObject(object.loggingConfig); + } + return message; + }; + + /** + * Creates a plain object from a SparkRJob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.SparkRJob + * @static + * @param {google.cloud.dataproc.v1.SparkRJob} message SparkRJob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SparkRJob.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.args = []; + object.fileUris = []; + object.archiveUris = []; + } + if (options.objects || options.defaults) + object.properties = {}; + if (options.defaults) { + object.mainRFileUri = ""; + object.loggingConfig = null; + } + if (message.mainRFileUri != null && message.hasOwnProperty("mainRFileUri")) + object.mainRFileUri = message.mainRFileUri; + 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.fileUris && message.fileUris.length) { + object.fileUris = []; + for (var j = 0; j < message.fileUris.length; ++j) + object.fileUris[j] = message.fileUris[j]; + } + if (message.archiveUris && message.archiveUris.length) { + object.archiveUris = []; + for (var j = 0; j < message.archiveUris.length; ++j) + object.archiveUris[j] = message.archiveUris[j]; + } + var keys2; + if (message.properties && (keys2 = Object.keys(message.properties)).length) { + object.properties = {}; + for (var j = 0; j < keys2.length; ++j) + object.properties[keys2[j]] = message.properties[keys2[j]]; + } + if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) + object.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.toObject(message.loggingConfig, options); + return object; + }; + + /** + * Converts this SparkRJob to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.SparkRJob + * @instance + * @returns {Object.} JSON object + */ + SparkRJob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SparkRJob + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.SparkRJob + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SparkRJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.SparkRJob"; + }; + + return SparkRJob; + })(); + + v1.PrestoJob = (function() { + + /** + * Properties of a PrestoJob. + * @memberof google.cloud.dataproc.v1 + * @interface IPrestoJob + * @property {string|null} [queryFileUri] PrestoJob queryFileUri + * @property {google.cloud.dataproc.v1.IQueryList|null} [queryList] PrestoJob queryList + * @property {boolean|null} [continueOnFailure] PrestoJob continueOnFailure + * @property {string|null} [outputFormat] PrestoJob outputFormat + * @property {Array.|null} [clientTags] PrestoJob clientTags + * @property {Object.|null} [properties] PrestoJob properties + * @property {google.cloud.dataproc.v1.ILoggingConfig|null} [loggingConfig] PrestoJob loggingConfig + */ + + /** + * Constructs a new PrestoJob. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a PrestoJob. + * @implements IPrestoJob + * @constructor + * @param {google.cloud.dataproc.v1.IPrestoJob=} [properties] Properties to set + */ + function PrestoJob(properties) { + this.clientTags = []; + this.properties = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PrestoJob queryFileUri. + * @member {string|null|undefined} queryFileUri + * @memberof google.cloud.dataproc.v1.PrestoJob + * @instance + */ + PrestoJob.prototype.queryFileUri = null; + + /** + * PrestoJob queryList. + * @member {google.cloud.dataproc.v1.IQueryList|null|undefined} queryList + * @memberof google.cloud.dataproc.v1.PrestoJob + * @instance + */ + PrestoJob.prototype.queryList = null; + + /** + * PrestoJob continueOnFailure. + * @member {boolean} continueOnFailure + * @memberof google.cloud.dataproc.v1.PrestoJob + * @instance + */ + PrestoJob.prototype.continueOnFailure = false; + + /** + * PrestoJob outputFormat. + * @member {string} outputFormat + * @memberof google.cloud.dataproc.v1.PrestoJob + * @instance + */ + PrestoJob.prototype.outputFormat = ""; + + /** + * PrestoJob clientTags. + * @member {Array.} clientTags + * @memberof google.cloud.dataproc.v1.PrestoJob + * @instance + */ + PrestoJob.prototype.clientTags = $util.emptyArray; + + /** + * PrestoJob properties. + * @member {Object.} properties + * @memberof google.cloud.dataproc.v1.PrestoJob + * @instance + */ + PrestoJob.prototype.properties = $util.emptyObject; + + /** + * PrestoJob loggingConfig. + * @member {google.cloud.dataproc.v1.ILoggingConfig|null|undefined} loggingConfig + * @memberof google.cloud.dataproc.v1.PrestoJob + * @instance + */ + PrestoJob.prototype.loggingConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PrestoJob queries. + * @member {"queryFileUri"|"queryList"|undefined} queries + * @memberof google.cloud.dataproc.v1.PrestoJob + * @instance + */ + Object.defineProperty(PrestoJob.prototype, "queries", { + get: $util.oneOfGetter($oneOfFields = ["queryFileUri", "queryList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PrestoJob instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.PrestoJob + * @static + * @param {google.cloud.dataproc.v1.IPrestoJob=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.PrestoJob} PrestoJob instance + */ + PrestoJob.create = function create(properties) { + return new PrestoJob(properties); + }; + + /** + * Encodes the specified PrestoJob message. Does not implicitly {@link google.cloud.dataproc.v1.PrestoJob.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.PrestoJob + * @static + * @param {google.cloud.dataproc.v1.IPrestoJob} message PrestoJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrestoJob.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.queryFileUri != null && Object.hasOwnProperty.call(message, "queryFileUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.queryFileUri); + if (message.queryList != null && Object.hasOwnProperty.call(message, "queryList")) + $root.google.cloud.dataproc.v1.QueryList.encode(message.queryList, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.continueOnFailure != null && Object.hasOwnProperty.call(message, "continueOnFailure")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.continueOnFailure); + if (message.outputFormat != null && Object.hasOwnProperty.call(message, "outputFormat")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.outputFormat); + if (message.clientTags != null && message.clientTags.length) + for (var i = 0; i < message.clientTags.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.clientTags[i]); + if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) + for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.properties[keys[i]]).ldelim(); + if (message.loggingConfig != null && Object.hasOwnProperty.call(message, "loggingConfig")) + $root.google.cloud.dataproc.v1.LoggingConfig.encode(message.loggingConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PrestoJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.PrestoJob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.PrestoJob + * @static + * @param {google.cloud.dataproc.v1.IPrestoJob} message PrestoJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrestoJob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PrestoJob message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.PrestoJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.PrestoJob} PrestoJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrestoJob.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.PrestoJob(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.queryFileUri = reader.string(); + break; + } + case 2: { + message.queryList = $root.google.cloud.dataproc.v1.QueryList.decode(reader, reader.uint32()); + break; + } + case 3: { + message.continueOnFailure = reader.bool(); + break; + } + case 4: { + message.outputFormat = reader.string(); + break; + } + case 5: { + if (!(message.clientTags && message.clientTags.length)) + message.clientTags = []; + message.clientTags.push(reader.string()); + break; + } + case 6: { + if (message.properties === $util.emptyObject) + message.properties = {}; + 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.properties[key] = value; + break; + } + case 7: { + message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PrestoJob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.PrestoJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.PrestoJob} PrestoJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrestoJob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrestoJob message. + * @function verify + * @memberof google.cloud.dataproc.v1.PrestoJob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrestoJob.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.queryFileUri != null && message.hasOwnProperty("queryFileUri")) { + properties.queries = 1; + if (!$util.isString(message.queryFileUri)) + return "queryFileUri: string expected"; + } + if (message.queryList != null && message.hasOwnProperty("queryList")) { + if (properties.queries === 1) + return "queries: multiple values"; + properties.queries = 1; + { + var error = $root.google.cloud.dataproc.v1.QueryList.verify(message.queryList); + if (error) + return "queryList." + error; + } + } + if (message.continueOnFailure != null && message.hasOwnProperty("continueOnFailure")) + if (typeof message.continueOnFailure !== "boolean") + return "continueOnFailure: boolean expected"; + if (message.outputFormat != null && message.hasOwnProperty("outputFormat")) + if (!$util.isString(message.outputFormat)) + return "outputFormat: string expected"; + if (message.clientTags != null && message.hasOwnProperty("clientTags")) { + if (!Array.isArray(message.clientTags)) + return "clientTags: array expected"; + for (var i = 0; i < message.clientTags.length; ++i) + if (!$util.isString(message.clientTags[i])) + return "clientTags: string[] expected"; + } + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!$util.isObject(message.properties)) + return "properties: object expected"; + var key = Object.keys(message.properties); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.properties[key[i]])) + return "properties: string{k:string} expected"; + } + if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) { + var error = $root.google.cloud.dataproc.v1.LoggingConfig.verify(message.loggingConfig); + if (error) + return "loggingConfig." + error; + } + return null; + }; + + /** + * Creates a PrestoJob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.PrestoJob + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.PrestoJob} PrestoJob + */ + PrestoJob.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.PrestoJob) + return object; + var message = new $root.google.cloud.dataproc.v1.PrestoJob(); + if (object.queryFileUri != null) + message.queryFileUri = String(object.queryFileUri); + if (object.queryList != null) { + if (typeof object.queryList !== "object") + throw TypeError(".google.cloud.dataproc.v1.PrestoJob.queryList: object expected"); + message.queryList = $root.google.cloud.dataproc.v1.QueryList.fromObject(object.queryList); + } + if (object.continueOnFailure != null) + message.continueOnFailure = Boolean(object.continueOnFailure); + if (object.outputFormat != null) + message.outputFormat = String(object.outputFormat); + if (object.clientTags) { + if (!Array.isArray(object.clientTags)) + throw TypeError(".google.cloud.dataproc.v1.PrestoJob.clientTags: array expected"); + message.clientTags = []; + for (var i = 0; i < object.clientTags.length; ++i) + message.clientTags[i] = String(object.clientTags[i]); + } + if (object.properties) { + if (typeof object.properties !== "object") + throw TypeError(".google.cloud.dataproc.v1.PrestoJob.properties: object expected"); + message.properties = {}; + for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) + message.properties[keys[i]] = String(object.properties[keys[i]]); + } + if (object.loggingConfig != null) { + if (typeof object.loggingConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.PrestoJob.loggingConfig: object expected"); + message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.fromObject(object.loggingConfig); + } + return message; + }; + + /** + * Creates a plain object from a PrestoJob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.PrestoJob + * @static + * @param {google.cloud.dataproc.v1.PrestoJob} message PrestoJob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrestoJob.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.clientTags = []; + if (options.objects || options.defaults) + object.properties = {}; + if (options.defaults) { + object.continueOnFailure = false; + object.outputFormat = ""; + object.loggingConfig = null; + } + if (message.queryFileUri != null && message.hasOwnProperty("queryFileUri")) { + object.queryFileUri = message.queryFileUri; + if (options.oneofs) + object.queries = "queryFileUri"; + } + if (message.queryList != null && message.hasOwnProperty("queryList")) { + object.queryList = $root.google.cloud.dataproc.v1.QueryList.toObject(message.queryList, options); + if (options.oneofs) + object.queries = "queryList"; + } + if (message.continueOnFailure != null && message.hasOwnProperty("continueOnFailure")) + object.continueOnFailure = message.continueOnFailure; + if (message.outputFormat != null && message.hasOwnProperty("outputFormat")) + object.outputFormat = message.outputFormat; + if (message.clientTags && message.clientTags.length) { + object.clientTags = []; + for (var j = 0; j < message.clientTags.length; ++j) + object.clientTags[j] = message.clientTags[j]; + } + var keys2; + if (message.properties && (keys2 = Object.keys(message.properties)).length) { + object.properties = {}; + for (var j = 0; j < keys2.length; ++j) + object.properties[keys2[j]] = message.properties[keys2[j]]; + } + if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) + object.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.toObject(message.loggingConfig, options); + return object; + }; + + /** + * Converts this PrestoJob to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.PrestoJob + * @instance + * @returns {Object.} JSON object + */ + PrestoJob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PrestoJob + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.PrestoJob + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PrestoJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.PrestoJob"; + }; + + return PrestoJob; + })(); + + v1.TrinoJob = (function() { + + /** + * Properties of a TrinoJob. + * @memberof google.cloud.dataproc.v1 + * @interface ITrinoJob + * @property {string|null} [queryFileUri] TrinoJob queryFileUri + * @property {google.cloud.dataproc.v1.IQueryList|null} [queryList] TrinoJob queryList + * @property {boolean|null} [continueOnFailure] TrinoJob continueOnFailure + * @property {string|null} [outputFormat] TrinoJob outputFormat + * @property {Array.|null} [clientTags] TrinoJob clientTags + * @property {Object.|null} [properties] TrinoJob properties + * @property {google.cloud.dataproc.v1.ILoggingConfig|null} [loggingConfig] TrinoJob loggingConfig + */ + + /** + * Constructs a new TrinoJob. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a TrinoJob. + * @implements ITrinoJob + * @constructor + * @param {google.cloud.dataproc.v1.ITrinoJob=} [properties] Properties to set + */ + function TrinoJob(properties) { + this.clientTags = []; + this.properties = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TrinoJob queryFileUri. + * @member {string|null|undefined} queryFileUri + * @memberof google.cloud.dataproc.v1.TrinoJob + * @instance + */ + TrinoJob.prototype.queryFileUri = null; + + /** + * TrinoJob queryList. + * @member {google.cloud.dataproc.v1.IQueryList|null|undefined} queryList + * @memberof google.cloud.dataproc.v1.TrinoJob + * @instance + */ + TrinoJob.prototype.queryList = null; + + /** + * TrinoJob continueOnFailure. + * @member {boolean} continueOnFailure + * @memberof google.cloud.dataproc.v1.TrinoJob + * @instance + */ + TrinoJob.prototype.continueOnFailure = false; + + /** + * TrinoJob outputFormat. + * @member {string} outputFormat + * @memberof google.cloud.dataproc.v1.TrinoJob + * @instance + */ + TrinoJob.prototype.outputFormat = ""; + + /** + * TrinoJob clientTags. + * @member {Array.} clientTags + * @memberof google.cloud.dataproc.v1.TrinoJob + * @instance + */ + TrinoJob.prototype.clientTags = $util.emptyArray; + + /** + * TrinoJob properties. + * @member {Object.} properties + * @memberof google.cloud.dataproc.v1.TrinoJob + * @instance + */ + TrinoJob.prototype.properties = $util.emptyObject; + + /** + * TrinoJob loggingConfig. + * @member {google.cloud.dataproc.v1.ILoggingConfig|null|undefined} loggingConfig + * @memberof google.cloud.dataproc.v1.TrinoJob + * @instance + */ + TrinoJob.prototype.loggingConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TrinoJob queries. + * @member {"queryFileUri"|"queryList"|undefined} queries + * @memberof google.cloud.dataproc.v1.TrinoJob + * @instance + */ + Object.defineProperty(TrinoJob.prototype, "queries", { + get: $util.oneOfGetter($oneOfFields = ["queryFileUri", "queryList"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TrinoJob instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.TrinoJob + * @static + * @param {google.cloud.dataproc.v1.ITrinoJob=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.TrinoJob} TrinoJob instance + */ + TrinoJob.create = function create(properties) { + return new TrinoJob(properties); + }; + + /** + * Encodes the specified TrinoJob message. Does not implicitly {@link google.cloud.dataproc.v1.TrinoJob.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.TrinoJob + * @static + * @param {google.cloud.dataproc.v1.ITrinoJob} message TrinoJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrinoJob.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.queryFileUri != null && Object.hasOwnProperty.call(message, "queryFileUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.queryFileUri); + if (message.queryList != null && Object.hasOwnProperty.call(message, "queryList")) + $root.google.cloud.dataproc.v1.QueryList.encode(message.queryList, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.continueOnFailure != null && Object.hasOwnProperty.call(message, "continueOnFailure")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.continueOnFailure); + if (message.outputFormat != null && Object.hasOwnProperty.call(message, "outputFormat")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.outputFormat); + if (message.clientTags != null && message.clientTags.length) + for (var i = 0; i < message.clientTags.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.clientTags[i]); + if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) + for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.properties[keys[i]]).ldelim(); + if (message.loggingConfig != null && Object.hasOwnProperty.call(message, "loggingConfig")) + $root.google.cloud.dataproc.v1.LoggingConfig.encode(message.loggingConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TrinoJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.TrinoJob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.TrinoJob + * @static + * @param {google.cloud.dataproc.v1.ITrinoJob} message TrinoJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrinoJob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TrinoJob message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.TrinoJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.TrinoJob} TrinoJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrinoJob.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.TrinoJob(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.queryFileUri = reader.string(); + break; + } + case 2: { + message.queryList = $root.google.cloud.dataproc.v1.QueryList.decode(reader, reader.uint32()); + break; + } + case 3: { + message.continueOnFailure = reader.bool(); + break; + } + case 4: { + message.outputFormat = reader.string(); + break; + } + case 5: { + if (!(message.clientTags && message.clientTags.length)) + message.clientTags = []; + message.clientTags.push(reader.string()); + break; + } + case 6: { + if (message.properties === $util.emptyObject) + message.properties = {}; + 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.properties[key] = value; + break; + } + case 7: { + message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TrinoJob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.TrinoJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.TrinoJob} TrinoJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrinoJob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TrinoJob message. + * @function verify + * @memberof google.cloud.dataproc.v1.TrinoJob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TrinoJob.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.queryFileUri != null && message.hasOwnProperty("queryFileUri")) { + properties.queries = 1; + if (!$util.isString(message.queryFileUri)) + return "queryFileUri: string expected"; + } + if (message.queryList != null && message.hasOwnProperty("queryList")) { + if (properties.queries === 1) + return "queries: multiple values"; + properties.queries = 1; + { + var error = $root.google.cloud.dataproc.v1.QueryList.verify(message.queryList); + if (error) + return "queryList." + error; + } + } + if (message.continueOnFailure != null && message.hasOwnProperty("continueOnFailure")) + if (typeof message.continueOnFailure !== "boolean") + return "continueOnFailure: boolean expected"; + if (message.outputFormat != null && message.hasOwnProperty("outputFormat")) + if (!$util.isString(message.outputFormat)) + return "outputFormat: string expected"; + if (message.clientTags != null && message.hasOwnProperty("clientTags")) { + if (!Array.isArray(message.clientTags)) + return "clientTags: array expected"; + for (var i = 0; i < message.clientTags.length; ++i) + if (!$util.isString(message.clientTags[i])) + return "clientTags: string[] expected"; + } + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!$util.isObject(message.properties)) + return "properties: object expected"; + var key = Object.keys(message.properties); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.properties[key[i]])) + return "properties: string{k:string} expected"; + } + if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) { + var error = $root.google.cloud.dataproc.v1.LoggingConfig.verify(message.loggingConfig); + if (error) + return "loggingConfig." + error; + } + return null; + }; + + /** + * Creates a TrinoJob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.TrinoJob + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.TrinoJob} TrinoJob + */ + TrinoJob.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.TrinoJob) + return object; + var message = new $root.google.cloud.dataproc.v1.TrinoJob(); + if (object.queryFileUri != null) + message.queryFileUri = String(object.queryFileUri); + if (object.queryList != null) { + if (typeof object.queryList !== "object") + throw TypeError(".google.cloud.dataproc.v1.TrinoJob.queryList: object expected"); + message.queryList = $root.google.cloud.dataproc.v1.QueryList.fromObject(object.queryList); + } + if (object.continueOnFailure != null) + message.continueOnFailure = Boolean(object.continueOnFailure); + if (object.outputFormat != null) + message.outputFormat = String(object.outputFormat); + if (object.clientTags) { + if (!Array.isArray(object.clientTags)) + throw TypeError(".google.cloud.dataproc.v1.TrinoJob.clientTags: array expected"); + message.clientTags = []; + for (var i = 0; i < object.clientTags.length; ++i) + message.clientTags[i] = String(object.clientTags[i]); + } + if (object.properties) { + if (typeof object.properties !== "object") + throw TypeError(".google.cloud.dataproc.v1.TrinoJob.properties: object expected"); + message.properties = {}; + for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) + message.properties[keys[i]] = String(object.properties[keys[i]]); + } + if (object.loggingConfig != null) { + if (typeof object.loggingConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.TrinoJob.loggingConfig: object expected"); + message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.fromObject(object.loggingConfig); + } + return message; + }; + + /** + * Creates a plain object from a TrinoJob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.TrinoJob + * @static + * @param {google.cloud.dataproc.v1.TrinoJob} message TrinoJob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TrinoJob.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.clientTags = []; + if (options.objects || options.defaults) + object.properties = {}; + if (options.defaults) { + object.continueOnFailure = false; + object.outputFormat = ""; + object.loggingConfig = null; + } + if (message.queryFileUri != null && message.hasOwnProperty("queryFileUri")) { + object.queryFileUri = message.queryFileUri; + if (options.oneofs) + object.queries = "queryFileUri"; + } + if (message.queryList != null && message.hasOwnProperty("queryList")) { + object.queryList = $root.google.cloud.dataproc.v1.QueryList.toObject(message.queryList, options); + if (options.oneofs) + object.queries = "queryList"; + } + if (message.continueOnFailure != null && message.hasOwnProperty("continueOnFailure")) + object.continueOnFailure = message.continueOnFailure; + if (message.outputFormat != null && message.hasOwnProperty("outputFormat")) + object.outputFormat = message.outputFormat; + if (message.clientTags && message.clientTags.length) { + object.clientTags = []; + for (var j = 0; j < message.clientTags.length; ++j) + object.clientTags[j] = message.clientTags[j]; + } + var keys2; + if (message.properties && (keys2 = Object.keys(message.properties)).length) { + object.properties = {}; + for (var j = 0; j < keys2.length; ++j) + object.properties[keys2[j]] = message.properties[keys2[j]]; + } + if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) + object.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.toObject(message.loggingConfig, options); + return object; + }; + + /** + * Converts this TrinoJob to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.TrinoJob + * @instance + * @returns {Object.} JSON object + */ + TrinoJob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TrinoJob + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.TrinoJob + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TrinoJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.TrinoJob"; + }; + + return TrinoJob; + })(); + + v1.FlinkJob = (function() { + + /** + * Properties of a FlinkJob. + * @memberof google.cloud.dataproc.v1 + * @interface IFlinkJob + * @property {string|null} [mainJarFileUri] FlinkJob mainJarFileUri + * @property {string|null} [mainClass] FlinkJob mainClass + * @property {Array.|null} [args] FlinkJob args + * @property {Array.|null} [jarFileUris] FlinkJob jarFileUris + * @property {string|null} [savepointUri] FlinkJob savepointUri + * @property {Object.|null} [properties] FlinkJob properties + * @property {google.cloud.dataproc.v1.ILoggingConfig|null} [loggingConfig] FlinkJob loggingConfig + */ + + /** + * Constructs a new FlinkJob. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a FlinkJob. + * @implements IFlinkJob + * @constructor + * @param {google.cloud.dataproc.v1.IFlinkJob=} [properties] Properties to set + */ + function FlinkJob(properties) { + this.args = []; + this.jarFileUris = []; + this.properties = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FlinkJob mainJarFileUri. + * @member {string|null|undefined} mainJarFileUri + * @memberof google.cloud.dataproc.v1.FlinkJob + * @instance + */ + FlinkJob.prototype.mainJarFileUri = null; + + /** + * FlinkJob mainClass. + * @member {string|null|undefined} mainClass + * @memberof google.cloud.dataproc.v1.FlinkJob + * @instance + */ + FlinkJob.prototype.mainClass = null; + + /** + * FlinkJob args. + * @member {Array.} args + * @memberof google.cloud.dataproc.v1.FlinkJob + * @instance + */ + FlinkJob.prototype.args = $util.emptyArray; + + /** + * FlinkJob jarFileUris. + * @member {Array.} jarFileUris + * @memberof google.cloud.dataproc.v1.FlinkJob + * @instance + */ + FlinkJob.prototype.jarFileUris = $util.emptyArray; + + /** + * FlinkJob savepointUri. + * @member {string} savepointUri + * @memberof google.cloud.dataproc.v1.FlinkJob + * @instance + */ + FlinkJob.prototype.savepointUri = ""; + + /** + * FlinkJob properties. + * @member {Object.} properties + * @memberof google.cloud.dataproc.v1.FlinkJob + * @instance + */ + FlinkJob.prototype.properties = $util.emptyObject; + + /** + * FlinkJob loggingConfig. + * @member {google.cloud.dataproc.v1.ILoggingConfig|null|undefined} loggingConfig + * @memberof google.cloud.dataproc.v1.FlinkJob + * @instance + */ + FlinkJob.prototype.loggingConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FlinkJob driver. + * @member {"mainJarFileUri"|"mainClass"|undefined} driver + * @memberof google.cloud.dataproc.v1.FlinkJob + * @instance + */ + Object.defineProperty(FlinkJob.prototype, "driver", { + get: $util.oneOfGetter($oneOfFields = ["mainJarFileUri", "mainClass"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FlinkJob instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.FlinkJob + * @static + * @param {google.cloud.dataproc.v1.IFlinkJob=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.FlinkJob} FlinkJob instance + */ + FlinkJob.create = function create(properties) { + return new FlinkJob(properties); + }; + + /** + * Encodes the specified FlinkJob message. Does not implicitly {@link google.cloud.dataproc.v1.FlinkJob.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.FlinkJob + * @static + * @param {google.cloud.dataproc.v1.IFlinkJob} message FlinkJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FlinkJob.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mainJarFileUri != null && Object.hasOwnProperty.call(message, "mainJarFileUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mainJarFileUri); + if (message.mainClass != null && Object.hasOwnProperty.call(message, "mainClass")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mainClass); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.args[i]); + if (message.jarFileUris != null && message.jarFileUris.length) + for (var i = 0; i < message.jarFileUris.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.jarFileUris[i]); + if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) + for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.properties[keys[i]]).ldelim(); + if (message.loggingConfig != null && Object.hasOwnProperty.call(message, "loggingConfig")) + $root.google.cloud.dataproc.v1.LoggingConfig.encode(message.loggingConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.savepointUri != null && Object.hasOwnProperty.call(message, "savepointUri")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.savepointUri); + return writer; + }; + + /** + * Encodes the specified FlinkJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.FlinkJob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.FlinkJob + * @static + * @param {google.cloud.dataproc.v1.IFlinkJob} message FlinkJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FlinkJob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FlinkJob message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.FlinkJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.FlinkJob} FlinkJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FlinkJob.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.FlinkJob(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.mainJarFileUri = reader.string(); + break; + } + case 2: { + message.mainClass = reader.string(); + break; + } + case 3: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push(reader.string()); + break; + } + case 4: { + if (!(message.jarFileUris && message.jarFileUris.length)) + message.jarFileUris = []; + message.jarFileUris.push(reader.string()); + break; + } + case 9: { + message.savepointUri = reader.string(); + break; + } + case 7: { + if (message.properties === $util.emptyObject) + message.properties = {}; + 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.properties[key] = value; + break; + } + case 8: { + message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FlinkJob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.FlinkJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.FlinkJob} FlinkJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FlinkJob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FlinkJob message. + * @function verify + * @memberof google.cloud.dataproc.v1.FlinkJob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FlinkJob.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.mainJarFileUri != null && message.hasOwnProperty("mainJarFileUri")) { + properties.driver = 1; + if (!$util.isString(message.mainJarFileUri)) + return "mainJarFileUri: string expected"; + } + if (message.mainClass != null && message.hasOwnProperty("mainClass")) { + if (properties.driver === 1) + return "driver: multiple values"; + properties.driver = 1; + if (!$util.isString(message.mainClass)) + return "mainClass: 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.jarFileUris != null && message.hasOwnProperty("jarFileUris")) { + if (!Array.isArray(message.jarFileUris)) + return "jarFileUris: array expected"; + for (var i = 0; i < message.jarFileUris.length; ++i) + if (!$util.isString(message.jarFileUris[i])) + return "jarFileUris: string[] expected"; + } + if (message.savepointUri != null && message.hasOwnProperty("savepointUri")) + if (!$util.isString(message.savepointUri)) + return "savepointUri: string expected"; + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!$util.isObject(message.properties)) + return "properties: object expected"; + var key = Object.keys(message.properties); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.properties[key[i]])) + return "properties: string{k:string} expected"; + } + if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) { + var error = $root.google.cloud.dataproc.v1.LoggingConfig.verify(message.loggingConfig); + if (error) + return "loggingConfig." + error; + } + return null; + }; + + /** + * Creates a FlinkJob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.FlinkJob + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.FlinkJob} FlinkJob + */ + FlinkJob.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.FlinkJob) + return object; + var message = new $root.google.cloud.dataproc.v1.FlinkJob(); + if (object.mainJarFileUri != null) + message.mainJarFileUri = String(object.mainJarFileUri); + if (object.mainClass != null) + message.mainClass = String(object.mainClass); + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".google.cloud.dataproc.v1.FlinkJob.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) + message.args[i] = String(object.args[i]); + } + if (object.jarFileUris) { + if (!Array.isArray(object.jarFileUris)) + throw TypeError(".google.cloud.dataproc.v1.FlinkJob.jarFileUris: array expected"); + message.jarFileUris = []; + for (var i = 0; i < object.jarFileUris.length; ++i) + message.jarFileUris[i] = String(object.jarFileUris[i]); + } + if (object.savepointUri != null) + message.savepointUri = String(object.savepointUri); + if (object.properties) { + if (typeof object.properties !== "object") + throw TypeError(".google.cloud.dataproc.v1.FlinkJob.properties: object expected"); + message.properties = {}; + for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) + message.properties[keys[i]] = String(object.properties[keys[i]]); + } + if (object.loggingConfig != null) { + if (typeof object.loggingConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.FlinkJob.loggingConfig: object expected"); + message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.fromObject(object.loggingConfig); + } + return message; + }; + + /** + * Creates a plain object from a FlinkJob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.FlinkJob + * @static + * @param {google.cloud.dataproc.v1.FlinkJob} message FlinkJob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FlinkJob.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.args = []; + object.jarFileUris = []; + } + if (options.objects || options.defaults) + object.properties = {}; + if (options.defaults) { + object.loggingConfig = null; + object.savepointUri = ""; + } + if (message.mainJarFileUri != null && message.hasOwnProperty("mainJarFileUri")) { + object.mainJarFileUri = message.mainJarFileUri; + if (options.oneofs) + object.driver = "mainJarFileUri"; + } + if (message.mainClass != null && message.hasOwnProperty("mainClass")) { + object.mainClass = message.mainClass; + if (options.oneofs) + object.driver = "mainClass"; + } + 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.jarFileUris && message.jarFileUris.length) { + object.jarFileUris = []; + for (var j = 0; j < message.jarFileUris.length; ++j) + object.jarFileUris[j] = message.jarFileUris[j]; + } + var keys2; + if (message.properties && (keys2 = Object.keys(message.properties)).length) { + object.properties = {}; + for (var j = 0; j < keys2.length; ++j) + object.properties[keys2[j]] = message.properties[keys2[j]]; + } + if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) + object.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.toObject(message.loggingConfig, options); + if (message.savepointUri != null && message.hasOwnProperty("savepointUri")) + object.savepointUri = message.savepointUri; + return object; + }; + + /** + * Converts this FlinkJob to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.FlinkJob + * @instance + * @returns {Object.} JSON object + */ + FlinkJob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FlinkJob + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.FlinkJob + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FlinkJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.FlinkJob"; + }; + + return FlinkJob; + })(); + + v1.JobPlacement = (function() { + + /** + * Properties of a JobPlacement. + * @memberof google.cloud.dataproc.v1 + * @interface IJobPlacement + * @property {string|null} [clusterName] JobPlacement clusterName + * @property {string|null} [clusterUuid] JobPlacement clusterUuid + * @property {Object.|null} [clusterLabels] JobPlacement clusterLabels + */ + + /** + * Constructs a new JobPlacement. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a JobPlacement. + * @implements IJobPlacement + * @constructor + * @param {google.cloud.dataproc.v1.IJobPlacement=} [properties] Properties to set + */ + function JobPlacement(properties) { + this.clusterLabels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobPlacement clusterName. + * @member {string} clusterName + * @memberof google.cloud.dataproc.v1.JobPlacement + * @instance + */ + JobPlacement.prototype.clusterName = ""; + + /** + * JobPlacement clusterUuid. + * @member {string} clusterUuid + * @memberof google.cloud.dataproc.v1.JobPlacement + * @instance + */ + JobPlacement.prototype.clusterUuid = ""; + + /** + * JobPlacement clusterLabels. + * @member {Object.} clusterLabels + * @memberof google.cloud.dataproc.v1.JobPlacement + * @instance + */ + JobPlacement.prototype.clusterLabels = $util.emptyObject; + + /** + * Creates a new JobPlacement instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.JobPlacement + * @static + * @param {google.cloud.dataproc.v1.IJobPlacement=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.JobPlacement} JobPlacement instance + */ + JobPlacement.create = function create(properties) { + return new JobPlacement(properties); + }; + + /** + * Encodes the specified JobPlacement message. Does not implicitly {@link google.cloud.dataproc.v1.JobPlacement.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.JobPlacement + * @static + * @param {google.cloud.dataproc.v1.IJobPlacement} message JobPlacement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobPlacement.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clusterName); + if (message.clusterUuid != null && Object.hasOwnProperty.call(message, "clusterUuid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterUuid); + if (message.clusterLabels != null && Object.hasOwnProperty.call(message, "clusterLabels")) + for (var keys = Object.keys(message.clusterLabels), 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.clusterLabels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified JobPlacement message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.JobPlacement.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.JobPlacement + * @static + * @param {google.cloud.dataproc.v1.IJobPlacement} message JobPlacement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobPlacement.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobPlacement message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.JobPlacement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.JobPlacement} JobPlacement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobPlacement.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.JobPlacement(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.clusterName = reader.string(); + break; + } + case 2: { + message.clusterUuid = reader.string(); + break; + } + case 3: { + if (message.clusterLabels === $util.emptyObject) + message.clusterLabels = {}; + 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.clusterLabels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobPlacement message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.JobPlacement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.JobPlacement} JobPlacement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobPlacement.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobPlacement message. + * @function verify + * @memberof google.cloud.dataproc.v1.JobPlacement + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobPlacement.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + if (!$util.isString(message.clusterName)) + return "clusterName: string expected"; + if (message.clusterUuid != null && message.hasOwnProperty("clusterUuid")) + if (!$util.isString(message.clusterUuid)) + return "clusterUuid: string expected"; + if (message.clusterLabels != null && message.hasOwnProperty("clusterLabels")) { + if (!$util.isObject(message.clusterLabels)) + return "clusterLabels: object expected"; + var key = Object.keys(message.clusterLabels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.clusterLabels[key[i]])) + return "clusterLabels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a JobPlacement message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.JobPlacement + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.JobPlacement} JobPlacement + */ + JobPlacement.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.JobPlacement) + return object; + var message = new $root.google.cloud.dataproc.v1.JobPlacement(); + if (object.clusterName != null) + message.clusterName = String(object.clusterName); + if (object.clusterUuid != null) + message.clusterUuid = String(object.clusterUuid); + if (object.clusterLabels) { + if (typeof object.clusterLabels !== "object") + throw TypeError(".google.cloud.dataproc.v1.JobPlacement.clusterLabels: object expected"); + message.clusterLabels = {}; + for (var keys = Object.keys(object.clusterLabels), i = 0; i < keys.length; ++i) + message.clusterLabels[keys[i]] = String(object.clusterLabels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a JobPlacement message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.JobPlacement + * @static + * @param {google.cloud.dataproc.v1.JobPlacement} message JobPlacement + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobPlacement.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.clusterLabels = {}; + if (options.defaults) { + object.clusterName = ""; + object.clusterUuid = ""; + } + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + object.clusterName = message.clusterName; + if (message.clusterUuid != null && message.hasOwnProperty("clusterUuid")) + object.clusterUuid = message.clusterUuid; + var keys2; + if (message.clusterLabels && (keys2 = Object.keys(message.clusterLabels)).length) { + object.clusterLabels = {}; + for (var j = 0; j < keys2.length; ++j) + object.clusterLabels[keys2[j]] = message.clusterLabels[keys2[j]]; + } + return object; + }; + + /** + * Converts this JobPlacement to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.JobPlacement + * @instance + * @returns {Object.} JSON object + */ + JobPlacement.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobPlacement + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.JobPlacement + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobPlacement.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.JobPlacement"; + }; + + return JobPlacement; + })(); + + v1.JobStatus = (function() { + + /** + * Properties of a JobStatus. + * @memberof google.cloud.dataproc.v1 + * @interface IJobStatus + * @property {google.cloud.dataproc.v1.JobStatus.State|null} [state] JobStatus state + * @property {string|null} [details] JobStatus details + * @property {google.protobuf.ITimestamp|null} [stateStartTime] JobStatus stateStartTime + * @property {google.cloud.dataproc.v1.JobStatus.Substate|null} [substate] JobStatus substate + */ + + /** + * Constructs a new JobStatus. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a JobStatus. + * @implements IJobStatus + * @constructor + * @param {google.cloud.dataproc.v1.IJobStatus=} [properties] Properties to set + */ + function JobStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobStatus state. + * @member {google.cloud.dataproc.v1.JobStatus.State} state + * @memberof google.cloud.dataproc.v1.JobStatus + * @instance + */ + JobStatus.prototype.state = 0; + + /** + * JobStatus details. + * @member {string} details + * @memberof google.cloud.dataproc.v1.JobStatus + * @instance + */ + JobStatus.prototype.details = ""; + + /** + * JobStatus stateStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} stateStartTime + * @memberof google.cloud.dataproc.v1.JobStatus + * @instance + */ + JobStatus.prototype.stateStartTime = null; + + /** + * JobStatus substate. + * @member {google.cloud.dataproc.v1.JobStatus.Substate} substate + * @memberof google.cloud.dataproc.v1.JobStatus + * @instance + */ + JobStatus.prototype.substate = 0; + + /** + * Creates a new JobStatus instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.JobStatus + * @static + * @param {google.cloud.dataproc.v1.IJobStatus=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.JobStatus} JobStatus instance + */ + JobStatus.create = function create(properties) { + return new JobStatus(properties); + }; + + /** + * Encodes the specified JobStatus message. Does not implicitly {@link google.cloud.dataproc.v1.JobStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.JobStatus + * @static + * @param {google.cloud.dataproc.v1.IJobStatus} message JobStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.details != null && Object.hasOwnProperty.call(message, "details")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.details); + if (message.stateStartTime != null && Object.hasOwnProperty.call(message, "stateStartTime")) + $root.google.protobuf.Timestamp.encode(message.stateStartTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.substate != null && Object.hasOwnProperty.call(message, "substate")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.substate); + return writer; + }; + + /** + * Encodes the specified JobStatus message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.JobStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.JobStatus + * @static + * @param {google.cloud.dataproc.v1.IJobStatus} message JobStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.JobStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.JobStatus} JobStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobStatus.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.JobStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.details = reader.string(); + break; + } + case 6: { + message.stateStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.substate = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.JobStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.JobStatus} JobStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobStatus message. + * @function verify + * @memberof google.cloud.dataproc.v1.JobStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 8: + case 2: + case 3: + case 7: + case 4: + case 5: + case 6: + case 9: + break; + } + if (message.details != null && message.hasOwnProperty("details")) + if (!$util.isString(message.details)) + return "details: string expected"; + if (message.stateStartTime != null && message.hasOwnProperty("stateStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.stateStartTime); + if (error) + return "stateStartTime." + error; + } + if (message.substate != null && message.hasOwnProperty("substate")) + switch (message.substate) { + default: + return "substate: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a JobStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.JobStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.JobStatus} JobStatus + */ + JobStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.JobStatus) + return object; + var message = new $root.google.cloud.dataproc.v1.JobStatus(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING": + case 1: + message.state = 1; + break; + case "SETUP_DONE": + case 8: + message.state = 8; + break; + case "RUNNING": + case 2: + message.state = 2; + break; + case "CANCEL_PENDING": + case 3: + message.state = 3; + break; + case "CANCEL_STARTED": + case 7: + message.state = 7; + break; + case "CANCELLED": + case 4: + message.state = 4; + break; + case "DONE": + case 5: + message.state = 5; + break; + case "ERROR": + case 6: + message.state = 6; + break; + case "ATTEMPT_FAILURE": + case 9: + message.state = 9; + break; + } + if (object.details != null) + message.details = String(object.details); + if (object.stateStartTime != null) { + if (typeof object.stateStartTime !== "object") + throw TypeError(".google.cloud.dataproc.v1.JobStatus.stateStartTime: object expected"); + message.stateStartTime = $root.google.protobuf.Timestamp.fromObject(object.stateStartTime); + } + switch (object.substate) { + default: + if (typeof object.substate === "number") { + message.substate = object.substate; + break; + } + break; + case "UNSPECIFIED": + case 0: + message.substate = 0; + break; + case "SUBMITTED": + case 1: + message.substate = 1; + break; + case "QUEUED": + case 2: + message.substate = 2; + break; + case "STALE_STATUS": + case 3: + message.substate = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a JobStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.JobStatus + * @static + * @param {google.cloud.dataproc.v1.JobStatus} message JobStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.details = ""; + object.stateStartTime = null; + object.substate = options.enums === String ? "UNSPECIFIED" : 0; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.dataproc.v1.JobStatus.State[message.state] === undefined ? message.state : $root.google.cloud.dataproc.v1.JobStatus.State[message.state] : message.state; + if (message.details != null && message.hasOwnProperty("details")) + object.details = message.details; + if (message.stateStartTime != null && message.hasOwnProperty("stateStartTime")) + object.stateStartTime = $root.google.protobuf.Timestamp.toObject(message.stateStartTime, options); + if (message.substate != null && message.hasOwnProperty("substate")) + object.substate = options.enums === String ? $root.google.cloud.dataproc.v1.JobStatus.Substate[message.substate] === undefined ? message.substate : $root.google.cloud.dataproc.v1.JobStatus.Substate[message.substate] : message.substate; + return object; + }; + + /** + * Converts this JobStatus to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.JobStatus + * @instance + * @returns {Object.} JSON object + */ + JobStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobStatus + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.JobStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.JobStatus"; + }; + + /** + * State enum. + * @name google.cloud.dataproc.v1.JobStatus.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} SETUP_DONE=8 SETUP_DONE value + * @property {number} RUNNING=2 RUNNING value + * @property {number} CANCEL_PENDING=3 CANCEL_PENDING value + * @property {number} CANCEL_STARTED=7 CANCEL_STARTED value + * @property {number} CANCELLED=4 CANCELLED value + * @property {number} DONE=5 DONE value + * @property {number} ERROR=6 ERROR value + * @property {number} ATTEMPT_FAILURE=9 ATTEMPT_FAILURE value + */ + JobStatus.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[8] = "SETUP_DONE"] = 8; + values[valuesById[2] = "RUNNING"] = 2; + values[valuesById[3] = "CANCEL_PENDING"] = 3; + values[valuesById[7] = "CANCEL_STARTED"] = 7; + values[valuesById[4] = "CANCELLED"] = 4; + values[valuesById[5] = "DONE"] = 5; + values[valuesById[6] = "ERROR"] = 6; + values[valuesById[9] = "ATTEMPT_FAILURE"] = 9; + return values; + })(); + + /** + * Substate enum. + * @name google.cloud.dataproc.v1.JobStatus.Substate + * @enum {number} + * @property {number} UNSPECIFIED=0 UNSPECIFIED value + * @property {number} SUBMITTED=1 SUBMITTED value + * @property {number} QUEUED=2 QUEUED value + * @property {number} STALE_STATUS=3 STALE_STATUS value + */ + JobStatus.Substate = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNSPECIFIED"] = 0; + values[valuesById[1] = "SUBMITTED"] = 1; + values[valuesById[2] = "QUEUED"] = 2; + values[valuesById[3] = "STALE_STATUS"] = 3; + return values; + })(); + + return JobStatus; + })(); + + v1.JobReference = (function() { + + /** + * Properties of a JobReference. + * @memberof google.cloud.dataproc.v1 + * @interface IJobReference + * @property {string|null} [projectId] JobReference projectId + * @property {string|null} [jobId] JobReference jobId + */ + + /** + * Constructs a new JobReference. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a JobReference. + * @implements IJobReference + * @constructor + * @param {google.cloud.dataproc.v1.IJobReference=} [properties] Properties to set + */ + function JobReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobReference projectId. + * @member {string} projectId + * @memberof google.cloud.dataproc.v1.JobReference + * @instance + */ + JobReference.prototype.projectId = ""; + + /** + * JobReference jobId. + * @member {string} jobId + * @memberof google.cloud.dataproc.v1.JobReference + * @instance + */ + JobReference.prototype.jobId = ""; + + /** + * Creates a new JobReference instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.JobReference + * @static + * @param {google.cloud.dataproc.v1.IJobReference=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.JobReference} JobReference instance + */ + JobReference.create = function create(properties) { + return new JobReference(properties); + }; + + /** + * Encodes the specified JobReference message. Does not implicitly {@link google.cloud.dataproc.v1.JobReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.JobReference + * @static + * @param {google.cloud.dataproc.v1.IJobReference} message JobReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobId); + return writer; + }; + + /** + * Encodes the specified JobReference message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.JobReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.JobReference + * @static + * @param {google.cloud.dataproc.v1.IJobReference} message JobReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.JobReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.JobReference} JobReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobReference.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.JobReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.jobId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.JobReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.JobReference} JobReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobReference message. + * @function verify + * @memberof google.cloud.dataproc.v1.JobReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.jobId != null && message.hasOwnProperty("jobId")) + if (!$util.isString(message.jobId)) + return "jobId: string expected"; + return null; + }; + + /** + * Creates a JobReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.JobReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.JobReference} JobReference + */ + JobReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.JobReference) + return object; + var message = new $root.google.cloud.dataproc.v1.JobReference(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.jobId != null) + message.jobId = String(object.jobId); + return message; + }; + + /** + * Creates a plain object from a JobReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.JobReference + * @static + * @param {google.cloud.dataproc.v1.JobReference} message JobReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.jobId = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.jobId != null && message.hasOwnProperty("jobId")) + object.jobId = message.jobId; + return object; + }; + + /** + * Converts this JobReference to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.JobReference + * @instance + * @returns {Object.} JSON object + */ + JobReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobReference + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.JobReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.JobReference"; + }; + + return JobReference; + })(); + + v1.YarnApplication = (function() { + + /** + * Properties of a YarnApplication. + * @memberof google.cloud.dataproc.v1 + * @interface IYarnApplication + * @property {string|null} [name] YarnApplication name + * @property {google.cloud.dataproc.v1.YarnApplication.State|null} [state] YarnApplication state + * @property {number|null} [progress] YarnApplication progress + * @property {string|null} [trackingUrl] YarnApplication trackingUrl + */ + + /** + * Constructs a new YarnApplication. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a YarnApplication. + * @implements IYarnApplication + * @constructor + * @param {google.cloud.dataproc.v1.IYarnApplication=} [properties] Properties to set + */ + function YarnApplication(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * YarnApplication name. + * @member {string} name + * @memberof google.cloud.dataproc.v1.YarnApplication + * @instance + */ + YarnApplication.prototype.name = ""; + + /** + * YarnApplication state. + * @member {google.cloud.dataproc.v1.YarnApplication.State} state + * @memberof google.cloud.dataproc.v1.YarnApplication + * @instance + */ + YarnApplication.prototype.state = 0; + + /** + * YarnApplication progress. + * @member {number} progress + * @memberof google.cloud.dataproc.v1.YarnApplication + * @instance + */ + YarnApplication.prototype.progress = 0; + + /** + * YarnApplication trackingUrl. + * @member {string} trackingUrl + * @memberof google.cloud.dataproc.v1.YarnApplication + * @instance + */ + YarnApplication.prototype.trackingUrl = ""; + + /** + * Creates a new YarnApplication instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.YarnApplication + * @static + * @param {google.cloud.dataproc.v1.IYarnApplication=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.YarnApplication} YarnApplication instance + */ + YarnApplication.create = function create(properties) { + return new YarnApplication(properties); + }; + + /** + * Encodes the specified YarnApplication message. Does not implicitly {@link google.cloud.dataproc.v1.YarnApplication.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.YarnApplication + * @static + * @param {google.cloud.dataproc.v1.IYarnApplication} message YarnApplication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + YarnApplication.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.progress); + if (message.trackingUrl != null && Object.hasOwnProperty.call(message, "trackingUrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trackingUrl); + return writer; + }; + + /** + * Encodes the specified YarnApplication message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.YarnApplication.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.YarnApplication + * @static + * @param {google.cloud.dataproc.v1.IYarnApplication} message YarnApplication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + YarnApplication.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a YarnApplication message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.YarnApplication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.YarnApplication} YarnApplication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + YarnApplication.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.YarnApplication(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + case 3: { + message.progress = reader.float(); + break; + } + case 4: { + message.trackingUrl = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a YarnApplication message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.YarnApplication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.YarnApplication} YarnApplication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + YarnApplication.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a YarnApplication message. + * @function verify + * @memberof google.cloud.dataproc.v1.YarnApplication + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + YarnApplication.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + if (message.progress != null && message.hasOwnProperty("progress")) + if (typeof message.progress !== "number") + return "progress: number expected"; + if (message.trackingUrl != null && message.hasOwnProperty("trackingUrl")) + if (!$util.isString(message.trackingUrl)) + return "trackingUrl: string expected"; + return null; + }; + + /** + * Creates a YarnApplication message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.YarnApplication + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.YarnApplication} YarnApplication + */ + YarnApplication.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.YarnApplication) + return object; + var message = new $root.google.cloud.dataproc.v1.YarnApplication(); + if (object.name != null) + message.name = String(object.name); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "NEW": + case 1: + message.state = 1; + break; + case "NEW_SAVING": + case 2: + message.state = 2; + break; + case "SUBMITTED": + case 3: + message.state = 3; + break; + case "ACCEPTED": + case 4: + message.state = 4; + break; + case "RUNNING": + case 5: + message.state = 5; + break; + case "FINISHED": + case 6: + message.state = 6; + break; + case "FAILED": + case 7: + message.state = 7; + break; + case "KILLED": + case 8: + message.state = 8; + break; + } + if (object.progress != null) + message.progress = Number(object.progress); + if (object.trackingUrl != null) + message.trackingUrl = String(object.trackingUrl); + return message; + }; + + /** + * Creates a plain object from a YarnApplication message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.YarnApplication + * @static + * @param {google.cloud.dataproc.v1.YarnApplication} message YarnApplication + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + YarnApplication.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.progress = 0; + object.trackingUrl = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.dataproc.v1.YarnApplication.State[message.state] === undefined ? message.state : $root.google.cloud.dataproc.v1.YarnApplication.State[message.state] : message.state; + if (message.progress != null && message.hasOwnProperty("progress")) + object.progress = options.json && !isFinite(message.progress) ? String(message.progress) : message.progress; + if (message.trackingUrl != null && message.hasOwnProperty("trackingUrl")) + object.trackingUrl = message.trackingUrl; + return object; + }; + + /** + * Converts this YarnApplication to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.YarnApplication + * @instance + * @returns {Object.} JSON object + */ + YarnApplication.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for YarnApplication + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.YarnApplication + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + YarnApplication.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.YarnApplication"; + }; + + /** + * State enum. + * @name google.cloud.dataproc.v1.YarnApplication.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} NEW=1 NEW value + * @property {number} NEW_SAVING=2 NEW_SAVING value + * @property {number} SUBMITTED=3 SUBMITTED value + * @property {number} ACCEPTED=4 ACCEPTED value + * @property {number} RUNNING=5 RUNNING value + * @property {number} FINISHED=6 FINISHED value + * @property {number} FAILED=7 FAILED value + * @property {number} KILLED=8 KILLED value + */ + YarnApplication.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NEW"] = 1; + values[valuesById[2] = "NEW_SAVING"] = 2; + values[valuesById[3] = "SUBMITTED"] = 3; + values[valuesById[4] = "ACCEPTED"] = 4; + values[valuesById[5] = "RUNNING"] = 5; + values[valuesById[6] = "FINISHED"] = 6; + values[valuesById[7] = "FAILED"] = 7; + values[valuesById[8] = "KILLED"] = 8; + return values; + })(); + + return YarnApplication; + })(); + + v1.Job = (function() { + + /** + * Properties of a Job. + * @memberof google.cloud.dataproc.v1 + * @interface IJob + * @property {google.cloud.dataproc.v1.IJobReference|null} [reference] Job reference + * @property {google.cloud.dataproc.v1.IJobPlacement|null} [placement] Job placement + * @property {google.cloud.dataproc.v1.IHadoopJob|null} [hadoopJob] Job hadoopJob + * @property {google.cloud.dataproc.v1.ISparkJob|null} [sparkJob] Job sparkJob + * @property {google.cloud.dataproc.v1.IPySparkJob|null} [pysparkJob] Job pysparkJob + * @property {google.cloud.dataproc.v1.IHiveJob|null} [hiveJob] Job hiveJob + * @property {google.cloud.dataproc.v1.IPigJob|null} [pigJob] Job pigJob + * @property {google.cloud.dataproc.v1.ISparkRJob|null} [sparkRJob] Job sparkRJob + * @property {google.cloud.dataproc.v1.ISparkSqlJob|null} [sparkSqlJob] Job sparkSqlJob + * @property {google.cloud.dataproc.v1.IPrestoJob|null} [prestoJob] Job prestoJob + * @property {google.cloud.dataproc.v1.ITrinoJob|null} [trinoJob] Job trinoJob + * @property {google.cloud.dataproc.v1.IFlinkJob|null} [flinkJob] Job flinkJob + * @property {google.cloud.dataproc.v1.IJobStatus|null} [status] Job status + * @property {Array.|null} [statusHistory] Job statusHistory + * @property {Array.|null} [yarnApplications] Job yarnApplications + * @property {string|null} [driverOutputResourceUri] Job driverOutputResourceUri + * @property {string|null} [driverControlFilesUri] Job driverControlFilesUri + * @property {Object.|null} [labels] Job labels + * @property {google.cloud.dataproc.v1.IJobScheduling|null} [scheduling] Job scheduling + * @property {string|null} [jobUuid] Job jobUuid + * @property {boolean|null} [done] Job done + * @property {google.cloud.dataproc.v1.IDriverSchedulingConfig|null} [driverSchedulingConfig] Job driverSchedulingConfig + */ + + /** + * Constructs a new Job. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a Job. + * @implements IJob + * @constructor + * @param {google.cloud.dataproc.v1.IJob=} [properties] Properties to set + */ + function Job(properties) { + this.statusHistory = []; + this.yarnApplications = []; + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Job reference. + * @member {google.cloud.dataproc.v1.IJobReference|null|undefined} reference + * @memberof google.cloud.dataproc.v1.Job + * @instance + */ + Job.prototype.reference = null; + + /** + * Job placement. + * @member {google.cloud.dataproc.v1.IJobPlacement|null|undefined} placement + * @memberof google.cloud.dataproc.v1.Job + * @instance + */ + Job.prototype.placement = null; + + /** + * Job hadoopJob. + * @member {google.cloud.dataproc.v1.IHadoopJob|null|undefined} hadoopJob + * @memberof google.cloud.dataproc.v1.Job + * @instance + */ + Job.prototype.hadoopJob = null; + + /** + * Job sparkJob. + * @member {google.cloud.dataproc.v1.ISparkJob|null|undefined} sparkJob + * @memberof google.cloud.dataproc.v1.Job + * @instance + */ + Job.prototype.sparkJob = null; + + /** + * Job pysparkJob. + * @member {google.cloud.dataproc.v1.IPySparkJob|null|undefined} pysparkJob + * @memberof google.cloud.dataproc.v1.Job + * @instance + */ + Job.prototype.pysparkJob = null; + + /** + * Job hiveJob. + * @member {google.cloud.dataproc.v1.IHiveJob|null|undefined} hiveJob + * @memberof google.cloud.dataproc.v1.Job + * @instance + */ + Job.prototype.hiveJob = null; + + /** + * Job pigJob. + * @member {google.cloud.dataproc.v1.IPigJob|null|undefined} pigJob + * @memberof google.cloud.dataproc.v1.Job + * @instance + */ + Job.prototype.pigJob = null; + + /** + * Job sparkRJob. + * @member {google.cloud.dataproc.v1.ISparkRJob|null|undefined} sparkRJob + * @memberof google.cloud.dataproc.v1.Job + * @instance + */ + Job.prototype.sparkRJob = null; + + /** + * Job sparkSqlJob. + * @member {google.cloud.dataproc.v1.ISparkSqlJob|null|undefined} sparkSqlJob + * @memberof google.cloud.dataproc.v1.Job + * @instance + */ + Job.prototype.sparkSqlJob = null; + + /** + * Job prestoJob. + * @member {google.cloud.dataproc.v1.IPrestoJob|null|undefined} prestoJob + * @memberof google.cloud.dataproc.v1.Job + * @instance + */ + Job.prototype.prestoJob = null; + + /** + * Job trinoJob. + * @member {google.cloud.dataproc.v1.ITrinoJob|null|undefined} trinoJob + * @memberof google.cloud.dataproc.v1.Job + * @instance + */ + Job.prototype.trinoJob = null; + + /** + * Job flinkJob. + * @member {google.cloud.dataproc.v1.IFlinkJob|null|undefined} flinkJob + * @memberof google.cloud.dataproc.v1.Job + * @instance + */ + Job.prototype.flinkJob = null; + + /** + * Job status. + * @member {google.cloud.dataproc.v1.IJobStatus|null|undefined} status + * @memberof google.cloud.dataproc.v1.Job + * @instance + */ + Job.prototype.status = null; + + /** + * Job statusHistory. + * @member {Array.} statusHistory + * @memberof google.cloud.dataproc.v1.Job + * @instance + */ + Job.prototype.statusHistory = $util.emptyArray; + + /** + * Job yarnApplications. + * @member {Array.} yarnApplications + * @memberof google.cloud.dataproc.v1.Job + * @instance + */ + Job.prototype.yarnApplications = $util.emptyArray; + + /** + * Job driverOutputResourceUri. + * @member {string} driverOutputResourceUri + * @memberof google.cloud.dataproc.v1.Job + * @instance + */ + Job.prototype.driverOutputResourceUri = ""; + + /** + * Job driverControlFilesUri. + * @member {string} driverControlFilesUri + * @memberof google.cloud.dataproc.v1.Job + * @instance + */ + Job.prototype.driverControlFilesUri = ""; + + /** + * Job labels. + * @member {Object.} labels + * @memberof google.cloud.dataproc.v1.Job + * @instance + */ + Job.prototype.labels = $util.emptyObject; + + /** + * Job scheduling. + * @member {google.cloud.dataproc.v1.IJobScheduling|null|undefined} scheduling + * @memberof google.cloud.dataproc.v1.Job + * @instance + */ + Job.prototype.scheduling = null; + + /** + * Job jobUuid. + * @member {string} jobUuid + * @memberof google.cloud.dataproc.v1.Job + * @instance + */ + Job.prototype.jobUuid = ""; + + /** + * Job done. + * @member {boolean} done + * @memberof google.cloud.dataproc.v1.Job + * @instance + */ + Job.prototype.done = false; + + /** + * Job driverSchedulingConfig. + * @member {google.cloud.dataproc.v1.IDriverSchedulingConfig|null|undefined} driverSchedulingConfig + * @memberof google.cloud.dataproc.v1.Job + * @instance + */ + Job.prototype.driverSchedulingConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Job typeJob. + * @member {"hadoopJob"|"sparkJob"|"pysparkJob"|"hiveJob"|"pigJob"|"sparkRJob"|"sparkSqlJob"|"prestoJob"|"trinoJob"|"flinkJob"|undefined} typeJob + * @memberof google.cloud.dataproc.v1.Job + * @instance + */ + Object.defineProperty(Job.prototype, "typeJob", { + get: $util.oneOfGetter($oneOfFields = ["hadoopJob", "sparkJob", "pysparkJob", "hiveJob", "pigJob", "sparkRJob", "sparkSqlJob", "prestoJob", "trinoJob", "flinkJob"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Job instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.Job + * @static + * @param {google.cloud.dataproc.v1.IJob=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.Job} Job instance + */ + Job.create = function create(properties) { + return new Job(properties); + }; + + /** + * Encodes the specified Job message. Does not implicitly {@link google.cloud.dataproc.v1.Job.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.Job + * @static + * @param {google.cloud.dataproc.v1.IJob} message Job message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Job.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.reference != null && Object.hasOwnProperty.call(message, "reference")) + $root.google.cloud.dataproc.v1.JobReference.encode(message.reference, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.placement != null && Object.hasOwnProperty.call(message, "placement")) + $root.google.cloud.dataproc.v1.JobPlacement.encode(message.placement, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.hadoopJob != null && Object.hasOwnProperty.call(message, "hadoopJob")) + $root.google.cloud.dataproc.v1.HadoopJob.encode(message.hadoopJob, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.sparkJob != null && Object.hasOwnProperty.call(message, "sparkJob")) + $root.google.cloud.dataproc.v1.SparkJob.encode(message.sparkJob, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.pysparkJob != null && Object.hasOwnProperty.call(message, "pysparkJob")) + $root.google.cloud.dataproc.v1.PySparkJob.encode(message.pysparkJob, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.hiveJob != null && Object.hasOwnProperty.call(message, "hiveJob")) + $root.google.cloud.dataproc.v1.HiveJob.encode(message.hiveJob, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.pigJob != null && Object.hasOwnProperty.call(message, "pigJob")) + $root.google.cloud.dataproc.v1.PigJob.encode(message.pigJob, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.cloud.dataproc.v1.JobStatus.encode(message.status, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.yarnApplications != null && message.yarnApplications.length) + for (var i = 0; i < message.yarnApplications.length; ++i) + $root.google.cloud.dataproc.v1.YarnApplication.encode(message.yarnApplications[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.sparkSqlJob != null && Object.hasOwnProperty.call(message, "sparkSqlJob")) + $root.google.cloud.dataproc.v1.SparkSqlJob.encode(message.sparkSqlJob, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.statusHistory != null && message.statusHistory.length) + for (var i = 0; i < message.statusHistory.length; ++i) + $root.google.cloud.dataproc.v1.JobStatus.encode(message.statusHistory[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.driverControlFilesUri != null && Object.hasOwnProperty.call(message, "driverControlFilesUri")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.driverControlFilesUri); + if (message.driverOutputResourceUri != null && Object.hasOwnProperty.call(message, "driverOutputResourceUri")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.driverOutputResourceUri); + 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 18, wireType 2 =*/146).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.scheduling != null && Object.hasOwnProperty.call(message, "scheduling")) + $root.google.cloud.dataproc.v1.JobScheduling.encode(message.scheduling, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.sparkRJob != null && Object.hasOwnProperty.call(message, "sparkRJob")) + $root.google.cloud.dataproc.v1.SparkRJob.encode(message.sparkRJob, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.jobUuid != null && Object.hasOwnProperty.call(message, "jobUuid")) + writer.uint32(/* id 22, wireType 2 =*/178).string(message.jobUuid); + if (message.prestoJob != null && Object.hasOwnProperty.call(message, "prestoJob")) + $root.google.cloud.dataproc.v1.PrestoJob.encode(message.prestoJob, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 24, wireType 0 =*/192).bool(message.done); + if (message.driverSchedulingConfig != null && Object.hasOwnProperty.call(message, "driverSchedulingConfig")) + $root.google.cloud.dataproc.v1.DriverSchedulingConfig.encode(message.driverSchedulingConfig, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.trinoJob != null && Object.hasOwnProperty.call(message, "trinoJob")) + $root.google.cloud.dataproc.v1.TrinoJob.encode(message.trinoJob, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.flinkJob != null && Object.hasOwnProperty.call(message, "flinkJob")) + $root.google.cloud.dataproc.v1.FlinkJob.encode(message.flinkJob, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.Job.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.Job + * @static + * @param {google.cloud.dataproc.v1.IJob} message Job message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Job.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Job message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.Job + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.Job} Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Job.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.Job(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.reference = $root.google.cloud.dataproc.v1.JobReference.decode(reader, reader.uint32()); + break; + } + case 2: { + message.placement = $root.google.cloud.dataproc.v1.JobPlacement.decode(reader, reader.uint32()); + break; + } + case 3: { + message.hadoopJob = $root.google.cloud.dataproc.v1.HadoopJob.decode(reader, reader.uint32()); + break; + } + case 4: { + message.sparkJob = $root.google.cloud.dataproc.v1.SparkJob.decode(reader, reader.uint32()); + break; + } + case 5: { + message.pysparkJob = $root.google.cloud.dataproc.v1.PySparkJob.decode(reader, reader.uint32()); + break; + } + case 6: { + message.hiveJob = $root.google.cloud.dataproc.v1.HiveJob.decode(reader, reader.uint32()); + break; + } + case 7: { + message.pigJob = $root.google.cloud.dataproc.v1.PigJob.decode(reader, reader.uint32()); + break; + } + case 21: { + message.sparkRJob = $root.google.cloud.dataproc.v1.SparkRJob.decode(reader, reader.uint32()); + break; + } + case 12: { + message.sparkSqlJob = $root.google.cloud.dataproc.v1.SparkSqlJob.decode(reader, reader.uint32()); + break; + } + case 23: { + message.prestoJob = $root.google.cloud.dataproc.v1.PrestoJob.decode(reader, reader.uint32()); + break; + } + case 28: { + message.trinoJob = $root.google.cloud.dataproc.v1.TrinoJob.decode(reader, reader.uint32()); + break; + } + case 29: { + message.flinkJob = $root.google.cloud.dataproc.v1.FlinkJob.decode(reader, reader.uint32()); + break; + } + case 8: { + message.status = $root.google.cloud.dataproc.v1.JobStatus.decode(reader, reader.uint32()); + break; + } + case 13: { + if (!(message.statusHistory && message.statusHistory.length)) + message.statusHistory = []; + message.statusHistory.push($root.google.cloud.dataproc.v1.JobStatus.decode(reader, reader.uint32())); + break; + } + case 9: { + if (!(message.yarnApplications && message.yarnApplications.length)) + message.yarnApplications = []; + message.yarnApplications.push($root.google.cloud.dataproc.v1.YarnApplication.decode(reader, reader.uint32())); + break; + } + case 17: { + message.driverOutputResourceUri = reader.string(); + break; + } + case 15: { + message.driverControlFilesUri = reader.string(); + break; + } + case 18: { + 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 20: { + message.scheduling = $root.google.cloud.dataproc.v1.JobScheduling.decode(reader, reader.uint32()); + break; + } + case 22: { + message.jobUuid = reader.string(); + break; + } + case 24: { + message.done = reader.bool(); + break; + } + case 27: { + message.driverSchedulingConfig = $root.google.cloud.dataproc.v1.DriverSchedulingConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Job message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.Job + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.Job} Job + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Job.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Job message. + * @function verify + * @memberof google.cloud.dataproc.v1.Job + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Job.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.reference != null && message.hasOwnProperty("reference")) { + var error = $root.google.cloud.dataproc.v1.JobReference.verify(message.reference); + if (error) + return "reference." + error; + } + if (message.placement != null && message.hasOwnProperty("placement")) { + var error = $root.google.cloud.dataproc.v1.JobPlacement.verify(message.placement); + if (error) + return "placement." + error; + } + if (message.hadoopJob != null && message.hasOwnProperty("hadoopJob")) { + properties.typeJob = 1; + { + var error = $root.google.cloud.dataproc.v1.HadoopJob.verify(message.hadoopJob); + if (error) + return "hadoopJob." + error; + } + } + if (message.sparkJob != null && message.hasOwnProperty("sparkJob")) { + if (properties.typeJob === 1) + return "typeJob: multiple values"; + properties.typeJob = 1; + { + var error = $root.google.cloud.dataproc.v1.SparkJob.verify(message.sparkJob); + if (error) + return "sparkJob." + error; + } + } + if (message.pysparkJob != null && message.hasOwnProperty("pysparkJob")) { + if (properties.typeJob === 1) + return "typeJob: multiple values"; + properties.typeJob = 1; + { + var error = $root.google.cloud.dataproc.v1.PySparkJob.verify(message.pysparkJob); + if (error) + return "pysparkJob." + error; + } + } + if (message.hiveJob != null && message.hasOwnProperty("hiveJob")) { + if (properties.typeJob === 1) + return "typeJob: multiple values"; + properties.typeJob = 1; + { + var error = $root.google.cloud.dataproc.v1.HiveJob.verify(message.hiveJob); + if (error) + return "hiveJob." + error; + } + } + if (message.pigJob != null && message.hasOwnProperty("pigJob")) { + if (properties.typeJob === 1) + return "typeJob: multiple values"; + properties.typeJob = 1; + { + var error = $root.google.cloud.dataproc.v1.PigJob.verify(message.pigJob); + if (error) + return "pigJob." + error; + } + } + if (message.sparkRJob != null && message.hasOwnProperty("sparkRJob")) { + if (properties.typeJob === 1) + return "typeJob: multiple values"; + properties.typeJob = 1; + { + var error = $root.google.cloud.dataproc.v1.SparkRJob.verify(message.sparkRJob); + if (error) + return "sparkRJob." + error; + } + } + if (message.sparkSqlJob != null && message.hasOwnProperty("sparkSqlJob")) { + if (properties.typeJob === 1) + return "typeJob: multiple values"; + properties.typeJob = 1; + { + var error = $root.google.cloud.dataproc.v1.SparkSqlJob.verify(message.sparkSqlJob); + if (error) + return "sparkSqlJob." + error; + } + } + if (message.prestoJob != null && message.hasOwnProperty("prestoJob")) { + if (properties.typeJob === 1) + return "typeJob: multiple values"; + properties.typeJob = 1; + { + var error = $root.google.cloud.dataproc.v1.PrestoJob.verify(message.prestoJob); + if (error) + return "prestoJob." + error; + } + } + if (message.trinoJob != null && message.hasOwnProperty("trinoJob")) { + if (properties.typeJob === 1) + return "typeJob: multiple values"; + properties.typeJob = 1; + { + var error = $root.google.cloud.dataproc.v1.TrinoJob.verify(message.trinoJob); + if (error) + return "trinoJob." + error; + } + } + if (message.flinkJob != null && message.hasOwnProperty("flinkJob")) { + if (properties.typeJob === 1) + return "typeJob: multiple values"; + properties.typeJob = 1; + { + var error = $root.google.cloud.dataproc.v1.FlinkJob.verify(message.flinkJob); + if (error) + return "flinkJob." + error; + } + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.cloud.dataproc.v1.JobStatus.verify(message.status); + if (error) + return "status." + error; + } + if (message.statusHistory != null && message.hasOwnProperty("statusHistory")) { + if (!Array.isArray(message.statusHistory)) + return "statusHistory: array expected"; + for (var i = 0; i < message.statusHistory.length; ++i) { + var error = $root.google.cloud.dataproc.v1.JobStatus.verify(message.statusHistory[i]); + if (error) + return "statusHistory." + error; + } + } + if (message.yarnApplications != null && message.hasOwnProperty("yarnApplications")) { + if (!Array.isArray(message.yarnApplications)) + return "yarnApplications: array expected"; + for (var i = 0; i < message.yarnApplications.length; ++i) { + var error = $root.google.cloud.dataproc.v1.YarnApplication.verify(message.yarnApplications[i]); + if (error) + return "yarnApplications." + error; + } + } + if (message.driverOutputResourceUri != null && message.hasOwnProperty("driverOutputResourceUri")) + if (!$util.isString(message.driverOutputResourceUri)) + return "driverOutputResourceUri: string expected"; + if (message.driverControlFilesUri != null && message.hasOwnProperty("driverControlFilesUri")) + if (!$util.isString(message.driverControlFilesUri)) + return "driverControlFilesUri: 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.scheduling != null && message.hasOwnProperty("scheduling")) { + var error = $root.google.cloud.dataproc.v1.JobScheduling.verify(message.scheduling); + if (error) + return "scheduling." + error; + } + if (message.jobUuid != null && message.hasOwnProperty("jobUuid")) + if (!$util.isString(message.jobUuid)) + return "jobUuid: string expected"; + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.driverSchedulingConfig != null && message.hasOwnProperty("driverSchedulingConfig")) { + var error = $root.google.cloud.dataproc.v1.DriverSchedulingConfig.verify(message.driverSchedulingConfig); + if (error) + return "driverSchedulingConfig." + error; + } + return null; + }; + + /** + * Creates a Job message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.Job + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.Job} Job + */ + Job.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.Job) + return object; + var message = new $root.google.cloud.dataproc.v1.Job(); + if (object.reference != null) { + if (typeof object.reference !== "object") + throw TypeError(".google.cloud.dataproc.v1.Job.reference: object expected"); + message.reference = $root.google.cloud.dataproc.v1.JobReference.fromObject(object.reference); + } + if (object.placement != null) { + if (typeof object.placement !== "object") + throw TypeError(".google.cloud.dataproc.v1.Job.placement: object expected"); + message.placement = $root.google.cloud.dataproc.v1.JobPlacement.fromObject(object.placement); + } + if (object.hadoopJob != null) { + if (typeof object.hadoopJob !== "object") + throw TypeError(".google.cloud.dataproc.v1.Job.hadoopJob: object expected"); + message.hadoopJob = $root.google.cloud.dataproc.v1.HadoopJob.fromObject(object.hadoopJob); + } + if (object.sparkJob != null) { + if (typeof object.sparkJob !== "object") + throw TypeError(".google.cloud.dataproc.v1.Job.sparkJob: object expected"); + message.sparkJob = $root.google.cloud.dataproc.v1.SparkJob.fromObject(object.sparkJob); + } + if (object.pysparkJob != null) { + if (typeof object.pysparkJob !== "object") + throw TypeError(".google.cloud.dataproc.v1.Job.pysparkJob: object expected"); + message.pysparkJob = $root.google.cloud.dataproc.v1.PySparkJob.fromObject(object.pysparkJob); + } + if (object.hiveJob != null) { + if (typeof object.hiveJob !== "object") + throw TypeError(".google.cloud.dataproc.v1.Job.hiveJob: object expected"); + message.hiveJob = $root.google.cloud.dataproc.v1.HiveJob.fromObject(object.hiveJob); + } + if (object.pigJob != null) { + if (typeof object.pigJob !== "object") + throw TypeError(".google.cloud.dataproc.v1.Job.pigJob: object expected"); + message.pigJob = $root.google.cloud.dataproc.v1.PigJob.fromObject(object.pigJob); + } + if (object.sparkRJob != null) { + if (typeof object.sparkRJob !== "object") + throw TypeError(".google.cloud.dataproc.v1.Job.sparkRJob: object expected"); + message.sparkRJob = $root.google.cloud.dataproc.v1.SparkRJob.fromObject(object.sparkRJob); + } + if (object.sparkSqlJob != null) { + if (typeof object.sparkSqlJob !== "object") + throw TypeError(".google.cloud.dataproc.v1.Job.sparkSqlJob: object expected"); + message.sparkSqlJob = $root.google.cloud.dataproc.v1.SparkSqlJob.fromObject(object.sparkSqlJob); + } + if (object.prestoJob != null) { + if (typeof object.prestoJob !== "object") + throw TypeError(".google.cloud.dataproc.v1.Job.prestoJob: object expected"); + message.prestoJob = $root.google.cloud.dataproc.v1.PrestoJob.fromObject(object.prestoJob); + } + if (object.trinoJob != null) { + if (typeof object.trinoJob !== "object") + throw TypeError(".google.cloud.dataproc.v1.Job.trinoJob: object expected"); + message.trinoJob = $root.google.cloud.dataproc.v1.TrinoJob.fromObject(object.trinoJob); + } + if (object.flinkJob != null) { + if (typeof object.flinkJob !== "object") + throw TypeError(".google.cloud.dataproc.v1.Job.flinkJob: object expected"); + message.flinkJob = $root.google.cloud.dataproc.v1.FlinkJob.fromObject(object.flinkJob); + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.dataproc.v1.Job.status: object expected"); + message.status = $root.google.cloud.dataproc.v1.JobStatus.fromObject(object.status); + } + if (object.statusHistory) { + if (!Array.isArray(object.statusHistory)) + throw TypeError(".google.cloud.dataproc.v1.Job.statusHistory: array expected"); + message.statusHistory = []; + for (var i = 0; i < object.statusHistory.length; ++i) { + if (typeof object.statusHistory[i] !== "object") + throw TypeError(".google.cloud.dataproc.v1.Job.statusHistory: object expected"); + message.statusHistory[i] = $root.google.cloud.dataproc.v1.JobStatus.fromObject(object.statusHistory[i]); + } + } + if (object.yarnApplications) { + if (!Array.isArray(object.yarnApplications)) + throw TypeError(".google.cloud.dataproc.v1.Job.yarnApplications: array expected"); + message.yarnApplications = []; + for (var i = 0; i < object.yarnApplications.length; ++i) { + if (typeof object.yarnApplications[i] !== "object") + throw TypeError(".google.cloud.dataproc.v1.Job.yarnApplications: object expected"); + message.yarnApplications[i] = $root.google.cloud.dataproc.v1.YarnApplication.fromObject(object.yarnApplications[i]); + } + } + if (object.driverOutputResourceUri != null) + message.driverOutputResourceUri = String(object.driverOutputResourceUri); + if (object.driverControlFilesUri != null) + message.driverControlFilesUri = String(object.driverControlFilesUri); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.dataproc.v1.Job.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.scheduling != null) { + if (typeof object.scheduling !== "object") + throw TypeError(".google.cloud.dataproc.v1.Job.scheduling: object expected"); + message.scheduling = $root.google.cloud.dataproc.v1.JobScheduling.fromObject(object.scheduling); + } + if (object.jobUuid != null) + message.jobUuid = String(object.jobUuid); + if (object.done != null) + message.done = Boolean(object.done); + if (object.driverSchedulingConfig != null) { + if (typeof object.driverSchedulingConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.Job.driverSchedulingConfig: object expected"); + message.driverSchedulingConfig = $root.google.cloud.dataproc.v1.DriverSchedulingConfig.fromObject(object.driverSchedulingConfig); + } + return message; + }; + + /** + * Creates a plain object from a Job message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.Job + * @static + * @param {google.cloud.dataproc.v1.Job} message Job + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Job.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.yarnApplications = []; + object.statusHistory = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.reference = null; + object.placement = null; + object.status = null; + object.driverControlFilesUri = ""; + object.driverOutputResourceUri = ""; + object.scheduling = null; + object.jobUuid = ""; + object.done = false; + object.driverSchedulingConfig = null; + } + if (message.reference != null && message.hasOwnProperty("reference")) + object.reference = $root.google.cloud.dataproc.v1.JobReference.toObject(message.reference, options); + if (message.placement != null && message.hasOwnProperty("placement")) + object.placement = $root.google.cloud.dataproc.v1.JobPlacement.toObject(message.placement, options); + if (message.hadoopJob != null && message.hasOwnProperty("hadoopJob")) { + object.hadoopJob = $root.google.cloud.dataproc.v1.HadoopJob.toObject(message.hadoopJob, options); + if (options.oneofs) + object.typeJob = "hadoopJob"; + } + if (message.sparkJob != null && message.hasOwnProperty("sparkJob")) { + object.sparkJob = $root.google.cloud.dataproc.v1.SparkJob.toObject(message.sparkJob, options); + if (options.oneofs) + object.typeJob = "sparkJob"; + } + if (message.pysparkJob != null && message.hasOwnProperty("pysparkJob")) { + object.pysparkJob = $root.google.cloud.dataproc.v1.PySparkJob.toObject(message.pysparkJob, options); + if (options.oneofs) + object.typeJob = "pysparkJob"; + } + if (message.hiveJob != null && message.hasOwnProperty("hiveJob")) { + object.hiveJob = $root.google.cloud.dataproc.v1.HiveJob.toObject(message.hiveJob, options); + if (options.oneofs) + object.typeJob = "hiveJob"; + } + if (message.pigJob != null && message.hasOwnProperty("pigJob")) { + object.pigJob = $root.google.cloud.dataproc.v1.PigJob.toObject(message.pigJob, options); + if (options.oneofs) + object.typeJob = "pigJob"; + } + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.cloud.dataproc.v1.JobStatus.toObject(message.status, options); + if (message.yarnApplications && message.yarnApplications.length) { + object.yarnApplications = []; + for (var j = 0; j < message.yarnApplications.length; ++j) + object.yarnApplications[j] = $root.google.cloud.dataproc.v1.YarnApplication.toObject(message.yarnApplications[j], options); + } + if (message.sparkSqlJob != null && message.hasOwnProperty("sparkSqlJob")) { + object.sparkSqlJob = $root.google.cloud.dataproc.v1.SparkSqlJob.toObject(message.sparkSqlJob, options); + if (options.oneofs) + object.typeJob = "sparkSqlJob"; + } + if (message.statusHistory && message.statusHistory.length) { + object.statusHistory = []; + for (var j = 0; j < message.statusHistory.length; ++j) + object.statusHistory[j] = $root.google.cloud.dataproc.v1.JobStatus.toObject(message.statusHistory[j], options); + } + if (message.driverControlFilesUri != null && message.hasOwnProperty("driverControlFilesUri")) + object.driverControlFilesUri = message.driverControlFilesUri; + if (message.driverOutputResourceUri != null && message.hasOwnProperty("driverOutputResourceUri")) + object.driverOutputResourceUri = message.driverOutputResourceUri; + 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.scheduling != null && message.hasOwnProperty("scheduling")) + object.scheduling = $root.google.cloud.dataproc.v1.JobScheduling.toObject(message.scheduling, options); + if (message.sparkRJob != null && message.hasOwnProperty("sparkRJob")) { + object.sparkRJob = $root.google.cloud.dataproc.v1.SparkRJob.toObject(message.sparkRJob, options); + if (options.oneofs) + object.typeJob = "sparkRJob"; + } + if (message.jobUuid != null && message.hasOwnProperty("jobUuid")) + object.jobUuid = message.jobUuid; + if (message.prestoJob != null && message.hasOwnProperty("prestoJob")) { + object.prestoJob = $root.google.cloud.dataproc.v1.PrestoJob.toObject(message.prestoJob, options); + if (options.oneofs) + object.typeJob = "prestoJob"; + } + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.driverSchedulingConfig != null && message.hasOwnProperty("driverSchedulingConfig")) + object.driverSchedulingConfig = $root.google.cloud.dataproc.v1.DriverSchedulingConfig.toObject(message.driverSchedulingConfig, options); + if (message.trinoJob != null && message.hasOwnProperty("trinoJob")) { + object.trinoJob = $root.google.cloud.dataproc.v1.TrinoJob.toObject(message.trinoJob, options); + if (options.oneofs) + object.typeJob = "trinoJob"; + } + if (message.flinkJob != null && message.hasOwnProperty("flinkJob")) { + object.flinkJob = $root.google.cloud.dataproc.v1.FlinkJob.toObject(message.flinkJob, options); + if (options.oneofs) + object.typeJob = "flinkJob"; + } + return object; + }; + + /** + * Converts this Job to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.Job + * @instance + * @returns {Object.} JSON object + */ + Job.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Job + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.Job + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Job.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.Job"; + }; + + return Job; + })(); + + v1.DriverSchedulingConfig = (function() { + + /** + * Properties of a DriverSchedulingConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IDriverSchedulingConfig + * @property {number|null} [memoryMb] DriverSchedulingConfig memoryMb + * @property {number|null} [vcores] DriverSchedulingConfig vcores + */ + + /** + * Constructs a new DriverSchedulingConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a DriverSchedulingConfig. + * @implements IDriverSchedulingConfig + * @constructor + * @param {google.cloud.dataproc.v1.IDriverSchedulingConfig=} [properties] Properties to set + */ + function DriverSchedulingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DriverSchedulingConfig memoryMb. + * @member {number} memoryMb + * @memberof google.cloud.dataproc.v1.DriverSchedulingConfig + * @instance + */ + DriverSchedulingConfig.prototype.memoryMb = 0; + + /** + * DriverSchedulingConfig vcores. + * @member {number} vcores + * @memberof google.cloud.dataproc.v1.DriverSchedulingConfig + * @instance + */ + DriverSchedulingConfig.prototype.vcores = 0; + + /** + * Creates a new DriverSchedulingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.DriverSchedulingConfig + * @static + * @param {google.cloud.dataproc.v1.IDriverSchedulingConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.DriverSchedulingConfig} DriverSchedulingConfig instance + */ + DriverSchedulingConfig.create = function create(properties) { + return new DriverSchedulingConfig(properties); + }; + + /** + * Encodes the specified DriverSchedulingConfig message. Does not implicitly {@link google.cloud.dataproc.v1.DriverSchedulingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.DriverSchedulingConfig + * @static + * @param {google.cloud.dataproc.v1.IDriverSchedulingConfig} message DriverSchedulingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DriverSchedulingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.memoryMb != null && Object.hasOwnProperty.call(message, "memoryMb")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.memoryMb); + if (message.vcores != null && Object.hasOwnProperty.call(message, "vcores")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.vcores); + return writer; + }; + + /** + * Encodes the specified DriverSchedulingConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DriverSchedulingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.DriverSchedulingConfig + * @static + * @param {google.cloud.dataproc.v1.IDriverSchedulingConfig} message DriverSchedulingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DriverSchedulingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DriverSchedulingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.DriverSchedulingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.DriverSchedulingConfig} DriverSchedulingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DriverSchedulingConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.DriverSchedulingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.memoryMb = reader.int32(); + break; + } + case 2: { + message.vcores = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DriverSchedulingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.DriverSchedulingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.DriverSchedulingConfig} DriverSchedulingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DriverSchedulingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DriverSchedulingConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.DriverSchedulingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DriverSchedulingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.memoryMb != null && message.hasOwnProperty("memoryMb")) + if (!$util.isInteger(message.memoryMb)) + return "memoryMb: integer expected"; + if (message.vcores != null && message.hasOwnProperty("vcores")) + if (!$util.isInteger(message.vcores)) + return "vcores: integer expected"; + return null; + }; + + /** + * Creates a DriverSchedulingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.DriverSchedulingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.DriverSchedulingConfig} DriverSchedulingConfig + */ + DriverSchedulingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.DriverSchedulingConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.DriverSchedulingConfig(); + if (object.memoryMb != null) + message.memoryMb = object.memoryMb | 0; + if (object.vcores != null) + message.vcores = object.vcores | 0; + return message; + }; + + /** + * Creates a plain object from a DriverSchedulingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.DriverSchedulingConfig + * @static + * @param {google.cloud.dataproc.v1.DriverSchedulingConfig} message DriverSchedulingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DriverSchedulingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.memoryMb = 0; + object.vcores = 0; + } + if (message.memoryMb != null && message.hasOwnProperty("memoryMb")) + object.memoryMb = message.memoryMb; + if (message.vcores != null && message.hasOwnProperty("vcores")) + object.vcores = message.vcores; + return object; + }; + + /** + * Converts this DriverSchedulingConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.DriverSchedulingConfig + * @instance + * @returns {Object.} JSON object + */ + DriverSchedulingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DriverSchedulingConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.DriverSchedulingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DriverSchedulingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.DriverSchedulingConfig"; + }; + + return DriverSchedulingConfig; + })(); + + v1.JobScheduling = (function() { + + /** + * Properties of a JobScheduling. + * @memberof google.cloud.dataproc.v1 + * @interface IJobScheduling + * @property {number|null} [maxFailuresPerHour] JobScheduling maxFailuresPerHour + * @property {number|null} [maxFailuresTotal] JobScheduling maxFailuresTotal + */ + + /** + * Constructs a new JobScheduling. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a JobScheduling. + * @implements IJobScheduling + * @constructor + * @param {google.cloud.dataproc.v1.IJobScheduling=} [properties] Properties to set + */ + function JobScheduling(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobScheduling maxFailuresPerHour. + * @member {number} maxFailuresPerHour + * @memberof google.cloud.dataproc.v1.JobScheduling + * @instance + */ + JobScheduling.prototype.maxFailuresPerHour = 0; + + /** + * JobScheduling maxFailuresTotal. + * @member {number} maxFailuresTotal + * @memberof google.cloud.dataproc.v1.JobScheduling + * @instance + */ + JobScheduling.prototype.maxFailuresTotal = 0; + + /** + * Creates a new JobScheduling instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.JobScheduling + * @static + * @param {google.cloud.dataproc.v1.IJobScheduling=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.JobScheduling} JobScheduling instance + */ + JobScheduling.create = function create(properties) { + return new JobScheduling(properties); + }; + + /** + * Encodes the specified JobScheduling message. Does not implicitly {@link google.cloud.dataproc.v1.JobScheduling.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.JobScheduling + * @static + * @param {google.cloud.dataproc.v1.IJobScheduling} message JobScheduling message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobScheduling.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxFailuresPerHour != null && Object.hasOwnProperty.call(message, "maxFailuresPerHour")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.maxFailuresPerHour); + if (message.maxFailuresTotal != null && Object.hasOwnProperty.call(message, "maxFailuresTotal")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxFailuresTotal); + return writer; + }; + + /** + * Encodes the specified JobScheduling message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.JobScheduling.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.JobScheduling + * @static + * @param {google.cloud.dataproc.v1.IJobScheduling} message JobScheduling message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobScheduling.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobScheduling message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.JobScheduling + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.JobScheduling} JobScheduling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobScheduling.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.JobScheduling(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.maxFailuresPerHour = reader.int32(); + break; + } + case 2: { + message.maxFailuresTotal = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobScheduling message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.JobScheduling + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.JobScheduling} JobScheduling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobScheduling.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobScheduling message. + * @function verify + * @memberof google.cloud.dataproc.v1.JobScheduling + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobScheduling.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maxFailuresPerHour != null && message.hasOwnProperty("maxFailuresPerHour")) + if (!$util.isInteger(message.maxFailuresPerHour)) + return "maxFailuresPerHour: integer expected"; + if (message.maxFailuresTotal != null && message.hasOwnProperty("maxFailuresTotal")) + if (!$util.isInteger(message.maxFailuresTotal)) + return "maxFailuresTotal: integer expected"; + return null; + }; + + /** + * Creates a JobScheduling message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.JobScheduling + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.JobScheduling} JobScheduling + */ + JobScheduling.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.JobScheduling) + return object; + var message = new $root.google.cloud.dataproc.v1.JobScheduling(); + if (object.maxFailuresPerHour != null) + message.maxFailuresPerHour = object.maxFailuresPerHour | 0; + if (object.maxFailuresTotal != null) + message.maxFailuresTotal = object.maxFailuresTotal | 0; + return message; + }; + + /** + * Creates a plain object from a JobScheduling message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.JobScheduling + * @static + * @param {google.cloud.dataproc.v1.JobScheduling} message JobScheduling + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobScheduling.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.maxFailuresPerHour = 0; + object.maxFailuresTotal = 0; + } + if (message.maxFailuresPerHour != null && message.hasOwnProperty("maxFailuresPerHour")) + object.maxFailuresPerHour = message.maxFailuresPerHour; + if (message.maxFailuresTotal != null && message.hasOwnProperty("maxFailuresTotal")) + object.maxFailuresTotal = message.maxFailuresTotal; + return object; + }; + + /** + * Converts this JobScheduling to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.JobScheduling + * @instance + * @returns {Object.} JSON object + */ + JobScheduling.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobScheduling + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.JobScheduling + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobScheduling.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.JobScheduling"; + }; + + return JobScheduling; + })(); + + v1.SubmitJobRequest = (function() { + + /** + * Properties of a SubmitJobRequest. + * @memberof google.cloud.dataproc.v1 + * @interface ISubmitJobRequest + * @property {string|null} [projectId] SubmitJobRequest projectId + * @property {string|null} [region] SubmitJobRequest region + * @property {google.cloud.dataproc.v1.IJob|null} [job] SubmitJobRequest job + * @property {string|null} [requestId] SubmitJobRequest requestId + */ + + /** + * Constructs a new SubmitJobRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a SubmitJobRequest. + * @implements ISubmitJobRequest + * @constructor + * @param {google.cloud.dataproc.v1.ISubmitJobRequest=} [properties] Properties to set + */ + function SubmitJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubmitJobRequest projectId. + * @member {string} projectId + * @memberof google.cloud.dataproc.v1.SubmitJobRequest + * @instance + */ + SubmitJobRequest.prototype.projectId = ""; + + /** + * SubmitJobRequest region. + * @member {string} region + * @memberof google.cloud.dataproc.v1.SubmitJobRequest + * @instance + */ + SubmitJobRequest.prototype.region = ""; + + /** + * SubmitJobRequest job. + * @member {google.cloud.dataproc.v1.IJob|null|undefined} job + * @memberof google.cloud.dataproc.v1.SubmitJobRequest + * @instance + */ + SubmitJobRequest.prototype.job = null; + + /** + * SubmitJobRequest requestId. + * @member {string} requestId + * @memberof google.cloud.dataproc.v1.SubmitJobRequest + * @instance + */ + SubmitJobRequest.prototype.requestId = ""; + + /** + * Creates a new SubmitJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.SubmitJobRequest + * @static + * @param {google.cloud.dataproc.v1.ISubmitJobRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.SubmitJobRequest} SubmitJobRequest instance + */ + SubmitJobRequest.create = function create(properties) { + return new SubmitJobRequest(properties); + }; + + /** + * Encodes the specified SubmitJobRequest message. Does not implicitly {@link google.cloud.dataproc.v1.SubmitJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.SubmitJobRequest + * @static + * @param {google.cloud.dataproc.v1.ISubmitJobRequest} message SubmitJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubmitJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.job != null && Object.hasOwnProperty.call(message, "job")) + $root.google.cloud.dataproc.v1.Job.encode(message.job, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.region); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified SubmitJobRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SubmitJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.SubmitJobRequest + * @static + * @param {google.cloud.dataproc.v1.ISubmitJobRequest} message SubmitJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubmitJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubmitJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.SubmitJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.SubmitJobRequest} SubmitJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubmitJobRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.SubmitJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 3: { + message.region = reader.string(); + break; + } + case 2: { + message.job = $root.google.cloud.dataproc.v1.Job.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubmitJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.SubmitJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.SubmitJobRequest} SubmitJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubmitJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubmitJobRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.SubmitJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubmitJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.job != null && message.hasOwnProperty("job")) { + var error = $root.google.cloud.dataproc.v1.Job.verify(message.job); + if (error) + return "job." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a SubmitJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.SubmitJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.SubmitJobRequest} SubmitJobRequest + */ + SubmitJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.SubmitJobRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.SubmitJobRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.region != null) + message.region = String(object.region); + if (object.job != null) { + if (typeof object.job !== "object") + throw TypeError(".google.cloud.dataproc.v1.SubmitJobRequest.job: object expected"); + message.job = $root.google.cloud.dataproc.v1.Job.fromObject(object.job); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a SubmitJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.SubmitJobRequest + * @static + * @param {google.cloud.dataproc.v1.SubmitJobRequest} message SubmitJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubmitJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.job = null; + object.region = ""; + object.requestId = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.job != null && message.hasOwnProperty("job")) + object.job = $root.google.cloud.dataproc.v1.Job.toObject(message.job, options); + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this SubmitJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.SubmitJobRequest + * @instance + * @returns {Object.} JSON object + */ + SubmitJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SubmitJobRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.SubmitJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SubmitJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.SubmitJobRequest"; + }; + + return SubmitJobRequest; + })(); + + v1.JobMetadata = (function() { + + /** + * Properties of a JobMetadata. + * @memberof google.cloud.dataproc.v1 + * @interface IJobMetadata + * @property {string|null} [jobId] JobMetadata jobId + * @property {google.cloud.dataproc.v1.IJobStatus|null} [status] JobMetadata status + * @property {string|null} [operationType] JobMetadata operationType + * @property {google.protobuf.ITimestamp|null} [startTime] JobMetadata startTime + */ + + /** + * Constructs a new JobMetadata. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a JobMetadata. + * @implements IJobMetadata + * @constructor + * @param {google.cloud.dataproc.v1.IJobMetadata=} [properties] Properties to set + */ + function JobMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JobMetadata jobId. + * @member {string} jobId + * @memberof google.cloud.dataproc.v1.JobMetadata + * @instance + */ + JobMetadata.prototype.jobId = ""; + + /** + * JobMetadata status. + * @member {google.cloud.dataproc.v1.IJobStatus|null|undefined} status + * @memberof google.cloud.dataproc.v1.JobMetadata + * @instance + */ + JobMetadata.prototype.status = null; + + /** + * JobMetadata operationType. + * @member {string} operationType + * @memberof google.cloud.dataproc.v1.JobMetadata + * @instance + */ + JobMetadata.prototype.operationType = ""; + + /** + * JobMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.dataproc.v1.JobMetadata + * @instance + */ + JobMetadata.prototype.startTime = null; + + /** + * Creates a new JobMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.JobMetadata + * @static + * @param {google.cloud.dataproc.v1.IJobMetadata=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.JobMetadata} JobMetadata instance + */ + JobMetadata.create = function create(properties) { + return new JobMetadata(properties); + }; + + /** + * Encodes the specified JobMetadata message. Does not implicitly {@link google.cloud.dataproc.v1.JobMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.JobMetadata + * @static + * @param {google.cloud.dataproc.v1.IJobMetadata} message JobMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.jobId); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.cloud.dataproc.v1.JobStatus.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.operationType != null && Object.hasOwnProperty.call(message, "operationType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.operationType); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JobMetadata message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.JobMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.JobMetadata + * @static + * @param {google.cloud.dataproc.v1.IJobMetadata} message JobMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JobMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JobMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.JobMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.JobMetadata} JobMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.JobMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.jobId = reader.string(); + break; + } + case 2: { + message.status = $root.google.cloud.dataproc.v1.JobStatus.decode(reader, reader.uint32()); + break; + } + case 3: { + message.operationType = reader.string(); + break; + } + case 4: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JobMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.JobMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.JobMetadata} JobMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JobMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JobMetadata message. + * @function verify + * @memberof google.cloud.dataproc.v1.JobMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JobMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.jobId != null && message.hasOwnProperty("jobId")) + if (!$util.isString(message.jobId)) + return "jobId: string expected"; + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.cloud.dataproc.v1.JobStatus.verify(message.status); + if (error) + return "status." + error; + } + if (message.operationType != null && message.hasOwnProperty("operationType")) + if (!$util.isString(message.operationType)) + return "operationType: string expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + return null; + }; + + /** + * Creates a JobMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.JobMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.JobMetadata} JobMetadata + */ + JobMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.JobMetadata) + return object; + var message = new $root.google.cloud.dataproc.v1.JobMetadata(); + if (object.jobId != null) + message.jobId = String(object.jobId); + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.dataproc.v1.JobMetadata.status: object expected"); + message.status = $root.google.cloud.dataproc.v1.JobStatus.fromObject(object.status); + } + if (object.operationType != null) + message.operationType = String(object.operationType); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.dataproc.v1.JobMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + return message; + }; + + /** + * Creates a plain object from a JobMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.JobMetadata + * @static + * @param {google.cloud.dataproc.v1.JobMetadata} message JobMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JobMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.jobId = ""; + object.status = null; + object.operationType = ""; + object.startTime = null; + } + if (message.jobId != null && message.hasOwnProperty("jobId")) + object.jobId = message.jobId; + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.cloud.dataproc.v1.JobStatus.toObject(message.status, options); + if (message.operationType != null && message.hasOwnProperty("operationType")) + object.operationType = message.operationType; + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + return object; + }; + + /** + * Converts this JobMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.JobMetadata + * @instance + * @returns {Object.} JSON object + */ + JobMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JobMetadata + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.JobMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JobMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.JobMetadata"; + }; + + return JobMetadata; + })(); + + v1.GetJobRequest = (function() { + + /** + * Properties of a GetJobRequest. + * @memberof google.cloud.dataproc.v1 + * @interface IGetJobRequest + * @property {string|null} [projectId] GetJobRequest projectId + * @property {string|null} [region] GetJobRequest region + * @property {string|null} [jobId] GetJobRequest jobId + */ + + /** + * Constructs a new GetJobRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a GetJobRequest. + * @implements IGetJobRequest + * @constructor + * @param {google.cloud.dataproc.v1.IGetJobRequest=} [properties] Properties to set + */ + function GetJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetJobRequest projectId. + * @member {string} projectId + * @memberof google.cloud.dataproc.v1.GetJobRequest + * @instance + */ + GetJobRequest.prototype.projectId = ""; + + /** + * GetJobRequest region. + * @member {string} region + * @memberof google.cloud.dataproc.v1.GetJobRequest + * @instance + */ + GetJobRequest.prototype.region = ""; + + /** + * GetJobRequest jobId. + * @member {string} jobId + * @memberof google.cloud.dataproc.v1.GetJobRequest + * @instance + */ + GetJobRequest.prototype.jobId = ""; + + /** + * Creates a new GetJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.GetJobRequest + * @static + * @param {google.cloud.dataproc.v1.IGetJobRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.GetJobRequest} GetJobRequest instance + */ + GetJobRequest.create = function create(properties) { + return new GetJobRequest(properties); + }; + + /** + * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.dataproc.v1.GetJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.GetJobRequest + * @static + * @param {google.cloud.dataproc.v1.IGetJobRequest} message GetJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.region); + return writer; + }; + + /** + * Encodes the specified GetJobRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GetJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.GetJobRequest + * @static + * @param {google.cloud.dataproc.v1.IGetJobRequest} message GetJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.GetJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.GetJobRequest} GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetJobRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.GetJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 3: { + message.region = reader.string(); + break; + } + case 2: { + message.jobId = 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.dataproc.v1.GetJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.GetJobRequest} GetJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetJobRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.GetJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.jobId != null && message.hasOwnProperty("jobId")) + if (!$util.isString(message.jobId)) + return "jobId: 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.dataproc.v1.GetJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.GetJobRequest} GetJobRequest + */ + GetJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.GetJobRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.GetJobRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.region != null) + message.region = String(object.region); + if (object.jobId != null) + message.jobId = String(object.jobId); + return message; + }; + + /** + * Creates a plain object from a GetJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.GetJobRequest + * @static + * @param {google.cloud.dataproc.v1.GetJobRequest} message GetJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.jobId = ""; + object.region = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.jobId != null && message.hasOwnProperty("jobId")) + object.jobId = message.jobId; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + return object; + }; + + /** + * Converts this GetJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.GetJobRequest + * @instance + * @returns {Object.} JSON object + */ + GetJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetJobRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.GetJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.GetJobRequest"; + }; + + return GetJobRequest; + })(); + + v1.ListJobsRequest = (function() { + + /** + * Properties of a ListJobsRequest. + * @memberof google.cloud.dataproc.v1 + * @interface IListJobsRequest + * @property {string|null} [projectId] ListJobsRequest projectId + * @property {string|null} [region] ListJobsRequest region + * @property {number|null} [pageSize] ListJobsRequest pageSize + * @property {string|null} [pageToken] ListJobsRequest pageToken + * @property {string|null} [clusterName] ListJobsRequest clusterName + * @property {google.cloud.dataproc.v1.ListJobsRequest.JobStateMatcher|null} [jobStateMatcher] ListJobsRequest jobStateMatcher + * @property {string|null} [filter] ListJobsRequest filter + */ + + /** + * Constructs a new ListJobsRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a ListJobsRequest. + * @implements IListJobsRequest + * @constructor + * @param {google.cloud.dataproc.v1.IListJobsRequest=} [properties] Properties to set + */ + function ListJobsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListJobsRequest projectId. + * @member {string} projectId + * @memberof google.cloud.dataproc.v1.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.projectId = ""; + + /** + * ListJobsRequest region. + * @member {string} region + * @memberof google.cloud.dataproc.v1.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.region = ""; + + /** + * ListJobsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dataproc.v1.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.pageSize = 0; + + /** + * ListJobsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dataproc.v1.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.pageToken = ""; + + /** + * ListJobsRequest clusterName. + * @member {string} clusterName + * @memberof google.cloud.dataproc.v1.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.clusterName = ""; + + /** + * ListJobsRequest jobStateMatcher. + * @member {google.cloud.dataproc.v1.ListJobsRequest.JobStateMatcher} jobStateMatcher + * @memberof google.cloud.dataproc.v1.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.jobStateMatcher = 0; + + /** + * ListJobsRequest filter. + * @member {string} filter + * @memberof google.cloud.dataproc.v1.ListJobsRequest + * @instance + */ + ListJobsRequest.prototype.filter = ""; + + /** + * Creates a new ListJobsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.ListJobsRequest + * @static + * @param {google.cloud.dataproc.v1.IListJobsRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.ListJobsRequest} ListJobsRequest instance + */ + ListJobsRequest.create = function create(properties) { + return new ListJobsRequest(properties); + }; + + /** + * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.dataproc.v1.ListJobsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.ListJobsRequest + * @static + * @param {google.cloud.dataproc.v1.IListJobsRequest} message ListJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.clusterName); + if (message.jobStateMatcher != null && Object.hasOwnProperty.call(message, "jobStateMatcher")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.jobStateMatcher); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.region); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListJobsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.ListJobsRequest + * @static + * @param {google.cloud.dataproc.v1.IListJobsRequest} message ListJobsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.ListJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.ListJobsRequest} ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ListJobsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 6: { + message.region = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.clusterName = reader.string(); + break; + } + case 5: { + message.jobStateMatcher = reader.int32(); + break; + } + case 7: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListJobsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.ListJobsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.ListJobsRequest} ListJobsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListJobsRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.ListJobsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListJobsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: 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.clusterName != null && message.hasOwnProperty("clusterName")) + if (!$util.isString(message.clusterName)) + return "clusterName: string expected"; + if (message.jobStateMatcher != null && message.hasOwnProperty("jobStateMatcher")) + switch (message.jobStateMatcher) { + default: + return "jobStateMatcher: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListJobsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.ListJobsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.ListJobsRequest} ListJobsRequest + */ + ListJobsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.ListJobsRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.ListJobsRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.region != null) + message.region = String(object.region); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.clusterName != null) + message.clusterName = String(object.clusterName); + switch (object.jobStateMatcher) { + default: + if (typeof object.jobStateMatcher === "number") { + message.jobStateMatcher = object.jobStateMatcher; + break; + } + break; + case "ALL": + case 0: + message.jobStateMatcher = 0; + break; + case "ACTIVE": + case 1: + message.jobStateMatcher = 1; + break; + case "NON_ACTIVE": + case 2: + message.jobStateMatcher = 2; + break; + } + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListJobsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.ListJobsRequest + * @static + * @param {google.cloud.dataproc.v1.ListJobsRequest} message ListJobsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListJobsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.pageSize = 0; + object.pageToken = ""; + object.clusterName = ""; + object.jobStateMatcher = options.enums === String ? "ALL" : 0; + object.region = ""; + object.filter = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + object.clusterName = message.clusterName; + if (message.jobStateMatcher != null && message.hasOwnProperty("jobStateMatcher")) + object.jobStateMatcher = options.enums === String ? $root.google.cloud.dataproc.v1.ListJobsRequest.JobStateMatcher[message.jobStateMatcher] === undefined ? message.jobStateMatcher : $root.google.cloud.dataproc.v1.ListJobsRequest.JobStateMatcher[message.jobStateMatcher] : message.jobStateMatcher; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListJobsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.ListJobsRequest + * @instance + * @returns {Object.} JSON object + */ + ListJobsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListJobsRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.ListJobsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListJobsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.ListJobsRequest"; + }; + + /** + * JobStateMatcher enum. + * @name google.cloud.dataproc.v1.ListJobsRequest.JobStateMatcher + * @enum {number} + * @property {number} ALL=0 ALL value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} NON_ACTIVE=2 NON_ACTIVE value + */ + ListJobsRequest.JobStateMatcher = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ALL"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "NON_ACTIVE"] = 2; + return values; + })(); + + return ListJobsRequest; + })(); + + v1.UpdateJobRequest = (function() { + + /** + * Properties of an UpdateJobRequest. + * @memberof google.cloud.dataproc.v1 + * @interface IUpdateJobRequest + * @property {string|null} [projectId] UpdateJobRequest projectId + * @property {string|null} [region] UpdateJobRequest region + * @property {string|null} [jobId] UpdateJobRequest jobId + * @property {google.cloud.dataproc.v1.IJob|null} [job] UpdateJobRequest job + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateJobRequest updateMask + */ + + /** + * Constructs a new UpdateJobRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents an UpdateJobRequest. + * @implements IUpdateJobRequest + * @constructor + * @param {google.cloud.dataproc.v1.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 projectId. + * @member {string} projectId + * @memberof google.cloud.dataproc.v1.UpdateJobRequest + * @instance + */ + UpdateJobRequest.prototype.projectId = ""; + + /** + * UpdateJobRequest region. + * @member {string} region + * @memberof google.cloud.dataproc.v1.UpdateJobRequest + * @instance + */ + UpdateJobRequest.prototype.region = ""; + + /** + * UpdateJobRequest jobId. + * @member {string} jobId + * @memberof google.cloud.dataproc.v1.UpdateJobRequest + * @instance + */ + UpdateJobRequest.prototype.jobId = ""; + + /** + * UpdateJobRequest job. + * @member {google.cloud.dataproc.v1.IJob|null|undefined} job + * @memberof google.cloud.dataproc.v1.UpdateJobRequest + * @instance + */ + UpdateJobRequest.prototype.job = null; + + /** + * UpdateJobRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dataproc.v1.UpdateJobRequest + * @instance + */ + UpdateJobRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.UpdateJobRequest + * @static + * @param {google.cloud.dataproc.v1.IUpdateJobRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.UpdateJobRequest} UpdateJobRequest instance + */ + UpdateJobRequest.create = function create(properties) { + return new UpdateJobRequest(properties); + }; + + /** + * Encodes the specified UpdateJobRequest message. Does not implicitly {@link google.cloud.dataproc.v1.UpdateJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.UpdateJobRequest + * @static + * @param {google.cloud.dataproc.v1.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.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.region); + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.jobId); + if (message.job != null && Object.hasOwnProperty.call(message, "job")) + $root.google.cloud.dataproc.v1.Job.encode(message.job, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateJobRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.UpdateJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.UpdateJobRequest + * @static + * @param {google.cloud.dataproc.v1.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.dataproc.v1.UpdateJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.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.dataproc.v1.UpdateJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 2: { + message.region = reader.string(); + break; + } + case 3: { + message.jobId = reader.string(); + break; + } + case 4: { + message.job = $root.google.cloud.dataproc.v1.Job.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + 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.dataproc.v1.UpdateJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.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.dataproc.v1.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.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.jobId != null && message.hasOwnProperty("jobId")) + if (!$util.isString(message.jobId)) + return "jobId: string expected"; + if (message.job != null && message.hasOwnProperty("job")) { + var error = $root.google.cloud.dataproc.v1.Job.verify(message.job); + if (error) + return "job." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.UpdateJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.UpdateJobRequest} UpdateJobRequest + */ + UpdateJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.UpdateJobRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.UpdateJobRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.region != null) + message.region = String(object.region); + if (object.jobId != null) + message.jobId = String(object.jobId); + if (object.job != null) { + if (typeof object.job !== "object") + throw TypeError(".google.cloud.dataproc.v1.UpdateJobRequest.job: object expected"); + message.job = $root.google.cloud.dataproc.v1.Job.fromObject(object.job); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dataproc.v1.UpdateJobRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.UpdateJobRequest + * @static + * @param {google.cloud.dataproc.v1.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.projectId = ""; + object.region = ""; + object.jobId = ""; + object.job = null; + object.updateMask = null; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.jobId != null && message.hasOwnProperty("jobId")) + object.jobId = message.jobId; + if (message.job != null && message.hasOwnProperty("job")) + object.job = $root.google.cloud.dataproc.v1.Job.toObject(message.job, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.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.dataproc.v1.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.dataproc.v1.UpdateJobRequest"; + }; + + return UpdateJobRequest; + })(); + + v1.ListJobsResponse = (function() { + + /** + * Properties of a ListJobsResponse. + * @memberof google.cloud.dataproc.v1 + * @interface IListJobsResponse + * @property {Array.|null} [jobs] ListJobsResponse jobs + * @property {string|null} [nextPageToken] ListJobsResponse nextPageToken + * @property {Array.|null} [unreachable] ListJobsResponse unreachable + */ + + /** + * Constructs a new ListJobsResponse. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a ListJobsResponse. + * @implements IListJobsResponse + * @constructor + * @param {google.cloud.dataproc.v1.IListJobsResponse=} [properties] Properties to set + */ + function ListJobsResponse(properties) { + this.jobs = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListJobsResponse jobs. + * @member {Array.} jobs + * @memberof google.cloud.dataproc.v1.ListJobsResponse + * @instance + */ + ListJobsResponse.prototype.jobs = $util.emptyArray; + + /** + * ListJobsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dataproc.v1.ListJobsResponse + * @instance + */ + ListJobsResponse.prototype.nextPageToken = ""; + + /** + * ListJobsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.dataproc.v1.ListJobsResponse + * @instance + */ + ListJobsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListJobsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.ListJobsResponse + * @static + * @param {google.cloud.dataproc.v1.IListJobsResponse=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.ListJobsResponse} ListJobsResponse instance + */ + ListJobsResponse.create = function create(properties) { + return new ListJobsResponse(properties); + }; + + /** + * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.cloud.dataproc.v1.ListJobsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.ListJobsResponse + * @static + * @param {google.cloud.dataproc.v1.IListJobsResponse} message ListJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.jobs != null && message.jobs.length) + for (var i = 0; i < message.jobs.length; ++i) + $root.google.cloud.dataproc.v1.Job.encode(message.jobs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListJobsResponse message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListJobsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.ListJobsResponse + * @static + * @param {google.cloud.dataproc.v1.IListJobsResponse} message ListJobsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListJobsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.ListJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.ListJobsResponse} ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.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.dataproc.v1.Job.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListJobsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.ListJobsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.ListJobsResponse} ListJobsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListJobsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListJobsResponse message. + * @function verify + * @memberof google.cloud.dataproc.v1.ListJobsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListJobsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.jobs != null && message.hasOwnProperty("jobs")) { + if (!Array.isArray(message.jobs)) + return "jobs: array expected"; + for (var i = 0; i < message.jobs.length; ++i) { + var error = $root.google.cloud.dataproc.v1.Job.verify(message.jobs[i]); + if (error) + return "jobs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListJobsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.ListJobsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.ListJobsResponse} ListJobsResponse + */ + ListJobsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.ListJobsResponse) + return object; + var message = new $root.google.cloud.dataproc.v1.ListJobsResponse(); + if (object.jobs) { + if (!Array.isArray(object.jobs)) + throw TypeError(".google.cloud.dataproc.v1.ListJobsResponse.jobs: array expected"); + message.jobs = []; + for (var i = 0; i < object.jobs.length; ++i) { + if (typeof object.jobs[i] !== "object") + throw TypeError(".google.cloud.dataproc.v1.ListJobsResponse.jobs: object expected"); + message.jobs[i] = $root.google.cloud.dataproc.v1.Job.fromObject(object.jobs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.dataproc.v1.ListJobsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListJobsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.ListJobsResponse + * @static + * @param {google.cloud.dataproc.v1.ListJobsResponse} message ListJobsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListJobsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.jobs = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.jobs && message.jobs.length) { + object.jobs = []; + for (var j = 0; j < message.jobs.length; ++j) + object.jobs[j] = $root.google.cloud.dataproc.v1.Job.toObject(message.jobs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListJobsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.ListJobsResponse + * @instance + * @returns {Object.} JSON object + */ + ListJobsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListJobsResponse + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.ListJobsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListJobsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.ListJobsResponse"; + }; + + return ListJobsResponse; + })(); + + v1.CancelJobRequest = (function() { + + /** + * Properties of a CancelJobRequest. + * @memberof google.cloud.dataproc.v1 + * @interface ICancelJobRequest + * @property {string|null} [projectId] CancelJobRequest projectId + * @property {string|null} [region] CancelJobRequest region + * @property {string|null} [jobId] CancelJobRequest jobId + */ + + /** + * Constructs a new CancelJobRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a CancelJobRequest. + * @implements ICancelJobRequest + * @constructor + * @param {google.cloud.dataproc.v1.ICancelJobRequest=} [properties] Properties to set + */ + function CancelJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelJobRequest projectId. + * @member {string} projectId + * @memberof google.cloud.dataproc.v1.CancelJobRequest + * @instance + */ + CancelJobRequest.prototype.projectId = ""; + + /** + * CancelJobRequest region. + * @member {string} region + * @memberof google.cloud.dataproc.v1.CancelJobRequest + * @instance + */ + CancelJobRequest.prototype.region = ""; + + /** + * CancelJobRequest jobId. + * @member {string} jobId + * @memberof google.cloud.dataproc.v1.CancelJobRequest + * @instance + */ + CancelJobRequest.prototype.jobId = ""; + + /** + * Creates a new CancelJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.CancelJobRequest + * @static + * @param {google.cloud.dataproc.v1.ICancelJobRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.CancelJobRequest} CancelJobRequest instance + */ + CancelJobRequest.create = function create(properties) { + return new CancelJobRequest(properties); + }; + + /** + * Encodes the specified CancelJobRequest message. Does not implicitly {@link google.cloud.dataproc.v1.CancelJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.CancelJobRequest + * @static + * @param {google.cloud.dataproc.v1.ICancelJobRequest} message CancelJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.region); + return writer; + }; + + /** + * Encodes the specified CancelJobRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.CancelJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.CancelJobRequest + * @static + * @param {google.cloud.dataproc.v1.ICancelJobRequest} message CancelJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.CancelJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.CancelJobRequest} CancelJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelJobRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.CancelJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 3: { + message.region = reader.string(); + break; + } + case 2: { + message.jobId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.CancelJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.CancelJobRequest} CancelJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelJobRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.CancelJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.jobId != null && message.hasOwnProperty("jobId")) + if (!$util.isString(message.jobId)) + return "jobId: string expected"; + return null; + }; + + /** + * Creates a CancelJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.CancelJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.CancelJobRequest} CancelJobRequest + */ + CancelJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.CancelJobRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.CancelJobRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.region != null) + message.region = String(object.region); + if (object.jobId != null) + message.jobId = String(object.jobId); + return message; + }; + + /** + * Creates a plain object from a CancelJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.CancelJobRequest + * @static + * @param {google.cloud.dataproc.v1.CancelJobRequest} message CancelJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.jobId = ""; + object.region = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.jobId != null && message.hasOwnProperty("jobId")) + object.jobId = message.jobId; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + return object; + }; + + /** + * Converts this CancelJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.CancelJobRequest + * @instance + * @returns {Object.} JSON object + */ + CancelJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelJobRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.CancelJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.CancelJobRequest"; + }; + + return CancelJobRequest; + })(); + + v1.DeleteJobRequest = (function() { + + /** + * Properties of a DeleteJobRequest. + * @memberof google.cloud.dataproc.v1 + * @interface IDeleteJobRequest + * @property {string|null} [projectId] DeleteJobRequest projectId + * @property {string|null} [region] DeleteJobRequest region + * @property {string|null} [jobId] DeleteJobRequest jobId + */ + + /** + * Constructs a new DeleteJobRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a DeleteJobRequest. + * @implements IDeleteJobRequest + * @constructor + * @param {google.cloud.dataproc.v1.IDeleteJobRequest=} [properties] Properties to set + */ + function DeleteJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteJobRequest projectId. + * @member {string} projectId + * @memberof google.cloud.dataproc.v1.DeleteJobRequest + * @instance + */ + DeleteJobRequest.prototype.projectId = ""; + + /** + * DeleteJobRequest region. + * @member {string} region + * @memberof google.cloud.dataproc.v1.DeleteJobRequest + * @instance + */ + DeleteJobRequest.prototype.region = ""; + + /** + * DeleteJobRequest jobId. + * @member {string} jobId + * @memberof google.cloud.dataproc.v1.DeleteJobRequest + * @instance + */ + DeleteJobRequest.prototype.jobId = ""; + + /** + * Creates a new DeleteJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.DeleteJobRequest + * @static + * @param {google.cloud.dataproc.v1.IDeleteJobRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.DeleteJobRequest} DeleteJobRequest instance + */ + DeleteJobRequest.create = function create(properties) { + return new DeleteJobRequest(properties); + }; + + /** + * Encodes the specified DeleteJobRequest message. Does not implicitly {@link google.cloud.dataproc.v1.DeleteJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.DeleteJobRequest + * @static + * @param {google.cloud.dataproc.v1.IDeleteJobRequest} message DeleteJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobId); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.region); + return writer; + }; + + /** + * Encodes the specified DeleteJobRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DeleteJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.DeleteJobRequest + * @static + * @param {google.cloud.dataproc.v1.IDeleteJobRequest} message DeleteJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.DeleteJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.DeleteJobRequest} DeleteJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteJobRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.DeleteJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.projectId = reader.string(); + break; + } + case 3: { + message.region = reader.string(); + break; + } + case 2: { + message.jobId = 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.dataproc.v1.DeleteJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.DeleteJobRequest} DeleteJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteJobRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.DeleteJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.jobId != null && message.hasOwnProperty("jobId")) + if (!$util.isString(message.jobId)) + return "jobId: 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.dataproc.v1.DeleteJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.DeleteJobRequest} DeleteJobRequest + */ + DeleteJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.DeleteJobRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.DeleteJobRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.region != null) + message.region = String(object.region); + if (object.jobId != null) + message.jobId = String(object.jobId); + return message; + }; + + /** + * Creates a plain object from a DeleteJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.DeleteJobRequest + * @static + * @param {google.cloud.dataproc.v1.DeleteJobRequest} message DeleteJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.jobId = ""; + object.region = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.jobId != null && message.hasOwnProperty("jobId")) + object.jobId = message.jobId; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + return object; + }; + + /** + * Converts this DeleteJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.DeleteJobRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteJobRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.DeleteJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.DeleteJobRequest"; + }; + + return DeleteJobRequest; + })(); + + v1.NodeGroupController = (function() { + + /** + * Constructs a new NodeGroupController service. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a NodeGroupController + * @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 NodeGroupController(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (NodeGroupController.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = NodeGroupController; + + /** + * Creates new NodeGroupController service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dataproc.v1.NodeGroupController + * @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 {NodeGroupController} RPC service. Useful where requests and/or responses are streamed. + */ + NodeGroupController.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.NodeGroupController|createNodeGroup}. + * @memberof google.cloud.dataproc.v1.NodeGroupController + * @typedef CreateNodeGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateNodeGroup. + * @function createNodeGroup + * @memberof google.cloud.dataproc.v1.NodeGroupController + * @instance + * @param {google.cloud.dataproc.v1.ICreateNodeGroupRequest} request CreateNodeGroupRequest message or plain object + * @param {google.cloud.dataproc.v1.NodeGroupController.CreateNodeGroupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NodeGroupController.prototype.createNodeGroup = function createNodeGroup(request, callback) { + return this.rpcCall(createNodeGroup, $root.google.cloud.dataproc.v1.CreateNodeGroupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateNodeGroup" }); + + /** + * Calls CreateNodeGroup. + * @function createNodeGroup + * @memberof google.cloud.dataproc.v1.NodeGroupController + * @instance + * @param {google.cloud.dataproc.v1.ICreateNodeGroupRequest} request CreateNodeGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.NodeGroupController|resizeNodeGroup}. + * @memberof google.cloud.dataproc.v1.NodeGroupController + * @typedef ResizeNodeGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ResizeNodeGroup. + * @function resizeNodeGroup + * @memberof google.cloud.dataproc.v1.NodeGroupController + * @instance + * @param {google.cloud.dataproc.v1.IResizeNodeGroupRequest} request ResizeNodeGroupRequest message or plain object + * @param {google.cloud.dataproc.v1.NodeGroupController.ResizeNodeGroupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NodeGroupController.prototype.resizeNodeGroup = function resizeNodeGroup(request, callback) { + return this.rpcCall(resizeNodeGroup, $root.google.cloud.dataproc.v1.ResizeNodeGroupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ResizeNodeGroup" }); + + /** + * Calls ResizeNodeGroup. + * @function resizeNodeGroup + * @memberof google.cloud.dataproc.v1.NodeGroupController + * @instance + * @param {google.cloud.dataproc.v1.IResizeNodeGroupRequest} request ResizeNodeGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.NodeGroupController|getNodeGroup}. + * @memberof google.cloud.dataproc.v1.NodeGroupController + * @typedef GetNodeGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataproc.v1.NodeGroup} [response] NodeGroup + */ + + /** + * Calls GetNodeGroup. + * @function getNodeGroup + * @memberof google.cloud.dataproc.v1.NodeGroupController + * @instance + * @param {google.cloud.dataproc.v1.IGetNodeGroupRequest} request GetNodeGroupRequest message or plain object + * @param {google.cloud.dataproc.v1.NodeGroupController.GetNodeGroupCallback} callback Node-style callback called with the error, if any, and NodeGroup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(NodeGroupController.prototype.getNodeGroup = function getNodeGroup(request, callback) { + return this.rpcCall(getNodeGroup, $root.google.cloud.dataproc.v1.GetNodeGroupRequest, $root.google.cloud.dataproc.v1.NodeGroup, request, callback); + }, "name", { value: "GetNodeGroup" }); + + /** + * Calls GetNodeGroup. + * @function getNodeGroup + * @memberof google.cloud.dataproc.v1.NodeGroupController + * @instance + * @param {google.cloud.dataproc.v1.IGetNodeGroupRequest} request GetNodeGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return NodeGroupController; + })(); + + v1.CreateNodeGroupRequest = (function() { + + /** + * Properties of a CreateNodeGroupRequest. + * @memberof google.cloud.dataproc.v1 + * @interface ICreateNodeGroupRequest + * @property {string|null} [parent] CreateNodeGroupRequest parent + * @property {google.cloud.dataproc.v1.INodeGroup|null} [nodeGroup] CreateNodeGroupRequest nodeGroup + * @property {string|null} [nodeGroupId] CreateNodeGroupRequest nodeGroupId + * @property {string|null} [requestId] CreateNodeGroupRequest requestId + */ + + /** + * Constructs a new CreateNodeGroupRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a CreateNodeGroupRequest. + * @implements ICreateNodeGroupRequest + * @constructor + * @param {google.cloud.dataproc.v1.ICreateNodeGroupRequest=} [properties] Properties to set + */ + function CreateNodeGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateNodeGroupRequest parent. + * @member {string} parent + * @memberof google.cloud.dataproc.v1.CreateNodeGroupRequest + * @instance + */ + CreateNodeGroupRequest.prototype.parent = ""; + + /** + * CreateNodeGroupRequest nodeGroup. + * @member {google.cloud.dataproc.v1.INodeGroup|null|undefined} nodeGroup + * @memberof google.cloud.dataproc.v1.CreateNodeGroupRequest + * @instance + */ + CreateNodeGroupRequest.prototype.nodeGroup = null; + + /** + * CreateNodeGroupRequest nodeGroupId. + * @member {string} nodeGroupId + * @memberof google.cloud.dataproc.v1.CreateNodeGroupRequest + * @instance + */ + CreateNodeGroupRequest.prototype.nodeGroupId = ""; + + /** + * CreateNodeGroupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.dataproc.v1.CreateNodeGroupRequest + * @instance + */ + CreateNodeGroupRequest.prototype.requestId = ""; + + /** + * Creates a new CreateNodeGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.CreateNodeGroupRequest + * @static + * @param {google.cloud.dataproc.v1.ICreateNodeGroupRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.CreateNodeGroupRequest} CreateNodeGroupRequest instance + */ + CreateNodeGroupRequest.create = function create(properties) { + return new CreateNodeGroupRequest(properties); + }; + + /** + * Encodes the specified CreateNodeGroupRequest message. Does not implicitly {@link google.cloud.dataproc.v1.CreateNodeGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.CreateNodeGroupRequest + * @static + * @param {google.cloud.dataproc.v1.ICreateNodeGroupRequest} message CreateNodeGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateNodeGroupRequest.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.nodeGroup != null && Object.hasOwnProperty.call(message, "nodeGroup")) + $root.google.cloud.dataproc.v1.NodeGroup.encode(message.nodeGroup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.nodeGroupId != null && Object.hasOwnProperty.call(message, "nodeGroupId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.nodeGroupId); + return writer; + }; + + /** + * Encodes the specified CreateNodeGroupRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.CreateNodeGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.CreateNodeGroupRequest + * @static + * @param {google.cloud.dataproc.v1.ICreateNodeGroupRequest} message CreateNodeGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateNodeGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateNodeGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.CreateNodeGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.CreateNodeGroupRequest} CreateNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateNodeGroupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.CreateNodeGroupRequest(); + 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.nodeGroup = $root.google.cloud.dataproc.v1.NodeGroup.decode(reader, reader.uint32()); + break; + } + case 4: { + message.nodeGroupId = reader.string(); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateNodeGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.CreateNodeGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.CreateNodeGroupRequest} CreateNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateNodeGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateNodeGroupRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.CreateNodeGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateNodeGroupRequest.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.nodeGroup != null && message.hasOwnProperty("nodeGroup")) { + var error = $root.google.cloud.dataproc.v1.NodeGroup.verify(message.nodeGroup); + if (error) + return "nodeGroup." + error; + } + if (message.nodeGroupId != null && message.hasOwnProperty("nodeGroupId")) + if (!$util.isString(message.nodeGroupId)) + return "nodeGroupId: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateNodeGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.CreateNodeGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.CreateNodeGroupRequest} CreateNodeGroupRequest + */ + CreateNodeGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.CreateNodeGroupRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.CreateNodeGroupRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.nodeGroup != null) { + if (typeof object.nodeGroup !== "object") + throw TypeError(".google.cloud.dataproc.v1.CreateNodeGroupRequest.nodeGroup: object expected"); + message.nodeGroup = $root.google.cloud.dataproc.v1.NodeGroup.fromObject(object.nodeGroup); + } + if (object.nodeGroupId != null) + message.nodeGroupId = String(object.nodeGroupId); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateNodeGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.CreateNodeGroupRequest + * @static + * @param {google.cloud.dataproc.v1.CreateNodeGroupRequest} message CreateNodeGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateNodeGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.nodeGroup = null; + object.requestId = ""; + object.nodeGroupId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.nodeGroup != null && message.hasOwnProperty("nodeGroup")) + object.nodeGroup = $root.google.cloud.dataproc.v1.NodeGroup.toObject(message.nodeGroup, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.nodeGroupId != null && message.hasOwnProperty("nodeGroupId")) + object.nodeGroupId = message.nodeGroupId; + return object; + }; + + /** + * Converts this CreateNodeGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.CreateNodeGroupRequest + * @instance + * @returns {Object.} JSON object + */ + CreateNodeGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateNodeGroupRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.CreateNodeGroupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateNodeGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.CreateNodeGroupRequest"; + }; + + return CreateNodeGroupRequest; + })(); + + v1.ResizeNodeGroupRequest = (function() { + + /** + * Properties of a ResizeNodeGroupRequest. + * @memberof google.cloud.dataproc.v1 + * @interface IResizeNodeGroupRequest + * @property {string|null} [name] ResizeNodeGroupRequest name + * @property {number|null} [size] ResizeNodeGroupRequest size + * @property {string|null} [requestId] ResizeNodeGroupRequest requestId + * @property {google.protobuf.IDuration|null} [gracefulDecommissionTimeout] ResizeNodeGroupRequest gracefulDecommissionTimeout + */ + + /** + * Constructs a new ResizeNodeGroupRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a ResizeNodeGroupRequest. + * @implements IResizeNodeGroupRequest + * @constructor + * @param {google.cloud.dataproc.v1.IResizeNodeGroupRequest=} [properties] Properties to set + */ + function ResizeNodeGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResizeNodeGroupRequest name. + * @member {string} name + * @memberof google.cloud.dataproc.v1.ResizeNodeGroupRequest + * @instance + */ + ResizeNodeGroupRequest.prototype.name = ""; + + /** + * ResizeNodeGroupRequest size. + * @member {number} size + * @memberof google.cloud.dataproc.v1.ResizeNodeGroupRequest + * @instance + */ + ResizeNodeGroupRequest.prototype.size = 0; + + /** + * ResizeNodeGroupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.dataproc.v1.ResizeNodeGroupRequest + * @instance + */ + ResizeNodeGroupRequest.prototype.requestId = ""; + + /** + * ResizeNodeGroupRequest gracefulDecommissionTimeout. + * @member {google.protobuf.IDuration|null|undefined} gracefulDecommissionTimeout + * @memberof google.cloud.dataproc.v1.ResizeNodeGroupRequest + * @instance + */ + ResizeNodeGroupRequest.prototype.gracefulDecommissionTimeout = null; + + /** + * Creates a new ResizeNodeGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.ResizeNodeGroupRequest + * @static + * @param {google.cloud.dataproc.v1.IResizeNodeGroupRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.ResizeNodeGroupRequest} ResizeNodeGroupRequest instance + */ + ResizeNodeGroupRequest.create = function create(properties) { + return new ResizeNodeGroupRequest(properties); + }; + + /** + * Encodes the specified ResizeNodeGroupRequest message. Does not implicitly {@link google.cloud.dataproc.v1.ResizeNodeGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.ResizeNodeGroupRequest + * @static + * @param {google.cloud.dataproc.v1.IResizeNodeGroupRequest} message ResizeNodeGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResizeNodeGroupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.size != null && Object.hasOwnProperty.call(message, "size")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.size); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.gracefulDecommissionTimeout != null && Object.hasOwnProperty.call(message, "gracefulDecommissionTimeout")) + $root.google.protobuf.Duration.encode(message.gracefulDecommissionTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResizeNodeGroupRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ResizeNodeGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.ResizeNodeGroupRequest + * @static + * @param {google.cloud.dataproc.v1.IResizeNodeGroupRequest} message ResizeNodeGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResizeNodeGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResizeNodeGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.ResizeNodeGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.ResizeNodeGroupRequest} ResizeNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResizeNodeGroupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ResizeNodeGroupRequest(); + 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.size = reader.int32(); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.gracefulDecommissionTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResizeNodeGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.ResizeNodeGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.ResizeNodeGroupRequest} ResizeNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResizeNodeGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResizeNodeGroupRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.ResizeNodeGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResizeNodeGroupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.size != null && message.hasOwnProperty("size")) + if (!$util.isInteger(message.size)) + return "size: integer expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.gracefulDecommissionTimeout != null && message.hasOwnProperty("gracefulDecommissionTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.gracefulDecommissionTimeout); + if (error) + return "gracefulDecommissionTimeout." + error; + } + return null; + }; + + /** + * Creates a ResizeNodeGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.ResizeNodeGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.ResizeNodeGroupRequest} ResizeNodeGroupRequest + */ + ResizeNodeGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.ResizeNodeGroupRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.ResizeNodeGroupRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.size != null) + message.size = object.size | 0; + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.gracefulDecommissionTimeout != null) { + if (typeof object.gracefulDecommissionTimeout !== "object") + throw TypeError(".google.cloud.dataproc.v1.ResizeNodeGroupRequest.gracefulDecommissionTimeout: object expected"); + message.gracefulDecommissionTimeout = $root.google.protobuf.Duration.fromObject(object.gracefulDecommissionTimeout); + } + return message; + }; + + /** + * Creates a plain object from a ResizeNodeGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.ResizeNodeGroupRequest + * @static + * @param {google.cloud.dataproc.v1.ResizeNodeGroupRequest} message ResizeNodeGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResizeNodeGroupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.size = 0; + object.requestId = ""; + object.gracefulDecommissionTimeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.size != null && message.hasOwnProperty("size")) + object.size = message.size; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.gracefulDecommissionTimeout != null && message.hasOwnProperty("gracefulDecommissionTimeout")) + object.gracefulDecommissionTimeout = $root.google.protobuf.Duration.toObject(message.gracefulDecommissionTimeout, options); + return object; + }; + + /** + * Converts this ResizeNodeGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.ResizeNodeGroupRequest + * @instance + * @returns {Object.} JSON object + */ + ResizeNodeGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResizeNodeGroupRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.ResizeNodeGroupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResizeNodeGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.ResizeNodeGroupRequest"; + }; + + return ResizeNodeGroupRequest; + })(); + + v1.GetNodeGroupRequest = (function() { + + /** + * Properties of a GetNodeGroupRequest. + * @memberof google.cloud.dataproc.v1 + * @interface IGetNodeGroupRequest + * @property {string|null} [name] GetNodeGroupRequest name + */ + + /** + * Constructs a new GetNodeGroupRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a GetNodeGroupRequest. + * @implements IGetNodeGroupRequest + * @constructor + * @param {google.cloud.dataproc.v1.IGetNodeGroupRequest=} [properties] Properties to set + */ + function GetNodeGroupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetNodeGroupRequest name. + * @member {string} name + * @memberof google.cloud.dataproc.v1.GetNodeGroupRequest + * @instance + */ + GetNodeGroupRequest.prototype.name = ""; + + /** + * Creates a new GetNodeGroupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.GetNodeGroupRequest + * @static + * @param {google.cloud.dataproc.v1.IGetNodeGroupRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.GetNodeGroupRequest} GetNodeGroupRequest instance + */ + GetNodeGroupRequest.create = function create(properties) { + return new GetNodeGroupRequest(properties); + }; + + /** + * Encodes the specified GetNodeGroupRequest message. Does not implicitly {@link google.cloud.dataproc.v1.GetNodeGroupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.GetNodeGroupRequest + * @static + * @param {google.cloud.dataproc.v1.IGetNodeGroupRequest} message GetNodeGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetNodeGroupRequest.encode = function encode(message, writer) { + 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 GetNodeGroupRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GetNodeGroupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.GetNodeGroupRequest + * @static + * @param {google.cloud.dataproc.v1.IGetNodeGroupRequest} message GetNodeGroupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetNodeGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetNodeGroupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.GetNodeGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.GetNodeGroupRequest} GetNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetNodeGroupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.GetNodeGroupRequest(); + 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 GetNodeGroupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.GetNodeGroupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.GetNodeGroupRequest} GetNodeGroupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetNodeGroupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetNodeGroupRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.GetNodeGroupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetNodeGroupRequest.verify = function verify(message) { + if (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 GetNodeGroupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.GetNodeGroupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.GetNodeGroupRequest} GetNodeGroupRequest + */ + GetNodeGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.GetNodeGroupRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.GetNodeGroupRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetNodeGroupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.GetNodeGroupRequest + * @static + * @param {google.cloud.dataproc.v1.GetNodeGroupRequest} message GetNodeGroupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetNodeGroupRequest.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 GetNodeGroupRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.GetNodeGroupRequest + * @instance + * @returns {Object.} JSON object + */ + GetNodeGroupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetNodeGroupRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.GetNodeGroupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetNodeGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.GetNodeGroupRequest"; + }; + + return GetNodeGroupRequest; + })(); + + v1.SessionTemplateController = (function() { + + /** + * Constructs a new SessionTemplateController service. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a SessionTemplateController + * @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 SessionTemplateController(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SessionTemplateController.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SessionTemplateController; + + /** + * Creates new SessionTemplateController service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dataproc.v1.SessionTemplateController + * @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 {SessionTemplateController} RPC service. Useful where requests and/or responses are streamed. + */ + SessionTemplateController.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.SessionTemplateController|createSessionTemplate}. + * @memberof google.cloud.dataproc.v1.SessionTemplateController + * @typedef CreateSessionTemplateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataproc.v1.SessionTemplate} [response] SessionTemplate + */ + + /** + * Calls CreateSessionTemplate. + * @function createSessionTemplate + * @memberof google.cloud.dataproc.v1.SessionTemplateController + * @instance + * @param {google.cloud.dataproc.v1.ICreateSessionTemplateRequest} request CreateSessionTemplateRequest message or plain object + * @param {google.cloud.dataproc.v1.SessionTemplateController.CreateSessionTemplateCallback} callback Node-style callback called with the error, if any, and SessionTemplate + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionTemplateController.prototype.createSessionTemplate = function createSessionTemplate(request, callback) { + return this.rpcCall(createSessionTemplate, $root.google.cloud.dataproc.v1.CreateSessionTemplateRequest, $root.google.cloud.dataproc.v1.SessionTemplate, request, callback); + }, "name", { value: "CreateSessionTemplate" }); + + /** + * Calls CreateSessionTemplate. + * @function createSessionTemplate + * @memberof google.cloud.dataproc.v1.SessionTemplateController + * @instance + * @param {google.cloud.dataproc.v1.ICreateSessionTemplateRequest} request CreateSessionTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.SessionTemplateController|updateSessionTemplate}. + * @memberof google.cloud.dataproc.v1.SessionTemplateController + * @typedef UpdateSessionTemplateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataproc.v1.SessionTemplate} [response] SessionTemplate + */ + + /** + * Calls UpdateSessionTemplate. + * @function updateSessionTemplate + * @memberof google.cloud.dataproc.v1.SessionTemplateController + * @instance + * @param {google.cloud.dataproc.v1.IUpdateSessionTemplateRequest} request UpdateSessionTemplateRequest message or plain object + * @param {google.cloud.dataproc.v1.SessionTemplateController.UpdateSessionTemplateCallback} callback Node-style callback called with the error, if any, and SessionTemplate + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionTemplateController.prototype.updateSessionTemplate = function updateSessionTemplate(request, callback) { + return this.rpcCall(updateSessionTemplate, $root.google.cloud.dataproc.v1.UpdateSessionTemplateRequest, $root.google.cloud.dataproc.v1.SessionTemplate, request, callback); + }, "name", { value: "UpdateSessionTemplate" }); + + /** + * Calls UpdateSessionTemplate. + * @function updateSessionTemplate + * @memberof google.cloud.dataproc.v1.SessionTemplateController + * @instance + * @param {google.cloud.dataproc.v1.IUpdateSessionTemplateRequest} request UpdateSessionTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.SessionTemplateController|getSessionTemplate}. + * @memberof google.cloud.dataproc.v1.SessionTemplateController + * @typedef GetSessionTemplateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataproc.v1.SessionTemplate} [response] SessionTemplate + */ + + /** + * Calls GetSessionTemplate. + * @function getSessionTemplate + * @memberof google.cloud.dataproc.v1.SessionTemplateController + * @instance + * @param {google.cloud.dataproc.v1.IGetSessionTemplateRequest} request GetSessionTemplateRequest message or plain object + * @param {google.cloud.dataproc.v1.SessionTemplateController.GetSessionTemplateCallback} callback Node-style callback called with the error, if any, and SessionTemplate + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionTemplateController.prototype.getSessionTemplate = function getSessionTemplate(request, callback) { + return this.rpcCall(getSessionTemplate, $root.google.cloud.dataproc.v1.GetSessionTemplateRequest, $root.google.cloud.dataproc.v1.SessionTemplate, request, callback); + }, "name", { value: "GetSessionTemplate" }); + + /** + * Calls GetSessionTemplate. + * @function getSessionTemplate + * @memberof google.cloud.dataproc.v1.SessionTemplateController + * @instance + * @param {google.cloud.dataproc.v1.IGetSessionTemplateRequest} request GetSessionTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.SessionTemplateController|listSessionTemplates}. + * @memberof google.cloud.dataproc.v1.SessionTemplateController + * @typedef ListSessionTemplatesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataproc.v1.ListSessionTemplatesResponse} [response] ListSessionTemplatesResponse + */ + + /** + * Calls ListSessionTemplates. + * @function listSessionTemplates + * @memberof google.cloud.dataproc.v1.SessionTemplateController + * @instance + * @param {google.cloud.dataproc.v1.IListSessionTemplatesRequest} request ListSessionTemplatesRequest message or plain object + * @param {google.cloud.dataproc.v1.SessionTemplateController.ListSessionTemplatesCallback} callback Node-style callback called with the error, if any, and ListSessionTemplatesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionTemplateController.prototype.listSessionTemplates = function listSessionTemplates(request, callback) { + return this.rpcCall(listSessionTemplates, $root.google.cloud.dataproc.v1.ListSessionTemplatesRequest, $root.google.cloud.dataproc.v1.ListSessionTemplatesResponse, request, callback); + }, "name", { value: "ListSessionTemplates" }); + + /** + * Calls ListSessionTemplates. + * @function listSessionTemplates + * @memberof google.cloud.dataproc.v1.SessionTemplateController + * @instance + * @param {google.cloud.dataproc.v1.IListSessionTemplatesRequest} request ListSessionTemplatesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.SessionTemplateController|deleteSessionTemplate}. + * @memberof google.cloud.dataproc.v1.SessionTemplateController + * @typedef DeleteSessionTemplateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteSessionTemplate. + * @function deleteSessionTemplate + * @memberof google.cloud.dataproc.v1.SessionTemplateController + * @instance + * @param {google.cloud.dataproc.v1.IDeleteSessionTemplateRequest} request DeleteSessionTemplateRequest message or plain object + * @param {google.cloud.dataproc.v1.SessionTemplateController.DeleteSessionTemplateCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionTemplateController.prototype.deleteSessionTemplate = function deleteSessionTemplate(request, callback) { + return this.rpcCall(deleteSessionTemplate, $root.google.cloud.dataproc.v1.DeleteSessionTemplateRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSessionTemplate" }); + + /** + * Calls DeleteSessionTemplate. + * @function deleteSessionTemplate + * @memberof google.cloud.dataproc.v1.SessionTemplateController + * @instance + * @param {google.cloud.dataproc.v1.IDeleteSessionTemplateRequest} request DeleteSessionTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SessionTemplateController; + })(); + + v1.CreateSessionTemplateRequest = (function() { + + /** + * Properties of a CreateSessionTemplateRequest. + * @memberof google.cloud.dataproc.v1 + * @interface ICreateSessionTemplateRequest + * @property {string|null} [parent] CreateSessionTemplateRequest parent + * @property {google.cloud.dataproc.v1.ISessionTemplate|null} [sessionTemplate] CreateSessionTemplateRequest sessionTemplate + */ + + /** + * Constructs a new CreateSessionTemplateRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a CreateSessionTemplateRequest. + * @implements ICreateSessionTemplateRequest + * @constructor + * @param {google.cloud.dataproc.v1.ICreateSessionTemplateRequest=} [properties] Properties to set + */ + function CreateSessionTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSessionTemplateRequest parent. + * @member {string} parent + * @memberof google.cloud.dataproc.v1.CreateSessionTemplateRequest + * @instance + */ + CreateSessionTemplateRequest.prototype.parent = ""; + + /** + * CreateSessionTemplateRequest sessionTemplate. + * @member {google.cloud.dataproc.v1.ISessionTemplate|null|undefined} sessionTemplate + * @memberof google.cloud.dataproc.v1.CreateSessionTemplateRequest + * @instance + */ + CreateSessionTemplateRequest.prototype.sessionTemplate = null; + + /** + * Creates a new CreateSessionTemplateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.CreateSessionTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.ICreateSessionTemplateRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.CreateSessionTemplateRequest} CreateSessionTemplateRequest instance + */ + CreateSessionTemplateRequest.create = function create(properties) { + return new CreateSessionTemplateRequest(properties); + }; + + /** + * Encodes the specified CreateSessionTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.CreateSessionTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.CreateSessionTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.ICreateSessionTemplateRequest} message CreateSessionTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSessionTemplateRequest.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.sessionTemplate != null && Object.hasOwnProperty.call(message, "sessionTemplate")) + $root.google.cloud.dataproc.v1.SessionTemplate.encode(message.sessionTemplate, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateSessionTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.CreateSessionTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.CreateSessionTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.ICreateSessionTemplateRequest} message CreateSessionTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSessionTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSessionTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.CreateSessionTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.CreateSessionTemplateRequest} CreateSessionTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSessionTemplateRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.CreateSessionTemplateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 3: { + message.sessionTemplate = $root.google.cloud.dataproc.v1.SessionTemplate.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSessionTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.CreateSessionTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.CreateSessionTemplateRequest} CreateSessionTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSessionTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSessionTemplateRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.CreateSessionTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSessionTemplateRequest.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.sessionTemplate != null && message.hasOwnProperty("sessionTemplate")) { + var error = $root.google.cloud.dataproc.v1.SessionTemplate.verify(message.sessionTemplate); + if (error) + return "sessionTemplate." + error; + } + return null; + }; + + /** + * Creates a CreateSessionTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.CreateSessionTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.CreateSessionTemplateRequest} CreateSessionTemplateRequest + */ + CreateSessionTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.CreateSessionTemplateRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.CreateSessionTemplateRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.sessionTemplate != null) { + if (typeof object.sessionTemplate !== "object") + throw TypeError(".google.cloud.dataproc.v1.CreateSessionTemplateRequest.sessionTemplate: object expected"); + message.sessionTemplate = $root.google.cloud.dataproc.v1.SessionTemplate.fromObject(object.sessionTemplate); + } + return message; + }; + + /** + * Creates a plain object from a CreateSessionTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.CreateSessionTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.CreateSessionTemplateRequest} message CreateSessionTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSessionTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.sessionTemplate = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.sessionTemplate != null && message.hasOwnProperty("sessionTemplate")) + object.sessionTemplate = $root.google.cloud.dataproc.v1.SessionTemplate.toObject(message.sessionTemplate, options); + return object; + }; + + /** + * Converts this CreateSessionTemplateRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.CreateSessionTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSessionTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSessionTemplateRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.CreateSessionTemplateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSessionTemplateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.CreateSessionTemplateRequest"; + }; + + return CreateSessionTemplateRequest; + })(); + + v1.UpdateSessionTemplateRequest = (function() { + + /** + * Properties of an UpdateSessionTemplateRequest. + * @memberof google.cloud.dataproc.v1 + * @interface IUpdateSessionTemplateRequest + * @property {google.cloud.dataproc.v1.ISessionTemplate|null} [sessionTemplate] UpdateSessionTemplateRequest sessionTemplate + */ + + /** + * Constructs a new UpdateSessionTemplateRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents an UpdateSessionTemplateRequest. + * @implements IUpdateSessionTemplateRequest + * @constructor + * @param {google.cloud.dataproc.v1.IUpdateSessionTemplateRequest=} [properties] Properties to set + */ + function UpdateSessionTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateSessionTemplateRequest sessionTemplate. + * @member {google.cloud.dataproc.v1.ISessionTemplate|null|undefined} sessionTemplate + * @memberof google.cloud.dataproc.v1.UpdateSessionTemplateRequest + * @instance + */ + UpdateSessionTemplateRequest.prototype.sessionTemplate = null; + + /** + * Creates a new UpdateSessionTemplateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.UpdateSessionTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.IUpdateSessionTemplateRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.UpdateSessionTemplateRequest} UpdateSessionTemplateRequest instance + */ + UpdateSessionTemplateRequest.create = function create(properties) { + return new UpdateSessionTemplateRequest(properties); + }; + + /** + * Encodes the specified UpdateSessionTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.UpdateSessionTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.UpdateSessionTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.IUpdateSessionTemplateRequest} message UpdateSessionTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSessionTemplateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sessionTemplate != null && Object.hasOwnProperty.call(message, "sessionTemplate")) + $root.google.cloud.dataproc.v1.SessionTemplate.encode(message.sessionTemplate, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateSessionTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.UpdateSessionTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.UpdateSessionTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.IUpdateSessionTemplateRequest} message UpdateSessionTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSessionTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSessionTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.UpdateSessionTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.UpdateSessionTemplateRequest} UpdateSessionTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSessionTemplateRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.UpdateSessionTemplateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.sessionTemplate = $root.google.cloud.dataproc.v1.SessionTemplate.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSessionTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.UpdateSessionTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.UpdateSessionTemplateRequest} UpdateSessionTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSessionTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSessionTemplateRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.UpdateSessionTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSessionTemplateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sessionTemplate != null && message.hasOwnProperty("sessionTemplate")) { + var error = $root.google.cloud.dataproc.v1.SessionTemplate.verify(message.sessionTemplate); + if (error) + return "sessionTemplate." + error; + } + return null; + }; + + /** + * Creates an UpdateSessionTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.UpdateSessionTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.UpdateSessionTemplateRequest} UpdateSessionTemplateRequest + */ + UpdateSessionTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.UpdateSessionTemplateRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.UpdateSessionTemplateRequest(); + if (object.sessionTemplate != null) { + if (typeof object.sessionTemplate !== "object") + throw TypeError(".google.cloud.dataproc.v1.UpdateSessionTemplateRequest.sessionTemplate: object expected"); + message.sessionTemplate = $root.google.cloud.dataproc.v1.SessionTemplate.fromObject(object.sessionTemplate); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSessionTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.UpdateSessionTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.UpdateSessionTemplateRequest} message UpdateSessionTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSessionTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.sessionTemplate = null; + if (message.sessionTemplate != null && message.hasOwnProperty("sessionTemplate")) + object.sessionTemplate = $root.google.cloud.dataproc.v1.SessionTemplate.toObject(message.sessionTemplate, options); + return object; + }; + + /** + * Converts this UpdateSessionTemplateRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.UpdateSessionTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSessionTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSessionTemplateRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.UpdateSessionTemplateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSessionTemplateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.UpdateSessionTemplateRequest"; + }; + + return UpdateSessionTemplateRequest; + })(); + + v1.GetSessionTemplateRequest = (function() { + + /** + * Properties of a GetSessionTemplateRequest. + * @memberof google.cloud.dataproc.v1 + * @interface IGetSessionTemplateRequest + * @property {string|null} [name] GetSessionTemplateRequest name + */ + + /** + * Constructs a new GetSessionTemplateRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a GetSessionTemplateRequest. + * @implements IGetSessionTemplateRequest + * @constructor + * @param {google.cloud.dataproc.v1.IGetSessionTemplateRequest=} [properties] Properties to set + */ + function GetSessionTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSessionTemplateRequest name. + * @member {string} name + * @memberof google.cloud.dataproc.v1.GetSessionTemplateRequest + * @instance + */ + GetSessionTemplateRequest.prototype.name = ""; + + /** + * Creates a new GetSessionTemplateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.GetSessionTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.IGetSessionTemplateRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.GetSessionTemplateRequest} GetSessionTemplateRequest instance + */ + GetSessionTemplateRequest.create = function create(properties) { + return new GetSessionTemplateRequest(properties); + }; + + /** + * Encodes the specified GetSessionTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.GetSessionTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.GetSessionTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.IGetSessionTemplateRequest} message GetSessionTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSessionTemplateRequest.encode = function encode(message, writer) { + 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 GetSessionTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GetSessionTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.GetSessionTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.IGetSessionTemplateRequest} message GetSessionTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSessionTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSessionTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.GetSessionTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.GetSessionTemplateRequest} GetSessionTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSessionTemplateRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.GetSessionTemplateRequest(); + 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 GetSessionTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.GetSessionTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.GetSessionTemplateRequest} GetSessionTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSessionTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSessionTemplateRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.GetSessionTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSessionTemplateRequest.verify = function verify(message) { + if (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 GetSessionTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.GetSessionTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.GetSessionTemplateRequest} GetSessionTemplateRequest + */ + GetSessionTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.GetSessionTemplateRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.GetSessionTemplateRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSessionTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.GetSessionTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.GetSessionTemplateRequest} message GetSessionTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSessionTemplateRequest.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 GetSessionTemplateRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.GetSessionTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + GetSessionTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSessionTemplateRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.GetSessionTemplateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSessionTemplateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.GetSessionTemplateRequest"; + }; + + return GetSessionTemplateRequest; + })(); + + v1.ListSessionTemplatesRequest = (function() { + + /** + * Properties of a ListSessionTemplatesRequest. + * @memberof google.cloud.dataproc.v1 + * @interface IListSessionTemplatesRequest + * @property {string|null} [parent] ListSessionTemplatesRequest parent + * @property {number|null} [pageSize] ListSessionTemplatesRequest pageSize + * @property {string|null} [pageToken] ListSessionTemplatesRequest pageToken + * @property {string|null} [filter] ListSessionTemplatesRequest filter + */ + + /** + * Constructs a new ListSessionTemplatesRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a ListSessionTemplatesRequest. + * @implements IListSessionTemplatesRequest + * @constructor + * @param {google.cloud.dataproc.v1.IListSessionTemplatesRequest=} [properties] Properties to set + */ + function ListSessionTemplatesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSessionTemplatesRequest parent. + * @member {string} parent + * @memberof google.cloud.dataproc.v1.ListSessionTemplatesRequest + * @instance + */ + ListSessionTemplatesRequest.prototype.parent = ""; + + /** + * ListSessionTemplatesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dataproc.v1.ListSessionTemplatesRequest + * @instance + */ + ListSessionTemplatesRequest.prototype.pageSize = 0; + + /** + * ListSessionTemplatesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dataproc.v1.ListSessionTemplatesRequest + * @instance + */ + ListSessionTemplatesRequest.prototype.pageToken = ""; + + /** + * ListSessionTemplatesRequest filter. + * @member {string} filter + * @memberof google.cloud.dataproc.v1.ListSessionTemplatesRequest + * @instance + */ + ListSessionTemplatesRequest.prototype.filter = ""; + + /** + * Creates a new ListSessionTemplatesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.ListSessionTemplatesRequest + * @static + * @param {google.cloud.dataproc.v1.IListSessionTemplatesRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.ListSessionTemplatesRequest} ListSessionTemplatesRequest instance + */ + ListSessionTemplatesRequest.create = function create(properties) { + return new ListSessionTemplatesRequest(properties); + }; + + /** + * Encodes the specified ListSessionTemplatesRequest message. Does not implicitly {@link google.cloud.dataproc.v1.ListSessionTemplatesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.ListSessionTemplatesRequest + * @static + * @param {google.cloud.dataproc.v1.IListSessionTemplatesRequest} message ListSessionTemplatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSessionTemplatesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListSessionTemplatesRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListSessionTemplatesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.ListSessionTemplatesRequest + * @static + * @param {google.cloud.dataproc.v1.IListSessionTemplatesRequest} message ListSessionTemplatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSessionTemplatesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSessionTemplatesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.ListSessionTemplatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.ListSessionTemplatesRequest} ListSessionTemplatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSessionTemplatesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ListSessionTemplatesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSessionTemplatesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.ListSessionTemplatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.ListSessionTemplatesRequest} ListSessionTemplatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSessionTemplatesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSessionTemplatesRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.ListSessionTemplatesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSessionTemplatesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListSessionTemplatesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.ListSessionTemplatesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.ListSessionTemplatesRequest} ListSessionTemplatesRequest + */ + ListSessionTemplatesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.ListSessionTemplatesRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.ListSessionTemplatesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListSessionTemplatesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.ListSessionTemplatesRequest + * @static + * @param {google.cloud.dataproc.v1.ListSessionTemplatesRequest} message ListSessionTemplatesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSessionTemplatesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListSessionTemplatesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.ListSessionTemplatesRequest + * @instance + * @returns {Object.} JSON object + */ + ListSessionTemplatesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSessionTemplatesRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.ListSessionTemplatesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSessionTemplatesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.ListSessionTemplatesRequest"; + }; + + return ListSessionTemplatesRequest; + })(); + + v1.ListSessionTemplatesResponse = (function() { + + /** + * Properties of a ListSessionTemplatesResponse. + * @memberof google.cloud.dataproc.v1 + * @interface IListSessionTemplatesResponse + * @property {Array.|null} [sessionTemplates] ListSessionTemplatesResponse sessionTemplates + * @property {string|null} [nextPageToken] ListSessionTemplatesResponse nextPageToken + */ + + /** + * Constructs a new ListSessionTemplatesResponse. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a ListSessionTemplatesResponse. + * @implements IListSessionTemplatesResponse + * @constructor + * @param {google.cloud.dataproc.v1.IListSessionTemplatesResponse=} [properties] Properties to set + */ + function ListSessionTemplatesResponse(properties) { + this.sessionTemplates = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSessionTemplatesResponse sessionTemplates. + * @member {Array.} sessionTemplates + * @memberof google.cloud.dataproc.v1.ListSessionTemplatesResponse + * @instance + */ + ListSessionTemplatesResponse.prototype.sessionTemplates = $util.emptyArray; + + /** + * ListSessionTemplatesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dataproc.v1.ListSessionTemplatesResponse + * @instance + */ + ListSessionTemplatesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSessionTemplatesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.ListSessionTemplatesResponse + * @static + * @param {google.cloud.dataproc.v1.IListSessionTemplatesResponse=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.ListSessionTemplatesResponse} ListSessionTemplatesResponse instance + */ + ListSessionTemplatesResponse.create = function create(properties) { + return new ListSessionTemplatesResponse(properties); + }; + + /** + * Encodes the specified ListSessionTemplatesResponse message. Does not implicitly {@link google.cloud.dataproc.v1.ListSessionTemplatesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.ListSessionTemplatesResponse + * @static + * @param {google.cloud.dataproc.v1.IListSessionTemplatesResponse} message ListSessionTemplatesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSessionTemplatesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sessionTemplates != null && message.sessionTemplates.length) + for (var i = 0; i < message.sessionTemplates.length; ++i) + $root.google.cloud.dataproc.v1.SessionTemplate.encode(message.sessionTemplates[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 ListSessionTemplatesResponse message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListSessionTemplatesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.ListSessionTemplatesResponse + * @static + * @param {google.cloud.dataproc.v1.IListSessionTemplatesResponse} message ListSessionTemplatesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSessionTemplatesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSessionTemplatesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.ListSessionTemplatesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.ListSessionTemplatesResponse} ListSessionTemplatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSessionTemplatesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ListSessionTemplatesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.sessionTemplates && message.sessionTemplates.length)) + message.sessionTemplates = []; + message.sessionTemplates.push($root.google.cloud.dataproc.v1.SessionTemplate.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSessionTemplatesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.ListSessionTemplatesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.ListSessionTemplatesResponse} ListSessionTemplatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSessionTemplatesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSessionTemplatesResponse message. + * @function verify + * @memberof google.cloud.dataproc.v1.ListSessionTemplatesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSessionTemplatesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sessionTemplates != null && message.hasOwnProperty("sessionTemplates")) { + if (!Array.isArray(message.sessionTemplates)) + return "sessionTemplates: array expected"; + for (var i = 0; i < message.sessionTemplates.length; ++i) { + var error = $root.google.cloud.dataproc.v1.SessionTemplate.verify(message.sessionTemplates[i]); + if (error) + return "sessionTemplates." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSessionTemplatesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.ListSessionTemplatesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.ListSessionTemplatesResponse} ListSessionTemplatesResponse + */ + ListSessionTemplatesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.ListSessionTemplatesResponse) + return object; + var message = new $root.google.cloud.dataproc.v1.ListSessionTemplatesResponse(); + if (object.sessionTemplates) { + if (!Array.isArray(object.sessionTemplates)) + throw TypeError(".google.cloud.dataproc.v1.ListSessionTemplatesResponse.sessionTemplates: array expected"); + message.sessionTemplates = []; + for (var i = 0; i < object.sessionTemplates.length; ++i) { + if (typeof object.sessionTemplates[i] !== "object") + throw TypeError(".google.cloud.dataproc.v1.ListSessionTemplatesResponse.sessionTemplates: object expected"); + message.sessionTemplates[i] = $root.google.cloud.dataproc.v1.SessionTemplate.fromObject(object.sessionTemplates[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSessionTemplatesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.ListSessionTemplatesResponse + * @static + * @param {google.cloud.dataproc.v1.ListSessionTemplatesResponse} message ListSessionTemplatesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSessionTemplatesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sessionTemplates = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.sessionTemplates && message.sessionTemplates.length) { + object.sessionTemplates = []; + for (var j = 0; j < message.sessionTemplates.length; ++j) + object.sessionTemplates[j] = $root.google.cloud.dataproc.v1.SessionTemplate.toObject(message.sessionTemplates[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSessionTemplatesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.ListSessionTemplatesResponse + * @instance + * @returns {Object.} JSON object + */ + ListSessionTemplatesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSessionTemplatesResponse + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.ListSessionTemplatesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSessionTemplatesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.ListSessionTemplatesResponse"; + }; + + return ListSessionTemplatesResponse; + })(); + + v1.DeleteSessionTemplateRequest = (function() { + + /** + * Properties of a DeleteSessionTemplateRequest. + * @memberof google.cloud.dataproc.v1 + * @interface IDeleteSessionTemplateRequest + * @property {string|null} [name] DeleteSessionTemplateRequest name + */ + + /** + * Constructs a new DeleteSessionTemplateRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a DeleteSessionTemplateRequest. + * @implements IDeleteSessionTemplateRequest + * @constructor + * @param {google.cloud.dataproc.v1.IDeleteSessionTemplateRequest=} [properties] Properties to set + */ + function DeleteSessionTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSessionTemplateRequest name. + * @member {string} name + * @memberof google.cloud.dataproc.v1.DeleteSessionTemplateRequest + * @instance + */ + DeleteSessionTemplateRequest.prototype.name = ""; + + /** + * Creates a new DeleteSessionTemplateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.DeleteSessionTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.IDeleteSessionTemplateRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.DeleteSessionTemplateRequest} DeleteSessionTemplateRequest instance + */ + DeleteSessionTemplateRequest.create = function create(properties) { + return new DeleteSessionTemplateRequest(properties); + }; + + /** + * Encodes the specified DeleteSessionTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.DeleteSessionTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.DeleteSessionTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.IDeleteSessionTemplateRequest} message DeleteSessionTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSessionTemplateRequest.encode = function encode(message, writer) { + 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 DeleteSessionTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DeleteSessionTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.DeleteSessionTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.IDeleteSessionTemplateRequest} message DeleteSessionTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSessionTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSessionTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.DeleteSessionTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.DeleteSessionTemplateRequest} DeleteSessionTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSessionTemplateRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.DeleteSessionTemplateRequest(); + 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 DeleteSessionTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.DeleteSessionTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.DeleteSessionTemplateRequest} DeleteSessionTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSessionTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSessionTemplateRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.DeleteSessionTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSessionTemplateRequest.verify = function verify(message) { + if (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 DeleteSessionTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.DeleteSessionTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.DeleteSessionTemplateRequest} DeleteSessionTemplateRequest + */ + DeleteSessionTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.DeleteSessionTemplateRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.DeleteSessionTemplateRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteSessionTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.DeleteSessionTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.DeleteSessionTemplateRequest} message DeleteSessionTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSessionTemplateRequest.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 DeleteSessionTemplateRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.DeleteSessionTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSessionTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSessionTemplateRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.DeleteSessionTemplateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSessionTemplateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.DeleteSessionTemplateRequest"; + }; + + return DeleteSessionTemplateRequest; + })(); + + v1.SessionTemplate = (function() { + + /** + * Properties of a SessionTemplate. + * @memberof google.cloud.dataproc.v1 + * @interface ISessionTemplate + * @property {string|null} [name] SessionTemplate name + * @property {string|null} [description] SessionTemplate description + * @property {google.protobuf.ITimestamp|null} [createTime] SessionTemplate createTime + * @property {google.cloud.dataproc.v1.IJupyterConfig|null} [jupyterSession] SessionTemplate jupyterSession + * @property {google.cloud.dataproc.v1.ISparkConnectConfig|null} [sparkConnectSession] SessionTemplate sparkConnectSession + * @property {string|null} [creator] SessionTemplate creator + * @property {Object.|null} [labels] SessionTemplate labels + * @property {google.cloud.dataproc.v1.IRuntimeConfig|null} [runtimeConfig] SessionTemplate runtimeConfig + * @property {google.cloud.dataproc.v1.IEnvironmentConfig|null} [environmentConfig] SessionTemplate environmentConfig + * @property {google.protobuf.ITimestamp|null} [updateTime] SessionTemplate updateTime + * @property {string|null} [uuid] SessionTemplate uuid + */ + + /** + * Constructs a new SessionTemplate. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a SessionTemplate. + * @implements ISessionTemplate + * @constructor + * @param {google.cloud.dataproc.v1.ISessionTemplate=} [properties] Properties to set + */ + function SessionTemplate(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SessionTemplate name. + * @member {string} name + * @memberof google.cloud.dataproc.v1.SessionTemplate + * @instance + */ + SessionTemplate.prototype.name = ""; + + /** + * SessionTemplate description. + * @member {string} description + * @memberof google.cloud.dataproc.v1.SessionTemplate + * @instance + */ + SessionTemplate.prototype.description = ""; + + /** + * SessionTemplate createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.dataproc.v1.SessionTemplate + * @instance + */ + SessionTemplate.prototype.createTime = null; + + /** + * SessionTemplate jupyterSession. + * @member {google.cloud.dataproc.v1.IJupyterConfig|null|undefined} jupyterSession + * @memberof google.cloud.dataproc.v1.SessionTemplate + * @instance + */ + SessionTemplate.prototype.jupyterSession = null; + + /** + * SessionTemplate sparkConnectSession. + * @member {google.cloud.dataproc.v1.ISparkConnectConfig|null|undefined} sparkConnectSession + * @memberof google.cloud.dataproc.v1.SessionTemplate + * @instance + */ + SessionTemplate.prototype.sparkConnectSession = null; + + /** + * SessionTemplate creator. + * @member {string} creator + * @memberof google.cloud.dataproc.v1.SessionTemplate + * @instance + */ + SessionTemplate.prototype.creator = ""; + + /** + * SessionTemplate labels. + * @member {Object.} labels + * @memberof google.cloud.dataproc.v1.SessionTemplate + * @instance + */ + SessionTemplate.prototype.labels = $util.emptyObject; + + /** + * SessionTemplate runtimeConfig. + * @member {google.cloud.dataproc.v1.IRuntimeConfig|null|undefined} runtimeConfig + * @memberof google.cloud.dataproc.v1.SessionTemplate + * @instance + */ + SessionTemplate.prototype.runtimeConfig = null; + + /** + * SessionTemplate environmentConfig. + * @member {google.cloud.dataproc.v1.IEnvironmentConfig|null|undefined} environmentConfig + * @memberof google.cloud.dataproc.v1.SessionTemplate + * @instance + */ + SessionTemplate.prototype.environmentConfig = null; + + /** + * SessionTemplate updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.dataproc.v1.SessionTemplate + * @instance + */ + SessionTemplate.prototype.updateTime = null; + + /** + * SessionTemplate uuid. + * @member {string} uuid + * @memberof google.cloud.dataproc.v1.SessionTemplate + * @instance + */ + SessionTemplate.prototype.uuid = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SessionTemplate sessionConfig. + * @member {"jupyterSession"|"sparkConnectSession"|undefined} sessionConfig + * @memberof google.cloud.dataproc.v1.SessionTemplate + * @instance + */ + Object.defineProperty(SessionTemplate.prototype, "sessionConfig", { + get: $util.oneOfGetter($oneOfFields = ["jupyterSession", "sparkConnectSession"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SessionTemplate instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.SessionTemplate + * @static + * @param {google.cloud.dataproc.v1.ISessionTemplate=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.SessionTemplate} SessionTemplate instance + */ + SessionTemplate.create = function create(properties) { + return new SessionTemplate(properties); + }; + + /** + * Encodes the specified SessionTemplate message. Does not implicitly {@link google.cloud.dataproc.v1.SessionTemplate.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.SessionTemplate + * @static + * @param {google.cloud.dataproc.v1.ISessionTemplate} message SessionTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionTemplate.encode = function encode(message, writer) { + if (!writer) + 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.jupyterSession != null && Object.hasOwnProperty.call(message, "jupyterSession")) + $root.google.cloud.dataproc.v1.JupyterConfig.encode(message.jupyterSession, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.creator); + 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.runtimeConfig != null && Object.hasOwnProperty.call(message, "runtimeConfig")) + $root.google.cloud.dataproc.v1.RuntimeConfig.encode(message.runtimeConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.environmentConfig != null && Object.hasOwnProperty.call(message, "environmentConfig")) + $root.google.cloud.dataproc.v1.EnvironmentConfig.encode(message.environmentConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.description); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.sparkConnectSession != null && Object.hasOwnProperty.call(message, "sparkConnectSession")) + $root.google.cloud.dataproc.v1.SparkConnectConfig.encode(message.sparkConnectSession, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.uuid != null && Object.hasOwnProperty.call(message, "uuid")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.uuid); + return writer; + }; + + /** + * Encodes the specified SessionTemplate message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SessionTemplate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.SessionTemplate + * @static + * @param {google.cloud.dataproc.v1.ISessionTemplate} message SessionTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionTemplate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SessionTemplate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.SessionTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.SessionTemplate} SessionTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionTemplate.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.SessionTemplate(), 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 9: { + message.description = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.jupyterSession = $root.google.cloud.dataproc.v1.JupyterConfig.decode(reader, reader.uint32()); + break; + } + case 11: { + message.sparkConnectSession = $root.google.cloud.dataproc.v1.SparkConnectConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.creator = reader.string(); + break; + } + case 6: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 7: { + message.runtimeConfig = $root.google.cloud.dataproc.v1.RuntimeConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + message.environmentConfig = $root.google.cloud.dataproc.v1.EnvironmentConfig.decode(reader, reader.uint32()); + break; + } + case 10: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 12: { + message.uuid = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SessionTemplate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.SessionTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.SessionTemplate} SessionTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionTemplate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SessionTemplate message. + * @function verify + * @memberof google.cloud.dataproc.v1.SessionTemplate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SessionTemplate.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.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.jupyterSession != null && message.hasOwnProperty("jupyterSession")) { + properties.sessionConfig = 1; + { + var error = $root.google.cloud.dataproc.v1.JupyterConfig.verify(message.jupyterSession); + if (error) + return "jupyterSession." + error; + } + } + if (message.sparkConnectSession != null && message.hasOwnProperty("sparkConnectSession")) { + if (properties.sessionConfig === 1) + return "sessionConfig: multiple values"; + properties.sessionConfig = 1; + { + var error = $root.google.cloud.dataproc.v1.SparkConnectConfig.verify(message.sparkConnectSession); + if (error) + return "sparkConnectSession." + error; + } + } + if (message.creator != null && message.hasOwnProperty("creator")) + if (!$util.isString(message.creator)) + return "creator: 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.runtimeConfig != null && message.hasOwnProperty("runtimeConfig")) { + var error = $root.google.cloud.dataproc.v1.RuntimeConfig.verify(message.runtimeConfig); + if (error) + return "runtimeConfig." + error; + } + if (message.environmentConfig != null && message.hasOwnProperty("environmentConfig")) { + var error = $root.google.cloud.dataproc.v1.EnvironmentConfig.verify(message.environmentConfig); + if (error) + return "environmentConfig." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.uuid != null && message.hasOwnProperty("uuid")) + if (!$util.isString(message.uuid)) + return "uuid: string expected"; + return null; + }; + + /** + * Creates a SessionTemplate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.SessionTemplate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.SessionTemplate} SessionTemplate + */ + SessionTemplate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.SessionTemplate) + return object; + var message = new $root.google.cloud.dataproc.v1.SessionTemplate(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.dataproc.v1.SessionTemplate.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.jupyterSession != null) { + if (typeof object.jupyterSession !== "object") + throw TypeError(".google.cloud.dataproc.v1.SessionTemplate.jupyterSession: object expected"); + message.jupyterSession = $root.google.cloud.dataproc.v1.JupyterConfig.fromObject(object.jupyterSession); + } + if (object.sparkConnectSession != null) { + if (typeof object.sparkConnectSession !== "object") + throw TypeError(".google.cloud.dataproc.v1.SessionTemplate.sparkConnectSession: object expected"); + message.sparkConnectSession = $root.google.cloud.dataproc.v1.SparkConnectConfig.fromObject(object.sparkConnectSession); + } + if (object.creator != null) + message.creator = String(object.creator); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.dataproc.v1.SessionTemplate.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.runtimeConfig != null) { + if (typeof object.runtimeConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.SessionTemplate.runtimeConfig: object expected"); + message.runtimeConfig = $root.google.cloud.dataproc.v1.RuntimeConfig.fromObject(object.runtimeConfig); + } + if (object.environmentConfig != null) { + if (typeof object.environmentConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.SessionTemplate.environmentConfig: object expected"); + message.environmentConfig = $root.google.cloud.dataproc.v1.EnvironmentConfig.fromObject(object.environmentConfig); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.dataproc.v1.SessionTemplate.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.uuid != null) + message.uuid = String(object.uuid); + return message; + }; + + /** + * Creates a plain object from a SessionTemplate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.SessionTemplate + * @static + * @param {google.cloud.dataproc.v1.SessionTemplate} message SessionTemplate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SessionTemplate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.creator = ""; + object.runtimeConfig = null; + object.environmentConfig = null; + object.description = ""; + object.updateTime = null; + object.uuid = ""; + } + 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.jupyterSession != null && message.hasOwnProperty("jupyterSession")) { + object.jupyterSession = $root.google.cloud.dataproc.v1.JupyterConfig.toObject(message.jupyterSession, options); + if (options.oneofs) + object.sessionConfig = "jupyterSession"; + } + if (message.creator != null && message.hasOwnProperty("creator")) + object.creator = message.creator; + 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.runtimeConfig != null && message.hasOwnProperty("runtimeConfig")) + object.runtimeConfig = $root.google.cloud.dataproc.v1.RuntimeConfig.toObject(message.runtimeConfig, options); + if (message.environmentConfig != null && message.hasOwnProperty("environmentConfig")) + object.environmentConfig = $root.google.cloud.dataproc.v1.EnvironmentConfig.toObject(message.environmentConfig, options); + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.sparkConnectSession != null && message.hasOwnProperty("sparkConnectSession")) { + object.sparkConnectSession = $root.google.cloud.dataproc.v1.SparkConnectConfig.toObject(message.sparkConnectSession, options); + if (options.oneofs) + object.sessionConfig = "sparkConnectSession"; + } + if (message.uuid != null && message.hasOwnProperty("uuid")) + object.uuid = message.uuid; + return object; + }; + + /** + * Converts this SessionTemplate to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.SessionTemplate + * @instance + * @returns {Object.} JSON object + */ + SessionTemplate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SessionTemplate + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.SessionTemplate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SessionTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.SessionTemplate"; + }; + + return SessionTemplate; + })(); + + v1.SessionController = (function() { + + /** + * Constructs a new SessionController service. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a SessionController + * @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 SessionController(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SessionController.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SessionController; + + /** + * Creates new SessionController service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dataproc.v1.SessionController + * @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 {SessionController} RPC service. Useful where requests and/or responses are streamed. + */ + SessionController.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.SessionController|createSession}. + * @memberof google.cloud.dataproc.v1.SessionController + * @typedef CreateSessionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateSession. + * @function createSession + * @memberof google.cloud.dataproc.v1.SessionController + * @instance + * @param {google.cloud.dataproc.v1.ICreateSessionRequest} request CreateSessionRequest message or plain object + * @param {google.cloud.dataproc.v1.SessionController.CreateSessionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionController.prototype.createSession = function createSession(request, callback) { + return this.rpcCall(createSession, $root.google.cloud.dataproc.v1.CreateSessionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateSession" }); + + /** + * Calls CreateSession. + * @function createSession + * @memberof google.cloud.dataproc.v1.SessionController + * @instance + * @param {google.cloud.dataproc.v1.ICreateSessionRequest} request CreateSessionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.SessionController|getSession}. + * @memberof google.cloud.dataproc.v1.SessionController + * @typedef GetSessionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataproc.v1.Session} [response] Session + */ + + /** + * Calls GetSession. + * @function getSession + * @memberof google.cloud.dataproc.v1.SessionController + * @instance + * @param {google.cloud.dataproc.v1.IGetSessionRequest} request GetSessionRequest message or plain object + * @param {google.cloud.dataproc.v1.SessionController.GetSessionCallback} callback Node-style callback called with the error, if any, and Session + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionController.prototype.getSession = function getSession(request, callback) { + return this.rpcCall(getSession, $root.google.cloud.dataproc.v1.GetSessionRequest, $root.google.cloud.dataproc.v1.Session, request, callback); + }, "name", { value: "GetSession" }); + + /** + * Calls GetSession. + * @function getSession + * @memberof google.cloud.dataproc.v1.SessionController + * @instance + * @param {google.cloud.dataproc.v1.IGetSessionRequest} request GetSessionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.SessionController|listSessions}. + * @memberof google.cloud.dataproc.v1.SessionController + * @typedef ListSessionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataproc.v1.ListSessionsResponse} [response] ListSessionsResponse + */ + + /** + * Calls ListSessions. + * @function listSessions + * @memberof google.cloud.dataproc.v1.SessionController + * @instance + * @param {google.cloud.dataproc.v1.IListSessionsRequest} request ListSessionsRequest message or plain object + * @param {google.cloud.dataproc.v1.SessionController.ListSessionsCallback} callback Node-style callback called with the error, if any, and ListSessionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionController.prototype.listSessions = function listSessions(request, callback) { + return this.rpcCall(listSessions, $root.google.cloud.dataproc.v1.ListSessionsRequest, $root.google.cloud.dataproc.v1.ListSessionsResponse, request, callback); + }, "name", { value: "ListSessions" }); + + /** + * Calls ListSessions. + * @function listSessions + * @memberof google.cloud.dataproc.v1.SessionController + * @instance + * @param {google.cloud.dataproc.v1.IListSessionsRequest} request ListSessionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.SessionController|terminateSession}. + * @memberof google.cloud.dataproc.v1.SessionController + * @typedef TerminateSessionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls TerminateSession. + * @function terminateSession + * @memberof google.cloud.dataproc.v1.SessionController + * @instance + * @param {google.cloud.dataproc.v1.ITerminateSessionRequest} request TerminateSessionRequest message or plain object + * @param {google.cloud.dataproc.v1.SessionController.TerminateSessionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionController.prototype.terminateSession = function terminateSession(request, callback) { + return this.rpcCall(terminateSession, $root.google.cloud.dataproc.v1.TerminateSessionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "TerminateSession" }); + + /** + * Calls TerminateSession. + * @function terminateSession + * @memberof google.cloud.dataproc.v1.SessionController + * @instance + * @param {google.cloud.dataproc.v1.ITerminateSessionRequest} request TerminateSessionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.SessionController|deleteSession}. + * @memberof google.cloud.dataproc.v1.SessionController + * @typedef DeleteSessionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteSession. + * @function deleteSession + * @memberof google.cloud.dataproc.v1.SessionController + * @instance + * @param {google.cloud.dataproc.v1.IDeleteSessionRequest} request DeleteSessionRequest message or plain object + * @param {google.cloud.dataproc.v1.SessionController.DeleteSessionCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionController.prototype.deleteSession = function deleteSession(request, callback) { + return this.rpcCall(deleteSession, $root.google.cloud.dataproc.v1.DeleteSessionRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteSession" }); + + /** + * Calls DeleteSession. + * @function deleteSession + * @memberof google.cloud.dataproc.v1.SessionController + * @instance + * @param {google.cloud.dataproc.v1.IDeleteSessionRequest} request DeleteSessionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SessionController; + })(); + + v1.CreateSessionRequest = (function() { + + /** + * Properties of a CreateSessionRequest. + * @memberof google.cloud.dataproc.v1 + * @interface ICreateSessionRequest + * @property {string|null} [parent] CreateSessionRequest parent + * @property {google.cloud.dataproc.v1.ISession|null} [session] CreateSessionRequest session + * @property {string|null} [sessionId] CreateSessionRequest sessionId + * @property {string|null} [requestId] CreateSessionRequest requestId + */ + + /** + * Constructs a new CreateSessionRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a CreateSessionRequest. + * @implements ICreateSessionRequest + * @constructor + * @param {google.cloud.dataproc.v1.ICreateSessionRequest=} [properties] Properties to set + */ + function CreateSessionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSessionRequest parent. + * @member {string} parent + * @memberof google.cloud.dataproc.v1.CreateSessionRequest + * @instance + */ + CreateSessionRequest.prototype.parent = ""; + + /** + * CreateSessionRequest session. + * @member {google.cloud.dataproc.v1.ISession|null|undefined} session + * @memberof google.cloud.dataproc.v1.CreateSessionRequest + * @instance + */ + CreateSessionRequest.prototype.session = null; + + /** + * CreateSessionRequest sessionId. + * @member {string} sessionId + * @memberof google.cloud.dataproc.v1.CreateSessionRequest + * @instance + */ + CreateSessionRequest.prototype.sessionId = ""; + + /** + * CreateSessionRequest requestId. + * @member {string} requestId + * @memberof google.cloud.dataproc.v1.CreateSessionRequest + * @instance + */ + CreateSessionRequest.prototype.requestId = ""; + + /** + * Creates a new CreateSessionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.CreateSessionRequest + * @static + * @param {google.cloud.dataproc.v1.ICreateSessionRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.CreateSessionRequest} CreateSessionRequest instance + */ + CreateSessionRequest.create = function create(properties) { + return new CreateSessionRequest(properties); + }; + + /** + * Encodes the specified CreateSessionRequest message. Does not implicitly {@link google.cloud.dataproc.v1.CreateSessionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.CreateSessionRequest + * @static + * @param {google.cloud.dataproc.v1.ICreateSessionRequest} message CreateSessionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSessionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + $root.google.cloud.dataproc.v1.Session.encode(message.session, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sessionId != null && Object.hasOwnProperty.call(message, "sessionId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sessionId); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateSessionRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.CreateSessionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.CreateSessionRequest + * @static + * @param {google.cloud.dataproc.v1.ICreateSessionRequest} message CreateSessionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSessionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.CreateSessionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.CreateSessionRequest} CreateSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSessionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.CreateSessionRequest(); + 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.session = $root.google.cloud.dataproc.v1.Session.decode(reader, reader.uint32()); + break; + } + case 3: { + message.sessionId = reader.string(); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSessionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.CreateSessionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.CreateSessionRequest} CreateSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSessionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSessionRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.CreateSessionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSessionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.session != null && message.hasOwnProperty("session")) { + var error = $root.google.cloud.dataproc.v1.Session.verify(message.session); + if (error) + return "session." + error; + } + if (message.sessionId != null && message.hasOwnProperty("sessionId")) + if (!$util.isString(message.sessionId)) + return "sessionId: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateSessionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.CreateSessionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.CreateSessionRequest} CreateSessionRequest + */ + CreateSessionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.CreateSessionRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.CreateSessionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.session != null) { + if (typeof object.session !== "object") + throw TypeError(".google.cloud.dataproc.v1.CreateSessionRequest.session: object expected"); + message.session = $root.google.cloud.dataproc.v1.Session.fromObject(object.session); + } + if (object.sessionId != null) + message.sessionId = String(object.sessionId); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateSessionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.CreateSessionRequest + * @static + * @param {google.cloud.dataproc.v1.CreateSessionRequest} message CreateSessionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSessionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.session = null; + object.sessionId = ""; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.session != null && message.hasOwnProperty("session")) + object.session = $root.google.cloud.dataproc.v1.Session.toObject(message.session, options); + if (message.sessionId != null && message.hasOwnProperty("sessionId")) + object.sessionId = message.sessionId; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateSessionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.CreateSessionRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSessionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSessionRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.CreateSessionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.CreateSessionRequest"; + }; + + return CreateSessionRequest; + })(); + + v1.GetSessionRequest = (function() { + + /** + * Properties of a GetSessionRequest. + * @memberof google.cloud.dataproc.v1 + * @interface IGetSessionRequest + * @property {string|null} [name] GetSessionRequest name + */ + + /** + * Constructs a new GetSessionRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a GetSessionRequest. + * @implements IGetSessionRequest + * @constructor + * @param {google.cloud.dataproc.v1.IGetSessionRequest=} [properties] Properties to set + */ + function GetSessionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSessionRequest name. + * @member {string} name + * @memberof google.cloud.dataproc.v1.GetSessionRequest + * @instance + */ + GetSessionRequest.prototype.name = ""; + + /** + * Creates a new GetSessionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.GetSessionRequest + * @static + * @param {google.cloud.dataproc.v1.IGetSessionRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.GetSessionRequest} GetSessionRequest instance + */ + GetSessionRequest.create = function create(properties) { + return new GetSessionRequest(properties); + }; + + /** + * Encodes the specified GetSessionRequest message. Does not implicitly {@link google.cloud.dataproc.v1.GetSessionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.GetSessionRequest + * @static + * @param {google.cloud.dataproc.v1.IGetSessionRequest} message GetSessionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSessionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetSessionRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GetSessionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.GetSessionRequest + * @static + * @param {google.cloud.dataproc.v1.IGetSessionRequest} message GetSessionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSessionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.GetSessionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.GetSessionRequest} GetSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSessionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.GetSessionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSessionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.GetSessionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.GetSessionRequest} GetSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSessionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSessionRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.GetSessionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSessionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetSessionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.GetSessionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.GetSessionRequest} GetSessionRequest + */ + GetSessionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.GetSessionRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.GetSessionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSessionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.GetSessionRequest + * @static + * @param {google.cloud.dataproc.v1.GetSessionRequest} message GetSessionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSessionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetSessionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.GetSessionRequest + * @instance + * @returns {Object.} JSON object + */ + GetSessionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSessionRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.GetSessionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.GetSessionRequest"; + }; + + return GetSessionRequest; + })(); + + v1.ListSessionsRequest = (function() { + + /** + * Properties of a ListSessionsRequest. + * @memberof google.cloud.dataproc.v1 + * @interface IListSessionsRequest + * @property {string|null} [parent] ListSessionsRequest parent + * @property {number|null} [pageSize] ListSessionsRequest pageSize + * @property {string|null} [pageToken] ListSessionsRequest pageToken + * @property {string|null} [filter] ListSessionsRequest filter + */ + + /** + * Constructs a new ListSessionsRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a ListSessionsRequest. + * @implements IListSessionsRequest + * @constructor + * @param {google.cloud.dataproc.v1.IListSessionsRequest=} [properties] Properties to set + */ + function ListSessionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSessionsRequest parent. + * @member {string} parent + * @memberof google.cloud.dataproc.v1.ListSessionsRequest + * @instance + */ + ListSessionsRequest.prototype.parent = ""; + + /** + * ListSessionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dataproc.v1.ListSessionsRequest + * @instance + */ + ListSessionsRequest.prototype.pageSize = 0; + + /** + * ListSessionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dataproc.v1.ListSessionsRequest + * @instance + */ + ListSessionsRequest.prototype.pageToken = ""; + + /** + * ListSessionsRequest filter. + * @member {string} filter + * @memberof google.cloud.dataproc.v1.ListSessionsRequest + * @instance + */ + ListSessionsRequest.prototype.filter = ""; + + /** + * Creates a new ListSessionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.ListSessionsRequest + * @static + * @param {google.cloud.dataproc.v1.IListSessionsRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.ListSessionsRequest} ListSessionsRequest instance + */ + ListSessionsRequest.create = function create(properties) { + return new ListSessionsRequest(properties); + }; + + /** + * Encodes the specified ListSessionsRequest message. Does not implicitly {@link google.cloud.dataproc.v1.ListSessionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.ListSessionsRequest + * @static + * @param {google.cloud.dataproc.v1.IListSessionsRequest} message ListSessionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSessionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListSessionsRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListSessionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.ListSessionsRequest + * @static + * @param {google.cloud.dataproc.v1.IListSessionsRequest} message ListSessionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSessionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSessionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.ListSessionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.ListSessionsRequest} ListSessionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSessionsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ListSessionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSessionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.ListSessionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.ListSessionsRequest} ListSessionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSessionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSessionsRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.ListSessionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSessionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListSessionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.ListSessionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.ListSessionsRequest} ListSessionsRequest + */ + ListSessionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.ListSessionsRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.ListSessionsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListSessionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.ListSessionsRequest + * @static + * @param {google.cloud.dataproc.v1.ListSessionsRequest} message ListSessionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSessionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListSessionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.ListSessionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListSessionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSessionsRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.ListSessionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSessionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.ListSessionsRequest"; + }; + + return ListSessionsRequest; + })(); + + v1.ListSessionsResponse = (function() { + + /** + * Properties of a ListSessionsResponse. + * @memberof google.cloud.dataproc.v1 + * @interface IListSessionsResponse + * @property {Array.|null} [sessions] ListSessionsResponse sessions + * @property {string|null} [nextPageToken] ListSessionsResponse nextPageToken + */ + + /** + * Constructs a new ListSessionsResponse. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a ListSessionsResponse. + * @implements IListSessionsResponse + * @constructor + * @param {google.cloud.dataproc.v1.IListSessionsResponse=} [properties] Properties to set + */ + function ListSessionsResponse(properties) { + this.sessions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSessionsResponse sessions. + * @member {Array.} sessions + * @memberof google.cloud.dataproc.v1.ListSessionsResponse + * @instance + */ + ListSessionsResponse.prototype.sessions = $util.emptyArray; + + /** + * ListSessionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dataproc.v1.ListSessionsResponse + * @instance + */ + ListSessionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSessionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.ListSessionsResponse + * @static + * @param {google.cloud.dataproc.v1.IListSessionsResponse=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.ListSessionsResponse} ListSessionsResponse instance + */ + ListSessionsResponse.create = function create(properties) { + return new ListSessionsResponse(properties); + }; + + /** + * Encodes the specified ListSessionsResponse message. Does not implicitly {@link google.cloud.dataproc.v1.ListSessionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.ListSessionsResponse + * @static + * @param {google.cloud.dataproc.v1.IListSessionsResponse} message ListSessionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSessionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sessions != null && message.sessions.length) + for (var i = 0; i < message.sessions.length; ++i) + $root.google.cloud.dataproc.v1.Session.encode(message.sessions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListSessionsResponse message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListSessionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.ListSessionsResponse + * @static + * @param {google.cloud.dataproc.v1.IListSessionsResponse} message ListSessionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSessionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSessionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.ListSessionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.ListSessionsResponse} ListSessionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSessionsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ListSessionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.sessions && message.sessions.length)) + message.sessions = []; + message.sessions.push($root.google.cloud.dataproc.v1.Session.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSessionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.ListSessionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.ListSessionsResponse} ListSessionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSessionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSessionsResponse message. + * @function verify + * @memberof google.cloud.dataproc.v1.ListSessionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSessionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sessions != null && message.hasOwnProperty("sessions")) { + if (!Array.isArray(message.sessions)) + return "sessions: array expected"; + for (var i = 0; i < message.sessions.length; ++i) { + var error = $root.google.cloud.dataproc.v1.Session.verify(message.sessions[i]); + if (error) + return "sessions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSessionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.ListSessionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.ListSessionsResponse} ListSessionsResponse + */ + ListSessionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.ListSessionsResponse) + return object; + var message = new $root.google.cloud.dataproc.v1.ListSessionsResponse(); + if (object.sessions) { + if (!Array.isArray(object.sessions)) + throw TypeError(".google.cloud.dataproc.v1.ListSessionsResponse.sessions: array expected"); + message.sessions = []; + for (var i = 0; i < object.sessions.length; ++i) { + if (typeof object.sessions[i] !== "object") + throw TypeError(".google.cloud.dataproc.v1.ListSessionsResponse.sessions: object expected"); + message.sessions[i] = $root.google.cloud.dataproc.v1.Session.fromObject(object.sessions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSessionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.ListSessionsResponse + * @static + * @param {google.cloud.dataproc.v1.ListSessionsResponse} message ListSessionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSessionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sessions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.sessions && message.sessions.length) { + object.sessions = []; + for (var j = 0; j < message.sessions.length; ++j) + object.sessions[j] = $root.google.cloud.dataproc.v1.Session.toObject(message.sessions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSessionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.ListSessionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListSessionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSessionsResponse + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.ListSessionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSessionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.ListSessionsResponse"; + }; + + return ListSessionsResponse; + })(); + + v1.TerminateSessionRequest = (function() { + + /** + * Properties of a TerminateSessionRequest. + * @memberof google.cloud.dataproc.v1 + * @interface ITerminateSessionRequest + * @property {string|null} [name] TerminateSessionRequest name + * @property {string|null} [requestId] TerminateSessionRequest requestId + */ + + /** + * Constructs a new TerminateSessionRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a TerminateSessionRequest. + * @implements ITerminateSessionRequest + * @constructor + * @param {google.cloud.dataproc.v1.ITerminateSessionRequest=} [properties] Properties to set + */ + function TerminateSessionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TerminateSessionRequest name. + * @member {string} name + * @memberof google.cloud.dataproc.v1.TerminateSessionRequest + * @instance + */ + TerminateSessionRequest.prototype.name = ""; + + /** + * TerminateSessionRequest requestId. + * @member {string} requestId + * @memberof google.cloud.dataproc.v1.TerminateSessionRequest + * @instance + */ + TerminateSessionRequest.prototype.requestId = ""; + + /** + * Creates a new TerminateSessionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.TerminateSessionRequest + * @static + * @param {google.cloud.dataproc.v1.ITerminateSessionRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.TerminateSessionRequest} TerminateSessionRequest instance + */ + TerminateSessionRequest.create = function create(properties) { + return new TerminateSessionRequest(properties); + }; + + /** + * Encodes the specified TerminateSessionRequest message. Does not implicitly {@link google.cloud.dataproc.v1.TerminateSessionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.TerminateSessionRequest + * @static + * @param {google.cloud.dataproc.v1.ITerminateSessionRequest} message TerminateSessionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TerminateSessionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified TerminateSessionRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.TerminateSessionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.TerminateSessionRequest + * @static + * @param {google.cloud.dataproc.v1.ITerminateSessionRequest} message TerminateSessionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TerminateSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TerminateSessionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.TerminateSessionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.TerminateSessionRequest} TerminateSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TerminateSessionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.TerminateSessionRequest(); + 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.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TerminateSessionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.TerminateSessionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.TerminateSessionRequest} TerminateSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TerminateSessionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TerminateSessionRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.TerminateSessionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TerminateSessionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a TerminateSessionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.TerminateSessionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.TerminateSessionRequest} TerminateSessionRequest + */ + TerminateSessionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.TerminateSessionRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.TerminateSessionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a TerminateSessionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.TerminateSessionRequest + * @static + * @param {google.cloud.dataproc.v1.TerminateSessionRequest} message TerminateSessionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TerminateSessionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this TerminateSessionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.TerminateSessionRequest + * @instance + * @returns {Object.} JSON object + */ + TerminateSessionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TerminateSessionRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.TerminateSessionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TerminateSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.TerminateSessionRequest"; + }; + + return TerminateSessionRequest; + })(); + + v1.DeleteSessionRequest = (function() { + + /** + * Properties of a DeleteSessionRequest. + * @memberof google.cloud.dataproc.v1 + * @interface IDeleteSessionRequest + * @property {string|null} [name] DeleteSessionRequest name + * @property {string|null} [requestId] DeleteSessionRequest requestId + */ + + /** + * Constructs a new DeleteSessionRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a DeleteSessionRequest. + * @implements IDeleteSessionRequest + * @constructor + * @param {google.cloud.dataproc.v1.IDeleteSessionRequest=} [properties] Properties to set + */ + function DeleteSessionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSessionRequest name. + * @member {string} name + * @memberof google.cloud.dataproc.v1.DeleteSessionRequest + * @instance + */ + DeleteSessionRequest.prototype.name = ""; + + /** + * DeleteSessionRequest requestId. + * @member {string} requestId + * @memberof google.cloud.dataproc.v1.DeleteSessionRequest + * @instance + */ + DeleteSessionRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteSessionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.DeleteSessionRequest + * @static + * @param {google.cloud.dataproc.v1.IDeleteSessionRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.DeleteSessionRequest} DeleteSessionRequest instance + */ + DeleteSessionRequest.create = function create(properties) { + return new DeleteSessionRequest(properties); + }; + + /** + * Encodes the specified DeleteSessionRequest message. Does not implicitly {@link google.cloud.dataproc.v1.DeleteSessionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.DeleteSessionRequest + * @static + * @param {google.cloud.dataproc.v1.IDeleteSessionRequest} message DeleteSessionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSessionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteSessionRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DeleteSessionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.DeleteSessionRequest + * @static + * @param {google.cloud.dataproc.v1.IDeleteSessionRequest} message DeleteSessionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSessionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.DeleteSessionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.DeleteSessionRequest} DeleteSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSessionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.DeleteSessionRequest(); + 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.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSessionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.DeleteSessionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.DeleteSessionRequest} DeleteSessionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSessionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSessionRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.DeleteSessionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSessionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteSessionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.DeleteSessionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.DeleteSessionRequest} DeleteSessionRequest + */ + DeleteSessionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.DeleteSessionRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.DeleteSessionRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteSessionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.DeleteSessionRequest + * @static + * @param {google.cloud.dataproc.v1.DeleteSessionRequest} message DeleteSessionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSessionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteSessionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.DeleteSessionRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSessionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSessionRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.DeleteSessionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.DeleteSessionRequest"; + }; + + return DeleteSessionRequest; + })(); + + v1.Session = (function() { + + /** + * Properties of a Session. + * @memberof google.cloud.dataproc.v1 + * @interface ISession + * @property {string|null} [name] Session name + * @property {string|null} [uuid] Session uuid + * @property {google.protobuf.ITimestamp|null} [createTime] Session createTime + * @property {google.cloud.dataproc.v1.IJupyterConfig|null} [jupyterSession] Session jupyterSession + * @property {google.cloud.dataproc.v1.ISparkConnectConfig|null} [sparkConnectSession] Session sparkConnectSession + * @property {google.cloud.dataproc.v1.IRuntimeInfo|null} [runtimeInfo] Session runtimeInfo + * @property {google.cloud.dataproc.v1.Session.State|null} [state] Session state + * @property {string|null} [stateMessage] Session stateMessage + * @property {google.protobuf.ITimestamp|null} [stateTime] Session stateTime + * @property {string|null} [creator] Session creator + * @property {Object.|null} [labels] Session labels + * @property {google.cloud.dataproc.v1.IRuntimeConfig|null} [runtimeConfig] Session runtimeConfig + * @property {google.cloud.dataproc.v1.IEnvironmentConfig|null} [environmentConfig] Session environmentConfig + * @property {string|null} [user] Session user + * @property {Array.|null} [stateHistory] Session stateHistory + * @property {string|null} [sessionTemplate] Session sessionTemplate + */ + + /** + * Constructs a new Session. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a Session. + * @implements ISession + * @constructor + * @param {google.cloud.dataproc.v1.ISession=} [properties] Properties to set + */ + function Session(properties) { + this.labels = {}; + this.stateHistory = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Session name. + * @member {string} name + * @memberof google.cloud.dataproc.v1.Session + * @instance + */ + Session.prototype.name = ""; + + /** + * Session uuid. + * @member {string} uuid + * @memberof google.cloud.dataproc.v1.Session + * @instance + */ + Session.prototype.uuid = ""; + + /** + * Session createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.dataproc.v1.Session + * @instance + */ + Session.prototype.createTime = null; + + /** + * Session jupyterSession. + * @member {google.cloud.dataproc.v1.IJupyterConfig|null|undefined} jupyterSession + * @memberof google.cloud.dataproc.v1.Session + * @instance + */ + Session.prototype.jupyterSession = null; + + /** + * Session sparkConnectSession. + * @member {google.cloud.dataproc.v1.ISparkConnectConfig|null|undefined} sparkConnectSession + * @memberof google.cloud.dataproc.v1.Session + * @instance + */ + Session.prototype.sparkConnectSession = null; + + /** + * Session runtimeInfo. + * @member {google.cloud.dataproc.v1.IRuntimeInfo|null|undefined} runtimeInfo + * @memberof google.cloud.dataproc.v1.Session + * @instance + */ + Session.prototype.runtimeInfo = null; + + /** + * Session state. + * @member {google.cloud.dataproc.v1.Session.State} state + * @memberof google.cloud.dataproc.v1.Session + * @instance + */ + Session.prototype.state = 0; + + /** + * Session stateMessage. + * @member {string} stateMessage + * @memberof google.cloud.dataproc.v1.Session + * @instance + */ + Session.prototype.stateMessage = ""; + + /** + * Session stateTime. + * @member {google.protobuf.ITimestamp|null|undefined} stateTime + * @memberof google.cloud.dataproc.v1.Session + * @instance + */ + Session.prototype.stateTime = null; + + /** + * Session creator. + * @member {string} creator + * @memberof google.cloud.dataproc.v1.Session + * @instance + */ + Session.prototype.creator = ""; + + /** + * Session labels. + * @member {Object.} labels + * @memberof google.cloud.dataproc.v1.Session + * @instance + */ + Session.prototype.labels = $util.emptyObject; + + /** + * Session runtimeConfig. + * @member {google.cloud.dataproc.v1.IRuntimeConfig|null|undefined} runtimeConfig + * @memberof google.cloud.dataproc.v1.Session + * @instance + */ + Session.prototype.runtimeConfig = null; + + /** + * Session environmentConfig. + * @member {google.cloud.dataproc.v1.IEnvironmentConfig|null|undefined} environmentConfig + * @memberof google.cloud.dataproc.v1.Session + * @instance + */ + Session.prototype.environmentConfig = null; + + /** + * Session user. + * @member {string} user + * @memberof google.cloud.dataproc.v1.Session + * @instance + */ + Session.prototype.user = ""; + + /** + * Session stateHistory. + * @member {Array.} stateHistory + * @memberof google.cloud.dataproc.v1.Session + * @instance + */ + Session.prototype.stateHistory = $util.emptyArray; + + /** + * Session sessionTemplate. + * @member {string} sessionTemplate + * @memberof google.cloud.dataproc.v1.Session + * @instance + */ + Session.prototype.sessionTemplate = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Session sessionConfig. + * @member {"jupyterSession"|"sparkConnectSession"|undefined} sessionConfig + * @memberof google.cloud.dataproc.v1.Session + * @instance + */ + Object.defineProperty(Session.prototype, "sessionConfig", { + get: $util.oneOfGetter($oneOfFields = ["jupyterSession", "sparkConnectSession"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Session instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.Session + * @static + * @param {google.cloud.dataproc.v1.ISession=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.Session} Session instance + */ + Session.create = function create(properties) { + return new Session(properties); + }; + + /** + * Encodes the specified Session message. Does not implicitly {@link google.cloud.dataproc.v1.Session.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.Session + * @static + * @param {google.cloud.dataproc.v1.ISession} message Session message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Session.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.uuid != null && Object.hasOwnProperty.call(message, "uuid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uuid); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.jupyterSession != null && Object.hasOwnProperty.call(message, "jupyterSession")) + $root.google.cloud.dataproc.v1.JupyterConfig.encode(message.jupyterSession, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.runtimeInfo != null && Object.hasOwnProperty.call(message, "runtimeInfo")) + $root.google.cloud.dataproc.v1.RuntimeInfo.encode(message.runtimeInfo, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + if (message.stateMessage != null && Object.hasOwnProperty.call(message, "stateMessage")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.stateMessage); + if (message.stateTime != null && Object.hasOwnProperty.call(message, "stateTime")) + $root.google.protobuf.Timestamp.encode(message.stateTime, 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.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.runtimeConfig != null && Object.hasOwnProperty.call(message, "runtimeConfig")) + $root.google.cloud.dataproc.v1.RuntimeConfig.encode(message.runtimeConfig, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.environmentConfig != null && Object.hasOwnProperty.call(message, "environmentConfig")) + $root.google.cloud.dataproc.v1.EnvironmentConfig.encode(message.environmentConfig, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.user); + if (message.stateHistory != null && message.stateHistory.length) + for (var i = 0; i < message.stateHistory.length; ++i) + $root.google.cloud.dataproc.v1.Session.SessionStateHistory.encode(message.stateHistory[i], writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.sessionTemplate != null && Object.hasOwnProperty.call(message, "sessionTemplate")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.sessionTemplate); + if (message.sparkConnectSession != null && Object.hasOwnProperty.call(message, "sparkConnectSession")) + $root.google.cloud.dataproc.v1.SparkConnectConfig.encode(message.sparkConnectSession, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Session message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.Session.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.Session + * @static + * @param {google.cloud.dataproc.v1.ISession} message Session message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Session.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Session message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.Session + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.Session} Session + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Session.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.Session(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.uuid = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.jupyterSession = $root.google.cloud.dataproc.v1.JupyterConfig.decode(reader, reader.uint32()); + break; + } + case 17: { + message.sparkConnectSession = $root.google.cloud.dataproc.v1.SparkConnectConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.runtimeInfo = $root.google.cloud.dataproc.v1.RuntimeInfo.decode(reader, reader.uint32()); + break; + } + case 7: { + message.state = reader.int32(); + break; + } + case 8: { + message.stateMessage = reader.string(); + break; + } + case 9: { + message.stateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.creator = reader.string(); + break; + } + case 11: { + 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 12: { + message.runtimeConfig = $root.google.cloud.dataproc.v1.RuntimeConfig.decode(reader, reader.uint32()); + break; + } + case 13: { + message.environmentConfig = $root.google.cloud.dataproc.v1.EnvironmentConfig.decode(reader, reader.uint32()); + break; + } + case 14: { + message.user = reader.string(); + break; + } + case 15: { + if (!(message.stateHistory && message.stateHistory.length)) + message.stateHistory = []; + message.stateHistory.push($root.google.cloud.dataproc.v1.Session.SessionStateHistory.decode(reader, reader.uint32())); + break; + } + case 16: { + message.sessionTemplate = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Session message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.Session + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.Session} Session + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Session.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Session message. + * @function verify + * @memberof google.cloud.dataproc.v1.Session + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Session.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.uuid != null && message.hasOwnProperty("uuid")) + if (!$util.isString(message.uuid)) + return "uuid: 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.jupyterSession != null && message.hasOwnProperty("jupyterSession")) { + properties.sessionConfig = 1; + { + var error = $root.google.cloud.dataproc.v1.JupyterConfig.verify(message.jupyterSession); + if (error) + return "jupyterSession." + error; + } + } + if (message.sparkConnectSession != null && message.hasOwnProperty("sparkConnectSession")) { + if (properties.sessionConfig === 1) + return "sessionConfig: multiple values"; + properties.sessionConfig = 1; + { + var error = $root.google.cloud.dataproc.v1.SparkConnectConfig.verify(message.sparkConnectSession); + if (error) + return "sparkConnectSession." + error; + } + } + if (message.runtimeInfo != null && message.hasOwnProperty("runtimeInfo")) { + var error = $root.google.cloud.dataproc.v1.RuntimeInfo.verify(message.runtimeInfo); + if (error) + return "runtimeInfo." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + if (!$util.isString(message.stateMessage)) + return "stateMessage: string expected"; + if (message.stateTime != null && message.hasOwnProperty("stateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.stateTime); + if (error) + return "stateTime." + error; + } + if (message.creator != null && message.hasOwnProperty("creator")) + if (!$util.isString(message.creator)) + return "creator: 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.runtimeConfig != null && message.hasOwnProperty("runtimeConfig")) { + var error = $root.google.cloud.dataproc.v1.RuntimeConfig.verify(message.runtimeConfig); + if (error) + return "runtimeConfig." + error; + } + if (message.environmentConfig != null && message.hasOwnProperty("environmentConfig")) { + var error = $root.google.cloud.dataproc.v1.EnvironmentConfig.verify(message.environmentConfig); + if (error) + return "environmentConfig." + error; + } + if (message.user != null && message.hasOwnProperty("user")) + if (!$util.isString(message.user)) + return "user: string expected"; + if (message.stateHistory != null && message.hasOwnProperty("stateHistory")) { + if (!Array.isArray(message.stateHistory)) + return "stateHistory: array expected"; + for (var i = 0; i < message.stateHistory.length; ++i) { + var error = $root.google.cloud.dataproc.v1.Session.SessionStateHistory.verify(message.stateHistory[i]); + if (error) + return "stateHistory." + error; + } + } + if (message.sessionTemplate != null && message.hasOwnProperty("sessionTemplate")) + if (!$util.isString(message.sessionTemplate)) + return "sessionTemplate: string expected"; + return null; + }; + + /** + * Creates a Session message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.Session + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.Session} Session + */ + Session.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.Session) + return object; + var message = new $root.google.cloud.dataproc.v1.Session(); + if (object.name != null) + message.name = String(object.name); + if (object.uuid != null) + message.uuid = String(object.uuid); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.dataproc.v1.Session.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.jupyterSession != null) { + if (typeof object.jupyterSession !== "object") + throw TypeError(".google.cloud.dataproc.v1.Session.jupyterSession: object expected"); + message.jupyterSession = $root.google.cloud.dataproc.v1.JupyterConfig.fromObject(object.jupyterSession); + } + if (object.sparkConnectSession != null) { + if (typeof object.sparkConnectSession !== "object") + throw TypeError(".google.cloud.dataproc.v1.Session.sparkConnectSession: object expected"); + message.sparkConnectSession = $root.google.cloud.dataproc.v1.SparkConnectConfig.fromObject(object.sparkConnectSession); + } + if (object.runtimeInfo != null) { + if (typeof object.runtimeInfo !== "object") + throw TypeError(".google.cloud.dataproc.v1.Session.runtimeInfo: object expected"); + message.runtimeInfo = $root.google.cloud.dataproc.v1.RuntimeInfo.fromObject(object.runtimeInfo); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + case "TERMINATING": + case 3: + message.state = 3; + break; + case "TERMINATED": + case 4: + message.state = 4; + break; + case "FAILED": + case 5: + message.state = 5; + break; + } + if (object.stateMessage != null) + message.stateMessage = String(object.stateMessage); + if (object.stateTime != null) { + if (typeof object.stateTime !== "object") + throw TypeError(".google.cloud.dataproc.v1.Session.stateTime: object expected"); + message.stateTime = $root.google.protobuf.Timestamp.fromObject(object.stateTime); + } + if (object.creator != null) + message.creator = String(object.creator); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.dataproc.v1.Session.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.runtimeConfig != null) { + if (typeof object.runtimeConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.Session.runtimeConfig: object expected"); + message.runtimeConfig = $root.google.cloud.dataproc.v1.RuntimeConfig.fromObject(object.runtimeConfig); + } + if (object.environmentConfig != null) { + if (typeof object.environmentConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.Session.environmentConfig: object expected"); + message.environmentConfig = $root.google.cloud.dataproc.v1.EnvironmentConfig.fromObject(object.environmentConfig); + } + if (object.user != null) + message.user = String(object.user); + if (object.stateHistory) { + if (!Array.isArray(object.stateHistory)) + throw TypeError(".google.cloud.dataproc.v1.Session.stateHistory: array expected"); + message.stateHistory = []; + for (var i = 0; i < object.stateHistory.length; ++i) { + if (typeof object.stateHistory[i] !== "object") + throw TypeError(".google.cloud.dataproc.v1.Session.stateHistory: object expected"); + message.stateHistory[i] = $root.google.cloud.dataproc.v1.Session.SessionStateHistory.fromObject(object.stateHistory[i]); + } + } + if (object.sessionTemplate != null) + message.sessionTemplate = String(object.sessionTemplate); + return message; + }; + + /** + * Creates a plain object from a Session message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.Session + * @static + * @param {google.cloud.dataproc.v1.Session} message Session + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Session.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.stateHistory = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.uuid = ""; + object.createTime = null; + object.runtimeInfo = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.stateMessage = ""; + object.stateTime = null; + object.creator = ""; + object.runtimeConfig = null; + object.environmentConfig = null; + object.user = ""; + object.sessionTemplate = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uuid != null && message.hasOwnProperty("uuid")) + object.uuid = message.uuid; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.jupyterSession != null && message.hasOwnProperty("jupyterSession")) { + object.jupyterSession = $root.google.cloud.dataproc.v1.JupyterConfig.toObject(message.jupyterSession, options); + if (options.oneofs) + object.sessionConfig = "jupyterSession"; + } + if (message.runtimeInfo != null && message.hasOwnProperty("runtimeInfo")) + object.runtimeInfo = $root.google.cloud.dataproc.v1.RuntimeInfo.toObject(message.runtimeInfo, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.dataproc.v1.Session.State[message.state] === undefined ? message.state : $root.google.cloud.dataproc.v1.Session.State[message.state] : message.state; + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + object.stateMessage = message.stateMessage; + if (message.stateTime != null && message.hasOwnProperty("stateTime")) + object.stateTime = $root.google.protobuf.Timestamp.toObject(message.stateTime, options); + if (message.creator != null && message.hasOwnProperty("creator")) + object.creator = message.creator; + 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.runtimeConfig != null && message.hasOwnProperty("runtimeConfig")) + object.runtimeConfig = $root.google.cloud.dataproc.v1.RuntimeConfig.toObject(message.runtimeConfig, options); + if (message.environmentConfig != null && message.hasOwnProperty("environmentConfig")) + object.environmentConfig = $root.google.cloud.dataproc.v1.EnvironmentConfig.toObject(message.environmentConfig, options); + if (message.user != null && message.hasOwnProperty("user")) + object.user = message.user; + if (message.stateHistory && message.stateHistory.length) { + object.stateHistory = []; + for (var j = 0; j < message.stateHistory.length; ++j) + object.stateHistory[j] = $root.google.cloud.dataproc.v1.Session.SessionStateHistory.toObject(message.stateHistory[j], options); + } + if (message.sessionTemplate != null && message.hasOwnProperty("sessionTemplate")) + object.sessionTemplate = message.sessionTemplate; + if (message.sparkConnectSession != null && message.hasOwnProperty("sparkConnectSession")) { + object.sparkConnectSession = $root.google.cloud.dataproc.v1.SparkConnectConfig.toObject(message.sparkConnectSession, options); + if (options.oneofs) + object.sessionConfig = "sparkConnectSession"; + } + return object; + }; + + /** + * Converts this Session to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.Session + * @instance + * @returns {Object.} JSON object + */ + Session.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Session + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.Session + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Session.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.Session"; + }; + + /** + * State enum. + * @name google.cloud.dataproc.v1.Session.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} TERMINATING=3 TERMINATING value + * @property {number} TERMINATED=4 TERMINATED value + * @property {number} FAILED=5 FAILED value + */ + Session.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[3] = "TERMINATING"] = 3; + values[valuesById[4] = "TERMINATED"] = 4; + values[valuesById[5] = "FAILED"] = 5; + return values; + })(); + + Session.SessionStateHistory = (function() { + + /** + * Properties of a SessionStateHistory. + * @memberof google.cloud.dataproc.v1.Session + * @interface ISessionStateHistory + * @property {google.cloud.dataproc.v1.Session.State|null} [state] SessionStateHistory state + * @property {string|null} [stateMessage] SessionStateHistory stateMessage + * @property {google.protobuf.ITimestamp|null} [stateStartTime] SessionStateHistory stateStartTime + */ + + /** + * Constructs a new SessionStateHistory. + * @memberof google.cloud.dataproc.v1.Session + * @classdesc Represents a SessionStateHistory. + * @implements ISessionStateHistory + * @constructor + * @param {google.cloud.dataproc.v1.Session.ISessionStateHistory=} [properties] Properties to set + */ + function SessionStateHistory(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SessionStateHistory state. + * @member {google.cloud.dataproc.v1.Session.State} state + * @memberof google.cloud.dataproc.v1.Session.SessionStateHistory + * @instance + */ + SessionStateHistory.prototype.state = 0; + + /** + * SessionStateHistory stateMessage. + * @member {string} stateMessage + * @memberof google.cloud.dataproc.v1.Session.SessionStateHistory + * @instance + */ + SessionStateHistory.prototype.stateMessage = ""; + + /** + * SessionStateHistory stateStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} stateStartTime + * @memberof google.cloud.dataproc.v1.Session.SessionStateHistory + * @instance + */ + SessionStateHistory.prototype.stateStartTime = null; + + /** + * Creates a new SessionStateHistory instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.Session.SessionStateHistory + * @static + * @param {google.cloud.dataproc.v1.Session.ISessionStateHistory=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.Session.SessionStateHistory} SessionStateHistory instance + */ + SessionStateHistory.create = function create(properties) { + return new SessionStateHistory(properties); + }; + + /** + * Encodes the specified SessionStateHistory message. Does not implicitly {@link google.cloud.dataproc.v1.Session.SessionStateHistory.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.Session.SessionStateHistory + * @static + * @param {google.cloud.dataproc.v1.Session.ISessionStateHistory} message SessionStateHistory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionStateHistory.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.stateMessage != null && Object.hasOwnProperty.call(message, "stateMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.stateMessage); + if (message.stateStartTime != null && Object.hasOwnProperty.call(message, "stateStartTime")) + $root.google.protobuf.Timestamp.encode(message.stateStartTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SessionStateHistory message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.Session.SessionStateHistory.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.Session.SessionStateHistory + * @static + * @param {google.cloud.dataproc.v1.Session.ISessionStateHistory} message SessionStateHistory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionStateHistory.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SessionStateHistory message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.Session.SessionStateHistory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.Session.SessionStateHistory} SessionStateHistory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionStateHistory.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.Session.SessionStateHistory(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.stateMessage = reader.string(); + break; + } + case 3: { + message.stateStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SessionStateHistory message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.Session.SessionStateHistory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.Session.SessionStateHistory} SessionStateHistory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionStateHistory.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SessionStateHistory message. + * @function verify + * @memberof google.cloud.dataproc.v1.Session.SessionStateHistory + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SessionStateHistory.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + if (!$util.isString(message.stateMessage)) + return "stateMessage: string expected"; + if (message.stateStartTime != null && message.hasOwnProperty("stateStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.stateStartTime); + if (error) + return "stateStartTime." + error; + } + return null; + }; + + /** + * Creates a SessionStateHistory message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.Session.SessionStateHistory + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.Session.SessionStateHistory} SessionStateHistory + */ + SessionStateHistory.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.Session.SessionStateHistory) + return object; + var message = new $root.google.cloud.dataproc.v1.Session.SessionStateHistory(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + case "TERMINATING": + case 3: + message.state = 3; + break; + case "TERMINATED": + case 4: + message.state = 4; + break; + case "FAILED": + case 5: + message.state = 5; + break; + } + if (object.stateMessage != null) + message.stateMessage = String(object.stateMessage); + if (object.stateStartTime != null) { + if (typeof object.stateStartTime !== "object") + throw TypeError(".google.cloud.dataproc.v1.Session.SessionStateHistory.stateStartTime: object expected"); + message.stateStartTime = $root.google.protobuf.Timestamp.fromObject(object.stateStartTime); + } + return message; + }; + + /** + * Creates a plain object from a SessionStateHistory message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.Session.SessionStateHistory + * @static + * @param {google.cloud.dataproc.v1.Session.SessionStateHistory} message SessionStateHistory + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SessionStateHistory.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.stateMessage = ""; + object.stateStartTime = null; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.dataproc.v1.Session.State[message.state] === undefined ? message.state : $root.google.cloud.dataproc.v1.Session.State[message.state] : message.state; + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + object.stateMessage = message.stateMessage; + if (message.stateStartTime != null && message.hasOwnProperty("stateStartTime")) + object.stateStartTime = $root.google.protobuf.Timestamp.toObject(message.stateStartTime, options); + return object; + }; + + /** + * Converts this SessionStateHistory to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.Session.SessionStateHistory + * @instance + * @returns {Object.} JSON object + */ + SessionStateHistory.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SessionStateHistory + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.Session.SessionStateHistory + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SessionStateHistory.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.Session.SessionStateHistory"; + }; + + return SessionStateHistory; + })(); + + return Session; + })(); + + v1.JupyterConfig = (function() { + + /** + * Properties of a JupyterConfig. + * @memberof google.cloud.dataproc.v1 + * @interface IJupyterConfig + * @property {google.cloud.dataproc.v1.JupyterConfig.Kernel|null} [kernel] JupyterConfig kernel + * @property {string|null} [displayName] JupyterConfig displayName + */ + + /** + * Constructs a new JupyterConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a JupyterConfig. + * @implements IJupyterConfig + * @constructor + * @param {google.cloud.dataproc.v1.IJupyterConfig=} [properties] Properties to set + */ + function JupyterConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JupyterConfig kernel. + * @member {google.cloud.dataproc.v1.JupyterConfig.Kernel} kernel + * @memberof google.cloud.dataproc.v1.JupyterConfig + * @instance + */ + JupyterConfig.prototype.kernel = 0; + + /** + * JupyterConfig displayName. + * @member {string} displayName + * @memberof google.cloud.dataproc.v1.JupyterConfig + * @instance + */ + JupyterConfig.prototype.displayName = ""; + + /** + * Creates a new JupyterConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.JupyterConfig + * @static + * @param {google.cloud.dataproc.v1.IJupyterConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.JupyterConfig} JupyterConfig instance + */ + JupyterConfig.create = function create(properties) { + return new JupyterConfig(properties); + }; + + /** + * Encodes the specified JupyterConfig message. Does not implicitly {@link google.cloud.dataproc.v1.JupyterConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.JupyterConfig + * @static + * @param {google.cloud.dataproc.v1.IJupyterConfig} message JupyterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JupyterConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kernel != null && Object.hasOwnProperty.call(message, "kernel")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.kernel); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + return writer; + }; + + /** + * Encodes the specified JupyterConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.JupyterConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.JupyterConfig + * @static + * @param {google.cloud.dataproc.v1.IJupyterConfig} message JupyterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JupyterConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JupyterConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.JupyterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.JupyterConfig} JupyterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JupyterConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.JupyterConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kernel = reader.int32(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JupyterConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.JupyterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.JupyterConfig} JupyterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JupyterConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JupyterConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.JupyterConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JupyterConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kernel != null && message.hasOwnProperty("kernel")) + switch (message.kernel) { + default: + return "kernel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + return null; + }; + + /** + * Creates a JupyterConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.JupyterConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.JupyterConfig} JupyterConfig + */ + JupyterConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.JupyterConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.JupyterConfig(); + switch (object.kernel) { + default: + if (typeof object.kernel === "number") { + message.kernel = object.kernel; + break; + } + break; + case "KERNEL_UNSPECIFIED": + case 0: + message.kernel = 0; + break; + case "PYTHON": + case 1: + message.kernel = 1; + break; + case "SCALA": + case 2: + message.kernel = 2; + break; + } + if (object.displayName != null) + message.displayName = String(object.displayName); + return message; + }; + + /** + * Creates a plain object from a JupyterConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.JupyterConfig + * @static + * @param {google.cloud.dataproc.v1.JupyterConfig} message JupyterConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JupyterConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kernel = options.enums === String ? "KERNEL_UNSPECIFIED" : 0; + object.displayName = ""; + } + if (message.kernel != null && message.hasOwnProperty("kernel")) + object.kernel = options.enums === String ? $root.google.cloud.dataproc.v1.JupyterConfig.Kernel[message.kernel] === undefined ? message.kernel : $root.google.cloud.dataproc.v1.JupyterConfig.Kernel[message.kernel] : message.kernel; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + return object; + }; + + /** + * Converts this JupyterConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.JupyterConfig + * @instance + * @returns {Object.} JSON object + */ + JupyterConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JupyterConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.JupyterConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JupyterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.JupyterConfig"; + }; + + /** + * Kernel enum. + * @name google.cloud.dataproc.v1.JupyterConfig.Kernel + * @enum {number} + * @property {number} KERNEL_UNSPECIFIED=0 KERNEL_UNSPECIFIED value + * @property {number} PYTHON=1 PYTHON value + * @property {number} SCALA=2 SCALA value + */ + JupyterConfig.Kernel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KERNEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "PYTHON"] = 1; + values[valuesById[2] = "SCALA"] = 2; + return values; + })(); + + return JupyterConfig; + })(); + + v1.SparkConnectConfig = (function() { + + /** + * Properties of a SparkConnectConfig. + * @memberof google.cloud.dataproc.v1 + * @interface ISparkConnectConfig + */ + + /** + * Constructs a new SparkConnectConfig. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a SparkConnectConfig. + * @implements ISparkConnectConfig + * @constructor + * @param {google.cloud.dataproc.v1.ISparkConnectConfig=} [properties] Properties to set + */ + function SparkConnectConfig(properties) { + if (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 SparkConnectConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.SparkConnectConfig + * @static + * @param {google.cloud.dataproc.v1.ISparkConnectConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.SparkConnectConfig} SparkConnectConfig instance + */ + SparkConnectConfig.create = function create(properties) { + return new SparkConnectConfig(properties); + }; + + /** + * Encodes the specified SparkConnectConfig message. Does not implicitly {@link google.cloud.dataproc.v1.SparkConnectConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.SparkConnectConfig + * @static + * @param {google.cloud.dataproc.v1.ISparkConnectConfig} message SparkConnectConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SparkConnectConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified SparkConnectConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SparkConnectConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.SparkConnectConfig + * @static + * @param {google.cloud.dataproc.v1.ISparkConnectConfig} message SparkConnectConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SparkConnectConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SparkConnectConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.SparkConnectConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.SparkConnectConfig} SparkConnectConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SparkConnectConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.SparkConnectConfig(); + 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 SparkConnectConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.SparkConnectConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.SparkConnectConfig} SparkConnectConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SparkConnectConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SparkConnectConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.SparkConnectConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SparkConnectConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a SparkConnectConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.SparkConnectConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.SparkConnectConfig} SparkConnectConfig + */ + SparkConnectConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.SparkConnectConfig) + return object; + return new $root.google.cloud.dataproc.v1.SparkConnectConfig(); + }; + + /** + * Creates a plain object from a SparkConnectConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.SparkConnectConfig + * @static + * @param {google.cloud.dataproc.v1.SparkConnectConfig} message SparkConnectConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SparkConnectConfig.toObject = function toObject() { + return {}; + }; + + /** + * Converts this SparkConnectConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.SparkConnectConfig + * @instance + * @returns {Object.} JSON object + */ + SparkConnectConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SparkConnectConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.SparkConnectConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SparkConnectConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.SparkConnectConfig"; + }; + + return SparkConnectConfig; + })(); + + v1.WorkflowTemplateService = (function() { + + /** + * Constructs a new WorkflowTemplateService service. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a WorkflowTemplateService + * @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 WorkflowTemplateService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (WorkflowTemplateService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = WorkflowTemplateService; + + /** + * Creates new WorkflowTemplateService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dataproc.v1.WorkflowTemplateService + * @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 {WorkflowTemplateService} RPC service. Useful where requests and/or responses are streamed. + */ + WorkflowTemplateService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dataproc.v1.WorkflowTemplateService|createWorkflowTemplate}. + * @memberof google.cloud.dataproc.v1.WorkflowTemplateService + * @typedef CreateWorkflowTemplateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataproc.v1.WorkflowTemplate} [response] WorkflowTemplate + */ + + /** + * Calls CreateWorkflowTemplate. + * @function createWorkflowTemplate + * @memberof google.cloud.dataproc.v1.WorkflowTemplateService + * @instance + * @param {google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest} request CreateWorkflowTemplateRequest message or plain object + * @param {google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplateCallback} callback Node-style callback called with the error, if any, and WorkflowTemplate + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WorkflowTemplateService.prototype.createWorkflowTemplate = function createWorkflowTemplate(request, callback) { + return this.rpcCall(createWorkflowTemplate, $root.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest, $root.google.cloud.dataproc.v1.WorkflowTemplate, request, callback); + }, "name", { value: "CreateWorkflowTemplate" }); + + /** + * Calls CreateWorkflowTemplate. + * @function createWorkflowTemplate + * @memberof google.cloud.dataproc.v1.WorkflowTemplateService + * @instance + * @param {google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest} request CreateWorkflowTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.WorkflowTemplateService|getWorkflowTemplate}. + * @memberof google.cloud.dataproc.v1.WorkflowTemplateService + * @typedef GetWorkflowTemplateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataproc.v1.WorkflowTemplate} [response] WorkflowTemplate + */ + + /** + * Calls GetWorkflowTemplate. + * @function getWorkflowTemplate + * @memberof google.cloud.dataproc.v1.WorkflowTemplateService + * @instance + * @param {google.cloud.dataproc.v1.IGetWorkflowTemplateRequest} request GetWorkflowTemplateRequest message or plain object + * @param {google.cloud.dataproc.v1.WorkflowTemplateService.GetWorkflowTemplateCallback} callback Node-style callback called with the error, if any, and WorkflowTemplate + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WorkflowTemplateService.prototype.getWorkflowTemplate = function getWorkflowTemplate(request, callback) { + return this.rpcCall(getWorkflowTemplate, $root.google.cloud.dataproc.v1.GetWorkflowTemplateRequest, $root.google.cloud.dataproc.v1.WorkflowTemplate, request, callback); + }, "name", { value: "GetWorkflowTemplate" }); + + /** + * Calls GetWorkflowTemplate. + * @function getWorkflowTemplate + * @memberof google.cloud.dataproc.v1.WorkflowTemplateService + * @instance + * @param {google.cloud.dataproc.v1.IGetWorkflowTemplateRequest} request GetWorkflowTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.WorkflowTemplateService|instantiateWorkflowTemplate}. + * @memberof google.cloud.dataproc.v1.WorkflowTemplateService + * @typedef InstantiateWorkflowTemplateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls InstantiateWorkflowTemplate. + * @function instantiateWorkflowTemplate + * @memberof google.cloud.dataproc.v1.WorkflowTemplateService + * @instance + * @param {google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest} request InstantiateWorkflowTemplateRequest message or plain object + * @param {google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplateCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WorkflowTemplateService.prototype.instantiateWorkflowTemplate = function instantiateWorkflowTemplate(request, callback) { + return this.rpcCall(instantiateWorkflowTemplate, $root.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "InstantiateWorkflowTemplate" }); + + /** + * Calls InstantiateWorkflowTemplate. + * @function instantiateWorkflowTemplate + * @memberof google.cloud.dataproc.v1.WorkflowTemplateService + * @instance + * @param {google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest} request InstantiateWorkflowTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.WorkflowTemplateService|instantiateInlineWorkflowTemplate}. + * @memberof google.cloud.dataproc.v1.WorkflowTemplateService + * @typedef InstantiateInlineWorkflowTemplateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls InstantiateInlineWorkflowTemplate. + * @function instantiateInlineWorkflowTemplate + * @memberof google.cloud.dataproc.v1.WorkflowTemplateService + * @instance + * @param {google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest} request InstantiateInlineWorkflowTemplateRequest message or plain object + * @param {google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateInlineWorkflowTemplateCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WorkflowTemplateService.prototype.instantiateInlineWorkflowTemplate = function instantiateInlineWorkflowTemplate(request, callback) { + return this.rpcCall(instantiateInlineWorkflowTemplate, $root.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "InstantiateInlineWorkflowTemplate" }); + + /** + * Calls InstantiateInlineWorkflowTemplate. + * @function instantiateInlineWorkflowTemplate + * @memberof google.cloud.dataproc.v1.WorkflowTemplateService + * @instance + * @param {google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest} request InstantiateInlineWorkflowTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.WorkflowTemplateService|updateWorkflowTemplate}. + * @memberof google.cloud.dataproc.v1.WorkflowTemplateService + * @typedef UpdateWorkflowTemplateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataproc.v1.WorkflowTemplate} [response] WorkflowTemplate + */ + + /** + * Calls UpdateWorkflowTemplate. + * @function updateWorkflowTemplate + * @memberof google.cloud.dataproc.v1.WorkflowTemplateService + * @instance + * @param {google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest} request UpdateWorkflowTemplateRequest message or plain object + * @param {google.cloud.dataproc.v1.WorkflowTemplateService.UpdateWorkflowTemplateCallback} callback Node-style callback called with the error, if any, and WorkflowTemplate + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WorkflowTemplateService.prototype.updateWorkflowTemplate = function updateWorkflowTemplate(request, callback) { + return this.rpcCall(updateWorkflowTemplate, $root.google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest, $root.google.cloud.dataproc.v1.WorkflowTemplate, request, callback); + }, "name", { value: "UpdateWorkflowTemplate" }); + + /** + * Calls UpdateWorkflowTemplate. + * @function updateWorkflowTemplate + * @memberof google.cloud.dataproc.v1.WorkflowTemplateService + * @instance + * @param {google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest} request UpdateWorkflowTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.WorkflowTemplateService|listWorkflowTemplates}. + * @memberof google.cloud.dataproc.v1.WorkflowTemplateService + * @typedef ListWorkflowTemplatesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dataproc.v1.ListWorkflowTemplatesResponse} [response] ListWorkflowTemplatesResponse + */ + + /** + * Calls ListWorkflowTemplates. + * @function listWorkflowTemplates + * @memberof google.cloud.dataproc.v1.WorkflowTemplateService + * @instance + * @param {google.cloud.dataproc.v1.IListWorkflowTemplatesRequest} request ListWorkflowTemplatesRequest message or plain object + * @param {google.cloud.dataproc.v1.WorkflowTemplateService.ListWorkflowTemplatesCallback} callback Node-style callback called with the error, if any, and ListWorkflowTemplatesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WorkflowTemplateService.prototype.listWorkflowTemplates = function listWorkflowTemplates(request, callback) { + return this.rpcCall(listWorkflowTemplates, $root.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest, $root.google.cloud.dataproc.v1.ListWorkflowTemplatesResponse, request, callback); + }, "name", { value: "ListWorkflowTemplates" }); + + /** + * Calls ListWorkflowTemplates. + * @function listWorkflowTemplates + * @memberof google.cloud.dataproc.v1.WorkflowTemplateService + * @instance + * @param {google.cloud.dataproc.v1.IListWorkflowTemplatesRequest} request ListWorkflowTemplatesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dataproc.v1.WorkflowTemplateService|deleteWorkflowTemplate}. + * @memberof google.cloud.dataproc.v1.WorkflowTemplateService + * @typedef DeleteWorkflowTemplateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteWorkflowTemplate. + * @function deleteWorkflowTemplate + * @memberof google.cloud.dataproc.v1.WorkflowTemplateService + * @instance + * @param {google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest} request DeleteWorkflowTemplateRequest message or plain object + * @param {google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplateCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(WorkflowTemplateService.prototype.deleteWorkflowTemplate = function deleteWorkflowTemplate(request, callback) { + return this.rpcCall(deleteWorkflowTemplate, $root.google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteWorkflowTemplate" }); + + /** + * Calls DeleteWorkflowTemplate. + * @function deleteWorkflowTemplate + * @memberof google.cloud.dataproc.v1.WorkflowTemplateService + * @instance + * @param {google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest} request DeleteWorkflowTemplateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return WorkflowTemplateService; + })(); + + v1.WorkflowTemplate = (function() { + + /** + * Properties of a WorkflowTemplate. + * @memberof google.cloud.dataproc.v1 + * @interface IWorkflowTemplate + * @property {string|null} [id] WorkflowTemplate id + * @property {string|null} [name] WorkflowTemplate name + * @property {number|null} [version] WorkflowTemplate version + * @property {google.protobuf.ITimestamp|null} [createTime] WorkflowTemplate createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] WorkflowTemplate updateTime + * @property {Object.|null} [labels] WorkflowTemplate labels + * @property {google.cloud.dataproc.v1.IWorkflowTemplatePlacement|null} [placement] WorkflowTemplate placement + * @property {Array.|null} [jobs] WorkflowTemplate jobs + * @property {Array.|null} [parameters] WorkflowTemplate parameters + * @property {google.protobuf.IDuration|null} [dagTimeout] WorkflowTemplate dagTimeout + * @property {google.cloud.dataproc.v1.WorkflowTemplate.IEncryptionConfig|null} [encryptionConfig] WorkflowTemplate encryptionConfig + */ + + /** + * Constructs a new WorkflowTemplate. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a WorkflowTemplate. + * @implements IWorkflowTemplate + * @constructor + * @param {google.cloud.dataproc.v1.IWorkflowTemplate=} [properties] Properties to set + */ + function WorkflowTemplate(properties) { + this.labels = {}; + this.jobs = []; + this.parameters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WorkflowTemplate id. + * @member {string} id + * @memberof google.cloud.dataproc.v1.WorkflowTemplate + * @instance + */ + WorkflowTemplate.prototype.id = ""; + + /** + * WorkflowTemplate name. + * @member {string} name + * @memberof google.cloud.dataproc.v1.WorkflowTemplate + * @instance + */ + WorkflowTemplate.prototype.name = ""; + + /** + * WorkflowTemplate version. + * @member {number} version + * @memberof google.cloud.dataproc.v1.WorkflowTemplate + * @instance + */ + WorkflowTemplate.prototype.version = 0; + + /** + * WorkflowTemplate createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.dataproc.v1.WorkflowTemplate + * @instance + */ + WorkflowTemplate.prototype.createTime = null; + + /** + * WorkflowTemplate updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.dataproc.v1.WorkflowTemplate + * @instance + */ + WorkflowTemplate.prototype.updateTime = null; + + /** + * WorkflowTemplate labels. + * @member {Object.} labels + * @memberof google.cloud.dataproc.v1.WorkflowTemplate + * @instance + */ + WorkflowTemplate.prototype.labels = $util.emptyObject; + + /** + * WorkflowTemplate placement. + * @member {google.cloud.dataproc.v1.IWorkflowTemplatePlacement|null|undefined} placement + * @memberof google.cloud.dataproc.v1.WorkflowTemplate + * @instance + */ + WorkflowTemplate.prototype.placement = null; + + /** + * WorkflowTemplate jobs. + * @member {Array.} jobs + * @memberof google.cloud.dataproc.v1.WorkflowTemplate + * @instance + */ + WorkflowTemplate.prototype.jobs = $util.emptyArray; + + /** + * WorkflowTemplate parameters. + * @member {Array.} parameters + * @memberof google.cloud.dataproc.v1.WorkflowTemplate + * @instance + */ + WorkflowTemplate.prototype.parameters = $util.emptyArray; + + /** + * WorkflowTemplate dagTimeout. + * @member {google.protobuf.IDuration|null|undefined} dagTimeout + * @memberof google.cloud.dataproc.v1.WorkflowTemplate + * @instance + */ + WorkflowTemplate.prototype.dagTimeout = null; + + /** + * WorkflowTemplate encryptionConfig. + * @member {google.cloud.dataproc.v1.WorkflowTemplate.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.cloud.dataproc.v1.WorkflowTemplate + * @instance + */ + WorkflowTemplate.prototype.encryptionConfig = null; + + /** + * Creates a new WorkflowTemplate instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.WorkflowTemplate + * @static + * @param {google.cloud.dataproc.v1.IWorkflowTemplate=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.WorkflowTemplate} WorkflowTemplate instance + */ + WorkflowTemplate.create = function create(properties) { + return new WorkflowTemplate(properties); + }; + + /** + * Encodes the specified WorkflowTemplate message. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowTemplate.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.WorkflowTemplate + * @static + * @param {google.cloud.dataproc.v1.IWorkflowTemplate} message WorkflowTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkflowTemplate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.version); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.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.placement != null && Object.hasOwnProperty.call(message, "placement")) + $root.google.cloud.dataproc.v1.WorkflowTemplatePlacement.encode(message.placement, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.jobs != null && message.jobs.length) + for (var i = 0; i < message.jobs.length; ++i) + $root.google.cloud.dataproc.v1.OrderedJob.encode(message.jobs[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.parameters != null && message.parameters.length) + for (var i = 0; i < message.parameters.length; ++i) + $root.google.cloud.dataproc.v1.TemplateParameter.encode(message.parameters[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.dagTimeout != null && Object.hasOwnProperty.call(message, "dagTimeout")) + $root.google.protobuf.Duration.encode(message.dagTimeout, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WorkflowTemplate message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowTemplate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.WorkflowTemplate + * @static + * @param {google.cloud.dataproc.v1.IWorkflowTemplate} message WorkflowTemplate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkflowTemplate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WorkflowTemplate message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.WorkflowTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.WorkflowTemplate} WorkflowTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkflowTemplate.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.WorkflowTemplate(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.id = reader.string(); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.version = reader.int32(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 7: { + message.placement = $root.google.cloud.dataproc.v1.WorkflowTemplatePlacement.decode(reader, reader.uint32()); + break; + } + case 8: { + if (!(message.jobs && message.jobs.length)) + message.jobs = []; + message.jobs.push($root.google.cloud.dataproc.v1.OrderedJob.decode(reader, reader.uint32())); + break; + } + case 9: { + if (!(message.parameters && message.parameters.length)) + message.parameters = []; + message.parameters.push($root.google.cloud.dataproc.v1.TemplateParameter.decode(reader, reader.uint32())); + break; + } + case 10: { + message.dagTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 11: { + message.encryptionConfig = $root.google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WorkflowTemplate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.WorkflowTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.WorkflowTemplate} WorkflowTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkflowTemplate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WorkflowTemplate message. + * @function verify + * @memberof google.cloud.dataproc.v1.WorkflowTemplate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WorkflowTemplate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer 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.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.placement != null && message.hasOwnProperty("placement")) { + var error = $root.google.cloud.dataproc.v1.WorkflowTemplatePlacement.verify(message.placement); + if (error) + return "placement." + error; + } + 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.dataproc.v1.OrderedJob.verify(message.jobs[i]); + if (error) + return "jobs." + error; + } + } + if (message.parameters != null && message.hasOwnProperty("parameters")) { + if (!Array.isArray(message.parameters)) + return "parameters: array expected"; + for (var i = 0; i < message.parameters.length; ++i) { + var error = $root.google.cloud.dataproc.v1.TemplateParameter.verify(message.parameters[i]); + if (error) + return "parameters." + error; + } + } + if (message.dagTimeout != null && message.hasOwnProperty("dagTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.dagTimeout); + if (error) + return "dagTimeout." + error; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + var error = $root.google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + return null; + }; + + /** + * Creates a WorkflowTemplate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.WorkflowTemplate + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.WorkflowTemplate} WorkflowTemplate + */ + WorkflowTemplate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.WorkflowTemplate) + return object; + var message = new $root.google.cloud.dataproc.v1.WorkflowTemplate(); + if (object.id != null) + message.id = String(object.id); + if (object.name != null) + message.name = String(object.name); + if (object.version != null) + message.version = object.version | 0; + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.dataproc.v1.WorkflowTemplate.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.dataproc.v1.WorkflowTemplate.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.dataproc.v1.WorkflowTemplate.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.placement != null) { + if (typeof object.placement !== "object") + throw TypeError(".google.cloud.dataproc.v1.WorkflowTemplate.placement: object expected"); + message.placement = $root.google.cloud.dataproc.v1.WorkflowTemplatePlacement.fromObject(object.placement); + } + if (object.jobs) { + if (!Array.isArray(object.jobs)) + throw TypeError(".google.cloud.dataproc.v1.WorkflowTemplate.jobs: array expected"); + message.jobs = []; + for (var i = 0; i < object.jobs.length; ++i) { + if (typeof object.jobs[i] !== "object") + throw TypeError(".google.cloud.dataproc.v1.WorkflowTemplate.jobs: object expected"); + message.jobs[i] = $root.google.cloud.dataproc.v1.OrderedJob.fromObject(object.jobs[i]); + } + } + if (object.parameters) { + if (!Array.isArray(object.parameters)) + throw TypeError(".google.cloud.dataproc.v1.WorkflowTemplate.parameters: array expected"); + message.parameters = []; + for (var i = 0; i < object.parameters.length; ++i) { + if (typeof object.parameters[i] !== "object") + throw TypeError(".google.cloud.dataproc.v1.WorkflowTemplate.parameters: object expected"); + message.parameters[i] = $root.google.cloud.dataproc.v1.TemplateParameter.fromObject(object.parameters[i]); + } + } + if (object.dagTimeout != null) { + if (typeof object.dagTimeout !== "object") + throw TypeError(".google.cloud.dataproc.v1.WorkflowTemplate.dagTimeout: object expected"); + message.dagTimeout = $root.google.protobuf.Duration.fromObject(object.dagTimeout); + } + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.cloud.dataproc.v1.WorkflowTemplate.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig.fromObject(object.encryptionConfig); + } + return message; + }; + + /** + * Creates a plain object from a WorkflowTemplate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.WorkflowTemplate + * @static + * @param {google.cloud.dataproc.v1.WorkflowTemplate} message WorkflowTemplate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WorkflowTemplate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.jobs = []; + object.parameters = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.id = ""; + object.version = 0; + object.createTime = null; + object.updateTime = null; + object.placement = null; + object.dagTimeout = null; + object.encryptionConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + 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); + 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.placement != null && message.hasOwnProperty("placement")) + object.placement = $root.google.cloud.dataproc.v1.WorkflowTemplatePlacement.toObject(message.placement, options); + if (message.jobs && message.jobs.length) { + object.jobs = []; + for (var j = 0; j < message.jobs.length; ++j) + object.jobs[j] = $root.google.cloud.dataproc.v1.OrderedJob.toObject(message.jobs[j], options); + } + if (message.parameters && message.parameters.length) { + object.parameters = []; + for (var j = 0; j < message.parameters.length; ++j) + object.parameters[j] = $root.google.cloud.dataproc.v1.TemplateParameter.toObject(message.parameters[j], options); + } + if (message.dagTimeout != null && message.hasOwnProperty("dagTimeout")) + object.dagTimeout = $root.google.protobuf.Duration.toObject(message.dagTimeout, options); + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) + object.encryptionConfig = $root.google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig.toObject(message.encryptionConfig, options); + return object; + }; + + /** + * Converts this WorkflowTemplate to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.WorkflowTemplate + * @instance + * @returns {Object.} JSON object + */ + WorkflowTemplate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WorkflowTemplate + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.WorkflowTemplate + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WorkflowTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.WorkflowTemplate"; + }; + + WorkflowTemplate.EncryptionConfig = (function() { + + /** + * Properties of an EncryptionConfig. + * @memberof google.cloud.dataproc.v1.WorkflowTemplate + * @interface IEncryptionConfig + * @property {string|null} [kmsKey] EncryptionConfig kmsKey + */ + + /** + * Constructs a new EncryptionConfig. + * @memberof google.cloud.dataproc.v1.WorkflowTemplate + * @classdesc Represents an EncryptionConfig. + * @implements IEncryptionConfig + * @constructor + * @param {google.cloud.dataproc.v1.WorkflowTemplate.IEncryptionConfig=} [properties] Properties to set + */ + function EncryptionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EncryptionConfig kmsKey. + * @member {string} kmsKey + * @memberof google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig + * @instance + */ + EncryptionConfig.prototype.kmsKey = ""; + + /** + * Creates a new EncryptionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig + * @static + * @param {google.cloud.dataproc.v1.WorkflowTemplate.IEncryptionConfig=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig} EncryptionConfig instance + */ + EncryptionConfig.create = function create(properties) { + return new EncryptionConfig(properties); + }; + + /** + * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig + * @static + * @param {google.cloud.dataproc.v1.WorkflowTemplate.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kmsKey != null && Object.hasOwnProperty.call(message, "kmsKey")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kmsKey); + return writer; + }; + + /** + * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig + * @static + * @param {google.cloud.dataproc.v1.WorkflowTemplate.IEncryptionConfig} message EncryptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig} EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kmsKey = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig} EncryptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EncryptionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EncryptionConfig message. + * @function verify + * @memberof google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EncryptionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) + if (!$util.isString(message.kmsKey)) + return "kmsKey: string expected"; + return null; + }; + + /** + * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig} EncryptionConfig + */ + EncryptionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig) + return object; + var message = new $root.google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig(); + if (object.kmsKey != null) + message.kmsKey = String(object.kmsKey); + return message; + }; + + /** + * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig + * @static + * @param {google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig} message EncryptionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EncryptionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.kmsKey = ""; + if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) + object.kmsKey = message.kmsKey; + return object; + }; + + /** + * Converts this EncryptionConfig to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig + * @instance + * @returns {Object.} JSON object + */ + EncryptionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EncryptionConfig + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig"; + }; + + return EncryptionConfig; + })(); + + return WorkflowTemplate; + })(); + + v1.WorkflowTemplatePlacement = (function() { + + /** + * Properties of a WorkflowTemplatePlacement. + * @memberof google.cloud.dataproc.v1 + * @interface IWorkflowTemplatePlacement + * @property {google.cloud.dataproc.v1.IManagedCluster|null} [managedCluster] WorkflowTemplatePlacement managedCluster + * @property {google.cloud.dataproc.v1.IClusterSelector|null} [clusterSelector] WorkflowTemplatePlacement clusterSelector + */ + + /** + * Constructs a new WorkflowTemplatePlacement. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a WorkflowTemplatePlacement. + * @implements IWorkflowTemplatePlacement + * @constructor + * @param {google.cloud.dataproc.v1.IWorkflowTemplatePlacement=} [properties] Properties to set + */ + function WorkflowTemplatePlacement(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WorkflowTemplatePlacement managedCluster. + * @member {google.cloud.dataproc.v1.IManagedCluster|null|undefined} managedCluster + * @memberof google.cloud.dataproc.v1.WorkflowTemplatePlacement + * @instance + */ + WorkflowTemplatePlacement.prototype.managedCluster = null; + + /** + * WorkflowTemplatePlacement clusterSelector. + * @member {google.cloud.dataproc.v1.IClusterSelector|null|undefined} clusterSelector + * @memberof google.cloud.dataproc.v1.WorkflowTemplatePlacement + * @instance + */ + WorkflowTemplatePlacement.prototype.clusterSelector = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * WorkflowTemplatePlacement placement. + * @member {"managedCluster"|"clusterSelector"|undefined} placement + * @memberof google.cloud.dataproc.v1.WorkflowTemplatePlacement + * @instance + */ + Object.defineProperty(WorkflowTemplatePlacement.prototype, "placement", { + get: $util.oneOfGetter($oneOfFields = ["managedCluster", "clusterSelector"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WorkflowTemplatePlacement instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.WorkflowTemplatePlacement + * @static + * @param {google.cloud.dataproc.v1.IWorkflowTemplatePlacement=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.WorkflowTemplatePlacement} WorkflowTemplatePlacement instance + */ + WorkflowTemplatePlacement.create = function create(properties) { + return new WorkflowTemplatePlacement(properties); + }; + + /** + * Encodes the specified WorkflowTemplatePlacement message. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowTemplatePlacement.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.WorkflowTemplatePlacement + * @static + * @param {google.cloud.dataproc.v1.IWorkflowTemplatePlacement} message WorkflowTemplatePlacement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkflowTemplatePlacement.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.managedCluster != null && Object.hasOwnProperty.call(message, "managedCluster")) + $root.google.cloud.dataproc.v1.ManagedCluster.encode(message.managedCluster, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.clusterSelector != null && Object.hasOwnProperty.call(message, "clusterSelector")) + $root.google.cloud.dataproc.v1.ClusterSelector.encode(message.clusterSelector, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WorkflowTemplatePlacement message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowTemplatePlacement.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.WorkflowTemplatePlacement + * @static + * @param {google.cloud.dataproc.v1.IWorkflowTemplatePlacement} message WorkflowTemplatePlacement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkflowTemplatePlacement.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WorkflowTemplatePlacement message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.WorkflowTemplatePlacement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.WorkflowTemplatePlacement} WorkflowTemplatePlacement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkflowTemplatePlacement.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.WorkflowTemplatePlacement(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.managedCluster = $root.google.cloud.dataproc.v1.ManagedCluster.decode(reader, reader.uint32()); + break; + } + case 2: { + message.clusterSelector = $root.google.cloud.dataproc.v1.ClusterSelector.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WorkflowTemplatePlacement message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.WorkflowTemplatePlacement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.WorkflowTemplatePlacement} WorkflowTemplatePlacement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkflowTemplatePlacement.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WorkflowTemplatePlacement message. + * @function verify + * @memberof google.cloud.dataproc.v1.WorkflowTemplatePlacement + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WorkflowTemplatePlacement.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.managedCluster != null && message.hasOwnProperty("managedCluster")) { + properties.placement = 1; + { + var error = $root.google.cloud.dataproc.v1.ManagedCluster.verify(message.managedCluster); + if (error) + return "managedCluster." + error; + } + } + if (message.clusterSelector != null && message.hasOwnProperty("clusterSelector")) { + if (properties.placement === 1) + return "placement: multiple values"; + properties.placement = 1; + { + var error = $root.google.cloud.dataproc.v1.ClusterSelector.verify(message.clusterSelector); + if (error) + return "clusterSelector." + error; + } + } + return null; + }; + + /** + * Creates a WorkflowTemplatePlacement message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.WorkflowTemplatePlacement + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.WorkflowTemplatePlacement} WorkflowTemplatePlacement + */ + WorkflowTemplatePlacement.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.WorkflowTemplatePlacement) + return object; + var message = new $root.google.cloud.dataproc.v1.WorkflowTemplatePlacement(); + if (object.managedCluster != null) { + if (typeof object.managedCluster !== "object") + throw TypeError(".google.cloud.dataproc.v1.WorkflowTemplatePlacement.managedCluster: object expected"); + message.managedCluster = $root.google.cloud.dataproc.v1.ManagedCluster.fromObject(object.managedCluster); + } + if (object.clusterSelector != null) { + if (typeof object.clusterSelector !== "object") + throw TypeError(".google.cloud.dataproc.v1.WorkflowTemplatePlacement.clusterSelector: object expected"); + message.clusterSelector = $root.google.cloud.dataproc.v1.ClusterSelector.fromObject(object.clusterSelector); + } + return message; + }; + + /** + * Creates a plain object from a WorkflowTemplatePlacement message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.WorkflowTemplatePlacement + * @static + * @param {google.cloud.dataproc.v1.WorkflowTemplatePlacement} message WorkflowTemplatePlacement + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WorkflowTemplatePlacement.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.managedCluster != null && message.hasOwnProperty("managedCluster")) { + object.managedCluster = $root.google.cloud.dataproc.v1.ManagedCluster.toObject(message.managedCluster, options); + if (options.oneofs) + object.placement = "managedCluster"; + } + if (message.clusterSelector != null && message.hasOwnProperty("clusterSelector")) { + object.clusterSelector = $root.google.cloud.dataproc.v1.ClusterSelector.toObject(message.clusterSelector, options); + if (options.oneofs) + object.placement = "clusterSelector"; + } + return object; + }; + + /** + * Converts this WorkflowTemplatePlacement to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.WorkflowTemplatePlacement + * @instance + * @returns {Object.} JSON object + */ + WorkflowTemplatePlacement.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WorkflowTemplatePlacement + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.WorkflowTemplatePlacement + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WorkflowTemplatePlacement.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.WorkflowTemplatePlacement"; + }; + + return WorkflowTemplatePlacement; + })(); + + v1.ManagedCluster = (function() { + + /** + * Properties of a ManagedCluster. + * @memberof google.cloud.dataproc.v1 + * @interface IManagedCluster + * @property {string|null} [clusterName] ManagedCluster clusterName + * @property {google.cloud.dataproc.v1.IClusterConfig|null} [config] ManagedCluster config + * @property {Object.|null} [labels] ManagedCluster labels + */ + + /** + * Constructs a new ManagedCluster. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a ManagedCluster. + * @implements IManagedCluster + * @constructor + * @param {google.cloud.dataproc.v1.IManagedCluster=} [properties] Properties to set + */ + function ManagedCluster(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ManagedCluster clusterName. + * @member {string} clusterName + * @memberof google.cloud.dataproc.v1.ManagedCluster + * @instance + */ + ManagedCluster.prototype.clusterName = ""; + + /** + * ManagedCluster config. + * @member {google.cloud.dataproc.v1.IClusterConfig|null|undefined} config + * @memberof google.cloud.dataproc.v1.ManagedCluster + * @instance + */ + ManagedCluster.prototype.config = null; + + /** + * ManagedCluster labels. + * @member {Object.} labels + * @memberof google.cloud.dataproc.v1.ManagedCluster + * @instance + */ + ManagedCluster.prototype.labels = $util.emptyObject; + + /** + * Creates a new ManagedCluster instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.ManagedCluster + * @static + * @param {google.cloud.dataproc.v1.IManagedCluster=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.ManagedCluster} ManagedCluster instance + */ + ManagedCluster.create = function create(properties) { + return new ManagedCluster(properties); + }; + + /** + * Encodes the specified ManagedCluster message. Does not implicitly {@link google.cloud.dataproc.v1.ManagedCluster.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.ManagedCluster + * @static + * @param {google.cloud.dataproc.v1.IManagedCluster} message ManagedCluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ManagedCluster.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterName); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.dataproc.v1.ClusterConfig.encode(message.config, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified ManagedCluster message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ManagedCluster.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.ManagedCluster + * @static + * @param {google.cloud.dataproc.v1.IManagedCluster} message ManagedCluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ManagedCluster.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ManagedCluster message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.ManagedCluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.ManagedCluster} ManagedCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ManagedCluster.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ManagedCluster(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.clusterName = reader.string(); + break; + } + case 3: { + message.config = $root.google.cloud.dataproc.v1.ClusterConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ManagedCluster message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.ManagedCluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.ManagedCluster} ManagedCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ManagedCluster.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ManagedCluster message. + * @function verify + * @memberof google.cloud.dataproc.v1.ManagedCluster + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ManagedCluster.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + if (!$util.isString(message.clusterName)) + return "clusterName: string expected"; + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.dataproc.v1.ClusterConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a ManagedCluster message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.ManagedCluster + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.ManagedCluster} ManagedCluster + */ + ManagedCluster.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.ManagedCluster) + return object; + var message = new $root.google.cloud.dataproc.v1.ManagedCluster(); + if (object.clusterName != null) + message.clusterName = String(object.clusterName); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.dataproc.v1.ManagedCluster.config: object expected"); + message.config = $root.google.cloud.dataproc.v1.ClusterConfig.fromObject(object.config); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.dataproc.v1.ManagedCluster.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a ManagedCluster message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.ManagedCluster + * @static + * @param {google.cloud.dataproc.v1.ManagedCluster} message ManagedCluster + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ManagedCluster.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.clusterName = ""; + object.config = null; + } + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + object.clusterName = message.clusterName; + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.dataproc.v1.ClusterConfig.toObject(message.config, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this ManagedCluster to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.ManagedCluster + * @instance + * @returns {Object.} JSON object + */ + ManagedCluster.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ManagedCluster + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.ManagedCluster + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ManagedCluster.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.ManagedCluster"; + }; + + return ManagedCluster; + })(); + + v1.ClusterSelector = (function() { + + /** + * Properties of a ClusterSelector. + * @memberof google.cloud.dataproc.v1 + * @interface IClusterSelector + * @property {string|null} [zone] ClusterSelector zone + * @property {Object.|null} [clusterLabels] ClusterSelector clusterLabels + */ + + /** + * Constructs a new ClusterSelector. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a ClusterSelector. + * @implements IClusterSelector + * @constructor + * @param {google.cloud.dataproc.v1.IClusterSelector=} [properties] Properties to set + */ + function ClusterSelector(properties) { + this.clusterLabels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClusterSelector zone. + * @member {string} zone + * @memberof google.cloud.dataproc.v1.ClusterSelector + * @instance + */ + ClusterSelector.prototype.zone = ""; + + /** + * ClusterSelector clusterLabels. + * @member {Object.} clusterLabels + * @memberof google.cloud.dataproc.v1.ClusterSelector + * @instance + */ + ClusterSelector.prototype.clusterLabels = $util.emptyObject; + + /** + * Creates a new ClusterSelector instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.ClusterSelector + * @static + * @param {google.cloud.dataproc.v1.IClusterSelector=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.ClusterSelector} ClusterSelector instance + */ + ClusterSelector.create = function create(properties) { + return new ClusterSelector(properties); + }; + + /** + * Encodes the specified ClusterSelector message. Does not implicitly {@link google.cloud.dataproc.v1.ClusterSelector.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.ClusterSelector + * @static + * @param {google.cloud.dataproc.v1.IClusterSelector} message ClusterSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterSelector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.zone); + if (message.clusterLabels != null && Object.hasOwnProperty.call(message, "clusterLabels")) + for (var keys = Object.keys(message.clusterLabels), 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.clusterLabels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClusterSelector message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ClusterSelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.ClusterSelector + * @static + * @param {google.cloud.dataproc.v1.IClusterSelector} message ClusterSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterSelector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClusterSelector message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.ClusterSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.ClusterSelector} ClusterSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterSelector.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ClusterSelector(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.zone = reader.string(); + break; + } + case 2: { + if (message.clusterLabels === $util.emptyObject) + message.clusterLabels = {}; + 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.clusterLabels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClusterSelector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.ClusterSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.ClusterSelector} ClusterSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterSelector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClusterSelector message. + * @function verify + * @memberof google.cloud.dataproc.v1.ClusterSelector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClusterSelector.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + if (message.clusterLabels != null && message.hasOwnProperty("clusterLabels")) { + if (!$util.isObject(message.clusterLabels)) + return "clusterLabels: object expected"; + var key = Object.keys(message.clusterLabels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.clusterLabels[key[i]])) + return "clusterLabels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a ClusterSelector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.ClusterSelector + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.ClusterSelector} ClusterSelector + */ + ClusterSelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.ClusterSelector) + return object; + var message = new $root.google.cloud.dataproc.v1.ClusterSelector(); + if (object.zone != null) + message.zone = String(object.zone); + if (object.clusterLabels) { + if (typeof object.clusterLabels !== "object") + throw TypeError(".google.cloud.dataproc.v1.ClusterSelector.clusterLabels: object expected"); + message.clusterLabels = {}; + for (var keys = Object.keys(object.clusterLabels), i = 0; i < keys.length; ++i) + message.clusterLabels[keys[i]] = String(object.clusterLabels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a ClusterSelector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.ClusterSelector + * @static + * @param {google.cloud.dataproc.v1.ClusterSelector} message ClusterSelector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClusterSelector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.clusterLabels = {}; + if (options.defaults) + object.zone = ""; + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + var keys2; + if (message.clusterLabels && (keys2 = Object.keys(message.clusterLabels)).length) { + object.clusterLabels = {}; + for (var j = 0; j < keys2.length; ++j) + object.clusterLabels[keys2[j]] = message.clusterLabels[keys2[j]]; + } + return object; + }; + + /** + * Converts this ClusterSelector to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.ClusterSelector + * @instance + * @returns {Object.} JSON object + */ + ClusterSelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClusterSelector + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.ClusterSelector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClusterSelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.ClusterSelector"; + }; + + return ClusterSelector; + })(); + + v1.OrderedJob = (function() { + + /** + * Properties of an OrderedJob. + * @memberof google.cloud.dataproc.v1 + * @interface IOrderedJob + * @property {string|null} [stepId] OrderedJob stepId + * @property {google.cloud.dataproc.v1.IHadoopJob|null} [hadoopJob] OrderedJob hadoopJob + * @property {google.cloud.dataproc.v1.ISparkJob|null} [sparkJob] OrderedJob sparkJob + * @property {google.cloud.dataproc.v1.IPySparkJob|null} [pysparkJob] OrderedJob pysparkJob + * @property {google.cloud.dataproc.v1.IHiveJob|null} [hiveJob] OrderedJob hiveJob + * @property {google.cloud.dataproc.v1.IPigJob|null} [pigJob] OrderedJob pigJob + * @property {google.cloud.dataproc.v1.ISparkRJob|null} [sparkRJob] OrderedJob sparkRJob + * @property {google.cloud.dataproc.v1.ISparkSqlJob|null} [sparkSqlJob] OrderedJob sparkSqlJob + * @property {google.cloud.dataproc.v1.IPrestoJob|null} [prestoJob] OrderedJob prestoJob + * @property {google.cloud.dataproc.v1.ITrinoJob|null} [trinoJob] OrderedJob trinoJob + * @property {google.cloud.dataproc.v1.IFlinkJob|null} [flinkJob] OrderedJob flinkJob + * @property {Object.|null} [labels] OrderedJob labels + * @property {google.cloud.dataproc.v1.IJobScheduling|null} [scheduling] OrderedJob scheduling + * @property {Array.|null} [prerequisiteStepIds] OrderedJob prerequisiteStepIds + */ + + /** + * Constructs a new OrderedJob. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents an OrderedJob. + * @implements IOrderedJob + * @constructor + * @param {google.cloud.dataproc.v1.IOrderedJob=} [properties] Properties to set + */ + function OrderedJob(properties) { + this.labels = {}; + this.prerequisiteStepIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OrderedJob stepId. + * @member {string} stepId + * @memberof google.cloud.dataproc.v1.OrderedJob + * @instance + */ + OrderedJob.prototype.stepId = ""; + + /** + * OrderedJob hadoopJob. + * @member {google.cloud.dataproc.v1.IHadoopJob|null|undefined} hadoopJob + * @memberof google.cloud.dataproc.v1.OrderedJob + * @instance + */ + OrderedJob.prototype.hadoopJob = null; + + /** + * OrderedJob sparkJob. + * @member {google.cloud.dataproc.v1.ISparkJob|null|undefined} sparkJob + * @memberof google.cloud.dataproc.v1.OrderedJob + * @instance + */ + OrderedJob.prototype.sparkJob = null; + + /** + * OrderedJob pysparkJob. + * @member {google.cloud.dataproc.v1.IPySparkJob|null|undefined} pysparkJob + * @memberof google.cloud.dataproc.v1.OrderedJob + * @instance + */ + OrderedJob.prototype.pysparkJob = null; + + /** + * OrderedJob hiveJob. + * @member {google.cloud.dataproc.v1.IHiveJob|null|undefined} hiveJob + * @memberof google.cloud.dataproc.v1.OrderedJob + * @instance + */ + OrderedJob.prototype.hiveJob = null; + + /** + * OrderedJob pigJob. + * @member {google.cloud.dataproc.v1.IPigJob|null|undefined} pigJob + * @memberof google.cloud.dataproc.v1.OrderedJob + * @instance + */ + OrderedJob.prototype.pigJob = null; + + /** + * OrderedJob sparkRJob. + * @member {google.cloud.dataproc.v1.ISparkRJob|null|undefined} sparkRJob + * @memberof google.cloud.dataproc.v1.OrderedJob + * @instance + */ + OrderedJob.prototype.sparkRJob = null; + + /** + * OrderedJob sparkSqlJob. + * @member {google.cloud.dataproc.v1.ISparkSqlJob|null|undefined} sparkSqlJob + * @memberof google.cloud.dataproc.v1.OrderedJob + * @instance + */ + OrderedJob.prototype.sparkSqlJob = null; + + /** + * OrderedJob prestoJob. + * @member {google.cloud.dataproc.v1.IPrestoJob|null|undefined} prestoJob + * @memberof google.cloud.dataproc.v1.OrderedJob + * @instance + */ + OrderedJob.prototype.prestoJob = null; + + /** + * OrderedJob trinoJob. + * @member {google.cloud.dataproc.v1.ITrinoJob|null|undefined} trinoJob + * @memberof google.cloud.dataproc.v1.OrderedJob + * @instance + */ + OrderedJob.prototype.trinoJob = null; + + /** + * OrderedJob flinkJob. + * @member {google.cloud.dataproc.v1.IFlinkJob|null|undefined} flinkJob + * @memberof google.cloud.dataproc.v1.OrderedJob + * @instance + */ + OrderedJob.prototype.flinkJob = null; + + /** + * OrderedJob labels. + * @member {Object.} labels + * @memberof google.cloud.dataproc.v1.OrderedJob + * @instance + */ + OrderedJob.prototype.labels = $util.emptyObject; + + /** + * OrderedJob scheduling. + * @member {google.cloud.dataproc.v1.IJobScheduling|null|undefined} scheduling + * @memberof google.cloud.dataproc.v1.OrderedJob + * @instance + */ + OrderedJob.prototype.scheduling = null; + + /** + * OrderedJob prerequisiteStepIds. + * @member {Array.} prerequisiteStepIds + * @memberof google.cloud.dataproc.v1.OrderedJob + * @instance + */ + OrderedJob.prototype.prerequisiteStepIds = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OrderedJob jobType. + * @member {"hadoopJob"|"sparkJob"|"pysparkJob"|"hiveJob"|"pigJob"|"sparkRJob"|"sparkSqlJob"|"prestoJob"|"trinoJob"|"flinkJob"|undefined} jobType + * @memberof google.cloud.dataproc.v1.OrderedJob + * @instance + */ + Object.defineProperty(OrderedJob.prototype, "jobType", { + get: $util.oneOfGetter($oneOfFields = ["hadoopJob", "sparkJob", "pysparkJob", "hiveJob", "pigJob", "sparkRJob", "sparkSqlJob", "prestoJob", "trinoJob", "flinkJob"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OrderedJob instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.OrderedJob + * @static + * @param {google.cloud.dataproc.v1.IOrderedJob=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.OrderedJob} OrderedJob instance + */ + OrderedJob.create = function create(properties) { + return new OrderedJob(properties); + }; + + /** + * Encodes the specified OrderedJob message. Does not implicitly {@link google.cloud.dataproc.v1.OrderedJob.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.OrderedJob + * @static + * @param {google.cloud.dataproc.v1.IOrderedJob} message OrderedJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrderedJob.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stepId != null && Object.hasOwnProperty.call(message, "stepId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.stepId); + if (message.hadoopJob != null && Object.hasOwnProperty.call(message, "hadoopJob")) + $root.google.cloud.dataproc.v1.HadoopJob.encode(message.hadoopJob, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sparkJob != null && Object.hasOwnProperty.call(message, "sparkJob")) + $root.google.cloud.dataproc.v1.SparkJob.encode(message.sparkJob, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.pysparkJob != null && Object.hasOwnProperty.call(message, "pysparkJob")) + $root.google.cloud.dataproc.v1.PySparkJob.encode(message.pysparkJob, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.hiveJob != null && Object.hasOwnProperty.call(message, "hiveJob")) + $root.google.cloud.dataproc.v1.HiveJob.encode(message.hiveJob, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.pigJob != null && Object.hasOwnProperty.call(message, "pigJob")) + $root.google.cloud.dataproc.v1.PigJob.encode(message.pigJob, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.sparkSqlJob != null && Object.hasOwnProperty.call(message, "sparkSqlJob")) + $root.google.cloud.dataproc.v1.SparkSqlJob.encode(message.sparkSqlJob, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.scheduling != null && Object.hasOwnProperty.call(message, "scheduling")) + $root.google.cloud.dataproc.v1.JobScheduling.encode(message.scheduling, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.prerequisiteStepIds != null && message.prerequisiteStepIds.length) + for (var i = 0; i < message.prerequisiteStepIds.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.prerequisiteStepIds[i]); + if (message.sparkRJob != null && Object.hasOwnProperty.call(message, "sparkRJob")) + $root.google.cloud.dataproc.v1.SparkRJob.encode(message.sparkRJob, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.prestoJob != null && Object.hasOwnProperty.call(message, "prestoJob")) + $root.google.cloud.dataproc.v1.PrestoJob.encode(message.prestoJob, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.trinoJob != null && Object.hasOwnProperty.call(message, "trinoJob")) + $root.google.cloud.dataproc.v1.TrinoJob.encode(message.trinoJob, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.flinkJob != null && Object.hasOwnProperty.call(message, "flinkJob")) + $root.google.cloud.dataproc.v1.FlinkJob.encode(message.flinkJob, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OrderedJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.OrderedJob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.OrderedJob + * @static + * @param {google.cloud.dataproc.v1.IOrderedJob} message OrderedJob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrderedJob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OrderedJob message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.OrderedJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.OrderedJob} OrderedJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrderedJob.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.OrderedJob(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.stepId = reader.string(); + break; + } + case 2: { + message.hadoopJob = $root.google.cloud.dataproc.v1.HadoopJob.decode(reader, reader.uint32()); + break; + } + case 3: { + message.sparkJob = $root.google.cloud.dataproc.v1.SparkJob.decode(reader, reader.uint32()); + break; + } + case 4: { + message.pysparkJob = $root.google.cloud.dataproc.v1.PySparkJob.decode(reader, reader.uint32()); + break; + } + case 5: { + message.hiveJob = $root.google.cloud.dataproc.v1.HiveJob.decode(reader, reader.uint32()); + break; + } + case 6: { + message.pigJob = $root.google.cloud.dataproc.v1.PigJob.decode(reader, reader.uint32()); + break; + } + case 11: { + message.sparkRJob = $root.google.cloud.dataproc.v1.SparkRJob.decode(reader, reader.uint32()); + break; + } + case 7: { + message.sparkSqlJob = $root.google.cloud.dataproc.v1.SparkSqlJob.decode(reader, reader.uint32()); + break; + } + case 12: { + message.prestoJob = $root.google.cloud.dataproc.v1.PrestoJob.decode(reader, reader.uint32()); + break; + } + case 13: { + message.trinoJob = $root.google.cloud.dataproc.v1.TrinoJob.decode(reader, reader.uint32()); + break; + } + case 14: { + message.flinkJob = $root.google.cloud.dataproc.v1.FlinkJob.decode(reader, reader.uint32()); + break; + } + case 8: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 9: { + message.scheduling = $root.google.cloud.dataproc.v1.JobScheduling.decode(reader, reader.uint32()); + break; + } + case 10: { + if (!(message.prerequisiteStepIds && message.prerequisiteStepIds.length)) + message.prerequisiteStepIds = []; + message.prerequisiteStepIds.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OrderedJob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.OrderedJob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.OrderedJob} OrderedJob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrderedJob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OrderedJob message. + * @function verify + * @memberof google.cloud.dataproc.v1.OrderedJob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OrderedJob.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.stepId != null && message.hasOwnProperty("stepId")) + if (!$util.isString(message.stepId)) + return "stepId: string expected"; + if (message.hadoopJob != null && message.hasOwnProperty("hadoopJob")) { + properties.jobType = 1; + { + var error = $root.google.cloud.dataproc.v1.HadoopJob.verify(message.hadoopJob); + if (error) + return "hadoopJob." + error; + } + } + if (message.sparkJob != null && message.hasOwnProperty("sparkJob")) { + if (properties.jobType === 1) + return "jobType: multiple values"; + properties.jobType = 1; + { + var error = $root.google.cloud.dataproc.v1.SparkJob.verify(message.sparkJob); + if (error) + return "sparkJob." + error; + } + } + if (message.pysparkJob != null && message.hasOwnProperty("pysparkJob")) { + if (properties.jobType === 1) + return "jobType: multiple values"; + properties.jobType = 1; + { + var error = $root.google.cloud.dataproc.v1.PySparkJob.verify(message.pysparkJob); + if (error) + return "pysparkJob." + error; + } + } + if (message.hiveJob != null && message.hasOwnProperty("hiveJob")) { + if (properties.jobType === 1) + return "jobType: multiple values"; + properties.jobType = 1; + { + var error = $root.google.cloud.dataproc.v1.HiveJob.verify(message.hiveJob); + if (error) + return "hiveJob." + error; + } + } + if (message.pigJob != null && message.hasOwnProperty("pigJob")) { + if (properties.jobType === 1) + return "jobType: multiple values"; + properties.jobType = 1; + { + var error = $root.google.cloud.dataproc.v1.PigJob.verify(message.pigJob); + if (error) + return "pigJob." + error; + } + } + if (message.sparkRJob != null && message.hasOwnProperty("sparkRJob")) { + if (properties.jobType === 1) + return "jobType: multiple values"; + properties.jobType = 1; + { + var error = $root.google.cloud.dataproc.v1.SparkRJob.verify(message.sparkRJob); + if (error) + return "sparkRJob." + error; + } + } + if (message.sparkSqlJob != null && message.hasOwnProperty("sparkSqlJob")) { + if (properties.jobType === 1) + return "jobType: multiple values"; + properties.jobType = 1; + { + var error = $root.google.cloud.dataproc.v1.SparkSqlJob.verify(message.sparkSqlJob); + if (error) + return "sparkSqlJob." + error; + } + } + if (message.prestoJob != null && message.hasOwnProperty("prestoJob")) { + if (properties.jobType === 1) + return "jobType: multiple values"; + properties.jobType = 1; + { + var error = $root.google.cloud.dataproc.v1.PrestoJob.verify(message.prestoJob); + if (error) + return "prestoJob." + error; + } + } + if (message.trinoJob != null && message.hasOwnProperty("trinoJob")) { + if (properties.jobType === 1) + return "jobType: multiple values"; + properties.jobType = 1; + { + var error = $root.google.cloud.dataproc.v1.TrinoJob.verify(message.trinoJob); + if (error) + return "trinoJob." + error; + } + } + if (message.flinkJob != null && message.hasOwnProperty("flinkJob")) { + if (properties.jobType === 1) + return "jobType: multiple values"; + properties.jobType = 1; + { + var error = $root.google.cloud.dataproc.v1.FlinkJob.verify(message.flinkJob); + if (error) + return "flinkJob." + error; + } + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.scheduling != null && message.hasOwnProperty("scheduling")) { + var error = $root.google.cloud.dataproc.v1.JobScheduling.verify(message.scheduling); + if (error) + return "scheduling." + error; + } + if (message.prerequisiteStepIds != null && message.hasOwnProperty("prerequisiteStepIds")) { + if (!Array.isArray(message.prerequisiteStepIds)) + return "prerequisiteStepIds: array expected"; + for (var i = 0; i < message.prerequisiteStepIds.length; ++i) + if (!$util.isString(message.prerequisiteStepIds[i])) + return "prerequisiteStepIds: string[] expected"; + } + return null; + }; + + /** + * Creates an OrderedJob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.OrderedJob + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.OrderedJob} OrderedJob + */ + OrderedJob.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.OrderedJob) + return object; + var message = new $root.google.cloud.dataproc.v1.OrderedJob(); + if (object.stepId != null) + message.stepId = String(object.stepId); + if (object.hadoopJob != null) { + if (typeof object.hadoopJob !== "object") + throw TypeError(".google.cloud.dataproc.v1.OrderedJob.hadoopJob: object expected"); + message.hadoopJob = $root.google.cloud.dataproc.v1.HadoopJob.fromObject(object.hadoopJob); + } + if (object.sparkJob != null) { + if (typeof object.sparkJob !== "object") + throw TypeError(".google.cloud.dataproc.v1.OrderedJob.sparkJob: object expected"); + message.sparkJob = $root.google.cloud.dataproc.v1.SparkJob.fromObject(object.sparkJob); + } + if (object.pysparkJob != null) { + if (typeof object.pysparkJob !== "object") + throw TypeError(".google.cloud.dataproc.v1.OrderedJob.pysparkJob: object expected"); + message.pysparkJob = $root.google.cloud.dataproc.v1.PySparkJob.fromObject(object.pysparkJob); + } + if (object.hiveJob != null) { + if (typeof object.hiveJob !== "object") + throw TypeError(".google.cloud.dataproc.v1.OrderedJob.hiveJob: object expected"); + message.hiveJob = $root.google.cloud.dataproc.v1.HiveJob.fromObject(object.hiveJob); + } + if (object.pigJob != null) { + if (typeof object.pigJob !== "object") + throw TypeError(".google.cloud.dataproc.v1.OrderedJob.pigJob: object expected"); + message.pigJob = $root.google.cloud.dataproc.v1.PigJob.fromObject(object.pigJob); + } + if (object.sparkRJob != null) { + if (typeof object.sparkRJob !== "object") + throw TypeError(".google.cloud.dataproc.v1.OrderedJob.sparkRJob: object expected"); + message.sparkRJob = $root.google.cloud.dataproc.v1.SparkRJob.fromObject(object.sparkRJob); + } + if (object.sparkSqlJob != null) { + if (typeof object.sparkSqlJob !== "object") + throw TypeError(".google.cloud.dataproc.v1.OrderedJob.sparkSqlJob: object expected"); + message.sparkSqlJob = $root.google.cloud.dataproc.v1.SparkSqlJob.fromObject(object.sparkSqlJob); + } + if (object.prestoJob != null) { + if (typeof object.prestoJob !== "object") + throw TypeError(".google.cloud.dataproc.v1.OrderedJob.prestoJob: object expected"); + message.prestoJob = $root.google.cloud.dataproc.v1.PrestoJob.fromObject(object.prestoJob); + } + if (object.trinoJob != null) { + if (typeof object.trinoJob !== "object") + throw TypeError(".google.cloud.dataproc.v1.OrderedJob.trinoJob: object expected"); + message.trinoJob = $root.google.cloud.dataproc.v1.TrinoJob.fromObject(object.trinoJob); + } + if (object.flinkJob != null) { + if (typeof object.flinkJob !== "object") + throw TypeError(".google.cloud.dataproc.v1.OrderedJob.flinkJob: object expected"); + message.flinkJob = $root.google.cloud.dataproc.v1.FlinkJob.fromObject(object.flinkJob); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.dataproc.v1.OrderedJob.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.scheduling != null) { + if (typeof object.scheduling !== "object") + throw TypeError(".google.cloud.dataproc.v1.OrderedJob.scheduling: object expected"); + message.scheduling = $root.google.cloud.dataproc.v1.JobScheduling.fromObject(object.scheduling); + } + if (object.prerequisiteStepIds) { + if (!Array.isArray(object.prerequisiteStepIds)) + throw TypeError(".google.cloud.dataproc.v1.OrderedJob.prerequisiteStepIds: array expected"); + message.prerequisiteStepIds = []; + for (var i = 0; i < object.prerequisiteStepIds.length; ++i) + message.prerequisiteStepIds[i] = String(object.prerequisiteStepIds[i]); + } + return message; + }; + + /** + * Creates a plain object from an OrderedJob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.OrderedJob + * @static + * @param {google.cloud.dataproc.v1.OrderedJob} message OrderedJob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OrderedJob.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.prerequisiteStepIds = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.stepId = ""; + object.scheduling = null; + } + if (message.stepId != null && message.hasOwnProperty("stepId")) + object.stepId = message.stepId; + if (message.hadoopJob != null && message.hasOwnProperty("hadoopJob")) { + object.hadoopJob = $root.google.cloud.dataproc.v1.HadoopJob.toObject(message.hadoopJob, options); + if (options.oneofs) + object.jobType = "hadoopJob"; + } + if (message.sparkJob != null && message.hasOwnProperty("sparkJob")) { + object.sparkJob = $root.google.cloud.dataproc.v1.SparkJob.toObject(message.sparkJob, options); + if (options.oneofs) + object.jobType = "sparkJob"; + } + if (message.pysparkJob != null && message.hasOwnProperty("pysparkJob")) { + object.pysparkJob = $root.google.cloud.dataproc.v1.PySparkJob.toObject(message.pysparkJob, options); + if (options.oneofs) + object.jobType = "pysparkJob"; + } + if (message.hiveJob != null && message.hasOwnProperty("hiveJob")) { + object.hiveJob = $root.google.cloud.dataproc.v1.HiveJob.toObject(message.hiveJob, options); + if (options.oneofs) + object.jobType = "hiveJob"; + } + if (message.pigJob != null && message.hasOwnProperty("pigJob")) { + object.pigJob = $root.google.cloud.dataproc.v1.PigJob.toObject(message.pigJob, options); + if (options.oneofs) + object.jobType = "pigJob"; + } + if (message.sparkSqlJob != null && message.hasOwnProperty("sparkSqlJob")) { + object.sparkSqlJob = $root.google.cloud.dataproc.v1.SparkSqlJob.toObject(message.sparkSqlJob, options); + if (options.oneofs) + object.jobType = "sparkSqlJob"; + } + 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.scheduling != null && message.hasOwnProperty("scheduling")) + object.scheduling = $root.google.cloud.dataproc.v1.JobScheduling.toObject(message.scheduling, options); + if (message.prerequisiteStepIds && message.prerequisiteStepIds.length) { + object.prerequisiteStepIds = []; + for (var j = 0; j < message.prerequisiteStepIds.length; ++j) + object.prerequisiteStepIds[j] = message.prerequisiteStepIds[j]; + } + if (message.sparkRJob != null && message.hasOwnProperty("sparkRJob")) { + object.sparkRJob = $root.google.cloud.dataproc.v1.SparkRJob.toObject(message.sparkRJob, options); + if (options.oneofs) + object.jobType = "sparkRJob"; + } + if (message.prestoJob != null && message.hasOwnProperty("prestoJob")) { + object.prestoJob = $root.google.cloud.dataproc.v1.PrestoJob.toObject(message.prestoJob, options); + if (options.oneofs) + object.jobType = "prestoJob"; + } + if (message.trinoJob != null && message.hasOwnProperty("trinoJob")) { + object.trinoJob = $root.google.cloud.dataproc.v1.TrinoJob.toObject(message.trinoJob, options); + if (options.oneofs) + object.jobType = "trinoJob"; + } + if (message.flinkJob != null && message.hasOwnProperty("flinkJob")) { + object.flinkJob = $root.google.cloud.dataproc.v1.FlinkJob.toObject(message.flinkJob, options); + if (options.oneofs) + object.jobType = "flinkJob"; + } + return object; + }; + + /** + * Converts this OrderedJob to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.OrderedJob + * @instance + * @returns {Object.} JSON object + */ + OrderedJob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OrderedJob + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.OrderedJob + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OrderedJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.OrderedJob"; + }; + + return OrderedJob; + })(); + + v1.TemplateParameter = (function() { + + /** + * Properties of a TemplateParameter. + * @memberof google.cloud.dataproc.v1 + * @interface ITemplateParameter + * @property {string|null} [name] TemplateParameter name + * @property {Array.|null} [fields] TemplateParameter fields + * @property {string|null} [description] TemplateParameter description + * @property {google.cloud.dataproc.v1.IParameterValidation|null} [validation] TemplateParameter validation + */ + + /** + * Constructs a new TemplateParameter. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a TemplateParameter. + * @implements ITemplateParameter + * @constructor + * @param {google.cloud.dataproc.v1.ITemplateParameter=} [properties] Properties to set + */ + function TemplateParameter(properties) { + this.fields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TemplateParameter name. + * @member {string} name + * @memberof google.cloud.dataproc.v1.TemplateParameter + * @instance + */ + TemplateParameter.prototype.name = ""; + + /** + * TemplateParameter fields. + * @member {Array.} fields + * @memberof google.cloud.dataproc.v1.TemplateParameter + * @instance + */ + TemplateParameter.prototype.fields = $util.emptyArray; + + /** + * TemplateParameter description. + * @member {string} description + * @memberof google.cloud.dataproc.v1.TemplateParameter + * @instance + */ + TemplateParameter.prototype.description = ""; + + /** + * TemplateParameter validation. + * @member {google.cloud.dataproc.v1.IParameterValidation|null|undefined} validation + * @memberof google.cloud.dataproc.v1.TemplateParameter + * @instance + */ + TemplateParameter.prototype.validation = null; + + /** + * Creates a new TemplateParameter instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.TemplateParameter + * @static + * @param {google.cloud.dataproc.v1.ITemplateParameter=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.TemplateParameter} TemplateParameter instance + */ + TemplateParameter.create = function create(properties) { + return new TemplateParameter(properties); + }; + + /** + * Encodes the specified TemplateParameter message. Does not implicitly {@link google.cloud.dataproc.v1.TemplateParameter.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.TemplateParameter + * @static + * @param {google.cloud.dataproc.v1.ITemplateParameter} message TemplateParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TemplateParameter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.fields != null && message.fields.length) + for (var i = 0; i < message.fields.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fields[i]); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.validation != null && Object.hasOwnProperty.call(message, "validation")) + $root.google.cloud.dataproc.v1.ParameterValidation.encode(message.validation, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TemplateParameter message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.TemplateParameter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.TemplateParameter + * @static + * @param {google.cloud.dataproc.v1.ITemplateParameter} message TemplateParameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TemplateParameter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TemplateParameter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.TemplateParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.TemplateParameter} TemplateParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TemplateParameter.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.TemplateParameter(); + 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.fields && message.fields.length)) + message.fields = []; + message.fields.push(reader.string()); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.validation = $root.google.cloud.dataproc.v1.ParameterValidation.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TemplateParameter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.TemplateParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.TemplateParameter} TemplateParameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TemplateParameter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TemplateParameter message. + * @function verify + * @memberof google.cloud.dataproc.v1.TemplateParameter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TemplateParameter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!Array.isArray(message.fields)) + return "fields: array expected"; + for (var i = 0; i < message.fields.length; ++i) + if (!$util.isString(message.fields[i])) + return "fields: string[] expected"; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.validation != null && message.hasOwnProperty("validation")) { + var error = $root.google.cloud.dataproc.v1.ParameterValidation.verify(message.validation); + if (error) + return "validation." + error; + } + return null; + }; + + /** + * Creates a TemplateParameter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.TemplateParameter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.TemplateParameter} TemplateParameter + */ + TemplateParameter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.TemplateParameter) + return object; + var message = new $root.google.cloud.dataproc.v1.TemplateParameter(); + if (object.name != null) + message.name = String(object.name); + if (object.fields) { + if (!Array.isArray(object.fields)) + throw TypeError(".google.cloud.dataproc.v1.TemplateParameter.fields: array expected"); + message.fields = []; + for (var i = 0; i < object.fields.length; ++i) + message.fields[i] = String(object.fields[i]); + } + if (object.description != null) + message.description = String(object.description); + if (object.validation != null) { + if (typeof object.validation !== "object") + throw TypeError(".google.cloud.dataproc.v1.TemplateParameter.validation: object expected"); + message.validation = $root.google.cloud.dataproc.v1.ParameterValidation.fromObject(object.validation); + } + return message; + }; + + /** + * Creates a plain object from a TemplateParameter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.TemplateParameter + * @static + * @param {google.cloud.dataproc.v1.TemplateParameter} message TemplateParameter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TemplateParameter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.fields = []; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.validation = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.fields && message.fields.length) { + object.fields = []; + for (var j = 0; j < message.fields.length; ++j) + object.fields[j] = message.fields[j]; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.validation != null && message.hasOwnProperty("validation")) + object.validation = $root.google.cloud.dataproc.v1.ParameterValidation.toObject(message.validation, options); + return object; + }; + + /** + * Converts this TemplateParameter to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.TemplateParameter + * @instance + * @returns {Object.} JSON object + */ + TemplateParameter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TemplateParameter + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.TemplateParameter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TemplateParameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.TemplateParameter"; + }; + + return TemplateParameter; + })(); + + v1.ParameterValidation = (function() { + + /** + * Properties of a ParameterValidation. + * @memberof google.cloud.dataproc.v1 + * @interface IParameterValidation + * @property {google.cloud.dataproc.v1.IRegexValidation|null} [regex] ParameterValidation regex + * @property {google.cloud.dataproc.v1.IValueValidation|null} [values] ParameterValidation values + */ + + /** + * Constructs a new ParameterValidation. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a ParameterValidation. + * @implements IParameterValidation + * @constructor + * @param {google.cloud.dataproc.v1.IParameterValidation=} [properties] Properties to set + */ + function ParameterValidation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ParameterValidation regex. + * @member {google.cloud.dataproc.v1.IRegexValidation|null|undefined} regex + * @memberof google.cloud.dataproc.v1.ParameterValidation + * @instance + */ + ParameterValidation.prototype.regex = null; + + /** + * ParameterValidation values. + * @member {google.cloud.dataproc.v1.IValueValidation|null|undefined} values + * @memberof google.cloud.dataproc.v1.ParameterValidation + * @instance + */ + ParameterValidation.prototype.values = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ParameterValidation validationType. + * @member {"regex"|"values"|undefined} validationType + * @memberof google.cloud.dataproc.v1.ParameterValidation + * @instance + */ + Object.defineProperty(ParameterValidation.prototype, "validationType", { + get: $util.oneOfGetter($oneOfFields = ["regex", "values"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ParameterValidation instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.ParameterValidation + * @static + * @param {google.cloud.dataproc.v1.IParameterValidation=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.ParameterValidation} ParameterValidation instance + */ + ParameterValidation.create = function create(properties) { + return new ParameterValidation(properties); + }; + + /** + * Encodes the specified ParameterValidation message. Does not implicitly {@link google.cloud.dataproc.v1.ParameterValidation.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.ParameterValidation + * @static + * @param {google.cloud.dataproc.v1.IParameterValidation} message ParameterValidation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ParameterValidation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.regex != null && Object.hasOwnProperty.call(message, "regex")) + $root.google.cloud.dataproc.v1.RegexValidation.encode(message.regex, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.values != null && Object.hasOwnProperty.call(message, "values")) + $root.google.cloud.dataproc.v1.ValueValidation.encode(message.values, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ParameterValidation message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ParameterValidation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.ParameterValidation + * @static + * @param {google.cloud.dataproc.v1.IParameterValidation} message ParameterValidation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ParameterValidation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ParameterValidation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.ParameterValidation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.ParameterValidation} ParameterValidation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ParameterValidation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ParameterValidation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.regex = $root.google.cloud.dataproc.v1.RegexValidation.decode(reader, reader.uint32()); + break; + } + case 2: { + message.values = $root.google.cloud.dataproc.v1.ValueValidation.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ParameterValidation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.ParameterValidation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.ParameterValidation} ParameterValidation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ParameterValidation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ParameterValidation message. + * @function verify + * @memberof google.cloud.dataproc.v1.ParameterValidation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ParameterValidation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.regex != null && message.hasOwnProperty("regex")) { + properties.validationType = 1; + { + var error = $root.google.cloud.dataproc.v1.RegexValidation.verify(message.regex); + if (error) + return "regex." + error; + } + } + if (message.values != null && message.hasOwnProperty("values")) { + if (properties.validationType === 1) + return "validationType: multiple values"; + properties.validationType = 1; + { + var error = $root.google.cloud.dataproc.v1.ValueValidation.verify(message.values); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a ParameterValidation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.ParameterValidation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.ParameterValidation} ParameterValidation + */ + ParameterValidation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.ParameterValidation) + return object; + var message = new $root.google.cloud.dataproc.v1.ParameterValidation(); + if (object.regex != null) { + if (typeof object.regex !== "object") + throw TypeError(".google.cloud.dataproc.v1.ParameterValidation.regex: object expected"); + message.regex = $root.google.cloud.dataproc.v1.RegexValidation.fromObject(object.regex); + } + if (object.values != null) { + if (typeof object.values !== "object") + throw TypeError(".google.cloud.dataproc.v1.ParameterValidation.values: object expected"); + message.values = $root.google.cloud.dataproc.v1.ValueValidation.fromObject(object.values); + } + return message; + }; + + /** + * Creates a plain object from a ParameterValidation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.ParameterValidation + * @static + * @param {google.cloud.dataproc.v1.ParameterValidation} message ParameterValidation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ParameterValidation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.regex != null && message.hasOwnProperty("regex")) { + object.regex = $root.google.cloud.dataproc.v1.RegexValidation.toObject(message.regex, options); + if (options.oneofs) + object.validationType = "regex"; + } + if (message.values != null && message.hasOwnProperty("values")) { + object.values = $root.google.cloud.dataproc.v1.ValueValidation.toObject(message.values, options); + if (options.oneofs) + object.validationType = "values"; + } + return object; + }; + + /** + * Converts this ParameterValidation to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.ParameterValidation + * @instance + * @returns {Object.} JSON object + */ + ParameterValidation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ParameterValidation + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.ParameterValidation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ParameterValidation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.ParameterValidation"; + }; + + return ParameterValidation; + })(); + + v1.RegexValidation = (function() { + + /** + * Properties of a RegexValidation. + * @memberof google.cloud.dataproc.v1 + * @interface IRegexValidation + * @property {Array.|null} [regexes] RegexValidation regexes + */ + + /** + * Constructs a new RegexValidation. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a RegexValidation. + * @implements IRegexValidation + * @constructor + * @param {google.cloud.dataproc.v1.IRegexValidation=} [properties] Properties to set + */ + function RegexValidation(properties) { + this.regexes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegexValidation regexes. + * @member {Array.} regexes + * @memberof google.cloud.dataproc.v1.RegexValidation + * @instance + */ + RegexValidation.prototype.regexes = $util.emptyArray; + + /** + * Creates a new RegexValidation instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.RegexValidation + * @static + * @param {google.cloud.dataproc.v1.IRegexValidation=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.RegexValidation} RegexValidation instance + */ + RegexValidation.create = function create(properties) { + return new RegexValidation(properties); + }; + + /** + * Encodes the specified RegexValidation message. Does not implicitly {@link google.cloud.dataproc.v1.RegexValidation.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.RegexValidation + * @static + * @param {google.cloud.dataproc.v1.IRegexValidation} message RegexValidation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegexValidation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.regexes != null && message.regexes.length) + for (var i = 0; i < message.regexes.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.regexes[i]); + return writer; + }; + + /** + * Encodes the specified RegexValidation message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.RegexValidation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.RegexValidation + * @static + * @param {google.cloud.dataproc.v1.IRegexValidation} message RegexValidation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegexValidation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegexValidation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.RegexValidation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.RegexValidation} RegexValidation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegexValidation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.RegexValidation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.regexes && message.regexes.length)) + message.regexes = []; + message.regexes.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegexValidation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.RegexValidation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.RegexValidation} RegexValidation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegexValidation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegexValidation message. + * @function verify + * @memberof google.cloud.dataproc.v1.RegexValidation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegexValidation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.regexes != null && message.hasOwnProperty("regexes")) { + if (!Array.isArray(message.regexes)) + return "regexes: array expected"; + for (var i = 0; i < message.regexes.length; ++i) + if (!$util.isString(message.regexes[i])) + return "regexes: string[] expected"; + } + return null; + }; + + /** + * Creates a RegexValidation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.RegexValidation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.RegexValidation} RegexValidation + */ + RegexValidation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.RegexValidation) + return object; + var message = new $root.google.cloud.dataproc.v1.RegexValidation(); + if (object.regexes) { + if (!Array.isArray(object.regexes)) + throw TypeError(".google.cloud.dataproc.v1.RegexValidation.regexes: array expected"); + message.regexes = []; + for (var i = 0; i < object.regexes.length; ++i) + message.regexes[i] = String(object.regexes[i]); + } + return message; + }; + + /** + * Creates a plain object from a RegexValidation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.RegexValidation + * @static + * @param {google.cloud.dataproc.v1.RegexValidation} message RegexValidation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegexValidation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.regexes = []; + if (message.regexes && message.regexes.length) { + object.regexes = []; + for (var j = 0; j < message.regexes.length; ++j) + object.regexes[j] = message.regexes[j]; + } + return object; + }; + + /** + * Converts this RegexValidation to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.RegexValidation + * @instance + * @returns {Object.} JSON object + */ + RegexValidation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RegexValidation + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.RegexValidation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RegexValidation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.RegexValidation"; + }; + + return RegexValidation; + })(); + + v1.ValueValidation = (function() { + + /** + * Properties of a ValueValidation. + * @memberof google.cloud.dataproc.v1 + * @interface IValueValidation + * @property {Array.|null} [values] ValueValidation values + */ + + /** + * Constructs a new ValueValidation. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a ValueValidation. + * @implements IValueValidation + * @constructor + * @param {google.cloud.dataproc.v1.IValueValidation=} [properties] Properties to set + */ + function ValueValidation(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValueValidation values. + * @member {Array.} values + * @memberof google.cloud.dataproc.v1.ValueValidation + * @instance + */ + ValueValidation.prototype.values = $util.emptyArray; + + /** + * Creates a new ValueValidation instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.ValueValidation + * @static + * @param {google.cloud.dataproc.v1.IValueValidation=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.ValueValidation} ValueValidation instance + */ + ValueValidation.create = function create(properties) { + return new ValueValidation(properties); + }; + + /** + * Encodes the specified ValueValidation message. Does not implicitly {@link google.cloud.dataproc.v1.ValueValidation.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.ValueValidation + * @static + * @param {google.cloud.dataproc.v1.IValueValidation} message ValueValidation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValueValidation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.values[i]); + return writer; + }; + + /** + * Encodes the specified ValueValidation message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ValueValidation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.ValueValidation + * @static + * @param {google.cloud.dataproc.v1.IValueValidation} message ValueValidation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValueValidation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValueValidation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.ValueValidation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.ValueValidation} ValueValidation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValueValidation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ValueValidation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValueValidation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.ValueValidation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.ValueValidation} ValueValidation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValueValidation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValueValidation message. + * @function verify + * @memberof google.cloud.dataproc.v1.ValueValidation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValueValidation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) + if (!$util.isString(message.values[i])) + return "values: string[] expected"; + } + return null; + }; + + /** + * Creates a ValueValidation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.ValueValidation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.ValueValidation} ValueValidation + */ + ValueValidation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.ValueValidation) + return object; + var message = new $root.google.cloud.dataproc.v1.ValueValidation(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.dataproc.v1.ValueValidation.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) + message.values[i] = String(object.values[i]); + } + return message; + }; + + /** + * Creates a plain object from a ValueValidation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.ValueValidation + * @static + * @param {google.cloud.dataproc.v1.ValueValidation} message ValueValidation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValueValidation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = message.values[j]; + } + return object; + }; + + /** + * Converts this ValueValidation to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.ValueValidation + * @instance + * @returns {Object.} JSON object + */ + ValueValidation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ValueValidation + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.ValueValidation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ValueValidation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.ValueValidation"; + }; + + return ValueValidation; + })(); + + v1.WorkflowMetadata = (function() { + + /** + * Properties of a WorkflowMetadata. + * @memberof google.cloud.dataproc.v1 + * @interface IWorkflowMetadata + * @property {string|null} [template] WorkflowMetadata template + * @property {number|null} [version] WorkflowMetadata version + * @property {google.cloud.dataproc.v1.IClusterOperation|null} [createCluster] WorkflowMetadata createCluster + * @property {google.cloud.dataproc.v1.IWorkflowGraph|null} [graph] WorkflowMetadata graph + * @property {google.cloud.dataproc.v1.IClusterOperation|null} [deleteCluster] WorkflowMetadata deleteCluster + * @property {google.cloud.dataproc.v1.WorkflowMetadata.State|null} [state] WorkflowMetadata state + * @property {string|null} [clusterName] WorkflowMetadata clusterName + * @property {Object.|null} [parameters] WorkflowMetadata parameters + * @property {google.protobuf.ITimestamp|null} [startTime] WorkflowMetadata startTime + * @property {google.protobuf.ITimestamp|null} [endTime] WorkflowMetadata endTime + * @property {string|null} [clusterUuid] WorkflowMetadata clusterUuid + * @property {google.protobuf.IDuration|null} [dagTimeout] WorkflowMetadata dagTimeout + * @property {google.protobuf.ITimestamp|null} [dagStartTime] WorkflowMetadata dagStartTime + * @property {google.protobuf.ITimestamp|null} [dagEndTime] WorkflowMetadata dagEndTime + */ + + /** + * Constructs a new WorkflowMetadata. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a WorkflowMetadata. + * @implements IWorkflowMetadata + * @constructor + * @param {google.cloud.dataproc.v1.IWorkflowMetadata=} [properties] Properties to set + */ + function WorkflowMetadata(properties) { + this.parameters = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WorkflowMetadata template. + * @member {string} template + * @memberof google.cloud.dataproc.v1.WorkflowMetadata + * @instance + */ + WorkflowMetadata.prototype.template = ""; + + /** + * WorkflowMetadata version. + * @member {number} version + * @memberof google.cloud.dataproc.v1.WorkflowMetadata + * @instance + */ + WorkflowMetadata.prototype.version = 0; + + /** + * WorkflowMetadata createCluster. + * @member {google.cloud.dataproc.v1.IClusterOperation|null|undefined} createCluster + * @memberof google.cloud.dataproc.v1.WorkflowMetadata + * @instance + */ + WorkflowMetadata.prototype.createCluster = null; + + /** + * WorkflowMetadata graph. + * @member {google.cloud.dataproc.v1.IWorkflowGraph|null|undefined} graph + * @memberof google.cloud.dataproc.v1.WorkflowMetadata + * @instance + */ + WorkflowMetadata.prototype.graph = null; + + /** + * WorkflowMetadata deleteCluster. + * @member {google.cloud.dataproc.v1.IClusterOperation|null|undefined} deleteCluster + * @memberof google.cloud.dataproc.v1.WorkflowMetadata + * @instance + */ + WorkflowMetadata.prototype.deleteCluster = null; + + /** + * WorkflowMetadata state. + * @member {google.cloud.dataproc.v1.WorkflowMetadata.State} state + * @memberof google.cloud.dataproc.v1.WorkflowMetadata + * @instance + */ + WorkflowMetadata.prototype.state = 0; + + /** + * WorkflowMetadata clusterName. + * @member {string} clusterName + * @memberof google.cloud.dataproc.v1.WorkflowMetadata + * @instance + */ + WorkflowMetadata.prototype.clusterName = ""; + + /** + * WorkflowMetadata parameters. + * @member {Object.} parameters + * @memberof google.cloud.dataproc.v1.WorkflowMetadata + * @instance + */ + WorkflowMetadata.prototype.parameters = $util.emptyObject; + + /** + * WorkflowMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.dataproc.v1.WorkflowMetadata + * @instance + */ + WorkflowMetadata.prototype.startTime = null; + + /** + * WorkflowMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.dataproc.v1.WorkflowMetadata + * @instance + */ + WorkflowMetadata.prototype.endTime = null; + + /** + * WorkflowMetadata clusterUuid. + * @member {string} clusterUuid + * @memberof google.cloud.dataproc.v1.WorkflowMetadata + * @instance + */ + WorkflowMetadata.prototype.clusterUuid = ""; + + /** + * WorkflowMetadata dagTimeout. + * @member {google.protobuf.IDuration|null|undefined} dagTimeout + * @memberof google.cloud.dataproc.v1.WorkflowMetadata + * @instance + */ + WorkflowMetadata.prototype.dagTimeout = null; + + /** + * WorkflowMetadata dagStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} dagStartTime + * @memberof google.cloud.dataproc.v1.WorkflowMetadata + * @instance + */ + WorkflowMetadata.prototype.dagStartTime = null; + + /** + * WorkflowMetadata dagEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} dagEndTime + * @memberof google.cloud.dataproc.v1.WorkflowMetadata + * @instance + */ + WorkflowMetadata.prototype.dagEndTime = null; + + /** + * Creates a new WorkflowMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.WorkflowMetadata + * @static + * @param {google.cloud.dataproc.v1.IWorkflowMetadata=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.WorkflowMetadata} WorkflowMetadata instance + */ + WorkflowMetadata.create = function create(properties) { + return new WorkflowMetadata(properties); + }; + + /** + * Encodes the specified WorkflowMetadata message. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.WorkflowMetadata + * @static + * @param {google.cloud.dataproc.v1.IWorkflowMetadata} message WorkflowMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkflowMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.template != null && Object.hasOwnProperty.call(message, "template")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.template); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.version); + if (message.createCluster != null && Object.hasOwnProperty.call(message, "createCluster")) + $root.google.cloud.dataproc.v1.ClusterOperation.encode(message.createCluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.graph != null && Object.hasOwnProperty.call(message, "graph")) + $root.google.cloud.dataproc.v1.WorkflowGraph.encode(message.graph, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.deleteCluster != null && Object.hasOwnProperty.call(message, "deleteCluster")) + $root.google.cloud.dataproc.v1.ClusterOperation.encode(message.deleteCluster, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); + if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.clusterName); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + for (var keys = Object.keys(message.parameters), 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.parameters[keys[i]]).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.clusterUuid != null && Object.hasOwnProperty.call(message, "clusterUuid")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.clusterUuid); + if (message.dagTimeout != null && Object.hasOwnProperty.call(message, "dagTimeout")) + $root.google.protobuf.Duration.encode(message.dagTimeout, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.dagStartTime != null && Object.hasOwnProperty.call(message, "dagStartTime")) + $root.google.protobuf.Timestamp.encode(message.dagStartTime, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.dagEndTime != null && Object.hasOwnProperty.call(message, "dagEndTime")) + $root.google.protobuf.Timestamp.encode(message.dagEndTime, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WorkflowMetadata message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.WorkflowMetadata + * @static + * @param {google.cloud.dataproc.v1.IWorkflowMetadata} message WorkflowMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkflowMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WorkflowMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.WorkflowMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.WorkflowMetadata} WorkflowMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkflowMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.WorkflowMetadata(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.template = reader.string(); + break; + } + case 2: { + message.version = reader.int32(); + break; + } + case 3: { + message.createCluster = $root.google.cloud.dataproc.v1.ClusterOperation.decode(reader, reader.uint32()); + break; + } + case 4: { + message.graph = $root.google.cloud.dataproc.v1.WorkflowGraph.decode(reader, reader.uint32()); + break; + } + case 5: { + message.deleteCluster = $root.google.cloud.dataproc.v1.ClusterOperation.decode(reader, reader.uint32()); + break; + } + case 6: { + message.state = reader.int32(); + break; + } + case 7: { + message.clusterName = reader.string(); + break; + } + case 8: { + if (message.parameters === $util.emptyObject) + message.parameters = {}; + 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.parameters[key] = value; + break; + } + case 9: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.clusterUuid = reader.string(); + break; + } + case 12: { + message.dagTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 13: { + message.dagStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 14: { + message.dagEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WorkflowMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.WorkflowMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.WorkflowMetadata} WorkflowMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkflowMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WorkflowMetadata message. + * @function verify + * @memberof google.cloud.dataproc.v1.WorkflowMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WorkflowMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.template != null && message.hasOwnProperty("template")) + if (!$util.isString(message.template)) + return "template: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.createCluster != null && message.hasOwnProperty("createCluster")) { + var error = $root.google.cloud.dataproc.v1.ClusterOperation.verify(message.createCluster); + if (error) + return "createCluster." + error; + } + if (message.graph != null && message.hasOwnProperty("graph")) { + var error = $root.google.cloud.dataproc.v1.WorkflowGraph.verify(message.graph); + if (error) + return "graph." + error; + } + if (message.deleteCluster != null && message.hasOwnProperty("deleteCluster")) { + var error = $root.google.cloud.dataproc.v1.ClusterOperation.verify(message.deleteCluster); + if (error) + return "deleteCluster." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + if (!$util.isString(message.clusterName)) + return "clusterName: string expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + if (!$util.isObject(message.parameters)) + return "parameters: object expected"; + var key = Object.keys(message.parameters); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.parameters[key[i]])) + return "parameters: string{k:string} expected"; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.clusterUuid != null && message.hasOwnProperty("clusterUuid")) + if (!$util.isString(message.clusterUuid)) + return "clusterUuid: string expected"; + if (message.dagTimeout != null && message.hasOwnProperty("dagTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.dagTimeout); + if (error) + return "dagTimeout." + error; + } + if (message.dagStartTime != null && message.hasOwnProperty("dagStartTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.dagStartTime); + if (error) + return "dagStartTime." + error; + } + if (message.dagEndTime != null && message.hasOwnProperty("dagEndTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.dagEndTime); + if (error) + return "dagEndTime." + error; + } + return null; + }; + + /** + * Creates a WorkflowMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.WorkflowMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.WorkflowMetadata} WorkflowMetadata + */ + WorkflowMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.WorkflowMetadata) + return object; + var message = new $root.google.cloud.dataproc.v1.WorkflowMetadata(); + if (object.template != null) + message.template = String(object.template); + if (object.version != null) + message.version = object.version | 0; + if (object.createCluster != null) { + if (typeof object.createCluster !== "object") + throw TypeError(".google.cloud.dataproc.v1.WorkflowMetadata.createCluster: object expected"); + message.createCluster = $root.google.cloud.dataproc.v1.ClusterOperation.fromObject(object.createCluster); + } + if (object.graph != null) { + if (typeof object.graph !== "object") + throw TypeError(".google.cloud.dataproc.v1.WorkflowMetadata.graph: object expected"); + message.graph = $root.google.cloud.dataproc.v1.WorkflowGraph.fromObject(object.graph); + } + if (object.deleteCluster != null) { + if (typeof object.deleteCluster !== "object") + throw TypeError(".google.cloud.dataproc.v1.WorkflowMetadata.deleteCluster: object expected"); + message.deleteCluster = $root.google.cloud.dataproc.v1.ClusterOperation.fromObject(object.deleteCluster); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "UNKNOWN": + case 0: + message.state = 0; + break; + case "PENDING": + case 1: + message.state = 1; + break; + case "RUNNING": + case 2: + message.state = 2; + break; + case "DONE": + case 3: + message.state = 3; + break; + } + if (object.clusterName != null) + message.clusterName = String(object.clusterName); + if (object.parameters) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.dataproc.v1.WorkflowMetadata.parameters: object expected"); + message.parameters = {}; + for (var keys = Object.keys(object.parameters), i = 0; i < keys.length; ++i) + message.parameters[keys[i]] = String(object.parameters[keys[i]]); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.dataproc.v1.WorkflowMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.dataproc.v1.WorkflowMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.clusterUuid != null) + message.clusterUuid = String(object.clusterUuid); + if (object.dagTimeout != null) { + if (typeof object.dagTimeout !== "object") + throw TypeError(".google.cloud.dataproc.v1.WorkflowMetadata.dagTimeout: object expected"); + message.dagTimeout = $root.google.protobuf.Duration.fromObject(object.dagTimeout); + } + if (object.dagStartTime != null) { + if (typeof object.dagStartTime !== "object") + throw TypeError(".google.cloud.dataproc.v1.WorkflowMetadata.dagStartTime: object expected"); + message.dagStartTime = $root.google.protobuf.Timestamp.fromObject(object.dagStartTime); + } + if (object.dagEndTime != null) { + if (typeof object.dagEndTime !== "object") + throw TypeError(".google.cloud.dataproc.v1.WorkflowMetadata.dagEndTime: object expected"); + message.dagEndTime = $root.google.protobuf.Timestamp.fromObject(object.dagEndTime); + } + return message; + }; + + /** + * Creates a plain object from a WorkflowMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.WorkflowMetadata + * @static + * @param {google.cloud.dataproc.v1.WorkflowMetadata} message WorkflowMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WorkflowMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.parameters = {}; + if (options.defaults) { + object.template = ""; + object.version = 0; + object.createCluster = null; + object.graph = null; + object.deleteCluster = null; + object.state = options.enums === String ? "UNKNOWN" : 0; + object.clusterName = ""; + object.startTime = null; + object.endTime = null; + object.clusterUuid = ""; + object.dagTimeout = null; + object.dagStartTime = null; + object.dagEndTime = null; + } + if (message.template != null && message.hasOwnProperty("template")) + object.template = message.template; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.createCluster != null && message.hasOwnProperty("createCluster")) + object.createCluster = $root.google.cloud.dataproc.v1.ClusterOperation.toObject(message.createCluster, options); + if (message.graph != null && message.hasOwnProperty("graph")) + object.graph = $root.google.cloud.dataproc.v1.WorkflowGraph.toObject(message.graph, options); + if (message.deleteCluster != null && message.hasOwnProperty("deleteCluster")) + object.deleteCluster = $root.google.cloud.dataproc.v1.ClusterOperation.toObject(message.deleteCluster, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.dataproc.v1.WorkflowMetadata.State[message.state] === undefined ? message.state : $root.google.cloud.dataproc.v1.WorkflowMetadata.State[message.state] : message.state; + if (message.clusterName != null && message.hasOwnProperty("clusterName")) + object.clusterName = message.clusterName; + var keys2; + if (message.parameters && (keys2 = Object.keys(message.parameters)).length) { + object.parameters = {}; + for (var j = 0; j < keys2.length; ++j) + object.parameters[keys2[j]] = message.parameters[keys2[j]]; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.clusterUuid != null && message.hasOwnProperty("clusterUuid")) + object.clusterUuid = message.clusterUuid; + if (message.dagTimeout != null && message.hasOwnProperty("dagTimeout")) + object.dagTimeout = $root.google.protobuf.Duration.toObject(message.dagTimeout, options); + if (message.dagStartTime != null && message.hasOwnProperty("dagStartTime")) + object.dagStartTime = $root.google.protobuf.Timestamp.toObject(message.dagStartTime, options); + if (message.dagEndTime != null && message.hasOwnProperty("dagEndTime")) + object.dagEndTime = $root.google.protobuf.Timestamp.toObject(message.dagEndTime, options); + return object; + }; + + /** + * Converts this WorkflowMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.WorkflowMetadata + * @instance + * @returns {Object.} JSON object + */ + WorkflowMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WorkflowMetadata + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.WorkflowMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WorkflowMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.WorkflowMetadata"; + }; + + /** + * State enum. + * @name google.cloud.dataproc.v1.WorkflowMetadata.State + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} PENDING=1 PENDING value + * @property {number} RUNNING=2 RUNNING value + * @property {number} DONE=3 DONE value + */ + WorkflowMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "RUNNING"] = 2; + values[valuesById[3] = "DONE"] = 3; + return values; + })(); + + return WorkflowMetadata; + })(); + + v1.ClusterOperation = (function() { + + /** + * Properties of a ClusterOperation. + * @memberof google.cloud.dataproc.v1 + * @interface IClusterOperation + * @property {string|null} [operationId] ClusterOperation operationId + * @property {string|null} [error] ClusterOperation error + * @property {boolean|null} [done] ClusterOperation done + */ + + /** + * Constructs a new ClusterOperation. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a ClusterOperation. + * @implements IClusterOperation + * @constructor + * @param {google.cloud.dataproc.v1.IClusterOperation=} [properties] Properties to set + */ + function ClusterOperation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClusterOperation operationId. + * @member {string} operationId + * @memberof google.cloud.dataproc.v1.ClusterOperation + * @instance + */ + ClusterOperation.prototype.operationId = ""; + + /** + * ClusterOperation error. + * @member {string} error + * @memberof google.cloud.dataproc.v1.ClusterOperation + * @instance + */ + ClusterOperation.prototype.error = ""; + + /** + * ClusterOperation done. + * @member {boolean} done + * @memberof google.cloud.dataproc.v1.ClusterOperation + * @instance + */ + ClusterOperation.prototype.done = false; + + /** + * Creates a new ClusterOperation instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.ClusterOperation + * @static + * @param {google.cloud.dataproc.v1.IClusterOperation=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.ClusterOperation} ClusterOperation instance + */ + ClusterOperation.create = function create(properties) { + return new ClusterOperation(properties); + }; + + /** + * Encodes the specified ClusterOperation message. Does not implicitly {@link google.cloud.dataproc.v1.ClusterOperation.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.ClusterOperation + * @static + * @param {google.cloud.dataproc.v1.IClusterOperation} message ClusterOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterOperation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operationId != null && Object.hasOwnProperty.call(message, "operationId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.operationId); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.error); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + return writer; + }; + + /** + * Encodes the specified ClusterOperation message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ClusterOperation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.ClusterOperation + * @static + * @param {google.cloud.dataproc.v1.IClusterOperation} message ClusterOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClusterOperation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClusterOperation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.ClusterOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.ClusterOperation} ClusterOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterOperation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ClusterOperation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.operationId = reader.string(); + break; + } + case 2: { + message.error = reader.string(); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClusterOperation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.ClusterOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.ClusterOperation} ClusterOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClusterOperation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClusterOperation message. + * @function verify + * @memberof google.cloud.dataproc.v1.ClusterOperation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClusterOperation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operationId != null && message.hasOwnProperty("operationId")) + if (!$util.isString(message.operationId)) + return "operationId: string expected"; + if (message.error != null && message.hasOwnProperty("error")) + if (!$util.isString(message.error)) + return "error: string expected"; + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + return null; + }; + + /** + * Creates a ClusterOperation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.ClusterOperation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.ClusterOperation} ClusterOperation + */ + ClusterOperation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.ClusterOperation) + return object; + var message = new $root.google.cloud.dataproc.v1.ClusterOperation(); + if (object.operationId != null) + message.operationId = String(object.operationId); + if (object.error != null) + message.error = String(object.error); + if (object.done != null) + message.done = Boolean(object.done); + return message; + }; + + /** + * Creates a plain object from a ClusterOperation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.ClusterOperation + * @static + * @param {google.cloud.dataproc.v1.ClusterOperation} message ClusterOperation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClusterOperation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.operationId = ""; + object.error = ""; + object.done = false; + } + if (message.operationId != null && message.hasOwnProperty("operationId")) + object.operationId = message.operationId; + if (message.error != null && message.hasOwnProperty("error")) + object.error = message.error; + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + return object; + }; + + /** + * Converts this ClusterOperation to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.ClusterOperation + * @instance + * @returns {Object.} JSON object + */ + ClusterOperation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClusterOperation + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.ClusterOperation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClusterOperation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.ClusterOperation"; + }; + + return ClusterOperation; + })(); + + v1.WorkflowGraph = (function() { + + /** + * Properties of a WorkflowGraph. + * @memberof google.cloud.dataproc.v1 + * @interface IWorkflowGraph + * @property {Array.|null} [nodes] WorkflowGraph nodes + */ + + /** + * Constructs a new WorkflowGraph. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a WorkflowGraph. + * @implements IWorkflowGraph + * @constructor + * @param {google.cloud.dataproc.v1.IWorkflowGraph=} [properties] Properties to set + */ + function WorkflowGraph(properties) { + this.nodes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WorkflowGraph nodes. + * @member {Array.} nodes + * @memberof google.cloud.dataproc.v1.WorkflowGraph + * @instance + */ + WorkflowGraph.prototype.nodes = $util.emptyArray; + + /** + * Creates a new WorkflowGraph instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.WorkflowGraph + * @static + * @param {google.cloud.dataproc.v1.IWorkflowGraph=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.WorkflowGraph} WorkflowGraph instance + */ + WorkflowGraph.create = function create(properties) { + return new WorkflowGraph(properties); + }; + + /** + * Encodes the specified WorkflowGraph message. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowGraph.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.WorkflowGraph + * @static + * @param {google.cloud.dataproc.v1.IWorkflowGraph} message WorkflowGraph message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkflowGraph.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodes != null && message.nodes.length) + for (var i = 0; i < message.nodes.length; ++i) + $root.google.cloud.dataproc.v1.WorkflowNode.encode(message.nodes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WorkflowGraph message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowGraph.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.WorkflowGraph + * @static + * @param {google.cloud.dataproc.v1.IWorkflowGraph} message WorkflowGraph message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkflowGraph.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WorkflowGraph message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.WorkflowGraph + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.WorkflowGraph} WorkflowGraph + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkflowGraph.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.WorkflowGraph(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.nodes && message.nodes.length)) + message.nodes = []; + message.nodes.push($root.google.cloud.dataproc.v1.WorkflowNode.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WorkflowGraph message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.WorkflowGraph + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.WorkflowGraph} WorkflowGraph + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkflowGraph.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WorkflowGraph message. + * @function verify + * @memberof google.cloud.dataproc.v1.WorkflowGraph + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WorkflowGraph.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodes != null && message.hasOwnProperty("nodes")) { + if (!Array.isArray(message.nodes)) + return "nodes: array expected"; + for (var i = 0; i < message.nodes.length; ++i) { + var error = $root.google.cloud.dataproc.v1.WorkflowNode.verify(message.nodes[i]); + if (error) + return "nodes." + error; + } + } + return null; + }; + + /** + * Creates a WorkflowGraph message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.WorkflowGraph + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.WorkflowGraph} WorkflowGraph + */ + WorkflowGraph.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.WorkflowGraph) + return object; + var message = new $root.google.cloud.dataproc.v1.WorkflowGraph(); + if (object.nodes) { + if (!Array.isArray(object.nodes)) + throw TypeError(".google.cloud.dataproc.v1.WorkflowGraph.nodes: array expected"); + message.nodes = []; + for (var i = 0; i < object.nodes.length; ++i) { + if (typeof object.nodes[i] !== "object") + throw TypeError(".google.cloud.dataproc.v1.WorkflowGraph.nodes: object expected"); + message.nodes[i] = $root.google.cloud.dataproc.v1.WorkflowNode.fromObject(object.nodes[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a WorkflowGraph message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.WorkflowGraph + * @static + * @param {google.cloud.dataproc.v1.WorkflowGraph} message WorkflowGraph + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WorkflowGraph.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nodes = []; + if (message.nodes && message.nodes.length) { + object.nodes = []; + for (var j = 0; j < message.nodes.length; ++j) + object.nodes[j] = $root.google.cloud.dataproc.v1.WorkflowNode.toObject(message.nodes[j], options); + } + return object; + }; + + /** + * Converts this WorkflowGraph to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.WorkflowGraph + * @instance + * @returns {Object.} JSON object + */ + WorkflowGraph.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WorkflowGraph + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.WorkflowGraph + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WorkflowGraph.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.WorkflowGraph"; + }; + + return WorkflowGraph; + })(); + + v1.WorkflowNode = (function() { + + /** + * Properties of a WorkflowNode. + * @memberof google.cloud.dataproc.v1 + * @interface IWorkflowNode + * @property {string|null} [stepId] WorkflowNode stepId + * @property {Array.|null} [prerequisiteStepIds] WorkflowNode prerequisiteStepIds + * @property {string|null} [jobId] WorkflowNode jobId + * @property {google.cloud.dataproc.v1.WorkflowNode.NodeState|null} [state] WorkflowNode state + * @property {string|null} [error] WorkflowNode error + */ + + /** + * Constructs a new WorkflowNode. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a WorkflowNode. + * @implements IWorkflowNode + * @constructor + * @param {google.cloud.dataproc.v1.IWorkflowNode=} [properties] Properties to set + */ + function WorkflowNode(properties) { + this.prerequisiteStepIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WorkflowNode stepId. + * @member {string} stepId + * @memberof google.cloud.dataproc.v1.WorkflowNode + * @instance + */ + WorkflowNode.prototype.stepId = ""; + + /** + * WorkflowNode prerequisiteStepIds. + * @member {Array.} prerequisiteStepIds + * @memberof google.cloud.dataproc.v1.WorkflowNode + * @instance + */ + WorkflowNode.prototype.prerequisiteStepIds = $util.emptyArray; + + /** + * WorkflowNode jobId. + * @member {string} jobId + * @memberof google.cloud.dataproc.v1.WorkflowNode + * @instance + */ + WorkflowNode.prototype.jobId = ""; + + /** + * WorkflowNode state. + * @member {google.cloud.dataproc.v1.WorkflowNode.NodeState} state + * @memberof google.cloud.dataproc.v1.WorkflowNode + * @instance + */ + WorkflowNode.prototype.state = 0; + + /** + * WorkflowNode error. + * @member {string} error + * @memberof google.cloud.dataproc.v1.WorkflowNode + * @instance + */ + WorkflowNode.prototype.error = ""; + + /** + * Creates a new WorkflowNode instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.WorkflowNode + * @static + * @param {google.cloud.dataproc.v1.IWorkflowNode=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.WorkflowNode} WorkflowNode instance + */ + WorkflowNode.create = function create(properties) { + return new WorkflowNode(properties); + }; + + /** + * Encodes the specified WorkflowNode message. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowNode.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.WorkflowNode + * @static + * @param {google.cloud.dataproc.v1.IWorkflowNode} message WorkflowNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkflowNode.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stepId != null && Object.hasOwnProperty.call(message, "stepId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.stepId); + if (message.prerequisiteStepIds != null && message.prerequisiteStepIds.length) + for (var i = 0; i < message.prerequisiteStepIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.prerequisiteStepIds[i]); + if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.jobId); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.error); + return writer; + }; + + /** + * Encodes the specified WorkflowNode message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowNode.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.WorkflowNode + * @static + * @param {google.cloud.dataproc.v1.IWorkflowNode} message WorkflowNode message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkflowNode.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WorkflowNode message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.WorkflowNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.WorkflowNode} WorkflowNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkflowNode.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.WorkflowNode(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.stepId = reader.string(); + break; + } + case 2: { + if (!(message.prerequisiteStepIds && message.prerequisiteStepIds.length)) + message.prerequisiteStepIds = []; + message.prerequisiteStepIds.push(reader.string()); + break; + } + case 3: { + message.jobId = reader.string(); + break; + } + case 5: { + message.state = reader.int32(); + break; + } + case 6: { + message.error = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WorkflowNode message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.WorkflowNode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.WorkflowNode} WorkflowNode + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkflowNode.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WorkflowNode message. + * @function verify + * @memberof google.cloud.dataproc.v1.WorkflowNode + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WorkflowNode.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stepId != null && message.hasOwnProperty("stepId")) + if (!$util.isString(message.stepId)) + return "stepId: string expected"; + if (message.prerequisiteStepIds != null && message.hasOwnProperty("prerequisiteStepIds")) { + if (!Array.isArray(message.prerequisiteStepIds)) + return "prerequisiteStepIds: array expected"; + for (var i = 0; i < message.prerequisiteStepIds.length; ++i) + if (!$util.isString(message.prerequisiteStepIds[i])) + return "prerequisiteStepIds: string[] expected"; + } + if (message.jobId != null && message.hasOwnProperty("jobId")) + if (!$util.isString(message.jobId)) + return "jobId: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.error != null && message.hasOwnProperty("error")) + if (!$util.isString(message.error)) + return "error: string expected"; + return null; + }; + + /** + * Creates a WorkflowNode message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.WorkflowNode + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.WorkflowNode} WorkflowNode + */ + WorkflowNode.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.WorkflowNode) + return object; + var message = new $root.google.cloud.dataproc.v1.WorkflowNode(); + if (object.stepId != null) + message.stepId = String(object.stepId); + if (object.prerequisiteStepIds) { + if (!Array.isArray(object.prerequisiteStepIds)) + throw TypeError(".google.cloud.dataproc.v1.WorkflowNode.prerequisiteStepIds: array expected"); + message.prerequisiteStepIds = []; + for (var i = 0; i < object.prerequisiteStepIds.length; ++i) + message.prerequisiteStepIds[i] = String(object.prerequisiteStepIds[i]); + } + if (object.jobId != null) + message.jobId = String(object.jobId); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "NODE_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "BLOCKED": + case 1: + message.state = 1; + break; + case "RUNNABLE": + case 2: + message.state = 2; + break; + case "RUNNING": + case 3: + message.state = 3; + break; + case "COMPLETED": + case 4: + message.state = 4; + break; + case "FAILED": + case 5: + message.state = 5; + break; + } + if (object.error != null) + message.error = String(object.error); + return message; + }; + + /** + * Creates a plain object from a WorkflowNode message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.WorkflowNode + * @static + * @param {google.cloud.dataproc.v1.WorkflowNode} message WorkflowNode + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WorkflowNode.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.prerequisiteStepIds = []; + if (options.defaults) { + object.stepId = ""; + object.jobId = ""; + object.state = options.enums === String ? "NODE_STATE_UNSPECIFIED" : 0; + object.error = ""; + } + if (message.stepId != null && message.hasOwnProperty("stepId")) + object.stepId = message.stepId; + if (message.prerequisiteStepIds && message.prerequisiteStepIds.length) { + object.prerequisiteStepIds = []; + for (var j = 0; j < message.prerequisiteStepIds.length; ++j) + object.prerequisiteStepIds[j] = message.prerequisiteStepIds[j]; + } + if (message.jobId != null && message.hasOwnProperty("jobId")) + object.jobId = message.jobId; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.dataproc.v1.WorkflowNode.NodeState[message.state] === undefined ? message.state : $root.google.cloud.dataproc.v1.WorkflowNode.NodeState[message.state] : message.state; + if (message.error != null && message.hasOwnProperty("error")) + object.error = message.error; + return object; + }; + + /** + * Converts this WorkflowNode to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.WorkflowNode + * @instance + * @returns {Object.} JSON object + */ + WorkflowNode.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WorkflowNode + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.WorkflowNode + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WorkflowNode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.WorkflowNode"; + }; + + /** + * NodeState enum. + * @name google.cloud.dataproc.v1.WorkflowNode.NodeState + * @enum {number} + * @property {number} NODE_STATE_UNSPECIFIED=0 NODE_STATE_UNSPECIFIED value + * @property {number} BLOCKED=1 BLOCKED value + * @property {number} RUNNABLE=2 RUNNABLE value + * @property {number} RUNNING=3 RUNNING value + * @property {number} COMPLETED=4 COMPLETED value + * @property {number} FAILED=5 FAILED value + */ + WorkflowNode.NodeState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NODE_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "BLOCKED"] = 1; + values[valuesById[2] = "RUNNABLE"] = 2; + values[valuesById[3] = "RUNNING"] = 3; + values[valuesById[4] = "COMPLETED"] = 4; + values[valuesById[5] = "FAILED"] = 5; + return values; + })(); + + return WorkflowNode; + })(); + + v1.CreateWorkflowTemplateRequest = (function() { + + /** + * Properties of a CreateWorkflowTemplateRequest. + * @memberof google.cloud.dataproc.v1 + * @interface ICreateWorkflowTemplateRequest + * @property {string|null} [parent] CreateWorkflowTemplateRequest parent + * @property {google.cloud.dataproc.v1.IWorkflowTemplate|null} [template] CreateWorkflowTemplateRequest template + */ + + /** + * Constructs a new CreateWorkflowTemplateRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a CreateWorkflowTemplateRequest. + * @implements ICreateWorkflowTemplateRequest + * @constructor + * @param {google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest=} [properties] Properties to set + */ + function CreateWorkflowTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateWorkflowTemplateRequest parent. + * @member {string} parent + * @memberof google.cloud.dataproc.v1.CreateWorkflowTemplateRequest + * @instance + */ + CreateWorkflowTemplateRequest.prototype.parent = ""; + + /** + * CreateWorkflowTemplateRequest template. + * @member {google.cloud.dataproc.v1.IWorkflowTemplate|null|undefined} template + * @memberof google.cloud.dataproc.v1.CreateWorkflowTemplateRequest + * @instance + */ + CreateWorkflowTemplateRequest.prototype.template = null; + + /** + * Creates a new CreateWorkflowTemplateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.CreateWorkflowTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.CreateWorkflowTemplateRequest} CreateWorkflowTemplateRequest instance + */ + CreateWorkflowTemplateRequest.create = function create(properties) { + return new CreateWorkflowTemplateRequest(properties); + }; + + /** + * Encodes the specified CreateWorkflowTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.CreateWorkflowTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.CreateWorkflowTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest} message CreateWorkflowTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateWorkflowTemplateRequest.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.template != null && Object.hasOwnProperty.call(message, "template")) + $root.google.cloud.dataproc.v1.WorkflowTemplate.encode(message.template, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateWorkflowTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.CreateWorkflowTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.CreateWorkflowTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest} message CreateWorkflowTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateWorkflowTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateWorkflowTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.CreateWorkflowTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.CreateWorkflowTemplateRequest} CreateWorkflowTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateWorkflowTemplateRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest(); + 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.template = $root.google.cloud.dataproc.v1.WorkflowTemplate.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateWorkflowTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.CreateWorkflowTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.CreateWorkflowTemplateRequest} CreateWorkflowTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateWorkflowTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateWorkflowTemplateRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.CreateWorkflowTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateWorkflowTemplateRequest.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.template != null && message.hasOwnProperty("template")) { + var error = $root.google.cloud.dataproc.v1.WorkflowTemplate.verify(message.template); + if (error) + return "template." + error; + } + return null; + }; + + /** + * Creates a CreateWorkflowTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.CreateWorkflowTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.CreateWorkflowTemplateRequest} CreateWorkflowTemplateRequest + */ + CreateWorkflowTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.template != null) { + if (typeof object.template !== "object") + throw TypeError(".google.cloud.dataproc.v1.CreateWorkflowTemplateRequest.template: object expected"); + message.template = $root.google.cloud.dataproc.v1.WorkflowTemplate.fromObject(object.template); + } + return message; + }; + + /** + * Creates a plain object from a CreateWorkflowTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.CreateWorkflowTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.CreateWorkflowTemplateRequest} message CreateWorkflowTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateWorkflowTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.template = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.template != null && message.hasOwnProperty("template")) + object.template = $root.google.cloud.dataproc.v1.WorkflowTemplate.toObject(message.template, options); + return object; + }; + + /** + * Converts this CreateWorkflowTemplateRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.CreateWorkflowTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + CreateWorkflowTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateWorkflowTemplateRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.CreateWorkflowTemplateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateWorkflowTemplateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.CreateWorkflowTemplateRequest"; + }; + + return CreateWorkflowTemplateRequest; + })(); + + v1.GetWorkflowTemplateRequest = (function() { + + /** + * Properties of a GetWorkflowTemplateRequest. + * @memberof google.cloud.dataproc.v1 + * @interface IGetWorkflowTemplateRequest + * @property {string|null} [name] GetWorkflowTemplateRequest name + * @property {number|null} [version] GetWorkflowTemplateRequest version + */ + + /** + * Constructs a new GetWorkflowTemplateRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a GetWorkflowTemplateRequest. + * @implements IGetWorkflowTemplateRequest + * @constructor + * @param {google.cloud.dataproc.v1.IGetWorkflowTemplateRequest=} [properties] Properties to set + */ + function GetWorkflowTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetWorkflowTemplateRequest name. + * @member {string} name + * @memberof google.cloud.dataproc.v1.GetWorkflowTemplateRequest + * @instance + */ + GetWorkflowTemplateRequest.prototype.name = ""; + + /** + * GetWorkflowTemplateRequest version. + * @member {number} version + * @memberof google.cloud.dataproc.v1.GetWorkflowTemplateRequest + * @instance + */ + GetWorkflowTemplateRequest.prototype.version = 0; + + /** + * Creates a new GetWorkflowTemplateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.GetWorkflowTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.IGetWorkflowTemplateRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.GetWorkflowTemplateRequest} GetWorkflowTemplateRequest instance + */ + GetWorkflowTemplateRequest.create = function create(properties) { + return new GetWorkflowTemplateRequest(properties); + }; + + /** + * Encodes the specified GetWorkflowTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.GetWorkflowTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.GetWorkflowTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.IGetWorkflowTemplateRequest} message GetWorkflowTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetWorkflowTemplateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.version); + return writer; + }; + + /** + * Encodes the specified GetWorkflowTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GetWorkflowTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.GetWorkflowTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.IGetWorkflowTemplateRequest} message GetWorkflowTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetWorkflowTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetWorkflowTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.GetWorkflowTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.GetWorkflowTemplateRequest} GetWorkflowTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetWorkflowTemplateRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.GetWorkflowTemplateRequest(); + 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.version = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetWorkflowTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.GetWorkflowTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.GetWorkflowTemplateRequest} GetWorkflowTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetWorkflowTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetWorkflowTemplateRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.GetWorkflowTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetWorkflowTemplateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + return null; + }; + + /** + * Creates a GetWorkflowTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.GetWorkflowTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.GetWorkflowTemplateRequest} GetWorkflowTemplateRequest + */ + GetWorkflowTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.GetWorkflowTemplateRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.GetWorkflowTemplateRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.version != null) + message.version = object.version | 0; + return message; + }; + + /** + * Creates a plain object from a GetWorkflowTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.GetWorkflowTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.GetWorkflowTemplateRequest} message GetWorkflowTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetWorkflowTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.version = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + return object; + }; + + /** + * Converts this GetWorkflowTemplateRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.GetWorkflowTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + GetWorkflowTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetWorkflowTemplateRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.GetWorkflowTemplateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetWorkflowTemplateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.GetWorkflowTemplateRequest"; + }; + + return GetWorkflowTemplateRequest; + })(); + + v1.InstantiateWorkflowTemplateRequest = (function() { + + /** + * Properties of an InstantiateWorkflowTemplateRequest. + * @memberof google.cloud.dataproc.v1 + * @interface IInstantiateWorkflowTemplateRequest + * @property {string|null} [name] InstantiateWorkflowTemplateRequest name + * @property {number|null} [version] InstantiateWorkflowTemplateRequest version + * @property {string|null} [requestId] InstantiateWorkflowTemplateRequest requestId + * @property {Object.|null} [parameters] InstantiateWorkflowTemplateRequest parameters + */ + + /** + * Constructs a new InstantiateWorkflowTemplateRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents an InstantiateWorkflowTemplateRequest. + * @implements IInstantiateWorkflowTemplateRequest + * @constructor + * @param {google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest=} [properties] Properties to set + */ + function InstantiateWorkflowTemplateRequest(properties) { + this.parameters = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstantiateWorkflowTemplateRequest name. + * @member {string} name + * @memberof google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest + * @instance + */ + InstantiateWorkflowTemplateRequest.prototype.name = ""; + + /** + * InstantiateWorkflowTemplateRequest version. + * @member {number} version + * @memberof google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest + * @instance + */ + InstantiateWorkflowTemplateRequest.prototype.version = 0; + + /** + * InstantiateWorkflowTemplateRequest requestId. + * @member {string} requestId + * @memberof google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest + * @instance + */ + InstantiateWorkflowTemplateRequest.prototype.requestId = ""; + + /** + * InstantiateWorkflowTemplateRequest parameters. + * @member {Object.} parameters + * @memberof google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest + * @instance + */ + InstantiateWorkflowTemplateRequest.prototype.parameters = $util.emptyObject; + + /** + * Creates a new InstantiateWorkflowTemplateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest} InstantiateWorkflowTemplateRequest instance + */ + InstantiateWorkflowTemplateRequest.create = function create(properties) { + return new InstantiateWorkflowTemplateRequest(properties); + }; + + /** + * Encodes the specified InstantiateWorkflowTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest} message InstantiateWorkflowTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstantiateWorkflowTemplateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.version); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + for (var keys = Object.keys(message.parameters), 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.parameters[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstantiateWorkflowTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest} message InstantiateWorkflowTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstantiateWorkflowTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstantiateWorkflowTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest} InstantiateWorkflowTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstantiateWorkflowTemplateRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest(), 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.version = reader.int32(); + break; + } + case 5: { + message.requestId = reader.string(); + break; + } + case 6: { + if (message.parameters === $util.emptyObject) + message.parameters = {}; + 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.parameters[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstantiateWorkflowTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest} InstantiateWorkflowTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstantiateWorkflowTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstantiateWorkflowTemplateRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstantiateWorkflowTemplateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + if (!$util.isObject(message.parameters)) + return "parameters: object expected"; + var key = Object.keys(message.parameters); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.parameters[key[i]])) + return "parameters: string{k:string} expected"; + } + return null; + }; + + /** + * Creates an InstantiateWorkflowTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest} InstantiateWorkflowTemplateRequest + */ + InstantiateWorkflowTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.version != null) + message.version = object.version | 0; + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.parameters) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest.parameters: object expected"); + message.parameters = {}; + for (var keys = Object.keys(object.parameters), i = 0; i < keys.length; ++i) + message.parameters[keys[i]] = String(object.parameters[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from an InstantiateWorkflowTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest} message InstantiateWorkflowTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstantiateWorkflowTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.parameters = {}; + if (options.defaults) { + object.name = ""; + object.version = 0; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + var keys2; + if (message.parameters && (keys2 = Object.keys(message.parameters)).length) { + object.parameters = {}; + for (var j = 0; j < keys2.length; ++j) + object.parameters[keys2[j]] = message.parameters[keys2[j]]; + } + return object; + }; + + /** + * Converts this InstantiateWorkflowTemplateRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + InstantiateWorkflowTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstantiateWorkflowTemplateRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstantiateWorkflowTemplateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest"; + }; + + return InstantiateWorkflowTemplateRequest; + })(); + + v1.InstantiateInlineWorkflowTemplateRequest = (function() { + + /** + * Properties of an InstantiateInlineWorkflowTemplateRequest. + * @memberof google.cloud.dataproc.v1 + * @interface IInstantiateInlineWorkflowTemplateRequest + * @property {string|null} [parent] InstantiateInlineWorkflowTemplateRequest parent + * @property {google.cloud.dataproc.v1.IWorkflowTemplate|null} [template] InstantiateInlineWorkflowTemplateRequest template + * @property {string|null} [requestId] InstantiateInlineWorkflowTemplateRequest requestId + */ + + /** + * Constructs a new InstantiateInlineWorkflowTemplateRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents an InstantiateInlineWorkflowTemplateRequest. + * @implements IInstantiateInlineWorkflowTemplateRequest + * @constructor + * @param {google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest=} [properties] Properties to set + */ + function InstantiateInlineWorkflowTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstantiateInlineWorkflowTemplateRequest parent. + * @member {string} parent + * @memberof google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest + * @instance + */ + InstantiateInlineWorkflowTemplateRequest.prototype.parent = ""; + + /** + * InstantiateInlineWorkflowTemplateRequest template. + * @member {google.cloud.dataproc.v1.IWorkflowTemplate|null|undefined} template + * @memberof google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest + * @instance + */ + InstantiateInlineWorkflowTemplateRequest.prototype.template = null; + + /** + * InstantiateInlineWorkflowTemplateRequest requestId. + * @member {string} requestId + * @memberof google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest + * @instance + */ + InstantiateInlineWorkflowTemplateRequest.prototype.requestId = ""; + + /** + * Creates a new InstantiateInlineWorkflowTemplateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest} InstantiateInlineWorkflowTemplateRequest instance + */ + InstantiateInlineWorkflowTemplateRequest.create = function create(properties) { + return new InstantiateInlineWorkflowTemplateRequest(properties); + }; + + /** + * Encodes the specified InstantiateInlineWorkflowTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest} message InstantiateInlineWorkflowTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstantiateInlineWorkflowTemplateRequest.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.template != null && Object.hasOwnProperty.call(message, "template")) + $root.google.cloud.dataproc.v1.WorkflowTemplate.encode(message.template, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified InstantiateInlineWorkflowTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest} message InstantiateInlineWorkflowTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstantiateInlineWorkflowTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstantiateInlineWorkflowTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest} InstantiateInlineWorkflowTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstantiateInlineWorkflowTemplateRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest(); + 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.template = $root.google.cloud.dataproc.v1.WorkflowTemplate.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstantiateInlineWorkflowTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest} InstantiateInlineWorkflowTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstantiateInlineWorkflowTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstantiateInlineWorkflowTemplateRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstantiateInlineWorkflowTemplateRequest.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.template != null && message.hasOwnProperty("template")) { + var error = $root.google.cloud.dataproc.v1.WorkflowTemplate.verify(message.template); + if (error) + return "template." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an InstantiateInlineWorkflowTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest} InstantiateInlineWorkflowTemplateRequest + */ + InstantiateInlineWorkflowTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.template != null) { + if (typeof object.template !== "object") + throw TypeError(".google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest.template: object expected"); + message.template = $root.google.cloud.dataproc.v1.WorkflowTemplate.fromObject(object.template); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an InstantiateInlineWorkflowTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest} message InstantiateInlineWorkflowTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstantiateInlineWorkflowTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.template = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.template != null && message.hasOwnProperty("template")) + object.template = $root.google.cloud.dataproc.v1.WorkflowTemplate.toObject(message.template, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this InstantiateInlineWorkflowTemplateRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + InstantiateInlineWorkflowTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstantiateInlineWorkflowTemplateRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstantiateInlineWorkflowTemplateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest"; + }; + + return InstantiateInlineWorkflowTemplateRequest; + })(); + + v1.UpdateWorkflowTemplateRequest = (function() { + + /** + * Properties of an UpdateWorkflowTemplateRequest. + * @memberof google.cloud.dataproc.v1 + * @interface IUpdateWorkflowTemplateRequest + * @property {google.cloud.dataproc.v1.IWorkflowTemplate|null} [template] UpdateWorkflowTemplateRequest template + */ + + /** + * Constructs a new UpdateWorkflowTemplateRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents an UpdateWorkflowTemplateRequest. + * @implements IUpdateWorkflowTemplateRequest + * @constructor + * @param {google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest=} [properties] Properties to set + */ + function UpdateWorkflowTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateWorkflowTemplateRequest template. + * @member {google.cloud.dataproc.v1.IWorkflowTemplate|null|undefined} template + * @memberof google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest + * @instance + */ + UpdateWorkflowTemplateRequest.prototype.template = null; + + /** + * Creates a new UpdateWorkflowTemplateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest} UpdateWorkflowTemplateRequest instance + */ + UpdateWorkflowTemplateRequest.create = function create(properties) { + return new UpdateWorkflowTemplateRequest(properties); + }; + + /** + * Encodes the specified UpdateWorkflowTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest} message UpdateWorkflowTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateWorkflowTemplateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.template != null && Object.hasOwnProperty.call(message, "template")) + $root.google.cloud.dataproc.v1.WorkflowTemplate.encode(message.template, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateWorkflowTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest} message UpdateWorkflowTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateWorkflowTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateWorkflowTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest} UpdateWorkflowTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateWorkflowTemplateRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.template = $root.google.cloud.dataproc.v1.WorkflowTemplate.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateWorkflowTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest} UpdateWorkflowTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateWorkflowTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateWorkflowTemplateRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateWorkflowTemplateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.template != null && message.hasOwnProperty("template")) { + var error = $root.google.cloud.dataproc.v1.WorkflowTemplate.verify(message.template); + if (error) + return "template." + error; + } + return null; + }; + + /** + * Creates an UpdateWorkflowTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest} UpdateWorkflowTemplateRequest + */ + UpdateWorkflowTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest(); + if (object.template != null) { + if (typeof object.template !== "object") + throw TypeError(".google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest.template: object expected"); + message.template = $root.google.cloud.dataproc.v1.WorkflowTemplate.fromObject(object.template); + } + return message; + }; + + /** + * Creates a plain object from an UpdateWorkflowTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest} message UpdateWorkflowTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateWorkflowTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.template = null; + if (message.template != null && message.hasOwnProperty("template")) + object.template = $root.google.cloud.dataproc.v1.WorkflowTemplate.toObject(message.template, options); + return object; + }; + + /** + * Converts this UpdateWorkflowTemplateRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateWorkflowTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateWorkflowTemplateRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateWorkflowTemplateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest"; + }; + + return UpdateWorkflowTemplateRequest; + })(); + + v1.ListWorkflowTemplatesRequest = (function() { + + /** + * Properties of a ListWorkflowTemplatesRequest. + * @memberof google.cloud.dataproc.v1 + * @interface IListWorkflowTemplatesRequest + * @property {string|null} [parent] ListWorkflowTemplatesRequest parent + * @property {number|null} [pageSize] ListWorkflowTemplatesRequest pageSize + * @property {string|null} [pageToken] ListWorkflowTemplatesRequest pageToken + */ + + /** + * Constructs a new ListWorkflowTemplatesRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a ListWorkflowTemplatesRequest. + * @implements IListWorkflowTemplatesRequest + * @constructor + * @param {google.cloud.dataproc.v1.IListWorkflowTemplatesRequest=} [properties] Properties to set + */ + function ListWorkflowTemplatesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListWorkflowTemplatesRequest parent. + * @member {string} parent + * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesRequest + * @instance + */ + ListWorkflowTemplatesRequest.prototype.parent = ""; + + /** + * ListWorkflowTemplatesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesRequest + * @instance + */ + ListWorkflowTemplatesRequest.prototype.pageSize = 0; + + /** + * ListWorkflowTemplatesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesRequest + * @instance + */ + ListWorkflowTemplatesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListWorkflowTemplatesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesRequest + * @static + * @param {google.cloud.dataproc.v1.IListWorkflowTemplatesRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.ListWorkflowTemplatesRequest} ListWorkflowTemplatesRequest instance + */ + ListWorkflowTemplatesRequest.create = function create(properties) { + return new ListWorkflowTemplatesRequest(properties); + }; + + /** + * Encodes the specified ListWorkflowTemplatesRequest message. Does not implicitly {@link google.cloud.dataproc.v1.ListWorkflowTemplatesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesRequest + * @static + * @param {google.cloud.dataproc.v1.IListWorkflowTemplatesRequest} message ListWorkflowTemplatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkflowTemplatesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListWorkflowTemplatesRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListWorkflowTemplatesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesRequest + * @static + * @param {google.cloud.dataproc.v1.IListWorkflowTemplatesRequest} message ListWorkflowTemplatesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkflowTemplatesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListWorkflowTemplatesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.ListWorkflowTemplatesRequest} ListWorkflowTemplatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkflowTemplatesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListWorkflowTemplatesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.ListWorkflowTemplatesRequest} ListWorkflowTemplatesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkflowTemplatesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListWorkflowTemplatesRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListWorkflowTemplatesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListWorkflowTemplatesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.ListWorkflowTemplatesRequest} ListWorkflowTemplatesRequest + */ + ListWorkflowTemplatesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListWorkflowTemplatesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesRequest + * @static + * @param {google.cloud.dataproc.v1.ListWorkflowTemplatesRequest} message ListWorkflowTemplatesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListWorkflowTemplatesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListWorkflowTemplatesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesRequest + * @instance + * @returns {Object.} JSON object + */ + ListWorkflowTemplatesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListWorkflowTemplatesRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListWorkflowTemplatesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.ListWorkflowTemplatesRequest"; + }; + + return ListWorkflowTemplatesRequest; + })(); + + v1.ListWorkflowTemplatesResponse = (function() { + + /** + * Properties of a ListWorkflowTemplatesResponse. + * @memberof google.cloud.dataproc.v1 + * @interface IListWorkflowTemplatesResponse + * @property {Array.|null} [templates] ListWorkflowTemplatesResponse templates + * @property {string|null} [nextPageToken] ListWorkflowTemplatesResponse nextPageToken + * @property {Array.|null} [unreachable] ListWorkflowTemplatesResponse unreachable + */ + + /** + * Constructs a new ListWorkflowTemplatesResponse. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a ListWorkflowTemplatesResponse. + * @implements IListWorkflowTemplatesResponse + * @constructor + * @param {google.cloud.dataproc.v1.IListWorkflowTemplatesResponse=} [properties] Properties to set + */ + function ListWorkflowTemplatesResponse(properties) { + this.templates = []; + 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]]; + } + + /** + * ListWorkflowTemplatesResponse templates. + * @member {Array.} templates + * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesResponse + * @instance + */ + ListWorkflowTemplatesResponse.prototype.templates = $util.emptyArray; + + /** + * ListWorkflowTemplatesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesResponse + * @instance + */ + ListWorkflowTemplatesResponse.prototype.nextPageToken = ""; + + /** + * ListWorkflowTemplatesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesResponse + * @instance + */ + ListWorkflowTemplatesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListWorkflowTemplatesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesResponse + * @static + * @param {google.cloud.dataproc.v1.IListWorkflowTemplatesResponse=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.ListWorkflowTemplatesResponse} ListWorkflowTemplatesResponse instance + */ + ListWorkflowTemplatesResponse.create = function create(properties) { + return new ListWorkflowTemplatesResponse(properties); + }; + + /** + * Encodes the specified ListWorkflowTemplatesResponse message. Does not implicitly {@link google.cloud.dataproc.v1.ListWorkflowTemplatesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesResponse + * @static + * @param {google.cloud.dataproc.v1.IListWorkflowTemplatesResponse} message ListWorkflowTemplatesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkflowTemplatesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.templates != null && message.templates.length) + for (var i = 0; i < message.templates.length; ++i) + $root.google.cloud.dataproc.v1.WorkflowTemplate.encode(message.templates[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 ListWorkflowTemplatesResponse message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListWorkflowTemplatesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesResponse + * @static + * @param {google.cloud.dataproc.v1.IListWorkflowTemplatesResponse} message ListWorkflowTemplatesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkflowTemplatesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListWorkflowTemplatesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.ListWorkflowTemplatesResponse} ListWorkflowTemplatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkflowTemplatesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ListWorkflowTemplatesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.templates && message.templates.length)) + message.templates = []; + message.templates.push($root.google.cloud.dataproc.v1.WorkflowTemplate.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 ListWorkflowTemplatesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.ListWorkflowTemplatesResponse} ListWorkflowTemplatesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkflowTemplatesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListWorkflowTemplatesResponse message. + * @function verify + * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListWorkflowTemplatesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.templates != null && message.hasOwnProperty("templates")) { + if (!Array.isArray(message.templates)) + return "templates: array expected"; + for (var i = 0; i < message.templates.length; ++i) { + var error = $root.google.cloud.dataproc.v1.WorkflowTemplate.verify(message.templates[i]); + if (error) + return "templates." + 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 ListWorkflowTemplatesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.ListWorkflowTemplatesResponse} ListWorkflowTemplatesResponse + */ + ListWorkflowTemplatesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.ListWorkflowTemplatesResponse) + return object; + var message = new $root.google.cloud.dataproc.v1.ListWorkflowTemplatesResponse(); + if (object.templates) { + if (!Array.isArray(object.templates)) + throw TypeError(".google.cloud.dataproc.v1.ListWorkflowTemplatesResponse.templates: array expected"); + message.templates = []; + for (var i = 0; i < object.templates.length; ++i) { + if (typeof object.templates[i] !== "object") + throw TypeError(".google.cloud.dataproc.v1.ListWorkflowTemplatesResponse.templates: object expected"); + message.templates[i] = $root.google.cloud.dataproc.v1.WorkflowTemplate.fromObject(object.templates[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.dataproc.v1.ListWorkflowTemplatesResponse.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 ListWorkflowTemplatesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesResponse + * @static + * @param {google.cloud.dataproc.v1.ListWorkflowTemplatesResponse} message ListWorkflowTemplatesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListWorkflowTemplatesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.templates = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.templates && message.templates.length) { + object.templates = []; + for (var j = 0; j < message.templates.length; ++j) + object.templates[j] = $root.google.cloud.dataproc.v1.WorkflowTemplate.toObject(message.templates[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 ListWorkflowTemplatesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesResponse + * @instance + * @returns {Object.} JSON object + */ + ListWorkflowTemplatesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListWorkflowTemplatesResponse + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListWorkflowTemplatesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.ListWorkflowTemplatesResponse"; + }; + + return ListWorkflowTemplatesResponse; + })(); + + v1.DeleteWorkflowTemplateRequest = (function() { + + /** + * Properties of a DeleteWorkflowTemplateRequest. + * @memberof google.cloud.dataproc.v1 + * @interface IDeleteWorkflowTemplateRequest + * @property {string|null} [name] DeleteWorkflowTemplateRequest name + * @property {number|null} [version] DeleteWorkflowTemplateRequest version + */ + + /** + * Constructs a new DeleteWorkflowTemplateRequest. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a DeleteWorkflowTemplateRequest. + * @implements IDeleteWorkflowTemplateRequest + * @constructor + * @param {google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest=} [properties] Properties to set + */ + function DeleteWorkflowTemplateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteWorkflowTemplateRequest name. + * @member {string} name + * @memberof google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest + * @instance + */ + DeleteWorkflowTemplateRequest.prototype.name = ""; + + /** + * DeleteWorkflowTemplateRequest version. + * @member {number} version + * @memberof google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest + * @instance + */ + DeleteWorkflowTemplateRequest.prototype.version = 0; + + /** + * Creates a new DeleteWorkflowTemplateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest} DeleteWorkflowTemplateRequest instance + */ + DeleteWorkflowTemplateRequest.create = function create(properties) { + return new DeleteWorkflowTemplateRequest(properties); + }; + + /** + * Encodes the specified DeleteWorkflowTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest} message DeleteWorkflowTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteWorkflowTemplateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.version); + return writer; + }; + + /** + * Encodes the specified DeleteWorkflowTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest} message DeleteWorkflowTemplateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteWorkflowTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteWorkflowTemplateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest} DeleteWorkflowTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteWorkflowTemplateRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest(); + 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.version = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteWorkflowTemplateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest} DeleteWorkflowTemplateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteWorkflowTemplateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteWorkflowTemplateRequest message. + * @function verify + * @memberof google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteWorkflowTemplateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + return null; + }; + + /** + * Creates a DeleteWorkflowTemplateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest} DeleteWorkflowTemplateRequest + */ + DeleteWorkflowTemplateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest) + return object; + var message = new $root.google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.version != null) + message.version = object.version | 0; + return message; + }; + + /** + * Creates a plain object from a DeleteWorkflowTemplateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest + * @static + * @param {google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest} message DeleteWorkflowTemplateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteWorkflowTemplateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.version = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + return object; + }; + + /** + * Converts this DeleteWorkflowTemplateRequest to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteWorkflowTemplateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteWorkflowTemplateRequest + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteWorkflowTemplateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest"; + }; + + return DeleteWorkflowTemplateRequest; + })(); + + return v1; + })(); + + return dataproc; + })(); + + 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; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 14: { + message.edition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + this.declaration = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.verification = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 3: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.targets = []; + this.editionDefaults = []; + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) + switch (message.targets[i]) { + default: + return "targets: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (typeof object.editionDefaults[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targets = []; + object.editionDefaults = []; + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.features = null; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; + } + if (message.editionDefaults && message.editionDefaults.length) { + object.editionDefaults = []; + for (var j = 0; j < message.editionDefaults.length; ++j) + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.debugRedact = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object.debugRedact = false; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + case 525000001: { + message[".google.api.apiVersion"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.features = null; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object.features = null; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + } + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && message.hasOwnProperty("enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (typeof object.defaults[i] !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.features = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.features = null; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.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.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.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] DoubleValue value + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Represents a DoubleValue. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + */ + function DoubleValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DoubleValue value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); + return writer; + }; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoubleValue message. + * @function verify + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DoubleValue} DoubleValue + */ + DoubleValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DoubleValue) + return object; + var message = new $root.google.protobuf.DoubleValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.DoubleValue} message DoubleValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this DoubleValue to JSON. + * @function toJSON + * @memberof google.protobuf.DoubleValue + * @instance + * @returns {Object.} JSON object + */ + DoubleValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + + return DoubleValue; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] FloatValue value + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Represents a FloatValue. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + */ + function FloatValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FloatValue value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); + return writer; + }; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FloatValue message. + * @function verify + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FloatValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FloatValue} FloatValue + */ + FloatValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FloatValue) + return object; + var message = new $root.google.protobuf.FloatValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.FloatValue} message FloatValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FloatValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this FloatValue to JSON. + * @function toJSON + * @memberof google.protobuf.FloatValue + * @instance + * @returns {Object.} JSON object + */ + FloatValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + + return FloatValue; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {number|Long|null} [value] Int64Value value + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Represents an Int64Value. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + */ + function Int64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int64Value value. + * @member {number|Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); + return writer; + }; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int64Value message. + * @function verify + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int64Value} Int64Value + */ + Int64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int64Value) + return object; + var message = new $root.google.protobuf.Int64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = false; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.Int64Value} message Int64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; + return object; + }; + + /** + * Converts this Int64Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int64Value + * @instance + * @returns {Object.} JSON object + */ + Int64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + + return Int64Value; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {number|Long|null} [value] UInt64Value value + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Represents a UInt64Value. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + */ + function UInt64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt64Value value. + * @member {number|Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); + return writer; + }; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.uint64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt64Value message. + * @function verify + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt64Value} UInt64Value + */ + UInt64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt64Value) + return object; + var message = new $root.google.protobuf.UInt64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = true; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.UInt64Value} message UInt64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; + return object; + }; + + /** + * Converts this UInt64Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt64Value + * @instance + * @returns {Object.} JSON object + */ + UInt64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] Int32Value value + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Represents an Int32Value. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + */ + function Int32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int32Value value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); + return writer; + }; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int32Value message. + * @function verify + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int32Value} Int32Value + */ + Int32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int32Value) + return object; + var message = new $root.google.protobuf.Int32Value(); + if (object.value != null) + message.value = object.value | 0; + return message; + }; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.Int32Value} message Int32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this Int32Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int32Value + * @instance + * @returns {Object.} JSON object + */ + Int32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + + return Int32Value; + })(); + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] UInt32Value value + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Represents a UInt32Value. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + */ + function UInt32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt32Value value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); + return writer; + }; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.uint32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt32Value message. + * @function verify + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt32Value} UInt32Value + */ + UInt32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt32Value) + return object; + var message = new $root.google.protobuf.UInt32Value(); + if (object.value != null) + message.value = object.value >>> 0; + return message; + }; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.UInt32Value} message UInt32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this UInt32Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt32Value + * @instance + * @returns {Object.} JSON object + */ + UInt32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + + return UInt32Value; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] BoolValue value + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Represents a BoolValue. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + */ + function BoolValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoolValue value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); + return writer; + }; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoolValue message. + * @function verify + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoolValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "boolean") + return "value: boolean expected"; + return null; + }; + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BoolValue} BoolValue + */ + BoolValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BoolValue) + return object; + var message = new $root.google.protobuf.BoolValue(); + if (object.value != null) + message.value = Boolean(object.value); + return message; + }; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.BoolValue} message BoolValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoolValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = false; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this BoolValue to JSON. + * @function toJSON + * @memberof google.protobuf.BoolValue + * @instance + * @returns {Object.} JSON object + */ + BoolValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + + return BoolValue; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] StringValue value + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Represents a StringValue. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [properties] Properties to set + */ + function StringValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StringValue value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringValue message. + * @function verify + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.StringValue} StringValue + */ + StringValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.StringValue) + return object; + var message = new $root.google.protobuf.StringValue(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.StringValue} message StringValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this StringValue to JSON. + * @function toJSON + * @memberof google.protobuf.StringValue + * @instance + * @returns {Object.} JSON object + */ + StringValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] BytesValue value + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Represents a BytesValue. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + */ + function BytesValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BytesValue value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BytesValue message. + * @function verify + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BytesValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BytesValue} BytesValue + */ + BytesValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BytesValue) + return object; + var message = new $root.google.protobuf.BytesValue(); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.BytesValue} message BytesValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BytesValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this BytesValue to JSON. + * @function toJSON + * @memberof google.protobuf.BytesValue + * @instance + * @returns {Object.} JSON object + */ + BytesValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + + return BytesValue; + })(); + + return protobuf; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + 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.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Interval = (function() { + + /** + * Properties of an Interval. + * @memberof google.type + * @interface IInterval + * @property {google.protobuf.ITimestamp|null} [startTime] Interval startTime + * @property {google.protobuf.ITimestamp|null} [endTime] Interval endTime + */ + + /** + * Constructs a new Interval. + * @memberof google.type + * @classdesc Represents an Interval. + * @implements IInterval + * @constructor + * @param {google.type.IInterval=} [properties] Properties to set + */ + function Interval(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Interval startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.type.Interval + * @instance + */ + Interval.prototype.startTime = null; + + /** + * Interval endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.type.Interval + * @instance + */ + Interval.prototype.endTime = null; + + /** + * Creates a new Interval instance using the specified properties. + * @function create + * @memberof google.type.Interval + * @static + * @param {google.type.IInterval=} [properties] Properties to set + * @returns {google.type.Interval} Interval instance + */ + Interval.create = function create(properties) { + return new Interval(properties); + }; + + /** + * Encodes the specified Interval message. Does not implicitly {@link google.type.Interval.verify|verify} messages. + * @function encode + * @memberof google.type.Interval + * @static + * @param {google.type.IInterval} message Interval message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Interval.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Interval message, length delimited. Does not implicitly {@link google.type.Interval.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Interval + * @static + * @param {google.type.IInterval} message Interval message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Interval.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Interval message from the specified reader or buffer. + * @function decode + * @memberof google.type.Interval + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Interval} Interval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Interval.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Interval(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Interval message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Interval + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Interval} Interval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Interval.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Interval message. + * @function verify + * @memberof google.type.Interval + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Interval.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates an Interval message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Interval + * @static + * @param {Object.} object Plain object + * @returns {google.type.Interval} Interval + */ + Interval.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Interval) + return object; + var message = new $root.google.type.Interval(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.type.Interval.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.type.Interval.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from an Interval message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Interval + * @static + * @param {google.type.Interval} message Interval + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Interval.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this Interval to JSON. + * @function toJSON + * @memberof google.type.Interval + * @instance + * @returns {Object.} JSON object + */ + Interval.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Interval + * @function getTypeUrl + * @memberof google.type.Interval + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Interval.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Interval"; + }; + + return Interval; + })(); + + return type; + })(); + + return google; + })(); + + return $root; +}); diff --git a/owl-bot-staging/google-cloud-dataproc/protos/protos.json b/owl-bot-staging/google-cloud-dataproc/protos/protos.json new file mode 100644 index 000000000000..317724581919 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/protos/protos.json @@ -0,0 +1,9294 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "dataproc": { + "nested": { + "v1": { + "options": { + "go_package": "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpb", + "java_multiple_files": true, + "java_outer_classname": "WorkflowTemplatesProto", + "java_package": "com.google.cloud.dataproc.v1", + "(google.api.resource_definition).type": "dataproc.googleapis.com/ClusterRegion", + "(google.api.resource_definition).pattern": "projects/{project}/regions/{region}/clusters/{cluster}" + }, + "nested": { + "AutoscalingPolicyService": { + "options": { + "(google.api.default_host)": "dataproc.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateAutoscalingPolicy": { + "requestType": "CreateAutoscalingPolicyRequest", + "responseType": "AutoscalingPolicy", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/autoscalingPolicies", + "(google.api.http).body": "policy", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*/regions/*}/autoscalingPolicies", + "(google.api.http).additional_bindings.body": "policy", + "(google.api.method_signature)": "parent,policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/autoscalingPolicies", + "body": "policy", + "additional_bindings": { + "post": "/v1/{parent=projects/*/regions/*}/autoscalingPolicies", + "body": "policy" + } + } + }, + { + "(google.api.method_signature)": "parent,policy" + } + ] + }, + "UpdateAutoscalingPolicy": { + "requestType": "UpdateAutoscalingPolicyRequest", + "responseType": "AutoscalingPolicy", + "options": { + "(google.api.http).put": "/v1/{policy.name=projects/*/locations/*/autoscalingPolicies/*}", + "(google.api.http).body": "policy", + "(google.api.http).additional_bindings.put": "/v1/{policy.name=projects/*/regions/*/autoscalingPolicies/*}", + "(google.api.http).additional_bindings.body": "policy", + "(google.api.method_signature)": "policy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/v1/{policy.name=projects/*/locations/*/autoscalingPolicies/*}", + "body": "policy", + "additional_bindings": { + "put": "/v1/{policy.name=projects/*/regions/*/autoscalingPolicies/*}", + "body": "policy" + } + } + }, + { + "(google.api.method_signature)": "policy" + } + ] + }, + "GetAutoscalingPolicy": { + "requestType": "GetAutoscalingPolicyRequest", + "responseType": "AutoscalingPolicy", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/autoscalingPolicies/*}", + "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/regions/*/autoscalingPolicies/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/autoscalingPolicies/*}", + "additional_bindings": { + "get": "/v1/{name=projects/*/regions/*/autoscalingPolicies/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListAutoscalingPolicies": { + "requestType": "ListAutoscalingPoliciesRequest", + "responseType": "ListAutoscalingPoliciesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/autoscalingPolicies", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*/regions/*}/autoscalingPolicies", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/autoscalingPolicies", + "additional_bindings": { + "get": "/v1/{parent=projects/*/regions/*}/autoscalingPolicies" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteAutoscalingPolicy": { + "requestType": "DeleteAutoscalingPolicyRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/autoscalingPolicies/*}", + "(google.api.http).additional_bindings.delete": "/v1/{name=projects/*/regions/*/autoscalingPolicies/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/autoscalingPolicies/*}", + "additional_bindings": { + "delete": "/v1/{name=projects/*/regions/*/autoscalingPolicies/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "AutoscalingPolicy": { + "options": { + "(google.api.resource).type": "dataproc.googleapis.com/AutoscalingPolicy", + "(google.api.resource).pattern": "projects/{project}/regions/{region}/autoscalingPolicies/{autoscaling_policy}" + }, + "oneofs": { + "algorithm": { + "oneof": [ + "basicAlgorithm" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "name": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "basicAlgorithm": { + "type": "BasicAutoscalingAlgorithm", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "workerConfig": { + "type": "InstanceGroupAutoscalingPolicyConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "secondaryWorkerConfig": { + "type": "InstanceGroupAutoscalingPolicyConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "clusterType": { + "type": "ClusterType", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ClusterType": { + "values": { + "CLUSTER_TYPE_UNSPECIFIED": 0, + "STANDARD": 1, + "ZERO_SCALE": 2 + } + } + } + }, + "BasicAutoscalingAlgorithm": { + "oneofs": { + "config": { + "oneof": [ + "yarnConfig" + ] + } + }, + "fields": { + "yarnConfig": { + "type": "BasicYarnAutoscalingConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cooldownPeriod": { + "type": "google.protobuf.Duration", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BasicYarnAutoscalingConfig": { + "fields": { + "gracefulDecommissionTimeout": { + "type": "google.protobuf.Duration", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "scaleUpFactor": { + "type": "double", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "scaleDownFactor": { + "type": "double", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "scaleUpMinWorkerFraction": { + "type": "double", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "scaleDownMinWorkerFraction": { + "type": "double", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "InstanceGroupAutoscalingPolicyConfig": { + "fields": { + "minInstances": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxInstances": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "weight": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateAutoscalingPolicyRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dataproc.googleapis.com/AutoscalingPolicy" + } + }, + "policy": { + "type": "AutoscalingPolicy", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetAutoscalingPolicyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataproc.googleapis.com/AutoscalingPolicy" + } + } + } + }, + "UpdateAutoscalingPolicyRequest": { + "fields": { + "policy": { + "type": "AutoscalingPolicy", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteAutoscalingPolicyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataproc.googleapis.com/AutoscalingPolicy" + } + } + } + }, + "ListAutoscalingPoliciesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dataproc.googleapis.com/AutoscalingPolicy" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListAutoscalingPoliciesResponse": { + "fields": { + "policies": { + "rule": "repeated", + "type": "AutoscalingPolicy", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nextPageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "BatchController": { + "options": { + "(google.api.default_host)": "dataproc.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateBatch": { + "requestType": "CreateBatchRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/batches", + "(google.api.http).body": "batch", + "(google.api.method_signature)": "parent,batch,batch_id", + "(google.longrunning.operation_info).response_type": "Batch", + "(google.longrunning.operation_info).metadata_type": "google.cloud.dataproc.v1.BatchOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/batches", + "body": "batch" + } + }, + { + "(google.api.method_signature)": "parent,batch,batch_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Batch", + "metadata_type": "google.cloud.dataproc.v1.BatchOperationMetadata" + } + } + ] + }, + "GetBatch": { + "requestType": "GetBatchRequest", + "responseType": "Batch", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/batches/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/batches/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListBatches": { + "requestType": "ListBatchesRequest", + "responseType": "ListBatchesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/batches", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/batches" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteBatch": { + "requestType": "DeleteBatchRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/batches/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/batches/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "CreateBatchRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dataproc.googleapis.com/Batch" + } + }, + "batch": { + "type": "Batch", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "batchId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetBatchRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataproc.googleapis.com/Batch" + } + } + } + }, + "ListBatchesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dataproc.googleapis.com/Batch" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListBatchesResponse": { + "fields": { + "batches": { + "rule": "repeated", + "type": "Batch", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "DeleteBatchRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataproc.googleapis.com/Batch" + } + } + } + }, + "Batch": { + "options": { + "(google.api.resource).type": "dataproc.googleapis.com/Batch", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/batches/{batch}" + }, + "oneofs": { + "batchConfig": { + "oneof": [ + "pysparkBatch", + "sparkBatch", + "sparkRBatch", + "sparkSqlBatch", + "pysparkNotebookBatch" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "uuid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "pysparkBatch": { + "type": "PySparkBatch", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sparkBatch": { + "type": "SparkBatch", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sparkRBatch": { + "type": "SparkRBatch", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sparkSqlBatch": { + "type": "SparkSqlBatch", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pysparkNotebookBatch": { + "type": "PySparkNotebookBatch", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "runtimeInfo": { + "type": "RuntimeInfo", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "stateMessage": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "stateTime": { + "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" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "runtimeConfig": { + "type": "RuntimeConfig", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "environmentConfig": { + "type": "EnvironmentConfig", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "operation": { + "type": "string", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "stateHistory": { + "rule": "repeated", + "type": "StateHistory", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PENDING": 1, + "RUNNING": 2, + "CANCELLING": 3, + "CANCELLED": 4, + "SUCCEEDED": 5, + "FAILED": 6 + } + }, + "StateHistory": { + "fields": { + "state": { + "type": "State", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "stateMessage": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "stateStartTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "PySparkBatch": { + "fields": { + "mainPythonFileUri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "args": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pythonFileUris": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "jarFileUris": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fileUris": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "archiveUris": { + "rule": "repeated", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SparkBatch": { + "oneofs": { + "driver": { + "oneof": [ + "mainJarFileUri", + "mainClass" + ] + } + }, + "fields": { + "mainJarFileUri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "mainClass": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "args": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "jarFileUris": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fileUris": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "archiveUris": { + "rule": "repeated", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SparkRBatch": { + "fields": { + "mainRFileUri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "args": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fileUris": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "archiveUris": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SparkSqlBatch": { + "fields": { + "queryFileUri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "queryVariables": { + "keyType": "string", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "jarFileUris": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PySparkNotebookBatch": { + "fields": { + "notebookFileUri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "params": { + "keyType": "string", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pythonFileUris": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "jarFileUris": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fileUris": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "archiveUris": { + "rule": "repeated", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RuntimeConfig": { + "fields": { + "version": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "containerImage": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "properties": { + "keyType": "string", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "repositoryConfig": { + "type": "RepositoryConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "autotuningConfig": { + "type": "AutotuningConfig", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "cohort": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "EnvironmentConfig": { + "fields": { + "executionConfig": { + "type": "ExecutionConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "peripheralsConfig": { + "type": "PeripheralsConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ExecutionConfig": { + "oneofs": { + "network": { + "oneof": [ + "networkUri", + "subnetworkUri" + ] + } + }, + "fields": { + "serviceAccount": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "networkUri": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "subnetworkUri": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "networkTags": { + "rule": "repeated", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "kmsKey": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "idleTtl": { + "type": "google.protobuf.Duration", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ttl": { + "type": "google.protobuf.Duration", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "stagingBucket": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "authenticationConfig": { + "type": "AuthenticationConfig", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SparkHistoryServerConfig": { + "fields": { + "dataprocCluster": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PeripheralsConfig": { + "fields": { + "metastoreService": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "metastore.googleapis.com/Service" + } + }, + "sparkHistoryServerConfig": { + "type": "SparkHistoryServerConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RuntimeInfo": { + "fields": { + "endpoints": { + "keyType": "string", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "outputUri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "diagnosticOutputUri": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "approximateUsage": { + "type": "UsageMetrics", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "currentUsage": { + "type": "UsageSnapshot", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "UsageMetrics": { + "fields": { + "milliDcuSeconds": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "shuffleStorageGbSeconds": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "milliAcceleratorSeconds": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "acceleratorType": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UsageSnapshot": { + "fields": { + "milliDcu": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "shuffleStorageGb": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "milliDcuPremium": { + "type": "int64", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "shuffleStorageGbPremium": { + "type": "int64", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "milliAccelerator": { + "type": "int64", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "acceleratorType": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "snapshotTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GkeClusterConfig": { + "fields": { + "gkeClusterTarget": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "container.googleapis.com/Cluster" + } + }, + "nodePoolTarget": { + "rule": "repeated", + "type": "GkeNodePoolTarget", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "KubernetesClusterConfig": { + "oneofs": { + "config": { + "oneof": [ + "gkeClusterConfig" + ] + } + }, + "fields": { + "kubernetesNamespace": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "gkeClusterConfig": { + "type": "GkeClusterConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "kubernetesSoftwareConfig": { + "type": "KubernetesSoftwareConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "KubernetesSoftwareConfig": { + "fields": { + "componentVersion": { + "keyType": "string", + "type": "string", + "id": 1 + }, + "properties": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "GkeNodePoolTarget": { + "fields": { + "nodePool": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "roles": { + "rule": "repeated", + "type": "Role", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "nodePoolConfig": { + "type": "GkeNodePoolConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + } + }, + "nested": { + "Role": { + "values": { + "ROLE_UNSPECIFIED": 0, + "DEFAULT": 1, + "CONTROLLER": 2, + "SPARK_DRIVER": 3, + "SPARK_EXECUTOR": 4 + } + } + } + }, + "GkeNodePoolConfig": { + "fields": { + "config": { + "type": "GkeNodeConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "locations": { + "rule": "repeated", + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "autoscaling": { + "type": "GkeNodePoolAutoscalingConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "GkeNodeConfig": { + "fields": { + "machineType": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "localSsdCount": { + "type": "int32", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "preemptible": { + "type": "bool", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "accelerators": { + "rule": "repeated", + "type": "GkeNodePoolAcceleratorConfig", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "minCpuPlatform": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "bootDiskKmsKey": { + "type": "string", + "id": 23, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "spot": { + "type": "bool", + "id": 32, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GkeNodePoolAcceleratorConfig": { + "fields": { + "acceleratorCount": { + "type": "int64", + "id": 1 + }, + "acceleratorType": { + "type": "string", + "id": 2 + }, + "gpuPartitionSize": { + "type": "string", + "id": 3 + } + } + }, + "GkeNodePoolAutoscalingConfig": { + "fields": { + "minNodeCount": { + "type": "int32", + "id": 2 + }, + "maxNodeCount": { + "type": "int32", + "id": 3 + } + } + } + } + }, + "AuthenticationConfig": { + "fields": { + "userWorkloadAuthenticationType": { + "type": "AuthenticationType", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "AuthenticationType": { + "values": { + "AUTHENTICATION_TYPE_UNSPECIFIED": 0, + "SERVICE_ACCOUNT": 1, + "END_USER_CREDENTIALS": 2 + } + } + } + }, + "AutotuningConfig": { + "fields": { + "scenarios": { + "rule": "repeated", + "type": "Scenario", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Scenario": { + "values": { + "SCENARIO_UNSPECIFIED": 0, + "SCALING": 2, + "BROADCAST_HASH_JOIN": 3, + "MEMORY": 4, + "NONE": 5, + "AUTO": 6 + } + } + } + }, + "RepositoryConfig": { + "fields": { + "pypiRepositoryConfig": { + "type": "PyPiRepositoryConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PyPiRepositoryConfig": { + "fields": { + "pypiRepository": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Component": { + "values": { + "COMPONENT_UNSPECIFIED": 0, + "ANACONDA": 5, + "DELTA": 20, + "DOCKER": 13, + "DRUID": 9, + "FLINK": 14, + "HBASE": 11, + "HIVE_WEBHCAT": 3, + "HUDI": 18, + "ICEBERG": 19, + "JUPYTER": 1, + "JUPYTER_KERNEL_GATEWAY": 22, + "PIG": 21, + "PRESTO": 6, + "TRINO": 17, + "RANGER": 12, + "SOLR": 10, + "ZEPPELIN": 4, + "ZOOKEEPER": 8 + } + }, + "FailureAction": { + "values": { + "FAILURE_ACTION_UNSPECIFIED": 0, + "NO_ACTION": 1, + "DELETE": 2 + } + }, + "ClusterController": { + "options": { + "(google.api.default_host)": "dataproc.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateCluster": { + "requestType": "CreateClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/projects/{project_id}/regions/{region}/clusters", + "(google.api.http).body": "cluster", + "(google.api.method_signature)": "project_id,region,cluster", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "google.cloud.dataproc.v1.ClusterOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/projects/{project_id}/regions/{region}/clusters", + "body": "cluster" + } + }, + { + "(google.api.method_signature)": "project_id,region,cluster" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "google.cloud.dataproc.v1.ClusterOperationMetadata" + } + } + ] + }, + "UpdateCluster": { + "requestType": "UpdateClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}", + "(google.api.http).body": "cluster", + "(google.api.method_signature)": "project_id,region,cluster_name,cluster,update_mask", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "google.cloud.dataproc.v1.ClusterOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}", + "body": "cluster" + } + }, + { + "(google.api.method_signature)": "project_id,region,cluster_name,cluster,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "google.cloud.dataproc.v1.ClusterOperationMetadata" + } + } + ] + }, + "StopCluster": { + "requestType": "StopClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:stop", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "google.cloud.dataproc.v1.ClusterOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:stop", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "google.cloud.dataproc.v1.ClusterOperationMetadata" + } + } + ] + }, + "StartCluster": { + "requestType": "StartClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:start", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "google.cloud.dataproc.v1.ClusterOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:start", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "google.cloud.dataproc.v1.ClusterOperationMetadata" + } + } + ] + }, + "DeleteCluster": { + "requestType": "DeleteClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}", + "(google.api.method_signature)": "project_id,region,cluster_name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.dataproc.v1.ClusterOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}" + } + }, + { + "(google.api.method_signature)": "project_id,region,cluster_name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.dataproc.v1.ClusterOperationMetadata" + } + } + ] + }, + "GetCluster": { + "requestType": "GetClusterRequest", + "responseType": "Cluster", + "options": { + "(google.api.http).get": "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}", + "(google.api.method_signature)": "project_id,region,cluster_name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}" + } + }, + { + "(google.api.method_signature)": "project_id,region,cluster_name" + } + ] + }, + "ListClusters": { + "requestType": "ListClustersRequest", + "responseType": "ListClustersResponse", + "options": { + "(google.api.http).get": "/v1/projects/{project_id}/regions/{region}/clusters", + "(google.api.method_signature)": "project_id,region,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/projects/{project_id}/regions/{region}/clusters" + } + }, + { + "(google.api.method_signature)": "project_id,region" + }, + { + "(google.api.method_signature)": "project_id,region,filter" + } + ] + }, + "DiagnoseCluster": { + "requestType": "DiagnoseClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:diagnose", + "(google.api.http).body": "*", + "(google.api.method_signature)": "project_id,region,cluster_name", + "(google.longrunning.operation_info).response_type": "DiagnoseClusterResults", + "(google.longrunning.operation_info).metadata_type": "google.cloud.dataproc.v1.ClusterOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:diagnose", + "body": "*" + } + }, + { + "(google.api.method_signature)": "project_id,region,cluster_name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "DiagnoseClusterResults", + "metadata_type": "google.cloud.dataproc.v1.ClusterOperationMetadata" + } + } + ] + } + } + }, + "Cluster": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "clusterName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "config": { + "type": "ClusterConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "virtualClusterConfig": { + "type": "VirtualClusterConfig", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "status": { + "type": "ClusterStatus", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusHistory": { + "rule": "repeated", + "type": "ClusterStatus", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "clusterUuid": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "metrics": { + "type": "ClusterMetrics", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ClusterConfig": { + "fields": { + "clusterType": { + "type": "ClusterType", + "id": 27, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "clusterTier": { + "type": "ClusterTier", + "id": 29, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "engine": { + "type": "Engine", + "id": 30, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "configBucket": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tempBucket": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "gceClusterConfig": { + "type": "GceClusterConfig", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "masterConfig": { + "type": "InstanceGroupConfig", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "workerConfig": { + "type": "InstanceGroupConfig", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "secondaryWorkerConfig": { + "type": "InstanceGroupConfig", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "softwareConfig": { + "type": "SoftwareConfig", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "initializationActions": { + "rule": "repeated", + "type": "NodeInitializationAction", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "encryptionConfig": { + "type": "EncryptionConfig", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "autoscalingConfig": { + "type": "AutoscalingConfig", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "securityConfig": { + "type": "SecurityConfig", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "lifecycleConfig": { + "type": "LifecycleConfig", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "endpointConfig": { + "type": "EndpointConfig", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "metastoreConfig": { + "type": "MetastoreConfig", + "id": 20, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dataprocMetricConfig": { + "type": "DataprocMetricConfig", + "id": 23, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "auxiliaryNodeGroups": { + "rule": "repeated", + "type": "AuxiliaryNodeGroup", + "id": 25, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ClusterType": { + "values": { + "CLUSTER_TYPE_UNSPECIFIED": 0, + "STANDARD": 1, + "SINGLE_NODE": 2, + "ZERO_SCALE": 3 + } + }, + "ClusterTier": { + "values": { + "CLUSTER_TIER_UNSPECIFIED": 0, + "CLUSTER_TIER_STANDARD": 1, + "CLUSTER_TIER_PREMIUM": 2 + } + }, + "Engine": { + "values": { + "ENGINE_UNSPECIFIED": 0, + "DEFAULT": 1, + "LIGHTNING": 2 + } + } + } + }, + "VirtualClusterConfig": { + "oneofs": { + "infrastructureConfig": { + "oneof": [ + "kubernetesClusterConfig" + ] + } + }, + "fields": { + "stagingBucket": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "kubernetesClusterConfig": { + "type": "KubernetesClusterConfig", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "auxiliaryServicesConfig": { + "type": "AuxiliaryServicesConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AuxiliaryServicesConfig": { + "fields": { + "metastoreConfig": { + "type": "MetastoreConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sparkHistoryServerConfig": { + "type": "SparkHistoryServerConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "EndpointConfig": { + "fields": { + "httpPorts": { + "keyType": "string", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "enableHttpPortAccess": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AutoscalingConfig": { + "fields": { + "policyUri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "EncryptionConfig": { + "fields": { + "gcePdKmsKeyName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "kmsKey": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + } + } + }, + "GceClusterConfig": { + "oneofs": { + "_internalIpOnly": { + "oneof": [ + "internalIpOnly" + ] + } + }, + "fields": { + "zoneUri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "networkUri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "subnetworkUri": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "internalIpOnly": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "privateIpv6GoogleAccess": { + "type": "PrivateIpv6GoogleAccess", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceAccount": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceAccountScopes": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tags": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "metadata": { + "keyType": "string", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "reservationAffinity": { + "type": "ReservationAffinity", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "nodeGroupAffinity": { + "type": "NodeGroupAffinity", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "shieldedInstanceConfig": { + "type": "ShieldedInstanceConfig", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "confidentialInstanceConfig": { + "type": "ConfidentialInstanceConfig", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "PrivateIpv6GoogleAccess": { + "values": { + "PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED": 0, + "INHERIT_FROM_SUBNETWORK": 1, + "OUTBOUND": 2, + "BIDIRECTIONAL": 3 + } + } + } + }, + "NodeGroupAffinity": { + "fields": { + "nodeGroupUri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ShieldedInstanceConfig": { + "oneofs": { + "_enableSecureBoot": { + "oneof": [ + "enableSecureBoot" + ] + }, + "_enableVtpm": { + "oneof": [ + "enableVtpm" + ] + }, + "_enableIntegrityMonitoring": { + "oneof": [ + "enableIntegrityMonitoring" + ] + } + }, + "fields": { + "enableSecureBoot": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "enableVtpm": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "enableIntegrityMonitoring": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "ConfidentialInstanceConfig": { + "fields": { + "enableConfidentialCompute": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "InstanceGroupConfig": { + "fields": { + "numInstances": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "instanceNames": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "instanceReferences": { + "rule": "repeated", + "type": "InstanceReference", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "imageUri": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "machineTypeUri": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "diskConfig": { + "type": "DiskConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "isPreemptible": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "preemptibility": { + "type": "Preemptibility", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "managedGroupConfig": { + "type": "ManagedGroupConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "accelerators": { + "rule": "repeated", + "type": "AcceleratorConfig", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "minCpuPlatform": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "minNumInstances": { + "type": "int32", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "instanceFlexibilityPolicy": { + "type": "InstanceFlexibilityPolicy", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "startupConfig": { + "type": "StartupConfig", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Preemptibility": { + "values": { + "PREEMPTIBILITY_UNSPECIFIED": 0, + "NON_PREEMPTIBLE": 1, + "PREEMPTIBLE": 2, + "SPOT": 3 + } + } + } + }, + "StartupConfig": { + "oneofs": { + "_requiredRegistrationFraction": { + "oneof": [ + "requiredRegistrationFraction" + ] + } + }, + "fields": { + "requiredRegistrationFraction": { + "type": "double", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "InstanceReference": { + "fields": { + "instanceName": { + "type": "string", + "id": 1 + }, + "instanceId": { + "type": "string", + "id": 2 + }, + "publicKey": { + "type": "string", + "id": 3 + }, + "publicEciesKey": { + "type": "string", + "id": 4 + } + } + }, + "ManagedGroupConfig": { + "fields": { + "instanceTemplateName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "instanceGroupManagerName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "instanceGroupManagerUri": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "InstanceFlexibilityPolicy": { + "fields": { + "provisioningModelMix": { + "type": "ProvisioningModelMix", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "instanceSelectionList": { + "rule": "repeated", + "type": "InstanceSelection", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "instanceSelectionResults": { + "rule": "repeated", + "type": "InstanceSelectionResult", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "ProvisioningModelMix": { + "oneofs": { + "_standardCapacityBase": { + "oneof": [ + "standardCapacityBase" + ] + }, + "_standardCapacityPercentAboveBase": { + "oneof": [ + "standardCapacityPercentAboveBase" + ] + } + }, + "fields": { + "standardCapacityBase": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "standardCapacityPercentAboveBase": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "InstanceSelection": { + "fields": { + "machineTypes": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "rank": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "InstanceSelectionResult": { + "oneofs": { + "_machineType": { + "oneof": [ + "machineType" + ] + }, + "_vmCount": { + "oneof": [ + "vmCount" + ] + } + }, + "fields": { + "machineType": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "vmCount": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + } + } + } + } + }, + "AcceleratorConfig": { + "fields": { + "acceleratorTypeUri": { + "type": "string", + "id": 1 + }, + "acceleratorCount": { + "type": "int32", + "id": 2 + } + } + }, + "DiskConfig": { + "oneofs": { + "_bootDiskProvisionedIops": { + "oneof": [ + "bootDiskProvisionedIops" + ] + }, + "_bootDiskProvisionedThroughput": { + "oneof": [ + "bootDiskProvisionedThroughput" + ] + } + }, + "fields": { + "bootDiskType": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "bootDiskSizeGb": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "numLocalSsds": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "localSsdInterface": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "bootDiskProvisionedIops": { + "type": "int64", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "bootDiskProvisionedThroughput": { + "type": "int64", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "AuxiliaryNodeGroup": { + "fields": { + "nodeGroup": { + "type": "NodeGroup", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "nodeGroupId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "NodeGroup": { + "options": { + "(google.api.resource).type": "dataproc.googleapis.com/NodeGroup", + "(google.api.resource).pattern": "projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{node_group}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "roles": { + "rule": "repeated", + "type": "Role", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "nodeGroupConfig": { + "type": "InstanceGroupConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Role": { + "values": { + "ROLE_UNSPECIFIED": 0, + "DRIVER": 1 + } + } + } + }, + "NodeInitializationAction": { + "fields": { + "executableFile": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "executionTimeout": { + "type": "google.protobuf.Duration", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ClusterStatus": { + "fields": { + "state": { + "type": "State", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "detail": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "stateStartTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "substate": { + "type": "Substate", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "UNKNOWN": 0, + "CREATING": 1, + "RUNNING": 2, + "ERROR": 3, + "ERROR_DUE_TO_UPDATE": 9, + "DELETING": 4, + "UPDATING": 5, + "STOPPING": 6, + "STOPPED": 7, + "STARTING": 8, + "REPAIRING": 10 + } + }, + "Substate": { + "values": { + "UNSPECIFIED": 0, + "UNHEALTHY": 1, + "STALE_STATUS": 2 + } + } + } + }, + "SecurityConfig": { + "fields": { + "kerberosConfig": { + "type": "KerberosConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "identityConfig": { + "type": "IdentityConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "KerberosConfig": { + "fields": { + "enableKerberos": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "rootPrincipalPasswordUri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "kmsKeyUri": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "keystoreUri": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "truststoreUri": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "keystorePasswordUri": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "keyPasswordUri": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "truststorePasswordUri": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "crossRealmTrustRealm": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "crossRealmTrustKdc": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "crossRealmTrustAdminServer": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "crossRealmTrustSharedPasswordUri": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "kdcDbKeyUri": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tgtLifetimeHours": { + "type": "int32", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "realm": { + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "IdentityConfig": { + "fields": { + "userServiceAccountMapping": { + "keyType": "string", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SoftwareConfig": { + "fields": { + "imageVersion": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "properties": { + "keyType": "string", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "optionalComponents": { + "rule": "repeated", + "type": "Component", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "LifecycleConfig": { + "oneofs": { + "ttl": { + "oneof": [ + "autoDeleteTime", + "autoDeleteTtl" + ] + }, + "stopTtl": { + "oneof": [ + "autoStopTime", + "autoStopTtl" + ] + } + }, + "fields": { + "idleDeleteTtl": { + "type": "google.protobuf.Duration", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "autoDeleteTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "autoDeleteTtl": { + "type": "google.protobuf.Duration", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "idleStopTtl": { + "type": "google.protobuf.Duration", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "autoStopTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "autoStopTtl": { + "type": "google.protobuf.Duration", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "idleStartTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "MetastoreConfig": { + "fields": { + "dataprocMetastoreService": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "metastore.googleapis.com/Service" + } + } + } + }, + "ClusterMetrics": { + "fields": { + "hdfsMetrics": { + "keyType": "string", + "type": "int64", + "id": 1 + }, + "yarnMetrics": { + "keyType": "string", + "type": "int64", + "id": 2 + } + } + }, + "DataprocMetricConfig": { + "fields": { + "metrics": { + "rule": "repeated", + "type": "Metric", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "MetricSource": { + "values": { + "METRIC_SOURCE_UNSPECIFIED": 0, + "MONITORING_AGENT_DEFAULTS": 1, + "HDFS": 2, + "SPARK": 3, + "YARN": 4, + "SPARK_HISTORY_SERVER": 5, + "HIVESERVER2": 6, + "HIVEMETASTORE": 7, + "FLINK": 8 + } + }, + "Metric": { + "fields": { + "metricSource": { + "type": "MetricSource", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "metricOverrides": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "CreateClusterRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cluster": { + "type": "Cluster", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "actionOnFailedPrimaryWorkers": { + "type": "FailureAction", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateClusterRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "clusterName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cluster": { + "type": "Cluster", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "gracefulDecommissionTimeout": { + "type": "google.protobuf.Duration", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "StopClusterRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "clusterName": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "clusterUuid": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "requestId": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "StartClusterRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "clusterName": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "clusterUuid": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "requestId": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteClusterRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "clusterName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "clusterUuid": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "requestId": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetClusterRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "clusterName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListClustersRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "filter": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListClustersResponse": { + "fields": { + "clusters": { + "rule": "repeated", + "type": "Cluster", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nextPageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "DiagnoseClusterRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "clusterName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "tarballGcsDir": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tarballAccess": { + "type": "TarballAccess", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "diagnosisInterval": { + "type": "google.type.Interval", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "jobs": { + "rule": "repeated", + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "yarnApplicationIds": { + "rule": "repeated", + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "TarballAccess": { + "values": { + "TARBALL_ACCESS_UNSPECIFIED": 0, + "GOOGLE_CLOUD_SUPPORT": 1, + "GOOGLE_DATAPROC_DIAGNOSE": 2 + } + } + } + }, + "DiagnoseClusterResults": { + "fields": { + "outputUri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ReservationAffinity": { + "fields": { + "consumeReservationType": { + "type": "Type", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "key": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "values": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "NO_RESERVATION": 1, + "ANY_RESERVATION": 2, + "SPECIFIC_RESERVATION": 3 + } + } + } + }, + "BatchOperationMetadata": { + "fields": { + "batch": { + "type": "string", + "id": 1 + }, + "batchUuid": { + "type": "string", + "id": 2 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "doneTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "operationType": { + "type": "BatchOperationType", + "id": 6 + }, + "description": { + "type": "string", + "id": 7 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 8 + }, + "warnings": { + "rule": "repeated", + "type": "string", + "id": 9 + } + }, + "nested": { + "BatchOperationType": { + "values": { + "BATCH_OPERATION_TYPE_UNSPECIFIED": 0, + "BATCH": 1 + } + } + } + }, + "SessionOperationMetadata": { + "fields": { + "session": { + "type": "string", + "id": 1 + }, + "sessionUuid": { + "type": "string", + "id": 2 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "doneTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "operationType": { + "type": "SessionOperationType", + "id": 6 + }, + "description": { + "type": "string", + "id": 7 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 8 + }, + "warnings": { + "rule": "repeated", + "type": "string", + "id": 9 + } + }, + "nested": { + "SessionOperationType": { + "values": { + "SESSION_OPERATION_TYPE_UNSPECIFIED": 0, + "CREATE": 1, + "TERMINATE": 2, + "DELETE": 3 + } + } + } + }, + "ClusterOperationStatus": { + "fields": { + "state": { + "type": "State", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "innerState": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "details": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "stateStartTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "UNKNOWN": 0, + "PENDING": 1, + "RUNNING": 2, + "DONE": 3 + } + } + } + }, + "ClusterOperationMetadata": { + "fields": { + "clusterName": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "clusterUuid": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "status": { + "type": "ClusterOperationStatus", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusHistory": { + "rule": "repeated", + "type": "ClusterOperationStatus", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "operationType": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "warnings": { + "rule": "repeated", + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "childOperationIds": { + "rule": "repeated", + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "NodeGroupOperationMetadata": { + "fields": { + "nodeGroupId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "clusterUuid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "status": { + "type": "ClusterOperationStatus", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusHistory": { + "rule": "repeated", + "type": "ClusterOperationStatus", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "operationType": { + "type": "NodeGroupOperationType", + "id": 5 + }, + "description": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "warnings": { + "rule": "repeated", + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "NodeGroupOperationType": { + "values": { + "NODE_GROUP_OPERATION_TYPE_UNSPECIFIED": 0, + "CREATE": 1, + "UPDATE": 2, + "DELETE": 3, + "RESIZE": 4 + } + } + } + }, + "JobController": { + "options": { + "(google.api.default_host)": "dataproc.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "SubmitJob": { + "requestType": "SubmitJobRequest", + "responseType": "Job", + "options": { + "(google.api.http).post": "/v1/projects/{project_id}/regions/{region}/jobs:submit", + "(google.api.http).body": "*", + "(google.api.method_signature)": "project_id,region,job" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/projects/{project_id}/regions/{region}/jobs:submit", + "body": "*" + } + }, + { + "(google.api.method_signature)": "project_id,region,job" + } + ] + }, + "SubmitJobAsOperation": { + "requestType": "SubmitJobRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/projects/{project_id}/regions/{region}/jobs:submitAsOperation", + "(google.api.http).body": "*", + "(google.api.method_signature)": "project_id, region, job", + "(google.longrunning.operation_info).response_type": "Job", + "(google.longrunning.operation_info).metadata_type": "JobMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/projects/{project_id}/regions/{region}/jobs:submitAsOperation", + "body": "*" + } + }, + { + "(google.api.method_signature)": "project_id, region, job" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Job", + "metadata_type": "JobMetadata" + } + } + ] + }, + "GetJob": { + "requestType": "GetJobRequest", + "responseType": "Job", + "options": { + "(google.api.http).get": "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}", + "(google.api.method_signature)": "project_id,region,job_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}" + } + }, + { + "(google.api.method_signature)": "project_id,region,job_id" + } + ] + }, + "ListJobs": { + "requestType": "ListJobsRequest", + "responseType": "ListJobsResponse", + "options": { + "(google.api.http).get": "/v1/projects/{project_id}/regions/{region}/jobs", + "(google.api.method_signature)": "project_id,region,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/projects/{project_id}/regions/{region}/jobs" + } + }, + { + "(google.api.method_signature)": "project_id,region" + }, + { + "(google.api.method_signature)": "project_id,region,filter" + } + ] + }, + "UpdateJob": { + "requestType": "UpdateJobRequest", + "responseType": "Job", + "options": { + "(google.api.http).patch": "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}", + "(google.api.http).body": "job" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}", + "body": "job" + } + } + ] + }, + "CancelJob": { + "requestType": "CancelJobRequest", + "responseType": "Job", + "options": { + "(google.api.http).post": "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "project_id,region,job_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "project_id,region,job_id" + } + ] + }, + "DeleteJob": { + "requestType": "DeleteJobRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}", + "(google.api.method_signature)": "project_id,region,job_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}" + } + }, + { + "(google.api.method_signature)": "project_id,region,job_id" + } + ] + } + } + }, + "LoggingConfig": { + "fields": { + "driverLogLevels": { + "keyType": "string", + "type": "Level", + "id": 2 + } + }, + "nested": { + "Level": { + "values": { + "LEVEL_UNSPECIFIED": 0, + "ALL": 1, + "TRACE": 2, + "DEBUG": 3, + "INFO": 4, + "WARN": 5, + "ERROR": 6, + "FATAL": 7, + "OFF": 8 + } + } + } + }, + "HadoopJob": { + "oneofs": { + "driver": { + "oneof": [ + "mainJarFileUri", + "mainClass" + ] + } + }, + "fields": { + "mainJarFileUri": { + "type": "string", + "id": 1 + }, + "mainClass": { + "type": "string", + "id": 2 + }, + "args": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "jarFileUris": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fileUris": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "archiveUris": { + "rule": "repeated", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "properties": { + "keyType": "string", + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "loggingConfig": { + "type": "LoggingConfig", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SparkJob": { + "oneofs": { + "driver": { + "oneof": [ + "mainJarFileUri", + "mainClass" + ] + } + }, + "fields": { + "mainJarFileUri": { + "type": "string", + "id": 1 + }, + "mainClass": { + "type": "string", + "id": 2 + }, + "args": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "jarFileUris": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fileUris": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "archiveUris": { + "rule": "repeated", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "properties": { + "keyType": "string", + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "loggingConfig": { + "type": "LoggingConfig", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PySparkJob": { + "fields": { + "mainPythonFileUri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "args": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pythonFileUris": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "jarFileUris": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fileUris": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "archiveUris": { + "rule": "repeated", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "properties": { + "keyType": "string", + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "loggingConfig": { + "type": "LoggingConfig", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "QueryList": { + "fields": { + "queries": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "HiveJob": { + "oneofs": { + "queries": { + "oneof": [ + "queryFileUri", + "queryList" + ] + } + }, + "fields": { + "queryFileUri": { + "type": "string", + "id": 1 + }, + "queryList": { + "type": "QueryList", + "id": 2 + }, + "continueOnFailure": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "scriptVariables": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "properties": { + "keyType": "string", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "jarFileUris": { + "rule": "repeated", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SparkSqlJob": { + "oneofs": { + "queries": { + "oneof": [ + "queryFileUri", + "queryList" + ] + } + }, + "fields": { + "queryFileUri": { + "type": "string", + "id": 1 + }, + "queryList": { + "type": "QueryList", + "id": 2 + }, + "scriptVariables": { + "keyType": "string", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "properties": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "jarFileUris": { + "rule": "repeated", + "type": "string", + "id": 56, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "loggingConfig": { + "type": "LoggingConfig", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PigJob": { + "oneofs": { + "queries": { + "oneof": [ + "queryFileUri", + "queryList" + ] + } + }, + "fields": { + "queryFileUri": { + "type": "string", + "id": 1 + }, + "queryList": { + "type": "QueryList", + "id": 2 + }, + "continueOnFailure": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "scriptVariables": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "properties": { + "keyType": "string", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "jarFileUris": { + "rule": "repeated", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "loggingConfig": { + "type": "LoggingConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SparkRJob": { + "fields": { + "mainRFileUri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "args": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fileUris": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "archiveUris": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "properties": { + "keyType": "string", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "loggingConfig": { + "type": "LoggingConfig", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PrestoJob": { + "oneofs": { + "queries": { + "oneof": [ + "queryFileUri", + "queryList" + ] + } + }, + "fields": { + "queryFileUri": { + "type": "string", + "id": 1 + }, + "queryList": { + "type": "QueryList", + "id": 2 + }, + "continueOnFailure": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputFormat": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "clientTags": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "properties": { + "keyType": "string", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "loggingConfig": { + "type": "LoggingConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "TrinoJob": { + "oneofs": { + "queries": { + "oneof": [ + "queryFileUri", + "queryList" + ] + } + }, + "fields": { + "queryFileUri": { + "type": "string", + "id": 1 + }, + "queryList": { + "type": "QueryList", + "id": 2 + }, + "continueOnFailure": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputFormat": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "clientTags": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "properties": { + "keyType": "string", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "loggingConfig": { + "type": "LoggingConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "FlinkJob": { + "oneofs": { + "driver": { + "oneof": [ + "mainJarFileUri", + "mainClass" + ] + } + }, + "fields": { + "mainJarFileUri": { + "type": "string", + "id": 1 + }, + "mainClass": { + "type": "string", + "id": 2 + }, + "args": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "jarFileUris": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "savepointUri": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "properties": { + "keyType": "string", + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "loggingConfig": { + "type": "LoggingConfig", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "JobPlacement": { + "fields": { + "clusterName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "clusterUuid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "clusterLabels": { + "keyType": "string", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "JobStatus": { + "fields": { + "state": { + "type": "State", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "details": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "stateStartTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "substate": { + "type": "Substate", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PENDING": 1, + "SETUP_DONE": 8, + "RUNNING": 2, + "CANCEL_PENDING": 3, + "CANCEL_STARTED": 7, + "CANCELLED": 4, + "DONE": 5, + "ERROR": 6, + "ATTEMPT_FAILURE": 9 + } + }, + "Substate": { + "values": { + "UNSPECIFIED": 0, + "SUBMITTED": 1, + "QUEUED": 2, + "STALE_STATUS": 3 + } + } + } + }, + "JobReference": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "jobId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "YarnApplication": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "state": { + "type": "State", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "progress": { + "type": "float", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "trackingUrl": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "NEW": 1, + "NEW_SAVING": 2, + "SUBMITTED": 3, + "ACCEPTED": 4, + "RUNNING": 5, + "FINISHED": 6, + "FAILED": 7, + "KILLED": 8 + } + } + } + }, + "Job": { + "oneofs": { + "typeJob": { + "oneof": [ + "hadoopJob", + "sparkJob", + "pysparkJob", + "hiveJob", + "pigJob", + "sparkRJob", + "sparkSqlJob", + "prestoJob", + "trinoJob", + "flinkJob" + ] + } + }, + "fields": { + "reference": { + "type": "JobReference", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "placement": { + "type": "JobPlacement", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "hadoopJob": { + "type": "HadoopJob", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sparkJob": { + "type": "SparkJob", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pysparkJob": { + "type": "PySparkJob", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "hiveJob": { + "type": "HiveJob", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pigJob": { + "type": "PigJob", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sparkRJob": { + "type": "SparkRJob", + "id": 21, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sparkSqlJob": { + "type": "SparkSqlJob", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "prestoJob": { + "type": "PrestoJob", + "id": 23, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "trinoJob": { + "type": "TrinoJob", + "id": 28, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "flinkJob": { + "type": "FlinkJob", + "id": 29, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "status": { + "type": "JobStatus", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusHistory": { + "rule": "repeated", + "type": "JobStatus", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "yarnApplications": { + "rule": "repeated", + "type": "YarnApplication", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "driverOutputResourceUri": { + "type": "string", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "driverControlFilesUri": { + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "scheduling": { + "type": "JobScheduling", + "id": 20, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "jobUuid": { + "type": "string", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "done": { + "type": "bool", + "id": 24, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "driverSchedulingConfig": { + "type": "DriverSchedulingConfig", + "id": 27, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DriverSchedulingConfig": { + "fields": { + "memoryMb": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "vcores": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "JobScheduling": { + "fields": { + "maxFailuresPerHour": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxFailuresTotal": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SubmitJobRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "job": { + "type": "Job", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "JobMetadata": { + "fields": { + "jobId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "status": { + "type": "JobStatus", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "operationType": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GetJobRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "jobId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListJobsRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "clusterName": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "jobStateMatcher": { + "type": "JobStateMatcher", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "JobStateMatcher": { + "values": { + "ALL": 0, + "ACTIVE": 1, + "NON_ACTIVE": 2 + } + } + } + }, + "UpdateJobRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "jobId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "job": { + "type": "Job", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListJobsResponse": { + "fields": { + "jobs": { + "rule": "repeated", + "type": "Job", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nextPageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CancelJobRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "jobId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteJobRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "jobId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "NodeGroupController": { + "options": { + "(google.api.default_host)": "dataproc.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateNodeGroup": { + "requestType": "CreateNodeGroupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/regions/*/clusters/*}/nodeGroups", + "(google.api.http).body": "node_group", + "(google.api.method_signature)": "parent,node_group,node_group_id", + "(google.longrunning.operation_info).response_type": "NodeGroup", + "(google.longrunning.operation_info).metadata_type": "google.cloud.dataproc.v1.NodeGroupOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/regions/*/clusters/*}/nodeGroups", + "body": "node_group" + } + }, + { + "(google.api.method_signature)": "parent,node_group,node_group_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "NodeGroup", + "metadata_type": "google.cloud.dataproc.v1.NodeGroupOperationMetadata" + } + } + ] + }, + "ResizeNodeGroup": { + "requestType": "ResizeNodeGroupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/regions/*/clusters/*/nodeGroups/*}:resize", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,size", + "(google.longrunning.operation_info).response_type": "NodeGroup", + "(google.longrunning.operation_info).metadata_type": "google.cloud.dataproc.v1.NodeGroupOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/regions/*/clusters/*/nodeGroups/*}:resize", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,size" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "NodeGroup", + "metadata_type": "google.cloud.dataproc.v1.NodeGroupOperationMetadata" + } + } + ] + }, + "GetNodeGroup": { + "requestType": "GetNodeGroupRequest", + "responseType": "NodeGroup", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/regions/*/clusters/*/nodeGroups/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/regions/*/clusters/*/nodeGroups/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "CreateNodeGroupRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dataproc.googleapis.com/NodeGroup" + } + }, + "nodeGroup": { + "type": "NodeGroup", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "nodeGroupId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ResizeNodeGroupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "size": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "gracefulDecommissionTimeout": { + "type": "google.protobuf.Duration", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetNodeGroupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataproc.googleapis.com/NodeGroup" + } + } + } + }, + "SessionTemplateController": { + "options": { + "(google.api.default_host)": "dataproc.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateSessionTemplate": { + "requestType": "CreateSessionTemplateRequest", + "responseType": "SessionTemplate", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/sessionTemplates", + "(google.api.http).body": "session_template", + "(google.api.method_signature)": "parent,session_template" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/sessionTemplates", + "body": "session_template" + } + }, + { + "(google.api.method_signature)": "parent,session_template" + } + ] + }, + "UpdateSessionTemplate": { + "requestType": "UpdateSessionTemplateRequest", + "responseType": "SessionTemplate", + "options": { + "(google.api.http).patch": "/v1/{session_template.name=projects/*/locations/*/sessionTemplates/*}", + "(google.api.http).body": "session_template", + "(google.api.method_signature)": "session_template" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{session_template.name=projects/*/locations/*/sessionTemplates/*}", + "body": "session_template" + } + }, + { + "(google.api.method_signature)": "session_template" + } + ] + }, + "GetSessionTemplate": { + "requestType": "GetSessionTemplateRequest", + "responseType": "SessionTemplate", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/sessionTemplates/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/sessionTemplates/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListSessionTemplates": { + "requestType": "ListSessionTemplatesRequest", + "responseType": "ListSessionTemplatesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/sessionTemplates", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/sessionTemplates" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteSessionTemplate": { + "requestType": "DeleteSessionTemplateRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/sessionTemplates/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/sessionTemplates/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "CreateSessionTemplateRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dataproc.googleapis.com/SessionTemplate" + } + }, + "sessionTemplate": { + "type": "SessionTemplate", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateSessionTemplateRequest": { + "fields": { + "sessionTemplate": { + "type": "SessionTemplate", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetSessionTemplateRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataproc.googleapis.com/SessionTemplate" + } + } + } + }, + "ListSessionTemplatesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dataproc.googleapis.com/SessionTemplate" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListSessionTemplatesResponse": { + "fields": { + "sessionTemplates": { + "rule": "repeated", + "type": "SessionTemplate", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteSessionTemplateRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataproc.googleapis.com/SessionTemplate" + } + } + } + }, + "SessionTemplate": { + "options": { + "(google.api.resource).type": "dataproc.googleapis.com/SessionTemplate", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/sessionTemplates/{template}" + }, + "oneofs": { + "sessionConfig": { + "oneof": [ + "jupyterSession", + "sparkConnectSession" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "jupyterSession": { + "type": "JupyterConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sparkConnectSession": { + "type": "SparkConnectConfig", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "creator": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "runtimeConfig": { + "type": "RuntimeConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "environmentConfig": { + "type": "EnvironmentConfig", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "uuid": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "SessionController": { + "options": { + "(google.api.default_host)": "dataproc.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateSession": { + "requestType": "CreateSessionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/sessions", + "(google.api.http).body": "session", + "(google.api.method_signature)": "parent,session,session_id", + "(google.longrunning.operation_info).response_type": "Session", + "(google.longrunning.operation_info).metadata_type": "google.cloud.dataproc.v1.SessionOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/sessions", + "body": "session" + } + }, + { + "(google.api.method_signature)": "parent,session,session_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Session", + "metadata_type": "google.cloud.dataproc.v1.SessionOperationMetadata" + } + } + ] + }, + "GetSession": { + "requestType": "GetSessionRequest", + "responseType": "Session", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/sessions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/sessions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListSessions": { + "requestType": "ListSessionsRequest", + "responseType": "ListSessionsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/sessions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/sessions" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "TerminateSession": { + "requestType": "TerminateSessionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/sessions/*}:terminate", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Session", + "(google.longrunning.operation_info).metadata_type": "google.cloud.dataproc.v1.SessionOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/sessions/*}:terminate", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Session", + "metadata_type": "google.cloud.dataproc.v1.SessionOperationMetadata" + } + } + ] + }, + "DeleteSession": { + "requestType": "DeleteSessionRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/sessions/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Session", + "(google.longrunning.operation_info).metadata_type": "google.cloud.dataproc.v1.SessionOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/sessions/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Session", + "metadata_type": "google.cloud.dataproc.v1.SessionOperationMetadata" + } + } + ] + } + } + }, + "CreateSessionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dataproc.googleapis.com/Session" + } + }, + "session": { + "type": "Session", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sessionId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetSessionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataproc.googleapis.com/Session" + } + } + } + }, + "ListSessionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dataproc.googleapis.com/Session" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListSessionsResponse": { + "fields": { + "sessions": { + "rule": "repeated", + "type": "Session", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "TerminateSessionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataproc.googleapis.com/Session" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteSessionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataproc.googleapis.com/Session" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Session": { + "options": { + "(google.api.resource).type": "dataproc.googleapis.com/Session", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/sessions/{session}" + }, + "oneofs": { + "sessionConfig": { + "oneof": [ + "jupyterSession", + "sparkConnectSession" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "uuid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "jupyterSession": { + "type": "JupyterConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sparkConnectSession": { + "type": "SparkConnectConfig", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "runtimeInfo": { + "type": "RuntimeInfo", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "stateMessage": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "stateTime": { + "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" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "runtimeConfig": { + "type": "RuntimeConfig", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "environmentConfig": { + "type": "EnvironmentConfig", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "user": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "stateHistory": { + "rule": "repeated", + "type": "SessionStateHistory", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sessionTemplate": { + "type": "string", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "dataproc.googleapis.com/SessionTemplate" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "ACTIVE": 2, + "TERMINATING": 3, + "TERMINATED": 4, + "FAILED": 5 + } + }, + "SessionStateHistory": { + "fields": { + "state": { + "type": "State", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "stateMessage": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "stateStartTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "JupyterConfig": { + "fields": { + "kernel": { + "type": "Kernel", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Kernel": { + "values": { + "KERNEL_UNSPECIFIED": 0, + "PYTHON": 1, + "SCALA": 2 + } + } + } + }, + "SparkConnectConfig": { + "fields": {} + }, + "WorkflowTemplateService": { + "options": { + "(google.api.default_host)": "dataproc.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateWorkflowTemplate": { + "requestType": "CreateWorkflowTemplateRequest", + "responseType": "WorkflowTemplate", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/workflowTemplates", + "(google.api.http).body": "template", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*/regions/*}/workflowTemplates", + "(google.api.http).additional_bindings.body": "template", + "(google.api.method_signature)": "parent,template" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/workflowTemplates", + "body": "template", + "additional_bindings": { + "post": "/v1/{parent=projects/*/regions/*}/workflowTemplates", + "body": "template" + } + } + }, + { + "(google.api.method_signature)": "parent,template" + } + ] + }, + "GetWorkflowTemplate": { + "requestType": "GetWorkflowTemplateRequest", + "responseType": "WorkflowTemplate", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/workflowTemplates/*}", + "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/regions/*/workflowTemplates/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/workflowTemplates/*}", + "additional_bindings": { + "get": "/v1/{name=projects/*/regions/*/workflowTemplates/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "InstantiateWorkflowTemplate": { + "requestType": "InstantiateWorkflowTemplateRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/workflowTemplates/*}:instantiate", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{name=projects/*/regions/*/workflowTemplates/*}:instantiate", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "name,parameters", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "WorkflowMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/workflowTemplates/*}:instantiate", + "body": "*", + "additional_bindings": { + "post": "/v1/{name=projects/*/regions/*/workflowTemplates/*}:instantiate", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.api.method_signature)": "name,parameters" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "WorkflowMetadata" + } + } + ] + }, + "InstantiateInlineWorkflowTemplate": { + "requestType": "InstantiateInlineWorkflowTemplateRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/workflowTemplates:instantiateInline", + "(google.api.http).body": "template", + "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*/regions/*}/workflowTemplates:instantiateInline", + "(google.api.http).additional_bindings.body": "template", + "(google.api.method_signature)": "parent,template", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "WorkflowMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/workflowTemplates:instantiateInline", + "body": "template", + "additional_bindings": { + "post": "/v1/{parent=projects/*/regions/*}/workflowTemplates:instantiateInline", + "body": "template" + } + } + }, + { + "(google.api.method_signature)": "parent,template" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "WorkflowMetadata" + } + } + ] + }, + "UpdateWorkflowTemplate": { + "requestType": "UpdateWorkflowTemplateRequest", + "responseType": "WorkflowTemplate", + "options": { + "(google.api.http).put": "/v1/{template.name=projects/*/locations/*/workflowTemplates/*}", + "(google.api.http).body": "template", + "(google.api.http).additional_bindings.put": "/v1/{template.name=projects/*/regions/*/workflowTemplates/*}", + "(google.api.http).additional_bindings.body": "template", + "(google.api.method_signature)": "template" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "put": "/v1/{template.name=projects/*/locations/*/workflowTemplates/*}", + "body": "template", + "additional_bindings": { + "put": "/v1/{template.name=projects/*/regions/*/workflowTemplates/*}", + "body": "template" + } + } + }, + { + "(google.api.method_signature)": "template" + } + ] + }, + "ListWorkflowTemplates": { + "requestType": "ListWorkflowTemplatesRequest", + "responseType": "ListWorkflowTemplatesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/workflowTemplates", + "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*/regions/*}/workflowTemplates", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/workflowTemplates", + "additional_bindings": { + "get": "/v1/{parent=projects/*/regions/*}/workflowTemplates" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteWorkflowTemplate": { + "requestType": "DeleteWorkflowTemplateRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/workflowTemplates/*}", + "(google.api.http).additional_bindings.delete": "/v1/{name=projects/*/regions/*/workflowTemplates/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/workflowTemplates/*}", + "additional_bindings": { + "delete": "/v1/{name=projects/*/regions/*/workflowTemplates/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "WorkflowTemplate": { + "options": { + "(google.api.resource).type": "dataproc.googleapis.com/WorkflowTemplate", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/workflowTemplates/{workflow_template}", + "(google.api.resource).history": "ORIGINALLY_SINGLE_PATTERN" + }, + "fields": { + "id": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "version": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "placement": { + "type": "WorkflowTemplatePlacement", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "jobs": { + "rule": "repeated", + "type": "OrderedJob", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "parameters": { + "rule": "repeated", + "type": "TemplateParameter", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dagTimeout": { + "type": "google.protobuf.Duration", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "encryptionConfig": { + "type": "EncryptionConfig", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "EncryptionConfig": { + "fields": { + "kmsKey": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } + } + } + } + } + }, + "WorkflowTemplatePlacement": { + "oneofs": { + "placement": { + "oneof": [ + "managedCluster", + "clusterSelector" + ] + } + }, + "fields": { + "managedCluster": { + "type": "ManagedCluster", + "id": 1 + }, + "clusterSelector": { + "type": "ClusterSelector", + "id": 2 + } + } + }, + "ManagedCluster": { + "fields": { + "clusterName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "config": { + "type": "ClusterConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ClusterSelector": { + "fields": { + "zone": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "clusterLabels": { + "keyType": "string", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "OrderedJob": { + "oneofs": { + "jobType": { + "oneof": [ + "hadoopJob", + "sparkJob", + "pysparkJob", + "hiveJob", + "pigJob", + "sparkRJob", + "sparkSqlJob", + "prestoJob", + "trinoJob", + "flinkJob" + ] + } + }, + "fields": { + "stepId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "hadoopJob": { + "type": "HadoopJob", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sparkJob": { + "type": "SparkJob", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pysparkJob": { + "type": "PySparkJob", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "hiveJob": { + "type": "HiveJob", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pigJob": { + "type": "PigJob", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sparkRJob": { + "type": "SparkRJob", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sparkSqlJob": { + "type": "SparkSqlJob", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "prestoJob": { + "type": "PrestoJob", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "trinoJob": { + "type": "TrinoJob", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "flinkJob": { + "type": "FlinkJob", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "scheduling": { + "type": "JobScheduling", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "prerequisiteStepIds": { + "rule": "repeated", + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "TemplateParameter": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "fields": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validation": { + "type": "ParameterValidation", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ParameterValidation": { + "oneofs": { + "validationType": { + "oneof": [ + "regex", + "values" + ] + } + }, + "fields": { + "regex": { + "type": "RegexValidation", + "id": 1 + }, + "values": { + "type": "ValueValidation", + "id": 2 + } + } + }, + "RegexValidation": { + "fields": { + "regexes": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ValueValidation": { + "fields": { + "values": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "WorkflowMetadata": { + "fields": { + "template": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "version": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createCluster": { + "type": "ClusterOperation", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "graph": { + "type": "WorkflowGraph", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteCluster": { + "type": "ClusterOperation", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "clusterName": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "parameters": { + "keyType": "string", + "type": "string", + "id": 8 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "clusterUuid": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dagTimeout": { + "type": "google.protobuf.Duration", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dagStartTime": { + "type": "google.protobuf.Timestamp", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dagEndTime": { + "type": "google.protobuf.Timestamp", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "UNKNOWN": 0, + "PENDING": 1, + "RUNNING": 2, + "DONE": 3 + } + } + } + }, + "ClusterOperation": { + "fields": { + "operationId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "error": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "done": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "WorkflowGraph": { + "fields": { + "nodes": { + "rule": "repeated", + "type": "WorkflowNode", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "WorkflowNode": { + "fields": { + "stepId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "prerequisiteStepIds": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "jobId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "NodeState", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "error": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "NodeState": { + "values": { + "NODE_STATE_UNSPECIFIED": 0, + "BLOCKED": 1, + "RUNNABLE": 2, + "RUNNING": 3, + "COMPLETED": 4, + "FAILED": 5 + } + } + } + }, + "CreateWorkflowTemplateRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dataproc.googleapis.com/WorkflowTemplate" + } + }, + "template": { + "type": "WorkflowTemplate", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetWorkflowTemplateRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataproc.googleapis.com/WorkflowTemplate" + } + }, + "version": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "InstantiateWorkflowTemplateRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataproc.googleapis.com/WorkflowTemplate" + } + }, + "version": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "requestId": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "parameters": { + "keyType": "string", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "InstantiateInlineWorkflowTemplateRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dataproc.googleapis.com/WorkflowTemplate" + } + }, + "template": { + "type": "WorkflowTemplate", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateWorkflowTemplateRequest": { + "fields": { + "template": { + "type": "WorkflowTemplate", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListWorkflowTemplatesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dataproc.googleapis.com/WorkflowTemplate" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListWorkflowTemplatesResponse": { + "fields": { + "templates": { + "rule": "repeated", + "type": "WorkflowTemplate", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nextPageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "DeleteWorkflowTemplateRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dataproc.googleapis.com/WorkflowTemplate" + } + }, + "version": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "apiVersion": { + "type": "string", + "id": 525000001, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions", + "options": { + "packed": false + } + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7, + "IDENTIFIER": 8 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "edition": "proto2", + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "Edition": { + "edition": "proto2", + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "FileDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10 + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11 + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "Edition", + "id": 14 + } + } + }, + "DescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "edition": "proto2", + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + }, + "declaration": { + "rule": "repeated", + "type": "Declaration", + "id": 2, + "options": { + "retention": "RETENTION_SOURCE" + } + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "verification": { + "type": "VerificationState", + "id": 3, + "options": { + "default": "UNVERIFIED", + "retention": "RETENTION_SOURCE" + } + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "Declaration": { + "fields": { + "number": { + "type": "int32", + "id": 1 + }, + "fullName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "reserved": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + } + }, + "reserved": [ + [ + 4, + 4 + ] + ] + }, + "VerificationState": { + "values": { + "DECLARATION": 0, + "UNVERIFIED": 1 + } + } + } + }, + "FieldDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REPEATED": 3, + "LABEL_REQUIRED": 2 + } + } + } + }, + "OneofDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "edition": "proto2", + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "edition": "proto2", + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "edition": "proto2", + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 12 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "edition": "proto2", + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19 + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "OneofOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "edition": "proto2", + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "edition": "proto2", + "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "edition": "proto2", + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "features": { + "type": "FeatureSet", + "id": 35 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "edition": "proto2", + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "FeatureSet": { + "edition": "proto2", + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO2", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + } + }, + "extensions": [ + [ + 1000, + 1000 + ], + [ + 1001, + 1001 + ], + [ + 1002, + 1002 + ], + [ + 9990, + 9990 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + } + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + } + } + }, + "FeatureSetDefaults": { + "edition": "proto2", + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "features": { + "type": "FeatureSet", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "edition": "proto2", + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2, + "options": { + "packed": true + } + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "edition": "proto2", + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1, + "options": { + "packed": true + } + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "DoubleValue": { + "fields": { + "value": { + "type": "double", + "id": 1 + } + } + }, + "FloatValue": { + "fields": { + "value": { + "type": "float", + "id": 1 + } + } + }, + "Int64Value": { + "fields": { + "value": { + "type": "int64", + "id": 1 + } + } + }, + "UInt64Value": { + "fields": { + "value": { + "type": "uint64", + "id": 1 + } + } + }, + "Int32Value": { + "fields": { + "value": { + "type": "int32", + "id": 1 + } + } + }, + "UInt32Value": { + "fields": { + "value": { + "type": "uint32", + "id": 1 + } + } + }, + "BoolValue": { + "fields": { + "value": { + "type": "bool", + "id": 1 + } + } + }, + "StringValue": { + "fields": { + "value": { + "type": "string", + "id": 1 + } + } + }, + "BytesValue": { + "fields": { + "value": { + "type": "bytes", + "id": 1 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + }, + "type": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/type/interval;interval", + "java_multiple_files": true, + "java_outer_classname": "IntervalProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Interval": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.create_autoscaling_policy.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.create_autoscaling_policy.js new file mode 100644 index 000000000000..3a69b6b6f135 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.create_autoscaling_policy.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(parent, policy) { + // [START dataproc_v1_generated_AutoscalingPolicyService_CreateAutoscalingPolicy_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 name" of the region or location, as described + * in https://cloud.google.com/apis/design/resource_names. + * * For `projects.regions.autoscalingPolicies.create`, the resource name + * of the region has the following format: + * `projects/{project_id}/regions/{region}` + * * For `projects.locations.autoscalingPolicies.create`, the resource name + * of the location has the following format: + * `projects/{project_id}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Required. The autoscaling policy to create. + */ + // const policy = {} + + // Imports the Dataproc library + const {AutoscalingPolicyServiceClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new AutoscalingPolicyServiceClient(); + + async function callCreateAutoscalingPolicy() { + // Construct request + const request = { + parent, + policy, + }; + + // Run request + const response = await dataprocClient.createAutoscalingPolicy(request); + console.log(response); + } + + callCreateAutoscalingPolicy(); + // [END dataproc_v1_generated_AutoscalingPolicyService_CreateAutoscalingPolicy_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-dataproc/samples/generated/v1/autoscaling_policy_service.delete_autoscaling_policy.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.delete_autoscaling_policy.js new file mode 100644 index 000000000000..bee4980d59ad --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.delete_autoscaling_policy.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 dataproc_v1_generated_AutoscalingPolicyService_DeleteAutoscalingPolicy_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 name" of the autoscaling policy, as described + * in https://cloud.google.com/apis/design/resource_names. + * * For `projects.regions.autoscalingPolicies.delete`, the resource name + * of the policy has the following format: + * `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` + * * For `projects.locations.autoscalingPolicies.delete`, the resource name + * of the policy has the following format: + * `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` + */ + // const name = 'abc123' + + // Imports the Dataproc library + const {AutoscalingPolicyServiceClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new AutoscalingPolicyServiceClient(); + + async function callDeleteAutoscalingPolicy() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataprocClient.deleteAutoscalingPolicy(request); + console.log(response); + } + + callDeleteAutoscalingPolicy(); + // [END dataproc_v1_generated_AutoscalingPolicyService_DeleteAutoscalingPolicy_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-dataproc/samples/generated/v1/autoscaling_policy_service.get_autoscaling_policy.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.get_autoscaling_policy.js new file mode 100644 index 000000000000..97c0661a0f3a --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.get_autoscaling_policy.js @@ -0,0 +1,68 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 dataproc_v1_generated_AutoscalingPolicyService_GetAutoscalingPolicy_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 name" of the autoscaling policy, as described + * in https://cloud.google.com/apis/design/resource_names. + * * For `projects.regions.autoscalingPolicies.get`, the resource name + * of the policy has the following format: + * `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` + * * For `projects.locations.autoscalingPolicies.get`, the resource name + * of the policy has the following format: + * `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` + */ + // const name = 'abc123' + + // Imports the Dataproc library + const {AutoscalingPolicyServiceClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new AutoscalingPolicyServiceClient(); + + async function callGetAutoscalingPolicy() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataprocClient.getAutoscalingPolicy(request); + console.log(response); + } + + callGetAutoscalingPolicy(); + // [END dataproc_v1_generated_AutoscalingPolicyService_GetAutoscalingPolicy_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-dataproc/samples/generated/v1/autoscaling_policy_service.list_autoscaling_policies.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.list_autoscaling_policies.js new file mode 100644 index 000000000000..fc5376e36647 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.list_autoscaling_policies.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) { + // [START dataproc_v1_generated_AutoscalingPolicyService_ListAutoscalingPolicies_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 name" of the region or location, as described + * in https://cloud.google.com/apis/design/resource_names. + * * For `projects.regions.autoscalingPolicies.list`, the resource name + * of the region has the following format: + * `projects/{project_id}/regions/{region}` + * * For `projects.locations.autoscalingPolicies.list`, the resource name + * of the location has the following format: + * `projects/{project_id}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of results to return in each response. + * Must be less than or equal to 1000. Defaults to 100. + */ + // const pageSize = 1234 + /** + * Optional. The page token, returned by a previous call, to request the + * next page of results. + */ + // const pageToken = 'abc123' + + // Imports the Dataproc library + const {AutoscalingPolicyServiceClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new AutoscalingPolicyServiceClient(); + + async function callListAutoscalingPolicies() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = dataprocClient.listAutoscalingPoliciesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAutoscalingPolicies(); + // [END dataproc_v1_generated_AutoscalingPolicyService_ListAutoscalingPolicies_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-dataproc/samples/generated/v1/autoscaling_policy_service.update_autoscaling_policy.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.update_autoscaling_policy.js new file mode 100644 index 000000000000..f5428f475eb4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.update_autoscaling_policy.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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(policy) { + // [START dataproc_v1_generated_AutoscalingPolicyService_UpdateAutoscalingPolicy_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 updated autoscaling policy. + */ + // const policy = {} + + // Imports the Dataproc library + const {AutoscalingPolicyServiceClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new AutoscalingPolicyServiceClient(); + + async function callUpdateAutoscalingPolicy() { + // Construct request + const request = { + policy, + }; + + // Run request + const response = await dataprocClient.updateAutoscalingPolicy(request); + console.log(response); + } + + callUpdateAutoscalingPolicy(); + // [END dataproc_v1_generated_AutoscalingPolicyService_UpdateAutoscalingPolicy_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-dataproc/samples/generated/v1/batch_controller.create_batch.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/batch_controller.create_batch.js new file mode 100644 index 000000000000..ffc3ad761b69 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/batch_controller.create_batch.js @@ -0,0 +1,86 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, batch) { + // [START dataproc_v1_generated_BatchController_CreateBatch_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource where this batch will be created. + */ + // const parent = 'abc123' + /** + * Required. The batch to create. + */ + // const batch = {} + /** + * Optional. The ID to use for the batch, which will become the final + * component of the batch's resource name. + * This value must be 4-63 characters. Valid characters are `/[a-z][0-9]-/`. + */ + // const batchId = 'abc123' + /** + * Optional. A unique ID used to identify the request. If the service + * receives two + * CreateBatchRequest (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateBatchRequest)s + * with the same request_id, the second request is ignored and the + * Operation that corresponds to the first Batch created and stored + * in the backend is returned. + * Recommendation: Set this value to a + * UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier). + * The value must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + */ + // const requestId = 'abc123' + + // Imports the Dataproc library + const {BatchControllerClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new BatchControllerClient(); + + async function callCreateBatch() { + // Construct request + const request = { + parent, + batch, + }; + + // Run request + const [operation] = await dataprocClient.createBatch(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateBatch(); + // [END dataproc_v1_generated_BatchController_CreateBatch_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-dataproc/samples/generated/v1/batch_controller.delete_batch.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/batch_controller.delete_batch.js new file mode 100644 index 000000000000..e86207ee29f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/batch_controller.delete_batch.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 dataproc_v1_generated_BatchController_DeleteBatch_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 fully qualified name of the batch to retrieve + * in the format + * "projects/PROJECT_ID/locations/DATAPROC_REGION/batches/BATCH_ID" + */ + // const name = 'abc123' + + // Imports the Dataproc library + const {BatchControllerClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new BatchControllerClient(); + + async function callDeleteBatch() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataprocClient.deleteBatch(request); + console.log(response); + } + + callDeleteBatch(); + // [END dataproc_v1_generated_BatchController_DeleteBatch_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-dataproc/samples/generated/v1/batch_controller.get_batch.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/batch_controller.get_batch.js new file mode 100644 index 000000000000..9c1153d6e9a1 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/batch_controller.get_batch.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 dataproc_v1_generated_BatchController_GetBatch_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 fully qualified name of the batch to retrieve + * in the format + * "projects/PROJECT_ID/locations/DATAPROC_REGION/batches/BATCH_ID" + */ + // const name = 'abc123' + + // Imports the Dataproc library + const {BatchControllerClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new BatchControllerClient(); + + async function callGetBatch() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataprocClient.getBatch(request); + console.log(response); + } + + callGetBatch(); + // [END dataproc_v1_generated_BatchController_GetBatch_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-dataproc/samples/generated/v1/batch_controller.list_batches.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/batch_controller.list_batches.js new file mode 100644 index 000000000000..082aeb5005df --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/batch_controller.list_batches.js @@ -0,0 +1,93 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 dataproc_v1_generated_BatchController_ListBatches_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of batches. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of batches to return in each response. + * The service may return fewer than this value. + * The default page size is 20; the maximum page size is 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token received from a previous `ListBatches` call. + * Provide this token to retrieve the subsequent page. + */ + // const pageToken = 'abc123' + /** + * Optional. A filter for the batches to return in the response. + * A filter is a logical expression constraining the values of various fields + * in each batch resource. Filters are case sensitive, and may contain + * multiple clauses combined with logical operators (AND/OR). + * Supported fields are `batch_id`, `batch_uuid`, `state`, and `create_time`. + * e.g. `state = RUNNING and create_time < "2023-01-01T00:00:00Z"` + * filters for batches in state RUNNING that were created before 2023-01-01 + * See https://google.aip.dev/assets/misc/ebnf-filtering.txt for a detailed + * description of the filter syntax and a list of supported comparisons. + */ + // const filter = 'abc123' + /** + * Optional. Field(s) on which to sort the list of batches. + * Currently the only supported sort orders are unspecified (empty) and + * `create_time desc` to sort by most recently created batches first. + * See https://google.aip.dev/132#ordering for more details. + */ + // const orderBy = 'abc123' + + // Imports the Dataproc library + const {BatchControllerClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new BatchControllerClient(); + + async function callListBatches() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = dataprocClient.listBatchesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListBatches(); + // [END dataproc_v1_generated_BatchController_ListBatches_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-dataproc/samples/generated/v1/cluster_controller.create_cluster.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.create_cluster.js new file mode 100644 index 000000000000..c21b7266325e --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.create_cluster.js @@ -0,0 +1,90 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, region, cluster) { + // [START dataproc_v1_generated_ClusterController_CreateCluster_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 ID of the Google Cloud Platform project that the cluster + * belongs to. + */ + // const projectId = 'abc123' + /** + * Required. The Dataproc region in which to handle the request. + */ + // const region = 'us-central1' + /** + * Required. The cluster to create. + */ + // const cluster = {} + /** + * Optional. A unique ID used to identify the request. If the server receives + * two + * CreateClusterRequest (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateClusterRequest)s + * with the same id, then the second request will be ignored and the + * first google.longrunning.Operation google.longrunning.Operation created + * and stored in the backend is returned. + * It is recommended to always set this value to a + * UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier). + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + */ + // const requestId = 'abc123' + /** + * Optional. Failure action when primary worker creation fails. + */ + // const actionOnFailedPrimaryWorkers = {} + + // Imports the Dataproc library + const {ClusterControllerClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new ClusterControllerClient(); + + async function callCreateCluster() { + // Construct request + const request = { + projectId, + region, + cluster, + }; + + // Run request + const [operation] = await dataprocClient.createCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateCluster(); + // [END dataproc_v1_generated_ClusterController_CreateCluster_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-dataproc/samples/generated/v1/cluster_controller.delete_cluster.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.delete_cluster.js new file mode 100644 index 000000000000..fdbb751717ee --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.delete_cluster.js @@ -0,0 +1,91 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, region, clusterName) { + // [START dataproc_v1_generated_ClusterController_DeleteCluster_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 ID of the Google Cloud Platform project that the cluster + * belongs to. + */ + // const projectId = 'abc123' + /** + * Required. The Dataproc region in which to handle the request. + */ + // const region = 'us-central1' + /** + * Required. The cluster name. + */ + // const clusterName = 'abc123' + /** + * Optional. Specifying the `cluster_uuid` means the RPC should fail + * (with error NOT_FOUND) if cluster with specified UUID does not exist. + */ + // const clusterUuid = 'abc123' + /** + * Optional. A unique ID used to identify the request. If the server + * receives two + * DeleteClusterRequest (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteClusterRequest)s + * with the same id, then the second request will be ignored and the + * first google.longrunning.Operation google.longrunning.Operation created + * and stored in the backend is returned. + * It is recommended to always set this value to a + * UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier). + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + */ + // const requestId = 'abc123' + + // Imports the Dataproc library + const {ClusterControllerClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new ClusterControllerClient(); + + async function callDeleteCluster() { + // Construct request + const request = { + projectId, + region, + clusterName, + }; + + // Run request + const [operation] = await dataprocClient.deleteCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteCluster(); + // [END dataproc_v1_generated_ClusterController_DeleteCluster_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-dataproc/samples/generated/v1/cluster_controller.diagnose_cluster.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.diagnose_cluster.js new file mode 100644 index 000000000000..819d22652184 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.diagnose_cluster.js @@ -0,0 +1,99 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, region, clusterName) { + // [START dataproc_v1_generated_ClusterController_DiagnoseCluster_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 ID of the Google Cloud Platform project that the cluster + * belongs to. + */ + // const projectId = 'abc123' + /** + * Required. The Dataproc region in which to handle the request. + */ + // const region = 'us-central1' + /** + * Required. The cluster name. + */ + // const clusterName = 'abc123' + /** + * Optional. (Optional) The output Cloud Storage directory for the diagnostic + * tarball. If not specified, a task-specific directory in the cluster's + * staging bucket will be used. + */ + // const tarballGcsDir = 'abc123' + /** + * Optional. (Optional) The access type to the diagnostic tarball. If not + * specified, falls back to default access of the bucket + */ + // const tarballAccess = {} + /** + * Optional. Time interval in which diagnosis should be carried out on the + * cluster. + */ + // const diagnosisInterval = {} + /** + * Optional. Specifies a list of jobs on which diagnosis is to be performed. + * Format: projects/{project}/regions/{region}/jobs/{job} + */ + // const jobs = ['abc','def'] + /** + * Optional. Specifies a list of yarn applications on which diagnosis is to be + * performed. + */ + // const yarnApplicationIds = ['abc','def'] + + // Imports the Dataproc library + const {ClusterControllerClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new ClusterControllerClient(); + + async function callDiagnoseCluster() { + // Construct request + const request = { + projectId, + region, + clusterName, + }; + + // Run request + const [operation] = await dataprocClient.diagnoseCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDiagnoseCluster(); + // [END dataproc_v1_generated_ClusterController_DiagnoseCluster_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-dataproc/samples/generated/v1/cluster_controller.get_cluster.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.get_cluster.js new file mode 100644 index 000000000000..4c362577eb27 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.get_cluster.js @@ -0,0 +1,72 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, region, clusterName) { + // [START dataproc_v1_generated_ClusterController_GetCluster_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 ID of the Google Cloud Platform project that the cluster + * belongs to. + */ + // const projectId = 'abc123' + /** + * Required. The Dataproc region in which to handle the request. + */ + // const region = 'us-central1' + /** + * Required. The cluster name. + */ + // const clusterName = 'abc123' + + // Imports the Dataproc library + const {ClusterControllerClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new ClusterControllerClient(); + + async function callGetCluster() { + // Construct request + const request = { + projectId, + region, + clusterName, + }; + + // Run request + const response = await dataprocClient.getCluster(request); + console.log(response); + } + + callGetCluster(); + // [END dataproc_v1_generated_ClusterController_GetCluster_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-dataproc/samples/generated/v1/cluster_controller.list_clusters.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.list_clusters.js new file mode 100644 index 000000000000..25dc003b89fc --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.list_clusters.js @@ -0,0 +1,95 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, region) { + // [START dataproc_v1_generated_ClusterController_ListClusters_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 ID of the Google Cloud Platform project that the cluster + * belongs to. + */ + // const projectId = 'abc123' + /** + * Required. The Dataproc region in which to handle the request. + */ + // const region = 'us-central1' + /** + * Optional. A filter constraining the clusters to list. Filters are + * case-sensitive and have the following syntax: + * field = value AND field = value ... + * where **field** is one of `status.state`, `clusterName`, or `labels.KEY`, + * and `[KEY]` is a label key. **value** can be `*` to match all values. + * `status.state` can be one of the following: `ACTIVE`, `INACTIVE`, + * `CREATING`, `RUNNING`, `ERROR`, `DELETING`, `UPDATING`, `STOPPING`, or + * `STOPPED`. `ACTIVE` contains the `CREATING`, `UPDATING`, and `RUNNING` + * states. `INACTIVE` contains the `DELETING`, `ERROR`, `STOPPING`, and + * `STOPPED` states. `clusterName` is the name of the cluster provided at + * creation time. Only the logical `AND` operator is supported; + * space-separated items are treated as having an implicit `AND` operator. + * Example filter: + * status.state = ACTIVE AND clusterName = mycluster + * AND labels.env = staging AND labels.starred = * + */ + // const filter = 'abc123' + /** + * Optional. The standard List page size. + */ + // const pageSize = 1234 + /** + * Optional. The standard List page token. + */ + // const pageToken = 'abc123' + + // Imports the Dataproc library + const {ClusterControllerClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new ClusterControllerClient(); + + async function callListClusters() { + // Construct request + const request = { + projectId, + region, + }; + + // Run request + const iterable = dataprocClient.listClustersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListClusters(); + // [END dataproc_v1_generated_ClusterController_ListClusters_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-dataproc/samples/generated/v1/cluster_controller.start_cluster.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.start_cluster.js new file mode 100644 index 000000000000..22b3429f3604 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.start_cluster.js @@ -0,0 +1,91 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, region, clusterName) { + // [START dataproc_v1_generated_ClusterController_StartCluster_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 ID of the Google Cloud Platform project the + * cluster belongs to. + */ + // const projectId = 'abc123' + /** + * Required. The Dataproc region in which to handle the request. + */ + // const region = 'us-central1' + /** + * Required. The cluster name. + */ + // const clusterName = 'abc123' + /** + * Optional. Specifying the `cluster_uuid` means the RPC will fail + * (with error NOT_FOUND) if a cluster with the specified UUID does not exist. + */ + // const clusterUuid = 'abc123' + /** + * Optional. A unique ID used to identify the request. If the server + * receives two + * StartClusterRequest (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StartClusterRequest)s + * with the same id, then the second request will be ignored and the + * first google.longrunning.Operation google.longrunning.Operation created + * and stored in the backend is returned. + * Recommendation: Set this value to a + * UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier). + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + */ + // const requestId = 'abc123' + + // Imports the Dataproc library + const {ClusterControllerClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new ClusterControllerClient(); + + async function callStartCluster() { + // Construct request + const request = { + projectId, + region, + clusterName, + }; + + // Run request + const [operation] = await dataprocClient.startCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callStartCluster(); + // [END dataproc_v1_generated_ClusterController_StartCluster_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-dataproc/samples/generated/v1/cluster_controller.stop_cluster.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.stop_cluster.js new file mode 100644 index 000000000000..09423acbc08f --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.stop_cluster.js @@ -0,0 +1,91 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, region, clusterName) { + // [START dataproc_v1_generated_ClusterController_StopCluster_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 ID of the Google Cloud Platform project the + * cluster belongs to. + */ + // const projectId = 'abc123' + /** + * Required. The Dataproc region in which to handle the request. + */ + // const region = 'us-central1' + /** + * Required. The cluster name. + */ + // const clusterName = 'abc123' + /** + * Optional. Specifying the `cluster_uuid` means the RPC will fail + * (with error NOT_FOUND) if a cluster with the specified UUID does not exist. + */ + // const clusterUuid = 'abc123' + /** + * Optional. A unique ID used to identify the request. If the server + * receives two + * StopClusterRequest (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StopClusterRequest)s + * with the same id, then the second request will be ignored and the + * first google.longrunning.Operation google.longrunning.Operation created + * and stored in the backend is returned. + * Recommendation: Set this value to a + * UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier). + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + */ + // const requestId = 'abc123' + + // Imports the Dataproc library + const {ClusterControllerClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new ClusterControllerClient(); + + async function callStopCluster() { + // Construct request + const request = { + projectId, + region, + clusterName, + }; + + // Run request + const [operation] = await dataprocClient.stopCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callStopCluster(); + // [END dataproc_v1_generated_ClusterController_StopCluster_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-dataproc/samples/generated/v1/cluster_controller.update_cluster.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.update_cluster.js new file mode 100644 index 000000000000..929840553e32 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.update_cluster.js @@ -0,0 +1,154 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, region, clusterName, cluster, updateMask) { + // [START dataproc_v1_generated_ClusterController_UpdateCluster_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 ID of the Google Cloud Platform project the + * cluster belongs to. + */ + // const projectId = 'abc123' + /** + * Required. The Dataproc region in which to handle the request. + */ + // const region = 'us-central1' + /** + * Required. The cluster name. + */ + // const clusterName = 'abc123' + /** + * Required. The changes to the cluster. + */ + // const cluster = {} + /** + * Optional. Timeout for graceful YARN decommissioning. Graceful + * decommissioning allows removing nodes from the cluster without + * interrupting jobs in progress. Timeout specifies how long to wait for jobs + * in progress to finish before forcefully removing nodes (and potentially + * interrupting jobs). Default timeout is 0 (for forceful decommission), and + * the maximum allowed timeout is 1 day. (see JSON representation of + * Duration (https://developers.google.com/protocol-buffers/docs/proto3#json)). + * Only supported on Dataproc image versions 1.2 and higher. + */ + // const gracefulDecommissionTimeout = {} + /** + * Required. Specifies the path, relative to `Cluster`, of + * the field to update. For example, to change the number of workers + * in a cluster to 5, the `update_mask` parameter would be + * specified as `config.worker_config.num_instances`, + * and the `PATCH` request body would specify the new value, as follows: + * { + * "config":{ + * "workerConfig":{ + * "numInstances":"5" + * } + * } + * } + * Similarly, to change the number of preemptible workers in a cluster to 5, + * the `update_mask` parameter would be + * `config.secondary_worker_config.num_instances`, and the `PATCH` request + * body would be set as follows: + * { + * "config":{ + * "secondaryWorkerConfig":{ + * "numInstances":"5" + * } + * } + * } + * Note: Currently, only the following fields can be updated: + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
MaskPurpose
labelsUpdate labels
config.worker_config.num_instancesResize primary worker group
config.secondary_worker_config.num_instancesResize secondary worker group
config.autoscaling_config.policy_uriUse, stop using, or + * change autoscaling policies
+ */ + // const updateMask = {} + /** + * Optional. A unique ID used to identify the request. If the server + * receives two + * UpdateClusterRequest (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.UpdateClusterRequest)s + * with the same id, then the second request will be ignored and the + * first google.longrunning.Operation google.longrunning.Operation created + * and stored in the backend is returned. + * It is recommended to always set this value to a + * UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier). + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + */ + // const requestId = 'abc123' + + // Imports the Dataproc library + const {ClusterControllerClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new ClusterControllerClient(); + + async function callUpdateCluster() { + // Construct request + const request = { + projectId, + region, + clusterName, + cluster, + updateMask, + }; + + // Run request + const [operation] = await dataprocClient.updateCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateCluster(); + // [END dataproc_v1_generated_ClusterController_UpdateCluster_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-dataproc/samples/generated/v1/job_controller.cancel_job.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.cancel_job.js new file mode 100644 index 000000000000..61b6c15af96d --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.cancel_job.js @@ -0,0 +1,72 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, region, jobId) { + // [START dataproc_v1_generated_JobController_CancelJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The ID of the Google Cloud Platform project that the job + * belongs to. + */ + // const projectId = 'abc123' + /** + * Required. The Dataproc region in which to handle the request. + */ + // const region = 'us-central1' + /** + * Required. The job ID. + */ + // const jobId = 'abc123' + + // Imports the Dataproc library + const {JobControllerClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new JobControllerClient(); + + async function callCancelJob() { + // Construct request + const request = { + projectId, + region, + jobId, + }; + + // Run request + const response = await dataprocClient.cancelJob(request); + console.log(response); + } + + callCancelJob(); + // [END dataproc_v1_generated_JobController_CancelJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.delete_job.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.delete_job.js new file mode 100644 index 000000000000..0958dd95e4cd --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.delete_job.js @@ -0,0 +1,72 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, region, jobId) { + // [START dataproc_v1_generated_JobController_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 ID of the Google Cloud Platform project that the job + * belongs to. + */ + // const projectId = 'abc123' + /** + * Required. The Dataproc region in which to handle the request. + */ + // const region = 'us-central1' + /** + * Required. The job ID. + */ + // const jobId = 'abc123' + + // Imports the Dataproc library + const {JobControllerClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new JobControllerClient(); + + async function callDeleteJob() { + // Construct request + const request = { + projectId, + region, + jobId, + }; + + // Run request + const response = await dataprocClient.deleteJob(request); + console.log(response); + } + + callDeleteJob(); + // [END dataproc_v1_generated_JobController_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-dataproc/samples/generated/v1/job_controller.get_job.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.get_job.js new file mode 100644 index 000000000000..68d65573fcc8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.get_job.js @@ -0,0 +1,72 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, region, jobId) { + // [START dataproc_v1_generated_JobController_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 ID of the Google Cloud Platform project that the job + * belongs to. + */ + // const projectId = 'abc123' + /** + * Required. The Dataproc region in which to handle the request. + */ + // const region = 'us-central1' + /** + * Required. The job ID. + */ + // const jobId = 'abc123' + + // Imports the Dataproc library + const {JobControllerClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new JobControllerClient(); + + async function callGetJob() { + // Construct request + const request = { + projectId, + region, + jobId, + }; + + // Run request + const response = await dataprocClient.getJob(request); + console.log(response); + } + + callGetJob(); + // [END dataproc_v1_generated_JobController_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-dataproc/samples/generated/v1/job_controller.list_jobs.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.list_jobs.js new file mode 100644 index 000000000000..c30212bd4cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.list_jobs.js @@ -0,0 +1,102 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, region) { + // [START dataproc_v1_generated_JobController_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 ID of the Google Cloud Platform project that the job + * belongs to. + */ + // const projectId = 'abc123' + /** + * Required. The Dataproc region in which to handle the request. + */ + // const region = 'us-central1' + /** + * Optional. The number of results to return in each response. + */ + // const pageSize = 1234 + /** + * Optional. The page token, returned by a previous call, to request the + * next page of results. + */ + // const pageToken = 'abc123' + /** + * Optional. If set, the returned jobs list includes only jobs that were + * submitted to the named cluster. + */ + // const clusterName = 'abc123' + /** + * Optional. Specifies enumerated categories of jobs to list. + * (default = match ALL jobs). + * If `filter` is provided, `jobStateMatcher` will be ignored. + */ + // const jobStateMatcher = {} + /** + * Optional. A filter constraining the jobs to list. Filters are + * case-sensitive and have the following syntax: + * field = value AND field = value ... + * where **field** is `status.state` or `labels.[KEY]`, and `[KEY]` is a label + * key. **value** can be `*` to match all values. + * `status.state` can be either `ACTIVE` or `NON_ACTIVE`. + * Only the logical `AND` operator is supported; space-separated items are + * treated as having an implicit `AND` operator. + * Example filter: + * status.state = ACTIVE AND labels.env = staging AND labels.starred = * + */ + // const filter = 'abc123' + + // Imports the Dataproc library + const {JobControllerClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new JobControllerClient(); + + async function callListJobs() { + // Construct request + const request = { + projectId, + region, + }; + + // Run request + const iterable = dataprocClient.listJobsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListJobs(); + // [END dataproc_v1_generated_JobController_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-dataproc/samples/generated/v1/job_controller.submit_job.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.submit_job.js new file mode 100644 index 000000000000..832168732636 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.submit_job.js @@ -0,0 +1,85 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, region, job) { + // [START dataproc_v1_generated_JobController_SubmitJob_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 ID of the Google Cloud Platform project that the job + * belongs to. + */ + // const projectId = 'abc123' + /** + * Required. The Dataproc region in which to handle the request. + */ + // const region = 'us-central1' + /** + * Required. The job resource. + */ + // const job = {} + /** + * Optional. A unique id used to identify the request. If the server + * receives two + * SubmitJobRequest (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.SubmitJobRequest)s + * with the same id, then the second request will be ignored and the + * first Job google.cloud.dataproc.v1.Job created and stored in the backend + * is returned. + * It is recommended to always set this value to a + * UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier). + * The id must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + */ + // const requestId = 'abc123' + + // Imports the Dataproc library + const {JobControllerClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new JobControllerClient(); + + async function callSubmitJob() { + // Construct request + const request = { + projectId, + region, + job, + }; + + // Run request + const response = await dataprocClient.submitJob(request); + console.log(response); + } + + callSubmitJob(); + // [END dataproc_v1_generated_JobController_SubmitJob_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-dataproc/samples/generated/v1/job_controller.submit_job_as_operation.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.submit_job_as_operation.js new file mode 100644 index 000000000000..588ed2ad0aa3 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.submit_job_as_operation.js @@ -0,0 +1,86 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, region, job) { + // [START dataproc_v1_generated_JobController_SubmitJobAsOperation_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 ID of the Google Cloud Platform project that the job + * belongs to. + */ + // const projectId = 'abc123' + /** + * Required. The Dataproc region in which to handle the request. + */ + // const region = 'us-central1' + /** + * Required. The job resource. + */ + // const job = {} + /** + * Optional. A unique id used to identify the request. If the server + * receives two + * SubmitJobRequest (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.SubmitJobRequest)s + * with the same id, then the second request will be ignored and the + * first Job google.cloud.dataproc.v1.Job created and stored in the backend + * is returned. + * It is recommended to always set this value to a + * UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier). + * The id must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + */ + // const requestId = 'abc123' + + // Imports the Dataproc library + const {JobControllerClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new JobControllerClient(); + + async function callSubmitJobAsOperation() { + // Construct request + const request = { + projectId, + region, + job, + }; + + // Run request + const [operation] = await dataprocClient.submitJobAsOperation(request); + const [response] = await operation.promise(); + console.log(response); + } + + callSubmitJobAsOperation(); + // [END dataproc_v1_generated_JobController_SubmitJobAsOperation_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-dataproc/samples/generated/v1/job_controller.update_job.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.update_job.js new file mode 100644 index 000000000000..ab81cc3dc4be --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.update_job.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(projectId, region, jobId, job, updateMask) { + // [START dataproc_v1_generated_JobController_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 ID of the Google Cloud Platform project that the job + * belongs to. + */ + // const projectId = 'abc123' + /** + * Required. The Dataproc region in which to handle the request. + */ + // const region = 'us-central1' + /** + * Required. The job ID. + */ + // const jobId = 'abc123' + /** + * Required. The changes to the job. + */ + // const job = {} + /** + * Required. Specifies the path, relative to Job, of + * the field to update. For example, to update the labels of a Job the + * update_mask parameter would be specified as + * labels, and the `PATCH` request body would specify the new + * value. Note: Currently, labels is the only + * field that can be updated. + */ + // const updateMask = {} + + // Imports the Dataproc library + const {JobControllerClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new JobControllerClient(); + + async function callUpdateJob() { + // Construct request + const request = { + projectId, + region, + jobId, + job, + updateMask, + }; + + // Run request + const response = await dataprocClient.updateJob(request); + console.log(response); + } + + callUpdateJob(); + // [END dataproc_v1_generated_JobController_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-dataproc/samples/generated/v1/node_group_controller.create_node_group.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/node_group_controller.create_node_group.js new file mode 100644 index 000000000000..dca50a784ced --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/node_group_controller.create_node_group.js @@ -0,0 +1,88 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, nodeGroup) { + // [START dataproc_v1_generated_NodeGroupController_CreateNodeGroup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource where this node group will be created. + * Format: `projects/{project}/regions/{region}/clusters/{cluster}` + */ + // const parent = 'abc123' + /** + * Required. The node group to create. + */ + // const nodeGroup = {} + /** + * Optional. An optional node group ID. Generated if not specified. + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). Cannot begin or end with underscore + * or hyphen. Must consist of from 3 to 33 characters. + */ + // const nodeGroupId = 'abc123' + /** + * Optional. A unique ID used to identify the request. If the server receives + * two + * CreateNodeGroupRequest (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateNodeGroupRequests) + * with the same ID, the second request is ignored and the + * first google.longrunning.Operation google.longrunning.Operation created + * and stored in the backend is returned. + * Recommendation: Set this value to a + * UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier). + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + */ + // const requestId = 'abc123' + + // Imports the Dataproc library + const {NodeGroupControllerClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new NodeGroupControllerClient(); + + async function callCreateNodeGroup() { + // Construct request + const request = { + parent, + nodeGroup, + }; + + // Run request + const [operation] = await dataprocClient.createNodeGroup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateNodeGroup(); + // [END dataproc_v1_generated_NodeGroupController_CreateNodeGroup_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-dataproc/samples/generated/v1/node_group_controller.get_node_group.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/node_group_controller.get_node_group.js new file mode 100644 index 000000000000..a51727868edd --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/node_group_controller.get_node_group.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 dataproc_v1_generated_NodeGroupController_GetNodeGroup_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 node group to retrieve. + * Format: + * `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` + */ + // const name = 'abc123' + + // Imports the Dataproc library + const {NodeGroupControllerClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new NodeGroupControllerClient(); + + async function callGetNodeGroup() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataprocClient.getNodeGroup(request); + console.log(response); + } + + callGetNodeGroup(); + // [END dataproc_v1_generated_NodeGroupController_GetNodeGroup_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-dataproc/samples/generated/v1/node_group_controller.resize_node_group.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/node_group_controller.resize_node_group.js new file mode 100644 index 000000000000..ecb1e402befb --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/node_group_controller.resize_node_group.js @@ -0,0 +1,98 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, size) { + // [START dataproc_v1_generated_NodeGroupController_ResizeNodeGroup_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 node group to resize. + * Format: + * `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` + */ + // const name = 'abc123' + /** + * Required. The number of running instances for the node group to maintain. + * The group adds or removes instances to maintain the number of instances + * specified by this parameter. + */ + // const size = 1234 + /** + * Optional. A unique ID used to identify the request. If the server receives + * two + * ResizeNodeGroupRequest (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.ResizeNodeGroupRequests) + * with the same ID, the second request is ignored and the + * first google.longrunning.Operation google.longrunning.Operation created + * and stored in the backend is returned. + * Recommendation: Set this value to a + * UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier). + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + */ + // const requestId = 'abc123' + /** + * Optional. Timeout for graceful YARN decommissioning. Graceful + * decommissioning + * (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/scaling-clusters#graceful_decommissioning) + * allows the removal of nodes from the Compute Engine node group + * without interrupting jobs in progress. This timeout specifies how long to + * wait for jobs in progress to finish before forcefully removing nodes (and + * potentially interrupting jobs). Default timeout is 0 (for forceful + * decommission), and the maximum allowed timeout is 1 day. (see JSON + * representation of + * Duration (https://developers.google.com/protocol-buffers/docs/proto3#json)). + * Only supported on Dataproc image versions 1.2 and higher. + */ + // const gracefulDecommissionTimeout = {} + + // Imports the Dataproc library + const {NodeGroupControllerClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new NodeGroupControllerClient(); + + async function callResizeNodeGroup() { + // Construct request + const request = { + name, + size, + }; + + // Run request + const [operation] = await dataprocClient.resizeNodeGroup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callResizeNodeGroup(); + // [END dataproc_v1_generated_NodeGroupController_ResizeNodeGroup_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-dataproc/samples/generated/v1/session_controller.create_session.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_controller.create_session.js new file mode 100644 index 000000000000..08791edce4b7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_controller.create_session.js @@ -0,0 +1,88 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, session, sessionId) { + // [START dataproc_v1_generated_SessionController_CreateSession_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource where this session will be created. + */ + // const parent = 'abc123' + /** + * Required. The interactive session to create. + */ + // const session = {} + /** + * Required. The ID to use for the session, which becomes the final component + * of the session's resource name. + * This value must be 4-63 characters. Valid characters + * are /[a-z][0-9]-/. + */ + // const sessionId = 'abc123' + /** + * Optional. A unique ID used to identify the request. If the service + * receives two + * CreateSessionRequests (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateSessionRequest)s + * with the same ID, the second request is ignored, and the + * first Session google.cloud.dataproc.v1.Session is created and stored in + * the backend. + * Recommendation: Set this value to a + * UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier). + * The value must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + */ + // const requestId = 'abc123' + + // Imports the Dataproc library + const {SessionControllerClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new SessionControllerClient(); + + async function callCreateSession() { + // Construct request + const request = { + parent, + session, + sessionId, + }; + + // Run request + const [operation] = await dataprocClient.createSession(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateSession(); + // [END dataproc_v1_generated_SessionController_CreateSession_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-dataproc/samples/generated/v1/session_controller.delete_session.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_controller.delete_session.js new file mode 100644 index 000000000000..7cd1617d688c --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_controller.delete_session.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(name) { + // [START dataproc_v1_generated_SessionController_DeleteSession_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 session resource to delete. + */ + // const name = 'abc123' + /** + * Optional. A unique ID used to identify the request. If the service + * receives two + * DeleteSessionRequest (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteSessionRequest)s + * with the same ID, the second request is ignored. + * Recommendation: Set this value to a + * UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier). + * The value must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + */ + // const requestId = 'abc123' + + // Imports the Dataproc library + const {SessionControllerClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new SessionControllerClient(); + + async function callDeleteSession() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await dataprocClient.deleteSession(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteSession(); + // [END dataproc_v1_generated_SessionController_DeleteSession_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-dataproc/samples/generated/v1/session_controller.get_session.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_controller.get_session.js new file mode 100644 index 000000000000..dad5a788dd37 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_controller.get_session.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 dataproc_v1_generated_SessionController_GetSession_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 session to retrieve. + */ + // const name = 'abc123' + + // Imports the Dataproc library + const {SessionControllerClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new SessionControllerClient(); + + async function callGetSession() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataprocClient.getSession(request); + console.log(response); + } + + callGetSession(); + // [END dataproc_v1_generated_SessionController_GetSession_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-dataproc/samples/generated/v1/session_controller.list_sessions.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_controller.list_sessions.js new file mode 100644 index 000000000000..e38c22717c0b --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_controller.list_sessions.js @@ -0,0 +1,88 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 dataproc_v1_generated_SessionController_ListSessions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent, which owns this collection of sessions. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of sessions to return in each response. + * The service may return fewer than this value. + */ + // const pageSize = 1234 + /** + * Optional. A page token received from a previous `ListSessions` call. + * Provide this token to retrieve the subsequent page. + */ + // const pageToken = 'abc123' + /** + * Optional. A filter for the sessions to return in the response. + * A filter is a logical expression constraining the values of various fields + * in each session resource. Filters are case sensitive, and may contain + * multiple clauses combined with logical operators (AND, OR). + * Supported fields are `session_id`, `session_uuid`, `state`, `create_time`, + * and `labels`. + * Example: `state = ACTIVE and create_time < "2023-01-01T00:00:00Z"` + * is a filter for sessions in an ACTIVE state that were created before + * 2023-01-01. `state = ACTIVE and labels.environment=production` is a filter + * for sessions in an ACTIVE state that have a production environment label. + * See https://google.aip.dev/assets/misc/ebnf-filtering.txt for a detailed + * description of the filter syntax and a list of supported comparators. + */ + // const filter = 'abc123' + + // Imports the Dataproc library + const {SessionControllerClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new SessionControllerClient(); + + async function callListSessions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = dataprocClient.listSessionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSessions(); + // [END dataproc_v1_generated_SessionController_ListSessions_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-dataproc/samples/generated/v1/session_controller.terminate_session.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_controller.terminate_session.js new file mode 100644 index 000000000000..e8e73468f82c --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_controller.terminate_session.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(name) { + // [START dataproc_v1_generated_SessionController_TerminateSession_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 session resource to terminate. + */ + // const name = 'abc123' + /** + * Optional. A unique ID used to identify the request. If the service + * receives two + * TerminateSessionRequest (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.TerminateSessionRequest)s + * with the same ID, the second request is ignored. + * Recommendation: Set this value to a + * UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier). + * The value must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + */ + // const requestId = 'abc123' + + // Imports the Dataproc library + const {SessionControllerClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new SessionControllerClient(); + + async function callTerminateSession() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await dataprocClient.terminateSession(request); + const [response] = await operation.promise(); + console.log(response); + } + + callTerminateSession(); + // [END dataproc_v1_generated_SessionController_TerminateSession_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-dataproc/samples/generated/v1/session_template_controller.create_session_template.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_template_controller.create_session_template.js new file mode 100644 index 000000000000..a1755cd7f7a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_template_controller.create_session_template.js @@ -0,0 +1,66 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, sessionTemplate) { + // [START dataproc_v1_generated_SessionTemplateController_CreateSessionTemplate_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource where this session template will be created. + */ + // const parent = 'abc123' + /** + * Required. The session template to create. + */ + // const sessionTemplate = {} + + // Imports the Dataproc library + const {SessionTemplateControllerClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new SessionTemplateControllerClient(); + + async function callCreateSessionTemplate() { + // Construct request + const request = { + parent, + sessionTemplate, + }; + + // Run request + const response = await dataprocClient.createSessionTemplate(request); + console.log(response); + } + + callCreateSessionTemplate(); + // [END dataproc_v1_generated_SessionTemplateController_CreateSessionTemplate_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-dataproc/samples/generated/v1/session_template_controller.delete_session_template.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_template_controller.delete_session_template.js new file mode 100644 index 000000000000..db600358bcdd --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_template_controller.delete_session_template.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 dataproc_v1_generated_SessionTemplateController_DeleteSessionTemplate_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 session template resource to delete. + */ + // const name = 'abc123' + + // Imports the Dataproc library + const {SessionTemplateControllerClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new SessionTemplateControllerClient(); + + async function callDeleteSessionTemplate() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataprocClient.deleteSessionTemplate(request); + console.log(response); + } + + callDeleteSessionTemplate(); + // [END dataproc_v1_generated_SessionTemplateController_DeleteSessionTemplate_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-dataproc/samples/generated/v1/session_template_controller.get_session_template.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_template_controller.get_session_template.js new file mode 100644 index 000000000000..1ed1f24b2c0e --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_template_controller.get_session_template.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 dataproc_v1_generated_SessionTemplateController_GetSessionTemplate_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 session template to retrieve. + */ + // const name = 'abc123' + + // Imports the Dataproc library + const {SessionTemplateControllerClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new SessionTemplateControllerClient(); + + async function callGetSessionTemplate() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataprocClient.getSessionTemplate(request); + console.log(response); + } + + callGetSessionTemplate(); + // [END dataproc_v1_generated_SessionTemplateController_GetSessionTemplate_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-dataproc/samples/generated/v1/session_template_controller.list_session_templates.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_template_controller.list_session_templates.js new file mode 100644 index 000000000000..2f4cbe0c06c9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_template_controller.list_session_templates.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 dataproc_v1_generated_SessionTemplateController_ListSessionTemplates_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent that owns this collection of session templates. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of sessions to return in each response. + * The service may return fewer than this value. + */ + // const pageSize = 1234 + /** + * Optional. A page token received from a previous `ListSessions` call. + * Provide this token to retrieve the subsequent page. + */ + // const pageToken = 'abc123' + /** + * Optional. A filter for the session templates to return in the response. + * Filters are case sensitive and have the following syntax: + * field = value AND field = value ... + */ + // const filter = 'abc123' + + // Imports the Dataproc library + const {SessionTemplateControllerClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new SessionTemplateControllerClient(); + + async function callListSessionTemplates() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = dataprocClient.listSessionTemplatesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSessionTemplates(); + // [END dataproc_v1_generated_SessionTemplateController_ListSessionTemplates_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-dataproc/samples/generated/v1/session_template_controller.update_session_template.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_template_controller.update_session_template.js new file mode 100644 index 000000000000..3382ef7da002 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_template_controller.update_session_template.js @@ -0,0 +1,61 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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(sessionTemplate) { + // [START dataproc_v1_generated_SessionTemplateController_UpdateSessionTemplate_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 updated session template. + */ + // const sessionTemplate = {} + + // Imports the Dataproc library + const {SessionTemplateControllerClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new SessionTemplateControllerClient(); + + async function callUpdateSessionTemplate() { + // Construct request + const request = { + sessionTemplate, + }; + + // Run request + const response = await dataprocClient.updateSessionTemplate(request); + console.log(response); + } + + callUpdateSessionTemplate(); + // [END dataproc_v1_generated_SessionTemplateController_UpdateSessionTemplate_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-dataproc/samples/generated/v1/snippet_metadata_google.cloud.dataproc.v1.json b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/snippet_metadata_google.cloud.dataproc.v1.json new file mode 100644 index 000000000000..6e8593086d41 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/snippet_metadata_google.cloud.dataproc.v1.json @@ -0,0 +1,2155 @@ +{ + "clientLibrary": { + "name": "nodejs-dataproc", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.dataproc.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "dataproc_v1_generated_AutoscalingPolicyService_CreateAutoscalingPolicy_async", + "title": "dataproc createAutoscalingPolicy Sample", + "origin": "API_DEFINITION", + "description": " Creates new autoscaling policy.", + "canonical": true, + "file": "autoscaling_policy_service.create_autoscaling_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateAutoscalingPolicy", + "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyService.CreateAutoscalingPolicy", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "policy", + "type": ".google.cloud.dataproc.v1.AutoscalingPolicy" + } + ], + "resultType": ".google.cloud.dataproc.v1.AutoscalingPolicy", + "client": { + "shortName": "AutoscalingPolicyServiceClient", + "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyServiceClient" + }, + "method": { + "shortName": "CreateAutoscalingPolicy", + "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyService.CreateAutoscalingPolicy", + "service": { + "shortName": "AutoscalingPolicyService", + "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyService" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_AutoscalingPolicyService_UpdateAutoscalingPolicy_async", + "title": "dataproc updateAutoscalingPolicy Sample", + "origin": "API_DEFINITION", + "description": " Updates (replaces) autoscaling policy. Disabled check for update_mask, because all updates will be full replacements.", + "canonical": true, + "file": "autoscaling_policy_service.update_autoscaling_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateAutoscalingPolicy", + "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyService.UpdateAutoscalingPolicy", + "async": true, + "parameters": [ + { + "name": "policy", + "type": ".google.cloud.dataproc.v1.AutoscalingPolicy" + } + ], + "resultType": ".google.cloud.dataproc.v1.AutoscalingPolicy", + "client": { + "shortName": "AutoscalingPolicyServiceClient", + "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyServiceClient" + }, + "method": { + "shortName": "UpdateAutoscalingPolicy", + "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyService.UpdateAutoscalingPolicy", + "service": { + "shortName": "AutoscalingPolicyService", + "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyService" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_AutoscalingPolicyService_GetAutoscalingPolicy_async", + "title": "dataproc getAutoscalingPolicy Sample", + "origin": "API_DEFINITION", + "description": " Retrieves autoscaling policy.", + "canonical": true, + "file": "autoscaling_policy_service.get_autoscaling_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetAutoscalingPolicy", + "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyService.GetAutoscalingPolicy", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataproc.v1.AutoscalingPolicy", + "client": { + "shortName": "AutoscalingPolicyServiceClient", + "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyServiceClient" + }, + "method": { + "shortName": "GetAutoscalingPolicy", + "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyService.GetAutoscalingPolicy", + "service": { + "shortName": "AutoscalingPolicyService", + "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyService" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_AutoscalingPolicyService_ListAutoscalingPolicies_async", + "title": "dataproc listAutoscalingPolicies Sample", + "origin": "API_DEFINITION", + "description": " Lists autoscaling policies in the project.", + "canonical": true, + "file": "autoscaling_policy_service.list_autoscaling_policies.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAutoscalingPolicies", + "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyService.ListAutoscalingPolicies", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse", + "client": { + "shortName": "AutoscalingPolicyServiceClient", + "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyServiceClient" + }, + "method": { + "shortName": "ListAutoscalingPolicies", + "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyService.ListAutoscalingPolicies", + "service": { + "shortName": "AutoscalingPolicyService", + "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyService" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_AutoscalingPolicyService_DeleteAutoscalingPolicy_async", + "title": "dataproc deleteAutoscalingPolicy Sample", + "origin": "API_DEFINITION", + "description": " Deletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by one or more clusters.", + "canonical": true, + "file": "autoscaling_policy_service.delete_autoscaling_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteAutoscalingPolicy", + "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyService.DeleteAutoscalingPolicy", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AutoscalingPolicyServiceClient", + "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyServiceClient" + }, + "method": { + "shortName": "DeleteAutoscalingPolicy", + "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyService.DeleteAutoscalingPolicy", + "service": { + "shortName": "AutoscalingPolicyService", + "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyService" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_BatchController_CreateBatch_async", + "title": "dataproc createBatch Sample", + "origin": "API_DEFINITION", + "description": " Creates a batch workload that executes asynchronously.", + "canonical": true, + "file": "batch_controller.create_batch.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateBatch", + "fullName": "google.cloud.dataproc.v1.BatchController.CreateBatch", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "batch", + "type": ".google.cloud.dataproc.v1.Batch" + }, + { + "name": "batch_id", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BatchControllerClient", + "fullName": "google.cloud.dataproc.v1.BatchControllerClient" + }, + "method": { + "shortName": "CreateBatch", + "fullName": "google.cloud.dataproc.v1.BatchController.CreateBatch", + "service": { + "shortName": "BatchController", + "fullName": "google.cloud.dataproc.v1.BatchController" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_BatchController_GetBatch_async", + "title": "dataproc getBatch Sample", + "origin": "API_DEFINITION", + "description": " Gets the batch workload resource representation.", + "canonical": true, + "file": "batch_controller.get_batch.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBatch", + "fullName": "google.cloud.dataproc.v1.BatchController.GetBatch", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataproc.v1.Batch", + "client": { + "shortName": "BatchControllerClient", + "fullName": "google.cloud.dataproc.v1.BatchControllerClient" + }, + "method": { + "shortName": "GetBatch", + "fullName": "google.cloud.dataproc.v1.BatchController.GetBatch", + "service": { + "shortName": "BatchController", + "fullName": "google.cloud.dataproc.v1.BatchController" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_BatchController_ListBatches_async", + "title": "dataproc listBatches Sample", + "origin": "API_DEFINITION", + "description": " Lists batch workloads.", + "canonical": true, + "file": "batch_controller.list_batches.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBatches", + "fullName": "google.cloud.dataproc.v1.BatchController.ListBatches", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataproc.v1.ListBatchesResponse", + "client": { + "shortName": "BatchControllerClient", + "fullName": "google.cloud.dataproc.v1.BatchControllerClient" + }, + "method": { + "shortName": "ListBatches", + "fullName": "google.cloud.dataproc.v1.BatchController.ListBatches", + "service": { + "shortName": "BatchController", + "fullName": "google.cloud.dataproc.v1.BatchController" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_BatchController_DeleteBatch_async", + "title": "dataproc deleteBatch Sample", + "origin": "API_DEFINITION", + "description": " Deletes the batch workload resource. If the batch is not in terminal state, the delete fails and the response returns `FAILED_PRECONDITION`.", + "canonical": true, + "file": "batch_controller.delete_batch.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteBatch", + "fullName": "google.cloud.dataproc.v1.BatchController.DeleteBatch", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "BatchControllerClient", + "fullName": "google.cloud.dataproc.v1.BatchControllerClient" + }, + "method": { + "shortName": "DeleteBatch", + "fullName": "google.cloud.dataproc.v1.BatchController.DeleteBatch", + "service": { + "shortName": "BatchController", + "fullName": "google.cloud.dataproc.v1.BatchController" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_ClusterController_CreateCluster_async", + "title": "dataproc createCluster Sample", + "origin": "API_DEFINITION", + "description": " Creates a cluster in a project. The returned [Operation.metadata][google.longrunning.Operation.metadata] will be [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata).", + "canonical": true, + "file": "cluster_controller.create_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCluster", + "fullName": "google.cloud.dataproc.v1.ClusterController.CreateCluster", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "region", + "type": "TYPE_STRING" + }, + { + "name": "cluster", + "type": ".google.cloud.dataproc.v1.Cluster" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "action_on_failed_primary_workers", + "type": ".google.cloud.dataproc.v1.FailureAction" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ClusterControllerClient", + "fullName": "google.cloud.dataproc.v1.ClusterControllerClient" + }, + "method": { + "shortName": "CreateCluster", + "fullName": "google.cloud.dataproc.v1.ClusterController.CreateCluster", + "service": { + "shortName": "ClusterController", + "fullName": "google.cloud.dataproc.v1.ClusterController" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_ClusterController_UpdateCluster_async", + "title": "dataproc updateCluster Sample", + "origin": "API_DEFINITION", + "description": " Updates a cluster in a project. The returned [Operation.metadata][google.longrunning.Operation.metadata] will be [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). The cluster must be in a [`RUNNING`][google.cloud.dataproc.v1.ClusterStatus.State] state or an error is returned.", + "canonical": true, + "file": "cluster_controller.update_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 146, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCluster", + "fullName": "google.cloud.dataproc.v1.ClusterController.UpdateCluster", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "region", + "type": "TYPE_STRING" + }, + { + "name": "cluster_name", + "type": "TYPE_STRING" + }, + { + "name": "cluster", + "type": ".google.cloud.dataproc.v1.Cluster" + }, + { + "name": "graceful_decommission_timeout", + "type": ".google.protobuf.Duration" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ClusterControllerClient", + "fullName": "google.cloud.dataproc.v1.ClusterControllerClient" + }, + "method": { + "shortName": "UpdateCluster", + "fullName": "google.cloud.dataproc.v1.ClusterController.UpdateCluster", + "service": { + "shortName": "ClusterController", + "fullName": "google.cloud.dataproc.v1.ClusterController" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_ClusterController_StopCluster_async", + "title": "dataproc stopCluster Sample", + "origin": "API_DEFINITION", + "description": " Stops a cluster in a project.", + "canonical": true, + "file": "cluster_controller.stop_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 83, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StopCluster", + "fullName": "google.cloud.dataproc.v1.ClusterController.StopCluster", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "region", + "type": "TYPE_STRING" + }, + { + "name": "cluster_name", + "type": "TYPE_STRING" + }, + { + "name": "cluster_uuid", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ClusterControllerClient", + "fullName": "google.cloud.dataproc.v1.ClusterControllerClient" + }, + "method": { + "shortName": "StopCluster", + "fullName": "google.cloud.dataproc.v1.ClusterController.StopCluster", + "service": { + "shortName": "ClusterController", + "fullName": "google.cloud.dataproc.v1.ClusterController" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_ClusterController_StartCluster_async", + "title": "dataproc startCluster Sample", + "origin": "API_DEFINITION", + "description": " Starts a cluster in a project.", + "canonical": true, + "file": "cluster_controller.start_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 83, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StartCluster", + "fullName": "google.cloud.dataproc.v1.ClusterController.StartCluster", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "region", + "type": "TYPE_STRING" + }, + { + "name": "cluster_name", + "type": "TYPE_STRING" + }, + { + "name": "cluster_uuid", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ClusterControllerClient", + "fullName": "google.cloud.dataproc.v1.ClusterControllerClient" + }, + "method": { + "shortName": "StartCluster", + "fullName": "google.cloud.dataproc.v1.ClusterController.StartCluster", + "service": { + "shortName": "ClusterController", + "fullName": "google.cloud.dataproc.v1.ClusterController" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_ClusterController_DeleteCluster_async", + "title": "dataproc deleteCluster Sample", + "origin": "API_DEFINITION", + "description": " Deletes a cluster in a project. The returned [Operation.metadata][google.longrunning.Operation.metadata] will be [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata).", + "canonical": true, + "file": "cluster_controller.delete_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 83, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCluster", + "fullName": "google.cloud.dataproc.v1.ClusterController.DeleteCluster", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "region", + "type": "TYPE_STRING" + }, + { + "name": "cluster_name", + "type": "TYPE_STRING" + }, + { + "name": "cluster_uuid", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ClusterControllerClient", + "fullName": "google.cloud.dataproc.v1.ClusterControllerClient" + }, + "method": { + "shortName": "DeleteCluster", + "fullName": "google.cloud.dataproc.v1.ClusterController.DeleteCluster", + "service": { + "shortName": "ClusterController", + "fullName": "google.cloud.dataproc.v1.ClusterController" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_ClusterController_GetCluster_async", + "title": "dataproc getCluster Sample", + "origin": "API_DEFINITION", + "description": " Gets the resource representation for a cluster in a project.", + "canonical": true, + "file": "cluster_controller.get_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCluster", + "fullName": "google.cloud.dataproc.v1.ClusterController.GetCluster", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "region", + "type": "TYPE_STRING" + }, + { + "name": "cluster_name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataproc.v1.Cluster", + "client": { + "shortName": "ClusterControllerClient", + "fullName": "google.cloud.dataproc.v1.ClusterControllerClient" + }, + "method": { + "shortName": "GetCluster", + "fullName": "google.cloud.dataproc.v1.ClusterController.GetCluster", + "service": { + "shortName": "ClusterController", + "fullName": "google.cloud.dataproc.v1.ClusterController" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_ClusterController_ListClusters_async", + "title": "dataproc listClusters Sample", + "origin": "API_DEFINITION", + "description": " Lists all regions/{region}/clusters in a project alphabetically.", + "canonical": true, + "file": "cluster_controller.list_clusters.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 87, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListClusters", + "fullName": "google.cloud.dataproc.v1.ClusterController.ListClusters", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "region", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataproc.v1.ListClustersResponse", + "client": { + "shortName": "ClusterControllerClient", + "fullName": "google.cloud.dataproc.v1.ClusterControllerClient" + }, + "method": { + "shortName": "ListClusters", + "fullName": "google.cloud.dataproc.v1.ClusterController.ListClusters", + "service": { + "shortName": "ClusterController", + "fullName": "google.cloud.dataproc.v1.ClusterController" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_ClusterController_DiagnoseCluster_async", + "title": "dataproc diagnoseCluster Sample", + "origin": "API_DEFINITION", + "description": " Gets cluster diagnostic information. The returned [Operation.metadata][google.longrunning.Operation.metadata] will be [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). After the operation completes, [Operation.response][google.longrunning.Operation.response] contains [DiagnoseClusterResults](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults).", + "canonical": true, + "file": "cluster_controller.diagnose_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 91, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DiagnoseCluster", + "fullName": "google.cloud.dataproc.v1.ClusterController.DiagnoseCluster", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "region", + "type": "TYPE_STRING" + }, + { + "name": "cluster_name", + "type": "TYPE_STRING" + }, + { + "name": "tarball_gcs_dir", + "type": "TYPE_STRING" + }, + { + "name": "tarball_access", + "type": ".google.cloud.dataproc.v1.DiagnoseClusterRequest.TarballAccess" + }, + { + "name": "diagnosis_interval", + "type": ".google.type.Interval" + }, + { + "name": "jobs", + "type": "TYPE_STRING[]" + }, + { + "name": "yarn_application_ids", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ClusterControllerClient", + "fullName": "google.cloud.dataproc.v1.ClusterControllerClient" + }, + "method": { + "shortName": "DiagnoseCluster", + "fullName": "google.cloud.dataproc.v1.ClusterController.DiagnoseCluster", + "service": { + "shortName": "ClusterController", + "fullName": "google.cloud.dataproc.v1.ClusterController" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_JobController_SubmitJob_async", + "title": "dataproc submitJob Sample", + "origin": "API_DEFINITION", + "description": " Submits a job to a cluster.", + "canonical": true, + "file": "job_controller.submit_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SubmitJob", + "fullName": "google.cloud.dataproc.v1.JobController.SubmitJob", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "region", + "type": "TYPE_STRING" + }, + { + "name": "job", + "type": ".google.cloud.dataproc.v1.Job" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataproc.v1.Job", + "client": { + "shortName": "JobControllerClient", + "fullName": "google.cloud.dataproc.v1.JobControllerClient" + }, + "method": { + "shortName": "SubmitJob", + "fullName": "google.cloud.dataproc.v1.JobController.SubmitJob", + "service": { + "shortName": "JobController", + "fullName": "google.cloud.dataproc.v1.JobController" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_JobController_SubmitJobAsOperation_async", + "title": "dataproc submitJobAsOperation Sample", + "origin": "API_DEFINITION", + "description": " Submits job to a cluster.", + "canonical": true, + "file": "job_controller.submit_job_as_operation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SubmitJobAsOperation", + "fullName": "google.cloud.dataproc.v1.JobController.SubmitJobAsOperation", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "region", + "type": "TYPE_STRING" + }, + { + "name": "job", + "type": ".google.cloud.dataproc.v1.Job" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "JobControllerClient", + "fullName": "google.cloud.dataproc.v1.JobControllerClient" + }, + "method": { + "shortName": "SubmitJobAsOperation", + "fullName": "google.cloud.dataproc.v1.JobController.SubmitJobAsOperation", + "service": { + "shortName": "JobController", + "fullName": "google.cloud.dataproc.v1.JobController" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_JobController_GetJob_async", + "title": "dataproc getJob Sample", + "origin": "API_DEFINITION", + "description": " Gets the resource representation for a job in a project.", + "canonical": true, + "file": "job_controller.get_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetJob", + "fullName": "google.cloud.dataproc.v1.JobController.GetJob", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "region", + "type": "TYPE_STRING" + }, + { + "name": "job_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataproc.v1.Job", + "client": { + "shortName": "JobControllerClient", + "fullName": "google.cloud.dataproc.v1.JobControllerClient" + }, + "method": { + "shortName": "GetJob", + "fullName": "google.cloud.dataproc.v1.JobController.GetJob", + "service": { + "shortName": "JobController", + "fullName": "google.cloud.dataproc.v1.JobController" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_JobController_ListJobs_async", + "title": "dataproc listJobs Sample", + "origin": "API_DEFINITION", + "description": " Lists regions/{region}/jobs in a project.", + "canonical": true, + "file": "job_controller.list_jobs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 94, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListJobs", + "fullName": "google.cloud.dataproc.v1.JobController.ListJobs", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "region", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "cluster_name", + "type": "TYPE_STRING" + }, + { + "name": "job_state_matcher", + "type": ".google.cloud.dataproc.v1.ListJobsRequest.JobStateMatcher" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataproc.v1.ListJobsResponse", + "client": { + "shortName": "JobControllerClient", + "fullName": "google.cloud.dataproc.v1.JobControllerClient" + }, + "method": { + "shortName": "ListJobs", + "fullName": "google.cloud.dataproc.v1.JobController.ListJobs", + "service": { + "shortName": "JobController", + "fullName": "google.cloud.dataproc.v1.JobController" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_JobController_UpdateJob_async", + "title": "dataproc updateJob Sample", + "origin": "API_DEFINITION", + "description": " Updates a job in a project.", + "canonical": true, + "file": "job_controller.update_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 79, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateJob", + "fullName": "google.cloud.dataproc.v1.JobController.UpdateJob", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "region", + "type": "TYPE_STRING" + }, + { + "name": "job_id", + "type": "TYPE_STRING" + }, + { + "name": "job", + "type": ".google.cloud.dataproc.v1.Job" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.dataproc.v1.Job", + "client": { + "shortName": "JobControllerClient", + "fullName": "google.cloud.dataproc.v1.JobControllerClient" + }, + "method": { + "shortName": "UpdateJob", + "fullName": "google.cloud.dataproc.v1.JobController.UpdateJob", + "service": { + "shortName": "JobController", + "fullName": "google.cloud.dataproc.v1.JobController" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_JobController_CancelJob_async", + "title": "dataproc cancelJob Sample", + "origin": "API_DEFINITION", + "description": " Starts a job cancellation request. To access the job resource after cancellation, call [regions/{region}/jobs.list](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/list) or [regions/{region}/jobs.get](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/get).", + "canonical": true, + "file": "job_controller.cancel_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CancelJob", + "fullName": "google.cloud.dataproc.v1.JobController.CancelJob", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "region", + "type": "TYPE_STRING" + }, + { + "name": "job_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataproc.v1.Job", + "client": { + "shortName": "JobControllerClient", + "fullName": "google.cloud.dataproc.v1.JobControllerClient" + }, + "method": { + "shortName": "CancelJob", + "fullName": "google.cloud.dataproc.v1.JobController.CancelJob", + "service": { + "shortName": "JobController", + "fullName": "google.cloud.dataproc.v1.JobController" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_JobController_DeleteJob_async", + "title": "dataproc deleteJob Sample", + "origin": "API_DEFINITION", + "description": " Deletes the job from the project. If the job is active, the delete fails, and the response returns `FAILED_PRECONDITION`.", + "canonical": true, + "file": "job_controller.delete_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteJob", + "fullName": "google.cloud.dataproc.v1.JobController.DeleteJob", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "region", + "type": "TYPE_STRING" + }, + { + "name": "job_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "JobControllerClient", + "fullName": "google.cloud.dataproc.v1.JobControllerClient" + }, + "method": { + "shortName": "DeleteJob", + "fullName": "google.cloud.dataproc.v1.JobController.DeleteJob", + "service": { + "shortName": "JobController", + "fullName": "google.cloud.dataproc.v1.JobController" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_NodeGroupController_CreateNodeGroup_async", + "title": "dataproc createNodeGroup Sample", + "origin": "API_DEFINITION", + "description": " Creates a node group in a cluster. The returned [Operation.metadata][google.longrunning.Operation.metadata] is [NodeGroupOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata).", + "canonical": true, + "file": "node_group_controller.create_node_group.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateNodeGroup", + "fullName": "google.cloud.dataproc.v1.NodeGroupController.CreateNodeGroup", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "node_group", + "type": ".google.cloud.dataproc.v1.NodeGroup" + }, + { + "name": "node_group_id", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NodeGroupControllerClient", + "fullName": "google.cloud.dataproc.v1.NodeGroupControllerClient" + }, + "method": { + "shortName": "CreateNodeGroup", + "fullName": "google.cloud.dataproc.v1.NodeGroupController.CreateNodeGroup", + "service": { + "shortName": "NodeGroupController", + "fullName": "google.cloud.dataproc.v1.NodeGroupController" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_NodeGroupController_ResizeNodeGroup_async", + "title": "dataproc resizeNodeGroup Sample", + "origin": "API_DEFINITION", + "description": " Resizes a node group in a cluster. The returned [Operation.metadata][google.longrunning.Operation.metadata] is [NodeGroupOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata).", + "canonical": true, + "file": "node_group_controller.resize_node_group.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 90, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ResizeNodeGroup", + "fullName": "google.cloud.dataproc.v1.NodeGroupController.ResizeNodeGroup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "size", + "type": "TYPE_INT32" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "graceful_decommission_timeout", + "type": ".google.protobuf.Duration" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "NodeGroupControllerClient", + "fullName": "google.cloud.dataproc.v1.NodeGroupControllerClient" + }, + "method": { + "shortName": "ResizeNodeGroup", + "fullName": "google.cloud.dataproc.v1.NodeGroupController.ResizeNodeGroup", + "service": { + "shortName": "NodeGroupController", + "fullName": "google.cloud.dataproc.v1.NodeGroupController" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_NodeGroupController_GetNodeGroup_async", + "title": "dataproc getNodeGroup Sample", + "origin": "API_DEFINITION", + "description": " Gets the resource representation for a node group in a cluster.", + "canonical": true, + "file": "node_group_controller.get_node_group.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetNodeGroup", + "fullName": "google.cloud.dataproc.v1.NodeGroupController.GetNodeGroup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataproc.v1.NodeGroup", + "client": { + "shortName": "NodeGroupControllerClient", + "fullName": "google.cloud.dataproc.v1.NodeGroupControllerClient" + }, + "method": { + "shortName": "GetNodeGroup", + "fullName": "google.cloud.dataproc.v1.NodeGroupController.GetNodeGroup", + "service": { + "shortName": "NodeGroupController", + "fullName": "google.cloud.dataproc.v1.NodeGroupController" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_SessionController_CreateSession_async", + "title": "dataproc createSession Sample", + "origin": "API_DEFINITION", + "description": " Create an interactive session asynchronously.", + "canonical": true, + "file": "session_controller.create_session.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSession", + "fullName": "google.cloud.dataproc.v1.SessionController.CreateSession", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "session", + "type": ".google.cloud.dataproc.v1.Session" + }, + { + "name": "session_id", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SessionControllerClient", + "fullName": "google.cloud.dataproc.v1.SessionControllerClient" + }, + "method": { + "shortName": "CreateSession", + "fullName": "google.cloud.dataproc.v1.SessionController.CreateSession", + "service": { + "shortName": "SessionController", + "fullName": "google.cloud.dataproc.v1.SessionController" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_SessionController_GetSession_async", + "title": "dataproc getSession Sample", + "origin": "API_DEFINITION", + "description": " Gets the resource representation for an interactive session.", + "canonical": true, + "file": "session_controller.get_session.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSession", + "fullName": "google.cloud.dataproc.v1.SessionController.GetSession", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataproc.v1.Session", + "client": { + "shortName": "SessionControllerClient", + "fullName": "google.cloud.dataproc.v1.SessionControllerClient" + }, + "method": { + "shortName": "GetSession", + "fullName": "google.cloud.dataproc.v1.SessionController.GetSession", + "service": { + "shortName": "SessionController", + "fullName": "google.cloud.dataproc.v1.SessionController" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_SessionController_ListSessions_async", + "title": "dataproc listSessions Sample", + "origin": "API_DEFINITION", + "description": " Lists interactive sessions.", + "canonical": true, + "file": "session_controller.list_sessions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSessions", + "fullName": "google.cloud.dataproc.v1.SessionController.ListSessions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataproc.v1.ListSessionsResponse", + "client": { + "shortName": "SessionControllerClient", + "fullName": "google.cloud.dataproc.v1.SessionControllerClient" + }, + "method": { + "shortName": "ListSessions", + "fullName": "google.cloud.dataproc.v1.SessionController.ListSessions", + "service": { + "shortName": "SessionController", + "fullName": "google.cloud.dataproc.v1.SessionController" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_SessionController_TerminateSession_async", + "title": "dataproc terminateSession Sample", + "origin": "API_DEFINITION", + "description": " Terminates the interactive session.", + "canonical": true, + "file": "session_controller.terminate_session.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TerminateSession", + "fullName": "google.cloud.dataproc.v1.SessionController.TerminateSession", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SessionControllerClient", + "fullName": "google.cloud.dataproc.v1.SessionControllerClient" + }, + "method": { + "shortName": "TerminateSession", + "fullName": "google.cloud.dataproc.v1.SessionController.TerminateSession", + "service": { + "shortName": "SessionController", + "fullName": "google.cloud.dataproc.v1.SessionController" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_SessionController_DeleteSession_async", + "title": "dataproc deleteSession Sample", + "origin": "API_DEFINITION", + "description": " Deletes the interactive session resource. If the session is not in terminal state, it is terminated, and then deleted.", + "canonical": true, + "file": "session_controller.delete_session.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteSession", + "fullName": "google.cloud.dataproc.v1.SessionController.DeleteSession", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "SessionControllerClient", + "fullName": "google.cloud.dataproc.v1.SessionControllerClient" + }, + "method": { + "shortName": "DeleteSession", + "fullName": "google.cloud.dataproc.v1.SessionController.DeleteSession", + "service": { + "shortName": "SessionController", + "fullName": "google.cloud.dataproc.v1.SessionController" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_SessionTemplateController_CreateSessionTemplate_async", + "title": "dataproc createSessionTemplate Sample", + "origin": "API_DEFINITION", + "description": " Create a session template synchronously.", + "canonical": true, + "file": "session_template_controller.create_session_template.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSessionTemplate", + "fullName": "google.cloud.dataproc.v1.SessionTemplateController.CreateSessionTemplate", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "session_template", + "type": ".google.cloud.dataproc.v1.SessionTemplate" + } + ], + "resultType": ".google.cloud.dataproc.v1.SessionTemplate", + "client": { + "shortName": "SessionTemplateControllerClient", + "fullName": "google.cloud.dataproc.v1.SessionTemplateControllerClient" + }, + "method": { + "shortName": "CreateSessionTemplate", + "fullName": "google.cloud.dataproc.v1.SessionTemplateController.CreateSessionTemplate", + "service": { + "shortName": "SessionTemplateController", + "fullName": "google.cloud.dataproc.v1.SessionTemplateController" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_SessionTemplateController_UpdateSessionTemplate_async", + "title": "dataproc updateSessionTemplate Sample", + "origin": "API_DEFINITION", + "description": " Updates the session template synchronously.", + "canonical": true, + "file": "session_template_controller.update_session_template.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSessionTemplate", + "fullName": "google.cloud.dataproc.v1.SessionTemplateController.UpdateSessionTemplate", + "async": true, + "parameters": [ + { + "name": "session_template", + "type": ".google.cloud.dataproc.v1.SessionTemplate" + } + ], + "resultType": ".google.cloud.dataproc.v1.SessionTemplate", + "client": { + "shortName": "SessionTemplateControllerClient", + "fullName": "google.cloud.dataproc.v1.SessionTemplateControllerClient" + }, + "method": { + "shortName": "UpdateSessionTemplate", + "fullName": "google.cloud.dataproc.v1.SessionTemplateController.UpdateSessionTemplate", + "service": { + "shortName": "SessionTemplateController", + "fullName": "google.cloud.dataproc.v1.SessionTemplateController" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_SessionTemplateController_GetSessionTemplate_async", + "title": "dataproc getSessionTemplate Sample", + "origin": "API_DEFINITION", + "description": " Gets the resource representation for a session template.", + "canonical": true, + "file": "session_template_controller.get_session_template.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSessionTemplate", + "fullName": "google.cloud.dataproc.v1.SessionTemplateController.GetSessionTemplate", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataproc.v1.SessionTemplate", + "client": { + "shortName": "SessionTemplateControllerClient", + "fullName": "google.cloud.dataproc.v1.SessionTemplateControllerClient" + }, + "method": { + "shortName": "GetSessionTemplate", + "fullName": "google.cloud.dataproc.v1.SessionTemplateController.GetSessionTemplate", + "service": { + "shortName": "SessionTemplateController", + "fullName": "google.cloud.dataproc.v1.SessionTemplateController" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_SessionTemplateController_ListSessionTemplates_async", + "title": "dataproc listSessionTemplates Sample", + "origin": "API_DEFINITION", + "description": " Lists session templates.", + "canonical": true, + "file": "session_template_controller.list_session_templates.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSessionTemplates", + "fullName": "google.cloud.dataproc.v1.SessionTemplateController.ListSessionTemplates", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataproc.v1.ListSessionTemplatesResponse", + "client": { + "shortName": "SessionTemplateControllerClient", + "fullName": "google.cloud.dataproc.v1.SessionTemplateControllerClient" + }, + "method": { + "shortName": "ListSessionTemplates", + "fullName": "google.cloud.dataproc.v1.SessionTemplateController.ListSessionTemplates", + "service": { + "shortName": "SessionTemplateController", + "fullName": "google.cloud.dataproc.v1.SessionTemplateController" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_SessionTemplateController_DeleteSessionTemplate_async", + "title": "dataproc deleteSessionTemplate Sample", + "origin": "API_DEFINITION", + "description": " Deletes a session template.", + "canonical": true, + "file": "session_template_controller.delete_session_template.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteSessionTemplate", + "fullName": "google.cloud.dataproc.v1.SessionTemplateController.DeleteSessionTemplate", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "SessionTemplateControllerClient", + "fullName": "google.cloud.dataproc.v1.SessionTemplateControllerClient" + }, + "method": { + "shortName": "DeleteSessionTemplate", + "fullName": "google.cloud.dataproc.v1.SessionTemplateController.DeleteSessionTemplate", + "service": { + "shortName": "SessionTemplateController", + "fullName": "google.cloud.dataproc.v1.SessionTemplateController" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_WorkflowTemplateService_CreateWorkflowTemplate_async", + "title": "dataproc createWorkflowTemplate Sample", + "origin": "API_DEFINITION", + "description": " Creates new workflow template.", + "canonical": true, + "file": "workflow_template_service.create_workflow_template.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateWorkflowTemplate", + "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "template", + "type": ".google.cloud.dataproc.v1.WorkflowTemplate" + } + ], + "resultType": ".google.cloud.dataproc.v1.WorkflowTemplate", + "client": { + "shortName": "WorkflowTemplateServiceClient", + "fullName": "google.cloud.dataproc.v1.WorkflowTemplateServiceClient" + }, + "method": { + "shortName": "CreateWorkflowTemplate", + "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate", + "service": { + "shortName": "WorkflowTemplateService", + "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_WorkflowTemplateService_GetWorkflowTemplate_async", + "title": "dataproc getWorkflowTemplate Sample", + "origin": "API_DEFINITION", + "description": " Retrieves the latest workflow template. Can retrieve previously instantiated template by specifying optional version parameter.", + "canonical": true, + "file": "workflow_template_service.get_workflow_template.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetWorkflowTemplate", + "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService.GetWorkflowTemplate", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "version", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.cloud.dataproc.v1.WorkflowTemplate", + "client": { + "shortName": "WorkflowTemplateServiceClient", + "fullName": "google.cloud.dataproc.v1.WorkflowTemplateServiceClient" + }, + "method": { + "shortName": "GetWorkflowTemplate", + "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService.GetWorkflowTemplate", + "service": { + "shortName": "WorkflowTemplateService", + "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_WorkflowTemplateService_InstantiateWorkflowTemplate_async", + "title": "dataproc instantiateWorkflowTemplate Sample", + "origin": "API_DEFINITION", + "description": " Instantiates a template and begins execution. The returned Operation can be used to track execution of workflow by polling [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when entire workflow is finished. The running workflow can be aborted via [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted. The [Operation.metadata][google.longrunning.Operation.metadata] will be [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see [Using WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). On successful completion, [Operation.response][google.longrunning.Operation.response] will be [Empty][google.protobuf.Empty].", + "canonical": true, + "file": "workflow_template_service.instantiate_workflow_template.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 84, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "InstantiateWorkflowTemplate", + "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "version", + "type": "TYPE_INT32" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "parameters", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "WorkflowTemplateServiceClient", + "fullName": "google.cloud.dataproc.v1.WorkflowTemplateServiceClient" + }, + "method": { + "shortName": "InstantiateWorkflowTemplate", + "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate", + "service": { + "shortName": "WorkflowTemplateService", + "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_WorkflowTemplateService_InstantiateInlineWorkflowTemplate_async", + "title": "dataproc instantiateInlineWorkflowTemplate Sample", + "origin": "API_DEFINITION", + "description": " Instantiates a template and begins execution. This method is equivalent to executing the sequence [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate], [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate], [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate]. The returned Operation can be used to track execution of workflow by polling [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when entire workflow is finished. The running workflow can be aborted via [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted. The [Operation.metadata][google.longrunning.Operation.metadata] will be [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see [Using WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). On successful completion, [Operation.response][google.longrunning.Operation.response] will be [Empty][google.protobuf.Empty].", + "canonical": true, + "file": "workflow_template_service.instantiate_inline_workflow_template.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "InstantiateInlineWorkflowTemplate", + "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateInlineWorkflowTemplate", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "template", + "type": ".google.cloud.dataproc.v1.WorkflowTemplate" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "WorkflowTemplateServiceClient", + "fullName": "google.cloud.dataproc.v1.WorkflowTemplateServiceClient" + }, + "method": { + "shortName": "InstantiateInlineWorkflowTemplate", + "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateInlineWorkflowTemplate", + "service": { + "shortName": "WorkflowTemplateService", + "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_WorkflowTemplateService_UpdateWorkflowTemplate_async", + "title": "dataproc updateWorkflowTemplate Sample", + "origin": "API_DEFINITION", + "description": " Updates (replaces) workflow template. The updated template must contain version that matches the current server version.", + "canonical": true, + "file": "workflow_template_service.update_workflow_template.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateWorkflowTemplate", + "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService.UpdateWorkflowTemplate", + "async": true, + "parameters": [ + { + "name": "template", + "type": ".google.cloud.dataproc.v1.WorkflowTemplate" + } + ], + "resultType": ".google.cloud.dataproc.v1.WorkflowTemplate", + "client": { + "shortName": "WorkflowTemplateServiceClient", + "fullName": "google.cloud.dataproc.v1.WorkflowTemplateServiceClient" + }, + "method": { + "shortName": "UpdateWorkflowTemplate", + "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService.UpdateWorkflowTemplate", + "service": { + "shortName": "WorkflowTemplateService", + "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_WorkflowTemplateService_ListWorkflowTemplates_async", + "title": "dataproc listWorkflowTemplates Sample", + "origin": "API_DEFINITION", + "description": " Lists workflows that match the specified filter in the request.", + "canonical": true, + "file": "workflow_template_service.list_workflow_templates.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListWorkflowTemplates", + "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService.ListWorkflowTemplates", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.dataproc.v1.ListWorkflowTemplatesResponse", + "client": { + "shortName": "WorkflowTemplateServiceClient", + "fullName": "google.cloud.dataproc.v1.WorkflowTemplateServiceClient" + }, + "method": { + "shortName": "ListWorkflowTemplates", + "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService.ListWorkflowTemplates", + "service": { + "shortName": "WorkflowTemplateService", + "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService" + } + } + } + }, + { + "regionTag": "dataproc_v1_generated_WorkflowTemplateService_DeleteWorkflowTemplate_async", + "title": "dataproc deleteWorkflowTemplate Sample", + "origin": "API_DEFINITION", + "description": " Deletes a workflow template. It does not cancel in-progress workflows.", + "canonical": true, + "file": "workflow_template_service.delete_workflow_template.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteWorkflowTemplate", + "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "version", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "WorkflowTemplateServiceClient", + "fullName": "google.cloud.dataproc.v1.WorkflowTemplateServiceClient" + }, + "method": { + "shortName": "DeleteWorkflowTemplate", + "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate", + "service": { + "shortName": "WorkflowTemplateService", + "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.create_workflow_template.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.create_workflow_template.js new file mode 100644 index 000000000000..abb7e20e3bd2 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.create_workflow_template.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(parent, template) { + // [START dataproc_v1_generated_WorkflowTemplateService_CreateWorkflowTemplate_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 name of the region or location, as described + * in https://cloud.google.com/apis/design/resource_names. + * * For `projects.regions.workflowTemplates.create`, the resource name of the + * region has the following format: + * `projects/{project_id}/regions/{region}` + * * For `projects.locations.workflowTemplates.create`, the resource name of + * the location has the following format: + * `projects/{project_id}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Required. The Dataproc workflow template to create. + */ + // const template = {} + + // Imports the Dataproc library + const {WorkflowTemplateServiceClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new WorkflowTemplateServiceClient(); + + async function callCreateWorkflowTemplate() { + // Construct request + const request = { + parent, + template, + }; + + // Run request + const response = await dataprocClient.createWorkflowTemplate(request); + console.log(response); + } + + callCreateWorkflowTemplate(); + // [END dataproc_v1_generated_WorkflowTemplateService_CreateWorkflowTemplate_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-dataproc/samples/generated/v1/workflow_template_service.delete_workflow_template.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.delete_workflow_template.js new file mode 100644 index 000000000000..4dc811740332 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.delete_workflow_template.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 dataproc_v1_generated_WorkflowTemplateService_DeleteWorkflowTemplate_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 name of the workflow template, as described + * in https://cloud.google.com/apis/design/resource_names. + * * For `projects.regions.workflowTemplates.delete`, the resource name + * of the template has the following format: + * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` + * * For `projects.locations.workflowTemplates.instantiate`, the resource name + * of the template has the following format: + * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` + */ + // const name = 'abc123' + /** + * Optional. The version of workflow template to delete. If specified, + * will only delete the template if the current server version matches + * specified version. + */ + // const version = 1234 + + // Imports the Dataproc library + const {WorkflowTemplateServiceClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new WorkflowTemplateServiceClient(); + + async function callDeleteWorkflowTemplate() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataprocClient.deleteWorkflowTemplate(request); + console.log(response); + } + + callDeleteWorkflowTemplate(); + // [END dataproc_v1_generated_WorkflowTemplateService_DeleteWorkflowTemplate_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-dataproc/samples/generated/v1/workflow_template_service.get_workflow_template.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.get_workflow_template.js new file mode 100644 index 000000000000..ae08acc46bb1 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.get_workflow_template.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 dataproc_v1_generated_WorkflowTemplateService_GetWorkflowTemplate_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 name of the workflow template, as described + * in https://cloud.google.com/apis/design/resource_names. + * * For `projects.regions.workflowTemplates.get`, the resource name of the + * template has the following format: + * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` + * * For `projects.locations.workflowTemplates.get`, the resource name of the + * template has the following format: + * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` + */ + // const name = 'abc123' + /** + * Optional. The version of workflow template to retrieve. Only previously + * instantiated versions can be retrieved. + * If unspecified, retrieves the current version. + */ + // const version = 1234 + + // Imports the Dataproc library + const {WorkflowTemplateServiceClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new WorkflowTemplateServiceClient(); + + async function callGetWorkflowTemplate() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await dataprocClient.getWorkflowTemplate(request); + console.log(response); + } + + callGetWorkflowTemplate(); + // [END dataproc_v1_generated_WorkflowTemplateService_GetWorkflowTemplate_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-dataproc/samples/generated/v1/workflow_template_service.instantiate_inline_workflow_template.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.instantiate_inline_workflow_template.js new file mode 100644 index 000000000000..f26c9ff34ea9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.instantiate_inline_workflow_template.js @@ -0,0 +1,84 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, template) { + // [START dataproc_v1_generated_WorkflowTemplateService_InstantiateInlineWorkflowTemplate_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 name of the region or location, as described + * in https://cloud.google.com/apis/design/resource_names. + * * For `projects.regions.workflowTemplates,instantiateinline`, the resource + * name of the region has the following format: + * `projects/{project_id}/regions/{region}` + * * For `projects.locations.workflowTemplates.instantiateinline`, the + * resource name of the location has the following format: + * `projects/{project_id}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Required. The workflow template to instantiate. + */ + // const template = {} + /** + * Optional. A tag that prevents multiple concurrent workflow + * instances with the same tag from running. This mitigates risk of + * concurrent instances started due to retries. + * It is recommended to always set this value to a + * UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier). + * The tag must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + */ + // const requestId = 'abc123' + + // Imports the Dataproc library + const {WorkflowTemplateServiceClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new WorkflowTemplateServiceClient(); + + async function callInstantiateInlineWorkflowTemplate() { + // Construct request + const request = { + parent, + template, + }; + + // Run request + const [operation] = await dataprocClient.instantiateInlineWorkflowTemplate(request); + const [response] = await operation.promise(); + console.log(response); + } + + callInstantiateInlineWorkflowTemplate(); + // [END dataproc_v1_generated_WorkflowTemplateService_InstantiateInlineWorkflowTemplate_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-dataproc/samples/generated/v1/workflow_template_service.instantiate_workflow_template.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.instantiate_workflow_template.js new file mode 100644 index 000000000000..3024a20ab9f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.instantiate_workflow_template.js @@ -0,0 +1,92 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 dataproc_v1_generated_WorkflowTemplateService_InstantiateWorkflowTemplate_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 name of the workflow template, as described + * in https://cloud.google.com/apis/design/resource_names. + * * For `projects.regions.workflowTemplates.instantiate`, the resource name + * of the template has the following format: + * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` + * * For `projects.locations.workflowTemplates.instantiate`, the resource name + * of the template has the following format: + * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` + */ + // const name = 'abc123' + /** + * Optional. The version of workflow template to instantiate. If specified, + * the workflow will be instantiated only if the current version of + * the workflow template has the supplied version. + * This option cannot be used to instantiate a previous version of + * workflow template. + */ + // const version = 1234 + /** + * Optional. A tag that prevents multiple concurrent workflow + * instances with the same tag from running. This mitigates risk of + * concurrent instances started due to retries. + * It is recommended to always set this value to a + * UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier). + * The tag must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + */ + // const requestId = 'abc123' + /** + * Optional. Map from parameter names to values that should be used for those + * parameters. Values may not exceed 1000 characters. + */ + // const parameters = [1,2,3,4] + + // Imports the Dataproc library + const {WorkflowTemplateServiceClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new WorkflowTemplateServiceClient(); + + async function callInstantiateWorkflowTemplate() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await dataprocClient.instantiateWorkflowTemplate(request); + const [response] = await operation.promise(); + console.log(response); + } + + callInstantiateWorkflowTemplate(); + // [END dataproc_v1_generated_WorkflowTemplateService_InstantiateWorkflowTemplate_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-dataproc/samples/generated/v1/workflow_template_service.list_workflow_templates.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.list_workflow_templates.js new file mode 100644 index 000000000000..24f5dc549461 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.list_workflow_templates.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 dataproc_v1_generated_WorkflowTemplateService_ListWorkflowTemplates_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 name of the region or location, as described + * in https://cloud.google.com/apis/design/resource_names. + * * For `projects.regions.workflowTemplates,list`, the resource + * name of the region has the following format: + * `projects/{project_id}/regions/{region}` + * * For `projects.locations.workflowTemplates.list`, the + * resource name of the location has the following format: + * `projects/{project_id}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of results to return in each response. + */ + // const pageSize = 1234 + /** + * Optional. The page token, returned by a previous call, to request the + * next page of results. + */ + // const pageToken = 'abc123' + + // Imports the Dataproc library + const {WorkflowTemplateServiceClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new WorkflowTemplateServiceClient(); + + async function callListWorkflowTemplates() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = dataprocClient.listWorkflowTemplatesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListWorkflowTemplates(); + // [END dataproc_v1_generated_WorkflowTemplateService_ListWorkflowTemplates_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-dataproc/samples/generated/v1/workflow_template_service.update_workflow_template.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.update_workflow_template.js new file mode 100644 index 000000000000..f9d2e24d2c95 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.update_workflow_template.js @@ -0,0 +1,62 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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(template) { + // [START dataproc_v1_generated_WorkflowTemplateService_UpdateWorkflowTemplate_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 updated workflow template. + * The `template.version` field must match the current version. + */ + // const template = {} + + // Imports the Dataproc library + const {WorkflowTemplateServiceClient} = require('@google-cloud/dataproc').v1; + + // Instantiates a client + const dataprocClient = new WorkflowTemplateServiceClient(); + + async function callUpdateWorkflowTemplate() { + // Construct request + const request = { + template, + }; + + // Run request + const response = await dataprocClient.updateWorkflowTemplate(request); + console.log(response); + } + + callUpdateWorkflowTemplate(); + // [END dataproc_v1_generated_WorkflowTemplateService_UpdateWorkflowTemplate_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-dataproc/src/index.ts b/owl-bot-staging/google-cloud-dataproc/src/index.ts new file mode 100644 index 000000000000..49417fe6517c --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/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 v1 from './v1'; + +const AutoscalingPolicyServiceClient = v1.AutoscalingPolicyServiceClient; +type AutoscalingPolicyServiceClient = v1.AutoscalingPolicyServiceClient; +const BatchControllerClient = v1.BatchControllerClient; +type BatchControllerClient = v1.BatchControllerClient; +const ClusterControllerClient = v1.ClusterControllerClient; +type ClusterControllerClient = v1.ClusterControllerClient; +const JobControllerClient = v1.JobControllerClient; +type JobControllerClient = v1.JobControllerClient; +const NodeGroupControllerClient = v1.NodeGroupControllerClient; +type NodeGroupControllerClient = v1.NodeGroupControllerClient; +const SessionControllerClient = v1.SessionControllerClient; +type SessionControllerClient = v1.SessionControllerClient; +const SessionTemplateControllerClient = v1.SessionTemplateControllerClient; +type SessionTemplateControllerClient = v1.SessionTemplateControllerClient; +const WorkflowTemplateServiceClient = v1.WorkflowTemplateServiceClient; +type WorkflowTemplateServiceClient = v1.WorkflowTemplateServiceClient; + +export {v1, AutoscalingPolicyServiceClient, BatchControllerClient, ClusterControllerClient, JobControllerClient, NodeGroupControllerClient, SessionControllerClient, SessionTemplateControllerClient, WorkflowTemplateServiceClient}; +export default {v1, AutoscalingPolicyServiceClient, BatchControllerClient, ClusterControllerClient, JobControllerClient, NodeGroupControllerClient, SessionControllerClient, SessionTemplateControllerClient, WorkflowTemplateServiceClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/autoscaling_policy_service_client.ts b/owl-bot-staging/google-cloud-dataproc/src/v1/autoscaling_policy_service_client.ts new file mode 100644 index 000000000000..0c01e0777c56 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/src/v1/autoscaling_policy_service_client.ts @@ -0,0 +1,1627 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, IamClient, IamProtos} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/autoscaling_policy_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './autoscaling_policy_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The API interface for managing autoscaling policies in the + * Dataproc API. + * @class + * @memberof v1 + */ +export class AutoscalingPolicyServiceClient { + 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('dataproc'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + autoscalingPolicyServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AutoscalingPolicyServiceClient. + * + * @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 AutoscalingPolicyServiceClient({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 AutoscalingPolicyServiceClient; + 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 = 'dataproc.' + 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.iamClient = new this._gaxModule.IamClient(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 = { + batchPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batches/{batch}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + nodeGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{node_group}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectLocationAutoscalingPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/autoscalingPolicies/{autoscaling_policy}' + ), + projectLocationWorkflowTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/workflowTemplates/{workflow_template}' + ), + projectRegionAutoscalingPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/regions/{region}/autoscalingPolicies/{autoscaling_policy}' + ), + projectRegionWorkflowTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/regions/{region}/workflowTemplates/{workflow_template}' + ), + sessionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/sessions/{session}' + ), + sessionTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/sessionTemplates/{template}' + ), + }; + + // 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 = { + listAutoscalingPolicies: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'policies') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dataproc.v1.AutoscalingPolicyService', 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.autoscalingPolicyServiceStub) { + return this.autoscalingPolicyServiceStub; + } + + // Put together the "service stub" for + // google.cloud.dataproc.v1.AutoscalingPolicyService. + this.autoscalingPolicyServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.dataproc.v1.AutoscalingPolicyService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dataproc.v1.AutoscalingPolicyService, + 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 autoscalingPolicyServiceStubMethods = + ['createAutoscalingPolicy', 'updateAutoscalingPolicy', 'getAutoscalingPolicy', 'listAutoscalingPolicies', 'deleteAutoscalingPolicy']; + for (const methodName of autoscalingPolicyServiceStubMethods) { + const callPromise = this.autoscalingPolicyServiceStub.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.autoscalingPolicyServiceStub; + } + + /** + * 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 'dataproc.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 'dataproc.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 -- + // ------------------- +/** + * Creates new autoscaling policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The "resource name" of the region or location, as described + * in https://cloud.google.com/apis/design/resource_names. + * + * * For `projects.regions.autoscalingPolicies.create`, the resource name + * of the region has the following format: + * `projects/{project_id}/regions/{region}` + * + * * For `projects.locations.autoscalingPolicies.create`, the resource name + * of the location has the following format: + * `projects/{project_id}/locations/{location}` + * @param {google.cloud.dataproc.v1.AutoscalingPolicy} request.policy + * Required. The autoscaling policy to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.dataproc.v1.AutoscalingPolicy|AutoscalingPolicy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/autoscaling_policy_service.create_autoscaling_policy.js + * region_tag:dataproc_v1_generated_AutoscalingPolicyService_CreateAutoscalingPolicy_async + */ + createAutoscalingPolicy( + request?: protos.google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataproc.v1.IAutoscalingPolicy, + protos.google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest|undefined, {}|undefined + ]>; + createAutoscalingPolicy( + request: protos.google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataproc.v1.IAutoscalingPolicy, + protos.google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest|null|undefined, + {}|null|undefined>): void; + createAutoscalingPolicy( + request: protos.google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest, + callback: Callback< + protos.google.cloud.dataproc.v1.IAutoscalingPolicy, + protos.google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest|null|undefined, + {}|null|undefined>): void; + createAutoscalingPolicy( + request?: protos.google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataproc.v1.IAutoscalingPolicy, + protos.google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataproc.v1.IAutoscalingPolicy, + protos.google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataproc.v1.IAutoscalingPolicy, + protos.google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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('createAutoscalingPolicy request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.dataproc.v1.IAutoscalingPolicy, + protos.google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createAutoscalingPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createAutoscalingPolicy(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.dataproc.v1.IAutoscalingPolicy, + protos.google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest|undefined, + {}|undefined + ]) => { + this._log.info('createAutoscalingPolicy response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates (replaces) autoscaling policy. + * + * Disabled check for update_mask, because all updates will be full + * replacements. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dataproc.v1.AutoscalingPolicy} request.policy + * Required. The updated autoscaling policy. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.dataproc.v1.AutoscalingPolicy|AutoscalingPolicy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/autoscaling_policy_service.update_autoscaling_policy.js + * region_tag:dataproc_v1_generated_AutoscalingPolicyService_UpdateAutoscalingPolicy_async + */ + updateAutoscalingPolicy( + request?: protos.google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataproc.v1.IAutoscalingPolicy, + protos.google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest|undefined, {}|undefined + ]>; + updateAutoscalingPolicy( + request: protos.google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataproc.v1.IAutoscalingPolicy, + protos.google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest|null|undefined, + {}|null|undefined>): void; + updateAutoscalingPolicy( + request: protos.google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest, + callback: Callback< + protos.google.cloud.dataproc.v1.IAutoscalingPolicy, + protos.google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest|null|undefined, + {}|null|undefined>): void; + updateAutoscalingPolicy( + request?: protos.google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataproc.v1.IAutoscalingPolicy, + protos.google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataproc.v1.IAutoscalingPolicy, + protos.google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataproc.v1.IAutoscalingPolicy, + protos.google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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({ + 'policy.name': request.policy!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateAutoscalingPolicy request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.dataproc.v1.IAutoscalingPolicy, + protos.google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateAutoscalingPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateAutoscalingPolicy(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.dataproc.v1.IAutoscalingPolicy, + protos.google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateAutoscalingPolicy 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; + }); + } +/** + * Retrieves autoscaling policy. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The "resource name" of the autoscaling policy, as described + * in https://cloud.google.com/apis/design/resource_names. + * + * * For `projects.regions.autoscalingPolicies.get`, the resource name + * of the policy has the following format: + * `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` + * + * * For `projects.locations.autoscalingPolicies.get`, the resource name + * of the policy has the following format: + * `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.dataproc.v1.AutoscalingPolicy|AutoscalingPolicy}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/autoscaling_policy_service.get_autoscaling_policy.js + * region_tag:dataproc_v1_generated_AutoscalingPolicyService_GetAutoscalingPolicy_async + */ + getAutoscalingPolicy( + request?: protos.google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataproc.v1.IAutoscalingPolicy, + protos.google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest|undefined, {}|undefined + ]>; + getAutoscalingPolicy( + request: protos.google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataproc.v1.IAutoscalingPolicy, + protos.google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest|null|undefined, + {}|null|undefined>): void; + getAutoscalingPolicy( + request: protos.google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest, + callback: Callback< + protos.google.cloud.dataproc.v1.IAutoscalingPolicy, + protos.google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest|null|undefined, + {}|null|undefined>): void; + getAutoscalingPolicy( + request?: protos.google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataproc.v1.IAutoscalingPolicy, + protos.google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataproc.v1.IAutoscalingPolicy, + protos.google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataproc.v1.IAutoscalingPolicy, + protos.google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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('getAutoscalingPolicy request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.dataproc.v1.IAutoscalingPolicy, + protos.google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAutoscalingPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getAutoscalingPolicy(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.dataproc.v1.IAutoscalingPolicy, + protos.google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest|undefined, + {}|undefined + ]) => { + this._log.info('getAutoscalingPolicy 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 autoscaling policy. It is an error to delete an autoscaling + * policy that is in use by one or more clusters. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The "resource name" of the autoscaling policy, as described + * in https://cloud.google.com/apis/design/resource_names. + * + * * For `projects.regions.autoscalingPolicies.delete`, the resource name + * of the policy has the following format: + * `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` + * + * * For `projects.locations.autoscalingPolicies.delete`, the resource name + * of the policy has the following format: + * `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/autoscaling_policy_service.delete_autoscaling_policy.js + * region_tag:dataproc_v1_generated_AutoscalingPolicyService_DeleteAutoscalingPolicy_async + */ + deleteAutoscalingPolicy( + request?: protos.google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest|undefined, {}|undefined + ]>; + deleteAutoscalingPolicy( + request: protos.google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest|null|undefined, + {}|null|undefined>): void; + deleteAutoscalingPolicy( + request: protos.google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest|null|undefined, + {}|null|undefined>): void; + deleteAutoscalingPolicy( + request?: protos.google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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('deleteAutoscalingPolicy request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteAutoscalingPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteAutoscalingPolicy(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteAutoscalingPolicy 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 autoscaling policies in the project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The "resource name" of the region or location, as described + * in https://cloud.google.com/apis/design/resource_names. + * + * * For `projects.regions.autoscalingPolicies.list`, the resource name + * of the region has the following format: + * `projects/{project_id}/regions/{region}` + * + * * For `projects.locations.autoscalingPolicies.list`, the resource name + * of the location has the following format: + * `projects/{project_id}/locations/{location}` + * @param {number} [request.pageSize] + * Optional. The maximum number of results to return in each response. + * Must be less than or equal to 1000. Defaults to 100. + * @param {string} [request.pageToken] + * Optional. The page token, returned by a previous call, to request the + * next page of results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.dataproc.v1.AutoscalingPolicy|AutoscalingPolicy}. + * 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 `listAutoscalingPoliciesAsync()` + * 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. + */ + listAutoscalingPolicies( + request?: protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataproc.v1.IAutoscalingPolicy[], + protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest|null, + protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse + ]>; + listAutoscalingPolicies( + request: protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest, + protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse|null|undefined, + protos.google.cloud.dataproc.v1.IAutoscalingPolicy>): void; + listAutoscalingPolicies( + request: protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest, + callback: PaginationCallback< + protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest, + protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse|null|undefined, + protos.google.cloud.dataproc.v1.IAutoscalingPolicy>): void; + listAutoscalingPolicies( + request?: protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest, + protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse|null|undefined, + protos.google.cloud.dataproc.v1.IAutoscalingPolicy>, + callback?: PaginationCallback< + protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest, + protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse|null|undefined, + protos.google.cloud.dataproc.v1.IAutoscalingPolicy>): + Promise<[ + protos.google.cloud.dataproc.v1.IAutoscalingPolicy[], + protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest|null, + protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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.dataproc.v1.IListAutoscalingPoliciesRequest, + protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse|null|undefined, + protos.google.cloud.dataproc.v1.IAutoscalingPolicy>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAutoscalingPolicies values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAutoscalingPolicies request %j', request); + return this.innerApiCalls + .listAutoscalingPolicies(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.dataproc.v1.IAutoscalingPolicy[], + protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest|null, + protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse + ]) => { + this._log.info('listAutoscalingPolicies values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listAutoscalingPolicies`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The "resource name" of the region or location, as described + * in https://cloud.google.com/apis/design/resource_names. + * + * * For `projects.regions.autoscalingPolicies.list`, the resource name + * of the region has the following format: + * `projects/{project_id}/regions/{region}` + * + * * For `projects.locations.autoscalingPolicies.list`, the resource name + * of the location has the following format: + * `projects/{project_id}/locations/{location}` + * @param {number} [request.pageSize] + * Optional. The maximum number of results to return in each response. + * Must be less than or equal to 1000. Defaults to 100. + * @param {string} [request.pageToken] + * Optional. The page token, returned by a previous call, to request the + * next page of results. + * @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.dataproc.v1.AutoscalingPolicy|AutoscalingPolicy} 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 `listAutoscalingPoliciesAsync()` + * 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. + */ + listAutoscalingPoliciesStream( + request?: protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest, + 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['listAutoscalingPolicies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listAutoscalingPolicies stream %j', request); + return this.descriptors.page.listAutoscalingPolicies.createStream( + this.innerApiCalls.listAutoscalingPolicies as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listAutoscalingPolicies`, 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 "resource name" of the region or location, as described + * in https://cloud.google.com/apis/design/resource_names. + * + * * For `projects.regions.autoscalingPolicies.list`, the resource name + * of the region has the following format: + * `projects/{project_id}/regions/{region}` + * + * * For `projects.locations.autoscalingPolicies.list`, the resource name + * of the location has the following format: + * `projects/{project_id}/locations/{location}` + * @param {number} [request.pageSize] + * Optional. The maximum number of results to return in each response. + * Must be less than or equal to 1000. Defaults to 100. + * @param {string} [request.pageToken] + * Optional. The page token, returned by a previous call, to request the + * next page of results. + * @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.dataproc.v1.AutoscalingPolicy|AutoscalingPolicy}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/autoscaling_policy_service.list_autoscaling_policies.js + * region_tag:dataproc_v1_generated_AutoscalingPolicyService_ListAutoscalingPolicies_async + */ + listAutoscalingPoliciesAsync( + request?: protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest, + 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['listAutoscalingPolicies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listAutoscalingPolicies iterate %j', request); + return this.descriptors.page.listAutoscalingPolicies.asyncIterate( + this.innerApiCalls['listAutoscalingPolicies'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @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 {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @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/interfaces/CallOptions.html | 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.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified batch resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch + * @returns {string} Resource name string. + */ + batchPath(project:string,location:string,batch:string) { + return this.pathTemplates.batchPathTemplate.render({ + project: project, + location: location, + batch: batch, + }); + } + + /** + * Parse the project from Batch resource. + * + * @param {string} batchName + * A fully-qualified path representing Batch resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchName(batchName: string) { + return this.pathTemplates.batchPathTemplate.match(batchName).project; + } + + /** + * Parse the location from Batch resource. + * + * @param {string} batchName + * A fully-qualified path representing Batch resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchName(batchName: string) { + return this.pathTemplates.batchPathTemplate.match(batchName).location; + } + + /** + * Parse the batch from Batch resource. + * + * @param {string} batchName + * A fully-qualified path representing Batch resource. + * @returns {string} A string representing the batch. + */ + matchBatchFromBatchName(batchName: string) { + return this.pathTemplates.batchPathTemplate.match(batchName).batch; + } + + /** + * 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 nodeGroup resource name string. + * + * @param {string} project + * @param {string} region + * @param {string} cluster + * @param {string} node_group + * @returns {string} Resource name string. + */ + nodeGroupPath(project:string,region:string,cluster:string,nodeGroup:string) { + return this.pathTemplates.nodeGroupPathTemplate.render({ + project: project, + region: region, + cluster: cluster, + node_group: nodeGroup, + }); + } + + /** + * Parse the project from NodeGroup resource. + * + * @param {string} nodeGroupName + * A fully-qualified path representing NodeGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNodeGroupName(nodeGroupName: string) { + return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).project; + } + + /** + * Parse the region from NodeGroup resource. + * + * @param {string} nodeGroupName + * A fully-qualified path representing NodeGroup resource. + * @returns {string} A string representing the region. + */ + matchRegionFromNodeGroupName(nodeGroupName: string) { + return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).region; + } + + /** + * Parse the cluster from NodeGroup resource. + * + * @param {string} nodeGroupName + * A fully-qualified path representing NodeGroup resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromNodeGroupName(nodeGroupName: string) { + return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).cluster; + } + + /** + * Parse the node_group from NodeGroup resource. + * + * @param {string} nodeGroupName + * A fully-qualified path representing NodeGroup resource. + * @returns {string} A string representing the node_group. + */ + matchNodeGroupFromNodeGroupName(nodeGroupName: string) { + return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).node_group; + } + + /** + * 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 projectLocationAutoscalingPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} autoscaling_policy + * @returns {string} Resource name string. + */ + projectLocationAutoscalingPolicyPath(project:string,location:string,autoscalingPolicy:string) { + return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render({ + project: project, + location: location, + autoscaling_policy: autoscalingPolicy, + }); + } + + /** + * Parse the project from ProjectLocationAutoscalingPolicy resource. + * + * @param {string} projectLocationAutoscalingPolicyName + * A fully-qualified path representing project_location_autoscaling_policy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { + return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).project; + } + + /** + * Parse the location from ProjectLocationAutoscalingPolicy resource. + * + * @param {string} projectLocationAutoscalingPolicyName + * A fully-qualified path representing project_location_autoscaling_policy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { + return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).location; + } + + /** + * Parse the autoscaling_policy from ProjectLocationAutoscalingPolicy resource. + * + * @param {string} projectLocationAutoscalingPolicyName + * A fully-qualified path representing project_location_autoscaling_policy resource. + * @returns {string} A string representing the autoscaling_policy. + */ + matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { + return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).autoscaling_policy; + } + + /** + * Return a fully-qualified projectLocationWorkflowTemplate resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} workflow_template + * @returns {string} Resource name string. + */ + projectLocationWorkflowTemplatePath(project:string,location:string,workflowTemplate:string) { + return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render({ + project: project, + location: location, + workflow_template: workflowTemplate, + }); + } + + /** + * Parse the project from ProjectLocationWorkflowTemplate resource. + * + * @param {string} projectLocationWorkflowTemplateName + * A fully-qualified path representing project_location_workflow_template resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { + return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).project; + } + + /** + * Parse the location from ProjectLocationWorkflowTemplate resource. + * + * @param {string} projectLocationWorkflowTemplateName + * A fully-qualified path representing project_location_workflow_template resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { + return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).location; + } + + /** + * Parse the workflow_template from ProjectLocationWorkflowTemplate resource. + * + * @param {string} projectLocationWorkflowTemplateName + * A fully-qualified path representing project_location_workflow_template resource. + * @returns {string} A string representing the workflow_template. + */ + matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { + return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).workflow_template; + } + + /** + * Return a fully-qualified projectRegionAutoscalingPolicy resource name string. + * + * @param {string} project + * @param {string} region + * @param {string} autoscaling_policy + * @returns {string} Resource name string. + */ + projectRegionAutoscalingPolicyPath(project:string,region:string,autoscalingPolicy:string) { + return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render({ + project: project, + region: region, + autoscaling_policy: autoscalingPolicy, + }); + } + + /** + * Parse the project from ProjectRegionAutoscalingPolicy resource. + * + * @param {string} projectRegionAutoscalingPolicyName + * A fully-qualified path representing project_region_autoscaling_policy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { + return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).project; + } + + /** + * Parse the region from ProjectRegionAutoscalingPolicy resource. + * + * @param {string} projectRegionAutoscalingPolicyName + * A fully-qualified path representing project_region_autoscaling_policy resource. + * @returns {string} A string representing the region. + */ + matchRegionFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { + return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).region; + } + + /** + * Parse the autoscaling_policy from ProjectRegionAutoscalingPolicy resource. + * + * @param {string} projectRegionAutoscalingPolicyName + * A fully-qualified path representing project_region_autoscaling_policy resource. + * @returns {string} A string representing the autoscaling_policy. + */ + matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { + return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).autoscaling_policy; + } + + /** + * Return a fully-qualified projectRegionWorkflowTemplate resource name string. + * + * @param {string} project + * @param {string} region + * @param {string} workflow_template + * @returns {string} Resource name string. + */ + projectRegionWorkflowTemplatePath(project:string,region:string,workflowTemplate:string) { + return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render({ + project: project, + region: region, + workflow_template: workflowTemplate, + }); + } + + /** + * Parse the project from ProjectRegionWorkflowTemplate resource. + * + * @param {string} projectRegionWorkflowTemplateName + * A fully-qualified path representing project_region_workflow_template resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { + return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).project; + } + + /** + * Parse the region from ProjectRegionWorkflowTemplate resource. + * + * @param {string} projectRegionWorkflowTemplateName + * A fully-qualified path representing project_region_workflow_template resource. + * @returns {string} A string representing the region. + */ + matchRegionFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { + return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).region; + } + + /** + * Parse the workflow_template from ProjectRegionWorkflowTemplate resource. + * + * @param {string} projectRegionWorkflowTemplateName + * A fully-qualified path representing project_region_workflow_template resource. + * @returns {string} A string representing the workflow_template. + */ + matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { + return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).workflow_template; + } + + /** + * Return a fully-qualified session resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} session + * @returns {string} Resource name string. + */ + sessionPath(project:string,location:string,session:string) { + return this.pathTemplates.sessionPathTemplate.render({ + project: project, + location: location, + session: session, + }); + } + + /** + * Parse the project from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).project; + } + + /** + * Parse the location from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).location; + } + + /** + * Parse the session from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the session. + */ + matchSessionFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).session; + } + + /** + * Return a fully-qualified sessionTemplate resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} template + * @returns {string} Resource name string. + */ + sessionTemplatePath(project:string,location:string,template:string) { + return this.pathTemplates.sessionTemplatePathTemplate.render({ + project: project, + location: location, + template: template, + }); + } + + /** + * Parse the project from SessionTemplate resource. + * + * @param {string} sessionTemplateName + * A fully-qualified path representing SessionTemplate resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSessionTemplateName(sessionTemplateName: string) { + return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).project; + } + + /** + * Parse the location from SessionTemplate resource. + * + * @param {string} sessionTemplateName + * A fully-qualified path representing SessionTemplate resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSessionTemplateName(sessionTemplateName: string) { + return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).location; + } + + /** + * Parse the template from SessionTemplate resource. + * + * @param {string} sessionTemplateName + * A fully-qualified path representing SessionTemplate resource. + * @returns {string} A string representing the template. + */ + matchTemplateFromSessionTemplateName(sessionTemplateName: string) { + return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).template; + } + + /** + * 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.autoscalingPolicyServiceStub && !this._terminated) { + return this.autoscalingPolicyServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.iamClient.close().catch(err => {throw err}); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/autoscaling_policy_service_client_config.json b/owl-bot-staging/google-cloud-dataproc/src/v1/autoscaling_policy_service_client_config.json new file mode 100644 index 000000000000..09bd892268fc --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/src/v1/autoscaling_policy_service_client_config.json @@ -0,0 +1,51 @@ +{ + "interfaces": { + "google.cloud.dataproc.v1.AutoscalingPolicyService": { + "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": { + "CreateAutoscalingPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateAutoscalingPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "GetAutoscalingPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListAutoscalingPolicies": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "DeleteAutoscalingPolicy": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/autoscaling_policy_service_proto_list.json b/owl-bot-staging/google-cloud-dataproc/src/v1/autoscaling_policy_service_proto_list.json new file mode 100644 index 000000000000..d6798f50ae7c --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/src/v1/autoscaling_policy_service_proto_list.json @@ -0,0 +1,12 @@ +[ + "../../protos/google/cloud/dataproc/v1/autoscaling_policies.proto", + "../../protos/google/cloud/dataproc/v1/batches.proto", + "../../protos/google/cloud/dataproc/v1/clusters.proto", + "../../protos/google/cloud/dataproc/v1/jobs.proto", + "../../protos/google/cloud/dataproc/v1/node_groups.proto", + "../../protos/google/cloud/dataproc/v1/operations.proto", + "../../protos/google/cloud/dataproc/v1/session_templates.proto", + "../../protos/google/cloud/dataproc/v1/sessions.proto", + "../../protos/google/cloud/dataproc/v1/shared.proto", + "../../protos/google/cloud/dataproc/v1/workflow_templates.proto" +] diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/batch_controller_client.ts b/owl-bot-staging/google-cloud-dataproc/src/v1/batch_controller_client.ts new file mode 100644 index 000000000000..2e9ea824d9d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/src/v1/batch_controller_client.ts @@ -0,0 +1,1832 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, IamClient, IamProtos} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/batch_controller_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './batch_controller_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The BatchController provides methods to manage batch workloads. + * @class + * @memberof v1 + */ +export class BatchControllerClient { + 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('dataproc'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + batchControllerStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of BatchControllerClient. + * + * @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 BatchControllerClient({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 BatchControllerClient; + 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 = 'dataproc.' + 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.iamClient = new this._gaxModule.IamClient(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 = { + batchPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batches/{batch}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + nodeGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{node_group}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectLocationAutoscalingPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/autoscalingPolicies/{autoscaling_policy}' + ), + projectLocationWorkflowTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/workflowTemplates/{workflow_template}' + ), + projectRegionAutoscalingPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/regions/{region}/autoscalingPolicies/{autoscaling_policy}' + ), + projectRegionWorkflowTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/regions/{region}/workflowTemplates/{workflow_template}' + ), + sessionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/sessions/{session}' + ), + sessionTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/sessionTemplates/{template}' + ), + }; + + // 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 = { + listBatches: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'batches') + }; + + 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.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1/{resource=projects/*/regions/*/clusters/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:getIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/regions/*/clusters/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/regions/*/clusters/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:testIamPermissions',body: '*',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/regions/*/operations/*}:cancel',additional_bindings: [{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/regions/*/operations/*}',additional_bindings: [{delete: '/v1/{name=projects/*/locations/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/regions/*/operations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/regions/*/operations}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*/operations}',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const createBatchResponse = protoFilesRoot.lookup( + '.google.cloud.dataproc.v1.Batch') as gax.protobuf.Type; + const createBatchMetadata = protoFilesRoot.lookup( + '.google.cloud.dataproc.v1.BatchOperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createBatch: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createBatchResponse.decode.bind(createBatchResponse), + createBatchMetadata.decode.bind(createBatchMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dataproc.v1.BatchController', 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.batchControllerStub) { + return this.batchControllerStub; + } + + // Put together the "service stub" for + // google.cloud.dataproc.v1.BatchController. + this.batchControllerStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.dataproc.v1.BatchController') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dataproc.v1.BatchController, + 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 batchControllerStubMethods = + ['createBatch', 'getBatch', 'listBatches', 'deleteBatch']; + for (const methodName of batchControllerStubMethods) { + const callPromise = this.batchControllerStub.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.batchControllerStub; + } + + /** + * 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 'dataproc.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 'dataproc.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 the batch workload resource representation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The fully qualified name of the batch to retrieve + * in the format + * "projects/PROJECT_ID/locations/DATAPROC_REGION/batches/BATCH_ID" + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.dataproc.v1.Batch|Batch}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/batch_controller.get_batch.js + * region_tag:dataproc_v1_generated_BatchController_GetBatch_async + */ + getBatch( + request?: protos.google.cloud.dataproc.v1.IGetBatchRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataproc.v1.IBatch, + protos.google.cloud.dataproc.v1.IGetBatchRequest|undefined, {}|undefined + ]>; + getBatch( + request: protos.google.cloud.dataproc.v1.IGetBatchRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataproc.v1.IBatch, + protos.google.cloud.dataproc.v1.IGetBatchRequest|null|undefined, + {}|null|undefined>): void; + getBatch( + request: protos.google.cloud.dataproc.v1.IGetBatchRequest, + callback: Callback< + protos.google.cloud.dataproc.v1.IBatch, + protos.google.cloud.dataproc.v1.IGetBatchRequest|null|undefined, + {}|null|undefined>): void; + getBatch( + request?: protos.google.cloud.dataproc.v1.IGetBatchRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataproc.v1.IBatch, + protos.google.cloud.dataproc.v1.IGetBatchRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataproc.v1.IBatch, + protos.google.cloud.dataproc.v1.IGetBatchRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataproc.v1.IBatch, + protos.google.cloud.dataproc.v1.IGetBatchRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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('getBatch request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.dataproc.v1.IBatch, + protos.google.cloud.dataproc.v1.IGetBatchRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getBatch response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getBatch(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.dataproc.v1.IBatch, + protos.google.cloud.dataproc.v1.IGetBatchRequest|undefined, + {}|undefined + ]) => { + this._log.info('getBatch response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes the batch workload resource. If the batch is not in terminal state, + * the delete fails and the response returns `FAILED_PRECONDITION`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The fully qualified name of the batch to retrieve + * in the format + * "projects/PROJECT_ID/locations/DATAPROC_REGION/batches/BATCH_ID" + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/batch_controller.delete_batch.js + * region_tag:dataproc_v1_generated_BatchController_DeleteBatch_async + */ + deleteBatch( + request?: protos.google.cloud.dataproc.v1.IDeleteBatchRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteBatchRequest|undefined, {}|undefined + ]>; + deleteBatch( + request: protos.google.cloud.dataproc.v1.IDeleteBatchRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteBatchRequest|null|undefined, + {}|null|undefined>): void; + deleteBatch( + request: protos.google.cloud.dataproc.v1.IDeleteBatchRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteBatchRequest|null|undefined, + {}|null|undefined>): void; + deleteBatch( + request?: protos.google.cloud.dataproc.v1.IDeleteBatchRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteBatchRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteBatchRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteBatchRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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('deleteBatch request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteBatchRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteBatch response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteBatch(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteBatchRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteBatch 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 batch workload that executes asynchronously. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource where this batch will be created. + * @param {google.cloud.dataproc.v1.Batch} request.batch + * Required. The batch to create. + * @param {string} [request.batchId] + * Optional. The ID to use for the batch, which will become the final + * component of the batch's resource name. + * + * This value must be 4-63 characters. Valid characters are `/{@link protos.0-9|a-z}-/`. + * @param {string} [request.requestId] + * Optional. A unique ID used to identify the request. If the service + * receives two + * [CreateBatchRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateBatchRequest)s + * with the same request_id, the second request is ignored and the + * Operation that corresponds to the first Batch created and stored + * in the backend is returned. + * + * Recommendation: Set this value to a + * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + * + * The value must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/batch_controller.create_batch.js + * region_tag:dataproc_v1_generated_BatchController_CreateBatch_async + */ + createBatch( + request?: protos.google.cloud.dataproc.v1.ICreateBatchRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createBatch( + request: protos.google.cloud.dataproc.v1.ICreateBatchRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createBatch( + request: protos.google.cloud.dataproc.v1.ICreateBatchRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createBatch( + request?: protos.google.cloud.dataproc.v1.ICreateBatchRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createBatch response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createBatch request %j', request); + return this.innerApiCalls.createBatch(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createBatch response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createBatch()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/batch_controller.create_batch.js + * region_tag:dataproc_v1_generated_BatchController_CreateBatch_async + */ + async checkCreateBatchProgress(name: string): Promise>{ + this._log.info('createBatch 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.createBatch, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists batch workloads. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of batches. + * @param {number} [request.pageSize] + * Optional. The maximum number of batches to return in each response. + * The service may return fewer than this value. + * The default page size is 20; the maximum page size is 1000. + * @param {string} [request.pageToken] + * Optional. A page token received from a previous `ListBatches` call. + * Provide this token to retrieve the subsequent page. + * @param {string} [request.filter] + * Optional. A filter for the batches to return in the response. + * + * A filter is a logical expression constraining the values of various fields + * in each batch resource. Filters are case sensitive, and may contain + * multiple clauses combined with logical operators (AND/OR). + * Supported fields are `batch_id`, `batch_uuid`, `state`, and `create_time`. + * + * e.g. `state = RUNNING and create_time < "2023-01-01T00:00:00Z"` + * filters for batches in state RUNNING that were created before 2023-01-01 + * + * See https://google.aip.dev/assets/misc/ebnf-filtering.txt for a detailed + * description of the filter syntax and a list of supported comparisons. + * @param {string} [request.orderBy] + * Optional. Field(s) on which to sort the list of batches. + * + * Currently the only supported sort orders are unspecified (empty) and + * `create_time desc` to sort by most recently created batches first. + * + * See https://google.aip.dev/132#ordering for more details. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.dataproc.v1.Batch|Batch}. + * 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 `listBatchesAsync()` + * 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. + */ + listBatches( + request?: protos.google.cloud.dataproc.v1.IListBatchesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataproc.v1.IBatch[], + protos.google.cloud.dataproc.v1.IListBatchesRequest|null, + protos.google.cloud.dataproc.v1.IListBatchesResponse + ]>; + listBatches( + request: protos.google.cloud.dataproc.v1.IListBatchesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dataproc.v1.IListBatchesRequest, + protos.google.cloud.dataproc.v1.IListBatchesResponse|null|undefined, + protos.google.cloud.dataproc.v1.IBatch>): void; + listBatches( + request: protos.google.cloud.dataproc.v1.IListBatchesRequest, + callback: PaginationCallback< + protos.google.cloud.dataproc.v1.IListBatchesRequest, + protos.google.cloud.dataproc.v1.IListBatchesResponse|null|undefined, + protos.google.cloud.dataproc.v1.IBatch>): void; + listBatches( + request?: protos.google.cloud.dataproc.v1.IListBatchesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.dataproc.v1.IListBatchesRequest, + protos.google.cloud.dataproc.v1.IListBatchesResponse|null|undefined, + protos.google.cloud.dataproc.v1.IBatch>, + callback?: PaginationCallback< + protos.google.cloud.dataproc.v1.IListBatchesRequest, + protos.google.cloud.dataproc.v1.IListBatchesResponse|null|undefined, + protos.google.cloud.dataproc.v1.IBatch>): + Promise<[ + protos.google.cloud.dataproc.v1.IBatch[], + protos.google.cloud.dataproc.v1.IListBatchesRequest|null, + protos.google.cloud.dataproc.v1.IListBatchesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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.dataproc.v1.IListBatchesRequest, + protos.google.cloud.dataproc.v1.IListBatchesResponse|null|undefined, + protos.google.cloud.dataproc.v1.IBatch>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listBatches values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listBatches request %j', request); + return this.innerApiCalls + .listBatches(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.dataproc.v1.IBatch[], + protos.google.cloud.dataproc.v1.IListBatchesRequest|null, + protos.google.cloud.dataproc.v1.IListBatchesResponse + ]) => { + this._log.info('listBatches values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listBatches`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of batches. + * @param {number} [request.pageSize] + * Optional. The maximum number of batches to return in each response. + * The service may return fewer than this value. + * The default page size is 20; the maximum page size is 1000. + * @param {string} [request.pageToken] + * Optional. A page token received from a previous `ListBatches` call. + * Provide this token to retrieve the subsequent page. + * @param {string} [request.filter] + * Optional. A filter for the batches to return in the response. + * + * A filter is a logical expression constraining the values of various fields + * in each batch resource. Filters are case sensitive, and may contain + * multiple clauses combined with logical operators (AND/OR). + * Supported fields are `batch_id`, `batch_uuid`, `state`, and `create_time`. + * + * e.g. `state = RUNNING and create_time < "2023-01-01T00:00:00Z"` + * filters for batches in state RUNNING that were created before 2023-01-01 + * + * See https://google.aip.dev/assets/misc/ebnf-filtering.txt for a detailed + * description of the filter syntax and a list of supported comparisons. + * @param {string} [request.orderBy] + * Optional. Field(s) on which to sort the list of batches. + * + * Currently the only supported sort orders are unspecified (empty) and + * `create_time desc` to sort by most recently created batches first. + * + * See https://google.aip.dev/132#ordering for more details. + * @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.dataproc.v1.Batch|Batch} 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 `listBatchesAsync()` + * 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. + */ + listBatchesStream( + request?: protos.google.cloud.dataproc.v1.IListBatchesRequest, + 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['listBatches']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listBatches stream %j', request); + return this.descriptors.page.listBatches.createStream( + this.innerApiCalls.listBatches as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listBatches`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of batches. + * @param {number} [request.pageSize] + * Optional. The maximum number of batches to return in each response. + * The service may return fewer than this value. + * The default page size is 20; the maximum page size is 1000. + * @param {string} [request.pageToken] + * Optional. A page token received from a previous `ListBatches` call. + * Provide this token to retrieve the subsequent page. + * @param {string} [request.filter] + * Optional. A filter for the batches to return in the response. + * + * A filter is a logical expression constraining the values of various fields + * in each batch resource. Filters are case sensitive, and may contain + * multiple clauses combined with logical operators (AND/OR). + * Supported fields are `batch_id`, `batch_uuid`, `state`, and `create_time`. + * + * e.g. `state = RUNNING and create_time < "2023-01-01T00:00:00Z"` + * filters for batches in state RUNNING that were created before 2023-01-01 + * + * See https://google.aip.dev/assets/misc/ebnf-filtering.txt for a detailed + * description of the filter syntax and a list of supported comparisons. + * @param {string} [request.orderBy] + * Optional. Field(s) on which to sort the list of batches. + * + * Currently the only supported sort orders are unspecified (empty) and + * `create_time desc` to sort by most recently created batches first. + * + * See https://google.aip.dev/132#ordering for more details. + * @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.dataproc.v1.Batch|Batch}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/batch_controller.list_batches.js + * region_tag:dataproc_v1_generated_BatchController_ListBatches_async + */ + listBatchesAsync( + request?: protos.google.cloud.dataproc.v1.IListBatchesRequest, + 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['listBatches']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listBatches iterate %j', request); + return this.descriptors.page.listBatches.asyncIterate( + this.innerApiCalls['listBatches'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @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 {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @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/interfaces/CallOptions.html | 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.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@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 batch resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch + * @returns {string} Resource name string. + */ + batchPath(project:string,location:string,batch:string) { + return this.pathTemplates.batchPathTemplate.render({ + project: project, + location: location, + batch: batch, + }); + } + + /** + * Parse the project from Batch resource. + * + * @param {string} batchName + * A fully-qualified path representing Batch resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchName(batchName: string) { + return this.pathTemplates.batchPathTemplate.match(batchName).project; + } + + /** + * Parse the location from Batch resource. + * + * @param {string} batchName + * A fully-qualified path representing Batch resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchName(batchName: string) { + return this.pathTemplates.batchPathTemplate.match(batchName).location; + } + + /** + * Parse the batch from Batch resource. + * + * @param {string} batchName + * A fully-qualified path representing Batch resource. + * @returns {string} A string representing the batch. + */ + matchBatchFromBatchName(batchName: string) { + return this.pathTemplates.batchPathTemplate.match(batchName).batch; + } + + /** + * 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 nodeGroup resource name string. + * + * @param {string} project + * @param {string} region + * @param {string} cluster + * @param {string} node_group + * @returns {string} Resource name string. + */ + nodeGroupPath(project:string,region:string,cluster:string,nodeGroup:string) { + return this.pathTemplates.nodeGroupPathTemplate.render({ + project: project, + region: region, + cluster: cluster, + node_group: nodeGroup, + }); + } + + /** + * Parse the project from NodeGroup resource. + * + * @param {string} nodeGroupName + * A fully-qualified path representing NodeGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNodeGroupName(nodeGroupName: string) { + return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).project; + } + + /** + * Parse the region from NodeGroup resource. + * + * @param {string} nodeGroupName + * A fully-qualified path representing NodeGroup resource. + * @returns {string} A string representing the region. + */ + matchRegionFromNodeGroupName(nodeGroupName: string) { + return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).region; + } + + /** + * Parse the cluster from NodeGroup resource. + * + * @param {string} nodeGroupName + * A fully-qualified path representing NodeGroup resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromNodeGroupName(nodeGroupName: string) { + return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).cluster; + } + + /** + * Parse the node_group from NodeGroup resource. + * + * @param {string} nodeGroupName + * A fully-qualified path representing NodeGroup resource. + * @returns {string} A string representing the node_group. + */ + matchNodeGroupFromNodeGroupName(nodeGroupName: string) { + return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).node_group; + } + + /** + * 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 projectLocationAutoscalingPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} autoscaling_policy + * @returns {string} Resource name string. + */ + projectLocationAutoscalingPolicyPath(project:string,location:string,autoscalingPolicy:string) { + return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render({ + project: project, + location: location, + autoscaling_policy: autoscalingPolicy, + }); + } + + /** + * Parse the project from ProjectLocationAutoscalingPolicy resource. + * + * @param {string} projectLocationAutoscalingPolicyName + * A fully-qualified path representing project_location_autoscaling_policy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { + return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).project; + } + + /** + * Parse the location from ProjectLocationAutoscalingPolicy resource. + * + * @param {string} projectLocationAutoscalingPolicyName + * A fully-qualified path representing project_location_autoscaling_policy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { + return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).location; + } + + /** + * Parse the autoscaling_policy from ProjectLocationAutoscalingPolicy resource. + * + * @param {string} projectLocationAutoscalingPolicyName + * A fully-qualified path representing project_location_autoscaling_policy resource. + * @returns {string} A string representing the autoscaling_policy. + */ + matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { + return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).autoscaling_policy; + } + + /** + * Return a fully-qualified projectLocationWorkflowTemplate resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} workflow_template + * @returns {string} Resource name string. + */ + projectLocationWorkflowTemplatePath(project:string,location:string,workflowTemplate:string) { + return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render({ + project: project, + location: location, + workflow_template: workflowTemplate, + }); + } + + /** + * Parse the project from ProjectLocationWorkflowTemplate resource. + * + * @param {string} projectLocationWorkflowTemplateName + * A fully-qualified path representing project_location_workflow_template resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { + return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).project; + } + + /** + * Parse the location from ProjectLocationWorkflowTemplate resource. + * + * @param {string} projectLocationWorkflowTemplateName + * A fully-qualified path representing project_location_workflow_template resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { + return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).location; + } + + /** + * Parse the workflow_template from ProjectLocationWorkflowTemplate resource. + * + * @param {string} projectLocationWorkflowTemplateName + * A fully-qualified path representing project_location_workflow_template resource. + * @returns {string} A string representing the workflow_template. + */ + matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { + return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).workflow_template; + } + + /** + * Return a fully-qualified projectRegionAutoscalingPolicy resource name string. + * + * @param {string} project + * @param {string} region + * @param {string} autoscaling_policy + * @returns {string} Resource name string. + */ + projectRegionAutoscalingPolicyPath(project:string,region:string,autoscalingPolicy:string) { + return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render({ + project: project, + region: region, + autoscaling_policy: autoscalingPolicy, + }); + } + + /** + * Parse the project from ProjectRegionAutoscalingPolicy resource. + * + * @param {string} projectRegionAutoscalingPolicyName + * A fully-qualified path representing project_region_autoscaling_policy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { + return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).project; + } + + /** + * Parse the region from ProjectRegionAutoscalingPolicy resource. + * + * @param {string} projectRegionAutoscalingPolicyName + * A fully-qualified path representing project_region_autoscaling_policy resource. + * @returns {string} A string representing the region. + */ + matchRegionFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { + return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).region; + } + + /** + * Parse the autoscaling_policy from ProjectRegionAutoscalingPolicy resource. + * + * @param {string} projectRegionAutoscalingPolicyName + * A fully-qualified path representing project_region_autoscaling_policy resource. + * @returns {string} A string representing the autoscaling_policy. + */ + matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { + return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).autoscaling_policy; + } + + /** + * Return a fully-qualified projectRegionWorkflowTemplate resource name string. + * + * @param {string} project + * @param {string} region + * @param {string} workflow_template + * @returns {string} Resource name string. + */ + projectRegionWorkflowTemplatePath(project:string,region:string,workflowTemplate:string) { + return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render({ + project: project, + region: region, + workflow_template: workflowTemplate, + }); + } + + /** + * Parse the project from ProjectRegionWorkflowTemplate resource. + * + * @param {string} projectRegionWorkflowTemplateName + * A fully-qualified path representing project_region_workflow_template resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { + return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).project; + } + + /** + * Parse the region from ProjectRegionWorkflowTemplate resource. + * + * @param {string} projectRegionWorkflowTemplateName + * A fully-qualified path representing project_region_workflow_template resource. + * @returns {string} A string representing the region. + */ + matchRegionFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { + return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).region; + } + + /** + * Parse the workflow_template from ProjectRegionWorkflowTemplate resource. + * + * @param {string} projectRegionWorkflowTemplateName + * A fully-qualified path representing project_region_workflow_template resource. + * @returns {string} A string representing the workflow_template. + */ + matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { + return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).workflow_template; + } + + /** + * Return a fully-qualified session resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} session + * @returns {string} Resource name string. + */ + sessionPath(project:string,location:string,session:string) { + return this.pathTemplates.sessionPathTemplate.render({ + project: project, + location: location, + session: session, + }); + } + + /** + * Parse the project from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).project; + } + + /** + * Parse the location from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).location; + } + + /** + * Parse the session from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the session. + */ + matchSessionFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).session; + } + + /** + * Return a fully-qualified sessionTemplate resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} template + * @returns {string} Resource name string. + */ + sessionTemplatePath(project:string,location:string,template:string) { + return this.pathTemplates.sessionTemplatePathTemplate.render({ + project: project, + location: location, + template: template, + }); + } + + /** + * Parse the project from SessionTemplate resource. + * + * @param {string} sessionTemplateName + * A fully-qualified path representing SessionTemplate resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSessionTemplateName(sessionTemplateName: string) { + return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).project; + } + + /** + * Parse the location from SessionTemplate resource. + * + * @param {string} sessionTemplateName + * A fully-qualified path representing SessionTemplate resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSessionTemplateName(sessionTemplateName: string) { + return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).location; + } + + /** + * Parse the template from SessionTemplate resource. + * + * @param {string} sessionTemplateName + * A fully-qualified path representing SessionTemplate resource. + * @returns {string} A string representing the template. + */ + matchTemplateFromSessionTemplateName(sessionTemplateName: string) { + return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).template; + } + + /** + * 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.batchControllerStub && !this._terminated) { + return this.batchControllerStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.iamClient.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-dataproc/src/v1/batch_controller_client_config.json b/owl-bot-staging/google-cloud-dataproc/src/v1/batch_controller_client_config.json new file mode 100644 index 000000000000..a451087cbb21 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/src/v1/batch_controller_client_config.json @@ -0,0 +1,42 @@ +{ + "interfaces": { + "google.cloud.dataproc.v1.BatchController": { + "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": { + "CreateBatch": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetBatch": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListBatches": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteBatch": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/batch_controller_proto_list.json b/owl-bot-staging/google-cloud-dataproc/src/v1/batch_controller_proto_list.json new file mode 100644 index 000000000000..d6798f50ae7c --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/src/v1/batch_controller_proto_list.json @@ -0,0 +1,12 @@ +[ + "../../protos/google/cloud/dataproc/v1/autoscaling_policies.proto", + "../../protos/google/cloud/dataproc/v1/batches.proto", + "../../protos/google/cloud/dataproc/v1/clusters.proto", + "../../protos/google/cloud/dataproc/v1/jobs.proto", + "../../protos/google/cloud/dataproc/v1/node_groups.proto", + "../../protos/google/cloud/dataproc/v1/operations.proto", + "../../protos/google/cloud/dataproc/v1/session_templates.proto", + "../../protos/google/cloud/dataproc/v1/sessions.proto", + "../../protos/google/cloud/dataproc/v1/shared.proto", + "../../protos/google/cloud/dataproc/v1/workflow_templates.proto" +] diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/cluster_controller_client.ts b/owl-bot-staging/google-cloud-dataproc/src/v1/cluster_controller_client.ts new file mode 100644 index 000000000000..5427df49e68c --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/src/v1/cluster_controller_client.ts @@ -0,0 +1,2563 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, IamClient, IamProtos} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/cluster_controller_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './cluster_controller_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The ClusterControllerService provides methods to manage clusters + * of Compute Engine instances. + * @class + * @memberof v1 + */ +export class ClusterControllerClient { + 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('dataproc'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + clusterControllerStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ClusterControllerClient. + * + * @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 ClusterControllerClient({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 ClusterControllerClient; + 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 = 'dataproc.' + 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.iamClient = new this._gaxModule.IamClient(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 = { + batchPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batches/{batch}' + ), + cryptoKeyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}' + ), + nodeGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{node_group}' + ), + projectLocationAutoscalingPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/autoscalingPolicies/{autoscaling_policy}' + ), + projectLocationWorkflowTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/workflowTemplates/{workflow_template}' + ), + projectRegionAutoscalingPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/regions/{region}/autoscalingPolicies/{autoscaling_policy}' + ), + projectRegionWorkflowTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/regions/{region}/workflowTemplates/{workflow_template}' + ), + servicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/services/{service}' + ), + sessionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/sessions/{session}' + ), + sessionTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/sessionTemplates/{template}' + ), + }; + + // 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 = { + listClusters: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'clusters') + }; + + 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.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1/{resource=projects/*/regions/*/clusters/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:getIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/regions/*/clusters/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/regions/*/clusters/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:testIamPermissions',body: '*',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/regions/*/operations/*}:cancel',additional_bindings: [{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/regions/*/operations/*}',additional_bindings: [{delete: '/v1/{name=projects/*/locations/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/regions/*/operations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/regions/*/operations}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*/operations}',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const createClusterResponse = protoFilesRoot.lookup( + '.google.cloud.dataproc.v1.Cluster') as gax.protobuf.Type; + const createClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.dataproc.v1.ClusterOperationMetadata') as gax.protobuf.Type; + const updateClusterResponse = protoFilesRoot.lookup( + '.google.cloud.dataproc.v1.Cluster') as gax.protobuf.Type; + const updateClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.dataproc.v1.ClusterOperationMetadata') as gax.protobuf.Type; + const stopClusterResponse = protoFilesRoot.lookup( + '.google.cloud.dataproc.v1.Cluster') as gax.protobuf.Type; + const stopClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.dataproc.v1.ClusterOperationMetadata') as gax.protobuf.Type; + const startClusterResponse = protoFilesRoot.lookup( + '.google.cloud.dataproc.v1.Cluster') as gax.protobuf.Type; + const startClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.dataproc.v1.ClusterOperationMetadata') as gax.protobuf.Type; + const deleteClusterResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.dataproc.v1.ClusterOperationMetadata') as gax.protobuf.Type; + const diagnoseClusterResponse = protoFilesRoot.lookup( + '.google.cloud.dataproc.v1.DiagnoseClusterResults') as gax.protobuf.Type; + const diagnoseClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.dataproc.v1.ClusterOperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createClusterResponse.decode.bind(createClusterResponse), + createClusterMetadata.decode.bind(createClusterMetadata)), + updateCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateClusterResponse.decode.bind(updateClusterResponse), + updateClusterMetadata.decode.bind(updateClusterMetadata)), + stopCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + stopClusterResponse.decode.bind(stopClusterResponse), + stopClusterMetadata.decode.bind(stopClusterMetadata)), + startCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + startClusterResponse.decode.bind(startClusterResponse), + startClusterMetadata.decode.bind(startClusterMetadata)), + deleteCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteClusterResponse.decode.bind(deleteClusterResponse), + deleteClusterMetadata.decode.bind(deleteClusterMetadata)), + diagnoseCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + diagnoseClusterResponse.decode.bind(diagnoseClusterResponse), + diagnoseClusterMetadata.decode.bind(diagnoseClusterMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dataproc.v1.ClusterController', 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.clusterControllerStub) { + return this.clusterControllerStub; + } + + // Put together the "service stub" for + // google.cloud.dataproc.v1.ClusterController. + this.clusterControllerStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.dataproc.v1.ClusterController') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dataproc.v1.ClusterController, + 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 clusterControllerStubMethods = + ['createCluster', 'updateCluster', 'stopCluster', 'startCluster', 'deleteCluster', 'getCluster', 'listClusters', 'diagnoseCluster']; + for (const methodName of clusterControllerStubMethods) { + const callPromise = this.clusterControllerStub.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.clusterControllerStub; + } + + /** + * 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 'dataproc.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 'dataproc.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 the resource representation for a cluster in a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the Google Cloud Platform project that the cluster + * belongs to. + * @param {string} request.region + * Required. The Dataproc region in which to handle the request. + * @param {string} request.clusterName + * Required. The cluster 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.dataproc.v1.Cluster|Cluster}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/cluster_controller.get_cluster.js + * region_tag:dataproc_v1_generated_ClusterController_GetCluster_async + */ + getCluster( + request?: protos.google.cloud.dataproc.v1.IGetClusterRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataproc.v1.ICluster, + protos.google.cloud.dataproc.v1.IGetClusterRequest|undefined, {}|undefined + ]>; + getCluster( + request: protos.google.cloud.dataproc.v1.IGetClusterRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataproc.v1.ICluster, + protos.google.cloud.dataproc.v1.IGetClusterRequest|null|undefined, + {}|null|undefined>): void; + getCluster( + request: protos.google.cloud.dataproc.v1.IGetClusterRequest, + callback: Callback< + protos.google.cloud.dataproc.v1.ICluster, + protos.google.cloud.dataproc.v1.IGetClusterRequest|null|undefined, + {}|null|undefined>): void; + getCluster( + request?: protos.google.cloud.dataproc.v1.IGetClusterRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataproc.v1.ICluster, + protos.google.cloud.dataproc.v1.IGetClusterRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataproc.v1.ICluster, + protos.google.cloud.dataproc.v1.IGetClusterRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataproc.v1.ICluster, + protos.google.cloud.dataproc.v1.IGetClusterRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'project_id': request.projectId?.toString() ?? '', + 'region': request.region ?? '', + 'cluster_name': request.clusterName ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getCluster request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.dataproc.v1.ICluster, + protos.google.cloud.dataproc.v1.IGetClusterRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCluster response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getCluster(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.dataproc.v1.ICluster, + protos.google.cloud.dataproc.v1.IGetClusterRequest|undefined, + {}|undefined + ]) => { + this._log.info('getCluster 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 cluster in a project. The returned + * {@link protos.google.longrunning.Operation.metadata|Operation.metadata} will be + * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the Google Cloud Platform project that the cluster + * belongs to. + * @param {string} request.region + * Required. The Dataproc region in which to handle the request. + * @param {google.cloud.dataproc.v1.Cluster} request.cluster + * Required. The cluster to create. + * @param {string} [request.requestId] + * Optional. A unique ID used to identify the request. If the server receives + * two + * [CreateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateClusterRequest)s + * with the same id, then the second request will be ignored and the + * first {@link protos.google.longrunning.Operation|google.longrunning.Operation} created + * and stored in the backend is returned. + * + * It is recommended to always set this value to a + * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + * + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + * @param {google.cloud.dataproc.v1.FailureAction} [request.actionOnFailedPrimaryWorkers] + * Optional. Failure action when primary worker creation fails. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/cluster_controller.create_cluster.js + * region_tag:dataproc_v1_generated_ClusterController_CreateCluster_async + */ + createCluster( + request?: protos.google.cloud.dataproc.v1.ICreateClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createCluster( + request: protos.google.cloud.dataproc.v1.ICreateClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createCluster( + request: protos.google.cloud.dataproc.v1.ICreateClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createCluster( + request?: protos.google.cloud.dataproc.v1.ICreateClusterRequest, + 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({ + 'project_id': request.projectId?.toString() ?? '', + 'region': request.region ?? '', + }); + 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('createCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createCluster request %j', request); + return this.innerApiCalls.createCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/cluster_controller.create_cluster.js + * region_tag:dataproc_v1_generated_ClusterController_CreateCluster_async + */ + async checkCreateClusterProgress(name: string): Promise>{ + this._log.info('createCluster 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.createCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates a cluster in a project. The returned + * {@link protos.google.longrunning.Operation.metadata|Operation.metadata} will be + * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). + * The cluster must be in a + * {@link protos.google.cloud.dataproc.v1.ClusterStatus.State|`RUNNING`} state or an error + * is returned. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the Google Cloud Platform project the + * cluster belongs to. + * @param {string} request.region + * Required. The Dataproc region in which to handle the request. + * @param {string} request.clusterName + * Required. The cluster name. + * @param {google.cloud.dataproc.v1.Cluster} request.cluster + * Required. The changes to the cluster. + * @param {google.protobuf.Duration} [request.gracefulDecommissionTimeout] + * Optional. Timeout for graceful YARN decommissioning. Graceful + * decommissioning allows removing nodes from the cluster without + * interrupting jobs in progress. Timeout specifies how long to wait for jobs + * in progress to finish before forcefully removing nodes (and potentially + * interrupting jobs). Default timeout is 0 (for forceful decommission), and + * the maximum allowed timeout is 1 day. (see JSON representation of + * [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). + * + * Only supported on Dataproc image versions 1.2 and higher. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Specifies the path, relative to `Cluster`, of + * the field to update. For example, to change the number of workers + * in a cluster to 5, the `update_mask` parameter would be + * specified as `config.worker_config.num_instances`, + * and the `PATCH` request body would specify the new value, as follows: + * + * { + * "config":{ + * "workerConfig":{ + * "numInstances":"5" + * } + * } + * } + * Similarly, to change the number of preemptible workers in a cluster to 5, + * the `update_mask` parameter would be + * `config.secondary_worker_config.num_instances`, and the `PATCH` request + * body would be set as follows: + * + * { + * "config":{ + * "secondaryWorkerConfig":{ + * "numInstances":"5" + * } + * } + * } + * Note: Currently, only the following fields can be updated: + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
MaskPurpose
labelsUpdate labels
config.worker_config.num_instancesResize primary worker group
config.secondary_worker_config.num_instancesResize secondary worker group
config.autoscaling_config.policy_uriUse, stop using, or + * change autoscaling policies
+ * @param {string} [request.requestId] + * Optional. A unique ID used to identify the request. If the server + * receives two + * [UpdateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.UpdateClusterRequest)s + * with the same id, then the second request will be ignored and the + * first {@link protos.google.longrunning.Operation|google.longrunning.Operation} created + * and stored in the backend is returned. + * + * It is recommended to always set this value to a + * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + * + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/cluster_controller.update_cluster.js + * region_tag:dataproc_v1_generated_ClusterController_UpdateCluster_async + */ + updateCluster( + request?: protos.google.cloud.dataproc.v1.IUpdateClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateCluster( + request: protos.google.cloud.dataproc.v1.IUpdateClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateCluster( + request: protos.google.cloud.dataproc.v1.IUpdateClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateCluster( + request?: protos.google.cloud.dataproc.v1.IUpdateClusterRequest, + 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({ + 'project_id': request.projectId?.toString() ?? '', + 'region': request.region ?? '', + 'cluster_name': request.clusterName ?? '', + }); + 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('updateCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateCluster request %j', request); + return this.innerApiCalls.updateCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/cluster_controller.update_cluster.js + * region_tag:dataproc_v1_generated_ClusterController_UpdateCluster_async + */ + async checkUpdateClusterProgress(name: string): Promise>{ + this._log.info('updateCluster 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.updateCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Stops a cluster in a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the Google Cloud Platform project the + * cluster belongs to. + * @param {string} request.region + * Required. The Dataproc region in which to handle the request. + * @param {string} request.clusterName + * Required. The cluster name. + * @param {string} [request.clusterUuid] + * Optional. Specifying the `cluster_uuid` means the RPC will fail + * (with error NOT_FOUND) if a cluster with the specified UUID does not exist. + * @param {string} [request.requestId] + * Optional. A unique ID used to identify the request. If the server + * receives two + * [StopClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StopClusterRequest)s + * with the same id, then the second request will be ignored and the + * first {@link protos.google.longrunning.Operation|google.longrunning.Operation} created + * and stored in the backend is returned. + * + * Recommendation: Set this value to a + * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + * + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/cluster_controller.stop_cluster.js + * region_tag:dataproc_v1_generated_ClusterController_StopCluster_async + */ + stopCluster( + request?: protos.google.cloud.dataproc.v1.IStopClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + stopCluster( + request: protos.google.cloud.dataproc.v1.IStopClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + stopCluster( + request: protos.google.cloud.dataproc.v1.IStopClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + stopCluster( + request?: protos.google.cloud.dataproc.v1.IStopClusterRequest, + 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({ + 'project_id': request.projectId?.toString() ?? '', + 'region': request.region ?? '', + 'cluster_name': request.clusterName ?? '', + }); + 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('stopCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('stopCluster request %j', request); + return this.innerApiCalls.stopCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('stopCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `stopCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/cluster_controller.stop_cluster.js + * region_tag:dataproc_v1_generated_ClusterController_StopCluster_async + */ + async checkStopClusterProgress(name: string): Promise>{ + this._log.info('stopCluster 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.stopCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Starts a cluster in a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the Google Cloud Platform project the + * cluster belongs to. + * @param {string} request.region + * Required. The Dataproc region in which to handle the request. + * @param {string} request.clusterName + * Required. The cluster name. + * @param {string} [request.clusterUuid] + * Optional. Specifying the `cluster_uuid` means the RPC will fail + * (with error NOT_FOUND) if a cluster with the specified UUID does not exist. + * @param {string} [request.requestId] + * Optional. A unique ID used to identify the request. If the server + * receives two + * [StartClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StartClusterRequest)s + * with the same id, then the second request will be ignored and the + * first {@link protos.google.longrunning.Operation|google.longrunning.Operation} created + * and stored in the backend is returned. + * + * Recommendation: Set this value to a + * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + * + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/cluster_controller.start_cluster.js + * region_tag:dataproc_v1_generated_ClusterController_StartCluster_async + */ + startCluster( + request?: protos.google.cloud.dataproc.v1.IStartClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + startCluster( + request: protos.google.cloud.dataproc.v1.IStartClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + startCluster( + request: protos.google.cloud.dataproc.v1.IStartClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + startCluster( + request?: protos.google.cloud.dataproc.v1.IStartClusterRequest, + 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({ + 'project_id': request.projectId?.toString() ?? '', + 'region': request.region ?? '', + 'cluster_name': request.clusterName ?? '', + }); + 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('startCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('startCluster request %j', request); + return this.innerApiCalls.startCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('startCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `startCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/cluster_controller.start_cluster.js + * region_tag:dataproc_v1_generated_ClusterController_StartCluster_async + */ + async checkStartClusterProgress(name: string): Promise>{ + this._log.info('startCluster 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.startCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a cluster in a project. The returned + * {@link protos.google.longrunning.Operation.metadata|Operation.metadata} will be + * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the Google Cloud Platform project that the cluster + * belongs to. + * @param {string} request.region + * Required. The Dataproc region in which to handle the request. + * @param {string} request.clusterName + * Required. The cluster name. + * @param {string} [request.clusterUuid] + * Optional. Specifying the `cluster_uuid` means the RPC should fail + * (with error NOT_FOUND) if cluster with specified UUID does not exist. + * @param {string} [request.requestId] + * Optional. A unique ID used to identify the request. If the server + * receives two + * [DeleteClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteClusterRequest)s + * with the same id, then the second request will be ignored and the + * first {@link protos.google.longrunning.Operation|google.longrunning.Operation} created + * and stored in the backend is returned. + * + * It is recommended to always set this value to a + * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + * + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/cluster_controller.delete_cluster.js + * region_tag:dataproc_v1_generated_ClusterController_DeleteCluster_async + */ + deleteCluster( + request?: protos.google.cloud.dataproc.v1.IDeleteClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteCluster( + request: protos.google.cloud.dataproc.v1.IDeleteClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteCluster( + request: protos.google.cloud.dataproc.v1.IDeleteClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteCluster( + request?: protos.google.cloud.dataproc.v1.IDeleteClusterRequest, + 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({ + 'project_id': request.projectId?.toString() ?? '', + 'region': request.region ?? '', + 'cluster_name': request.clusterName ?? '', + }); + 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('deleteCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteCluster request %j', request); + return this.innerApiCalls.deleteCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/cluster_controller.delete_cluster.js + * region_tag:dataproc_v1_generated_ClusterController_DeleteCluster_async + */ + async checkDeleteClusterProgress(name: string): Promise>{ + this._log.info('deleteCluster 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.deleteCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Gets cluster diagnostic information. The returned + * {@link protos.google.longrunning.Operation.metadata|Operation.metadata} will be + * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). + * After the operation completes, + * {@link protos.google.longrunning.Operation.response|Operation.response} + * contains + * [DiagnoseClusterResults](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the Google Cloud Platform project that the cluster + * belongs to. + * @param {string} request.region + * Required. The Dataproc region in which to handle the request. + * @param {string} request.clusterName + * Required. The cluster name. + * @param {string} [request.tarballGcsDir] + * Optional. (Optional) The output Cloud Storage directory for the diagnostic + * tarball. If not specified, a task-specific directory in the cluster's + * staging bucket will be used. + * @param {google.cloud.dataproc.v1.DiagnoseClusterRequest.TarballAccess} [request.tarballAccess] + * Optional. (Optional) The access type to the diagnostic tarball. If not + * specified, falls back to default access of the bucket + * @param {google.type.Interval} [request.diagnosisInterval] + * Optional. Time interval in which diagnosis should be carried out on the + * cluster. + * @param {string[]} [request.jobs] + * Optional. Specifies a list of jobs on which diagnosis is to be performed. + * Format: projects/{project}/regions/{region}/jobs/{job} + * @param {string[]} [request.yarnApplicationIds] + * Optional. Specifies a list of yarn applications on which diagnosis is to be + * performed. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/cluster_controller.diagnose_cluster.js + * region_tag:dataproc_v1_generated_ClusterController_DiagnoseCluster_async + */ + diagnoseCluster( + request?: protos.google.cloud.dataproc.v1.IDiagnoseClusterRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + diagnoseCluster( + request: protos.google.cloud.dataproc.v1.IDiagnoseClusterRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + diagnoseCluster( + request: protos.google.cloud.dataproc.v1.IDiagnoseClusterRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + diagnoseCluster( + request?: protos.google.cloud.dataproc.v1.IDiagnoseClusterRequest, + 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({ + 'project_id': request.projectId?.toString() ?? '', + 'region': request.region ?? '', + 'cluster_name': request.clusterName ?? '', + }); + 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('diagnoseCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('diagnoseCluster request %j', request); + return this.innerApiCalls.diagnoseCluster(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('diagnoseCluster response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `diagnoseCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/cluster_controller.diagnose_cluster.js + * region_tag:dataproc_v1_generated_ClusterController_DiagnoseCluster_async + */ + async checkDiagnoseClusterProgress(name: string): Promise>{ + this._log.info('diagnoseCluster 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.diagnoseCluster, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists all regions/{region}/clusters in a project alphabetically. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the Google Cloud Platform project that the cluster + * belongs to. + * @param {string} request.region + * Required. The Dataproc region in which to handle the request. + * @param {string} [request.filter] + * Optional. A filter constraining the clusters to list. Filters are + * case-sensitive and have the following syntax: + * + * field = value [AND [field = value]] ... + * + * where **field** is one of `status.state`, `clusterName`, or `labels.[KEY]`, + * and `[KEY]` is a label key. **value** can be `*` to match all values. + * `status.state` can be one of the following: `ACTIVE`, `INACTIVE`, + * `CREATING`, `RUNNING`, `ERROR`, `DELETING`, `UPDATING`, `STOPPING`, or + * `STOPPED`. `ACTIVE` contains the `CREATING`, `UPDATING`, and `RUNNING` + * states. `INACTIVE` contains the `DELETING`, `ERROR`, `STOPPING`, and + * `STOPPED` states. `clusterName` is the name of the cluster provided at + * creation time. Only the logical `AND` operator is supported; + * space-separated items are treated as having an implicit `AND` operator. + * + * Example filter: + * + * status.state = ACTIVE AND clusterName = mycluster + * AND labels.env = staging AND labels.starred = * + * @param {number} [request.pageSize] + * Optional. The standard List page size. + * @param {string} [request.pageToken] + * Optional. 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 {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.dataproc.v1.Cluster|Cluster}. + * 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 `listClustersAsync()` + * 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. + */ + listClusters( + request?: protos.google.cloud.dataproc.v1.IListClustersRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataproc.v1.ICluster[], + protos.google.cloud.dataproc.v1.IListClustersRequest|null, + protos.google.cloud.dataproc.v1.IListClustersResponse + ]>; + listClusters( + request: protos.google.cloud.dataproc.v1.IListClustersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dataproc.v1.IListClustersRequest, + protos.google.cloud.dataproc.v1.IListClustersResponse|null|undefined, + protos.google.cloud.dataproc.v1.ICluster>): void; + listClusters( + request: protos.google.cloud.dataproc.v1.IListClustersRequest, + callback: PaginationCallback< + protos.google.cloud.dataproc.v1.IListClustersRequest, + protos.google.cloud.dataproc.v1.IListClustersResponse|null|undefined, + protos.google.cloud.dataproc.v1.ICluster>): void; + listClusters( + request?: protos.google.cloud.dataproc.v1.IListClustersRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.dataproc.v1.IListClustersRequest, + protos.google.cloud.dataproc.v1.IListClustersResponse|null|undefined, + protos.google.cloud.dataproc.v1.ICluster>, + callback?: PaginationCallback< + protos.google.cloud.dataproc.v1.IListClustersRequest, + protos.google.cloud.dataproc.v1.IListClustersResponse|null|undefined, + protos.google.cloud.dataproc.v1.ICluster>): + Promise<[ + protos.google.cloud.dataproc.v1.ICluster[], + protos.google.cloud.dataproc.v1.IListClustersRequest|null, + protos.google.cloud.dataproc.v1.IListClustersResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'project_id': request.projectId?.toString() ?? '', + 'region': request.region ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.dataproc.v1.IListClustersRequest, + protos.google.cloud.dataproc.v1.IListClustersResponse|null|undefined, + protos.google.cloud.dataproc.v1.ICluster>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listClusters values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listClusters request %j', request); + return this.innerApiCalls + .listClusters(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.dataproc.v1.ICluster[], + protos.google.cloud.dataproc.v1.IListClustersRequest|null, + protos.google.cloud.dataproc.v1.IListClustersResponse + ]) => { + this._log.info('listClusters values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listClusters`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the Google Cloud Platform project that the cluster + * belongs to. + * @param {string} request.region + * Required. The Dataproc region in which to handle the request. + * @param {string} [request.filter] + * Optional. A filter constraining the clusters to list. Filters are + * case-sensitive and have the following syntax: + * + * field = value [AND [field = value]] ... + * + * where **field** is one of `status.state`, `clusterName`, or `labels.[KEY]`, + * and `[KEY]` is a label key. **value** can be `*` to match all values. + * `status.state` can be one of the following: `ACTIVE`, `INACTIVE`, + * `CREATING`, `RUNNING`, `ERROR`, `DELETING`, `UPDATING`, `STOPPING`, or + * `STOPPED`. `ACTIVE` contains the `CREATING`, `UPDATING`, and `RUNNING` + * states. `INACTIVE` contains the `DELETING`, `ERROR`, `STOPPING`, and + * `STOPPED` states. `clusterName` is the name of the cluster provided at + * creation time. Only the logical `AND` operator is supported; + * space-separated items are treated as having an implicit `AND` operator. + * + * Example filter: + * + * status.state = ACTIVE AND clusterName = mycluster + * AND labels.env = staging AND labels.starred = * + * @param {number} [request.pageSize] + * Optional. The standard List page size. + * @param {string} [request.pageToken] + * Optional. 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 {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.dataproc.v1.Cluster|Cluster} 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 `listClustersAsync()` + * 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. + */ + listClustersStream( + request?: protos.google.cloud.dataproc.v1.IListClustersRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'project_id': request.projectId?.toString() ?? '', + 'region': request.region ?? '', + }); + const defaultCallSettings = this._defaults['listClusters']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listClusters stream %j', request); + return this.descriptors.page.listClusters.createStream( + this.innerApiCalls.listClusters as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listClusters`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the Google Cloud Platform project that the cluster + * belongs to. + * @param {string} request.region + * Required. The Dataproc region in which to handle the request. + * @param {string} [request.filter] + * Optional. A filter constraining the clusters to list. Filters are + * case-sensitive and have the following syntax: + * + * field = value [AND [field = value]] ... + * + * where **field** is one of `status.state`, `clusterName`, or `labels.[KEY]`, + * and `[KEY]` is a label key. **value** can be `*` to match all values. + * `status.state` can be one of the following: `ACTIVE`, `INACTIVE`, + * `CREATING`, `RUNNING`, `ERROR`, `DELETING`, `UPDATING`, `STOPPING`, or + * `STOPPED`. `ACTIVE` contains the `CREATING`, `UPDATING`, and `RUNNING` + * states. `INACTIVE` contains the `DELETING`, `ERROR`, `STOPPING`, and + * `STOPPED` states. `clusterName` is the name of the cluster provided at + * creation time. Only the logical `AND` operator is supported; + * space-separated items are treated as having an implicit `AND` operator. + * + * Example filter: + * + * status.state = ACTIVE AND clusterName = mycluster + * AND labels.env = staging AND labels.starred = * + * @param {number} [request.pageSize] + * Optional. The standard List page size. + * @param {string} [request.pageToken] + * Optional. 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 protos.google.cloud.dataproc.v1.Cluster|Cluster}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/cluster_controller.list_clusters.js + * region_tag:dataproc_v1_generated_ClusterController_ListClusters_async + */ + listClustersAsync( + request?: protos.google.cloud.dataproc.v1.IListClustersRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'project_id': request.projectId?.toString() ?? '', + 'region': request.region ?? '', + }); + const defaultCallSettings = this._defaults['listClusters']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listClusters iterate %j', request); + return this.descriptors.page.listClusters.asyncIterate( + this.innerApiCalls['listClusters'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @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 {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @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/interfaces/CallOptions.html | 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.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@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 batch resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch + * @returns {string} Resource name string. + */ + batchPath(project:string,location:string,batch:string) { + return this.pathTemplates.batchPathTemplate.render({ + project: project, + location: location, + batch: batch, + }); + } + + /** + * Parse the project from Batch resource. + * + * @param {string} batchName + * A fully-qualified path representing Batch resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchName(batchName: string) { + return this.pathTemplates.batchPathTemplate.match(batchName).project; + } + + /** + * Parse the location from Batch resource. + * + * @param {string} batchName + * A fully-qualified path representing Batch resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchName(batchName: string) { + return this.pathTemplates.batchPathTemplate.match(batchName).location; + } + + /** + * Parse the batch from Batch resource. + * + * @param {string} batchName + * A fully-qualified path representing Batch resource. + * @returns {string} A string representing the batch. + */ + matchBatchFromBatchName(batchName: string) { + return this.pathTemplates.batchPathTemplate.match(batchName).batch; + } + + /** + * 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 nodeGroup resource name string. + * + * @param {string} project + * @param {string} region + * @param {string} cluster + * @param {string} node_group + * @returns {string} Resource name string. + */ + nodeGroupPath(project:string,region:string,cluster:string,nodeGroup:string) { + return this.pathTemplates.nodeGroupPathTemplate.render({ + project: project, + region: region, + cluster: cluster, + node_group: nodeGroup, + }); + } + + /** + * Parse the project from NodeGroup resource. + * + * @param {string} nodeGroupName + * A fully-qualified path representing NodeGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNodeGroupName(nodeGroupName: string) { + return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).project; + } + + /** + * Parse the region from NodeGroup resource. + * + * @param {string} nodeGroupName + * A fully-qualified path representing NodeGroup resource. + * @returns {string} A string representing the region. + */ + matchRegionFromNodeGroupName(nodeGroupName: string) { + return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).region; + } + + /** + * Parse the cluster from NodeGroup resource. + * + * @param {string} nodeGroupName + * A fully-qualified path representing NodeGroup resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromNodeGroupName(nodeGroupName: string) { + return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).cluster; + } + + /** + * Parse the node_group from NodeGroup resource. + * + * @param {string} nodeGroupName + * A fully-qualified path representing NodeGroup resource. + * @returns {string} A string representing the node_group. + */ + matchNodeGroupFromNodeGroupName(nodeGroupName: string) { + return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).node_group; + } + + /** + * Return a fully-qualified projectLocationAutoscalingPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} autoscaling_policy + * @returns {string} Resource name string. + */ + projectLocationAutoscalingPolicyPath(project:string,location:string,autoscalingPolicy:string) { + return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render({ + project: project, + location: location, + autoscaling_policy: autoscalingPolicy, + }); + } + + /** + * Parse the project from ProjectLocationAutoscalingPolicy resource. + * + * @param {string} projectLocationAutoscalingPolicyName + * A fully-qualified path representing project_location_autoscaling_policy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { + return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).project; + } + + /** + * Parse the location from ProjectLocationAutoscalingPolicy resource. + * + * @param {string} projectLocationAutoscalingPolicyName + * A fully-qualified path representing project_location_autoscaling_policy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { + return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).location; + } + + /** + * Parse the autoscaling_policy from ProjectLocationAutoscalingPolicy resource. + * + * @param {string} projectLocationAutoscalingPolicyName + * A fully-qualified path representing project_location_autoscaling_policy resource. + * @returns {string} A string representing the autoscaling_policy. + */ + matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { + return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).autoscaling_policy; + } + + /** + * Return a fully-qualified projectLocationWorkflowTemplate resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} workflow_template + * @returns {string} Resource name string. + */ + projectLocationWorkflowTemplatePath(project:string,location:string,workflowTemplate:string) { + return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render({ + project: project, + location: location, + workflow_template: workflowTemplate, + }); + } + + /** + * Parse the project from ProjectLocationWorkflowTemplate resource. + * + * @param {string} projectLocationWorkflowTemplateName + * A fully-qualified path representing project_location_workflow_template resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { + return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).project; + } + + /** + * Parse the location from ProjectLocationWorkflowTemplate resource. + * + * @param {string} projectLocationWorkflowTemplateName + * A fully-qualified path representing project_location_workflow_template resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { + return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).location; + } + + /** + * Parse the workflow_template from ProjectLocationWorkflowTemplate resource. + * + * @param {string} projectLocationWorkflowTemplateName + * A fully-qualified path representing project_location_workflow_template resource. + * @returns {string} A string representing the workflow_template. + */ + matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { + return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).workflow_template; + } + + /** + * Return a fully-qualified projectRegionAutoscalingPolicy resource name string. + * + * @param {string} project + * @param {string} region + * @param {string} autoscaling_policy + * @returns {string} Resource name string. + */ + projectRegionAutoscalingPolicyPath(project:string,region:string,autoscalingPolicy:string) { + return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render({ + project: project, + region: region, + autoscaling_policy: autoscalingPolicy, + }); + } + + /** + * Parse the project from ProjectRegionAutoscalingPolicy resource. + * + * @param {string} projectRegionAutoscalingPolicyName + * A fully-qualified path representing project_region_autoscaling_policy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { + return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).project; + } + + /** + * Parse the region from ProjectRegionAutoscalingPolicy resource. + * + * @param {string} projectRegionAutoscalingPolicyName + * A fully-qualified path representing project_region_autoscaling_policy resource. + * @returns {string} A string representing the region. + */ + matchRegionFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { + return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).region; + } + + /** + * Parse the autoscaling_policy from ProjectRegionAutoscalingPolicy resource. + * + * @param {string} projectRegionAutoscalingPolicyName + * A fully-qualified path representing project_region_autoscaling_policy resource. + * @returns {string} A string representing the autoscaling_policy. + */ + matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { + return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).autoscaling_policy; + } + + /** + * Return a fully-qualified projectRegionWorkflowTemplate resource name string. + * + * @param {string} project + * @param {string} region + * @param {string} workflow_template + * @returns {string} Resource name string. + */ + projectRegionWorkflowTemplatePath(project:string,region:string,workflowTemplate:string) { + return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render({ + project: project, + region: region, + workflow_template: workflowTemplate, + }); + } + + /** + * Parse the project from ProjectRegionWorkflowTemplate resource. + * + * @param {string} projectRegionWorkflowTemplateName + * A fully-qualified path representing project_region_workflow_template resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { + return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).project; + } + + /** + * Parse the region from ProjectRegionWorkflowTemplate resource. + * + * @param {string} projectRegionWorkflowTemplateName + * A fully-qualified path representing project_region_workflow_template resource. + * @returns {string} A string representing the region. + */ + matchRegionFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { + return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).region; + } + + /** + * Parse the workflow_template from ProjectRegionWorkflowTemplate resource. + * + * @param {string} projectRegionWorkflowTemplateName + * A fully-qualified path representing project_region_workflow_template resource. + * @returns {string} A string representing the workflow_template. + */ + matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { + return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).workflow_template; + } + + /** + * 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 session resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} session + * @returns {string} Resource name string. + */ + sessionPath(project:string,location:string,session:string) { + return this.pathTemplates.sessionPathTemplate.render({ + project: project, + location: location, + session: session, + }); + } + + /** + * Parse the project from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).project; + } + + /** + * Parse the location from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).location; + } + + /** + * Parse the session from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the session. + */ + matchSessionFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).session; + } + + /** + * Return a fully-qualified sessionTemplate resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} template + * @returns {string} Resource name string. + */ + sessionTemplatePath(project:string,location:string,template:string) { + return this.pathTemplates.sessionTemplatePathTemplate.render({ + project: project, + location: location, + template: template, + }); + } + + /** + * Parse the project from SessionTemplate resource. + * + * @param {string} sessionTemplateName + * A fully-qualified path representing SessionTemplate resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSessionTemplateName(sessionTemplateName: string) { + return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).project; + } + + /** + * Parse the location from SessionTemplate resource. + * + * @param {string} sessionTemplateName + * A fully-qualified path representing SessionTemplate resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSessionTemplateName(sessionTemplateName: string) { + return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).location; + } + + /** + * Parse the template from SessionTemplate resource. + * + * @param {string} sessionTemplateName + * A fully-qualified path representing SessionTemplate resource. + * @returns {string} A string representing the template. + */ + matchTemplateFromSessionTemplateName(sessionTemplateName: string) { + return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).template; + } + + /** + * 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.clusterControllerStub && !this._terminated) { + return this.clusterControllerStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.iamClient.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-dataproc/src/v1/cluster_controller_client_config.json b/owl-bot-staging/google-cloud-dataproc/src/v1/cluster_controller_client_config.json new file mode 100644 index 000000000000..6f5f5f3dd1d9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/src/v1/cluster_controller_client_config.json @@ -0,0 +1,72 @@ +{ + "interfaces": { + "google.cloud.dataproc.v1.ClusterController": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ], + "deadline_exceeded_internal_unavailable": [ + "DEADLINE_EXCEEDED", + "INTERNAL", + "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": { + "CreateCluster": { + "timeout_millis": 300000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateCluster": { + "timeout_millis": 300000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "StopCluster": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StartCluster": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteCluster": { + "timeout_millis": 300000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetCluster": { + "timeout_millis": 300000, + "retry_codes_name": "deadline_exceeded_internal_unavailable", + "retry_params_name": "default" + }, + "ListClusters": { + "timeout_millis": 300000, + "retry_codes_name": "deadline_exceeded_internal_unavailable", + "retry_params_name": "default" + }, + "DiagnoseCluster": { + "timeout_millis": 300000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/cluster_controller_proto_list.json b/owl-bot-staging/google-cloud-dataproc/src/v1/cluster_controller_proto_list.json new file mode 100644 index 000000000000..d6798f50ae7c --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/src/v1/cluster_controller_proto_list.json @@ -0,0 +1,12 @@ +[ + "../../protos/google/cloud/dataproc/v1/autoscaling_policies.proto", + "../../protos/google/cloud/dataproc/v1/batches.proto", + "../../protos/google/cloud/dataproc/v1/clusters.proto", + "../../protos/google/cloud/dataproc/v1/jobs.proto", + "../../protos/google/cloud/dataproc/v1/node_groups.proto", + "../../protos/google/cloud/dataproc/v1/operations.proto", + "../../protos/google/cloud/dataproc/v1/session_templates.proto", + "../../protos/google/cloud/dataproc/v1/sessions.proto", + "../../protos/google/cloud/dataproc/v1/shared.proto", + "../../protos/google/cloud/dataproc/v1/workflow_templates.proto" +] diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-dataproc/src/v1/gapic_metadata.json new file mode 100644 index 000000000000..ff5385074eb9 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/src/v1/gapic_metadata.json @@ -0,0 +1,589 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.dataproc.v1", + "libraryPackage": "@google-cloud/dataproc", + "services": { + "AutoscalingPolicyService": { + "clients": { + "grpc": { + "libraryClient": "AutoscalingPolicyServiceClient", + "rpcs": { + "CreateAutoscalingPolicy": { + "methods": [ + "createAutoscalingPolicy" + ] + }, + "UpdateAutoscalingPolicy": { + "methods": [ + "updateAutoscalingPolicy" + ] + }, + "GetAutoscalingPolicy": { + "methods": [ + "getAutoscalingPolicy" + ] + }, + "DeleteAutoscalingPolicy": { + "methods": [ + "deleteAutoscalingPolicy" + ] + }, + "ListAutoscalingPolicies": { + "methods": [ + "listAutoscalingPolicies", + "listAutoscalingPoliciesStream", + "listAutoscalingPoliciesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AutoscalingPolicyServiceClient", + "rpcs": { + "CreateAutoscalingPolicy": { + "methods": [ + "createAutoscalingPolicy" + ] + }, + "UpdateAutoscalingPolicy": { + "methods": [ + "updateAutoscalingPolicy" + ] + }, + "GetAutoscalingPolicy": { + "methods": [ + "getAutoscalingPolicy" + ] + }, + "DeleteAutoscalingPolicy": { + "methods": [ + "deleteAutoscalingPolicy" + ] + }, + "ListAutoscalingPolicies": { + "methods": [ + "listAutoscalingPolicies", + "listAutoscalingPoliciesStream", + "listAutoscalingPoliciesAsync" + ] + } + } + } + } + }, + "BatchController": { + "clients": { + "grpc": { + "libraryClient": "BatchControllerClient", + "rpcs": { + "GetBatch": { + "methods": [ + "getBatch" + ] + }, + "DeleteBatch": { + "methods": [ + "deleteBatch" + ] + }, + "CreateBatch": { + "methods": [ + "createBatch" + ] + }, + "ListBatches": { + "methods": [ + "listBatches", + "listBatchesStream", + "listBatchesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "BatchControllerClient", + "rpcs": { + "GetBatch": { + "methods": [ + "getBatch" + ] + }, + "DeleteBatch": { + "methods": [ + "deleteBatch" + ] + }, + "CreateBatch": { + "methods": [ + "createBatch" + ] + }, + "ListBatches": { + "methods": [ + "listBatches", + "listBatchesStream", + "listBatchesAsync" + ] + } + } + } + } + }, + "ClusterController": { + "clients": { + "grpc": { + "libraryClient": "ClusterControllerClient", + "rpcs": { + "GetCluster": { + "methods": [ + "getCluster" + ] + }, + "CreateCluster": { + "methods": [ + "createCluster" + ] + }, + "UpdateCluster": { + "methods": [ + "updateCluster" + ] + }, + "StopCluster": { + "methods": [ + "stopCluster" + ] + }, + "StartCluster": { + "methods": [ + "startCluster" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "DiagnoseCluster": { + "methods": [ + "diagnoseCluster" + ] + }, + "ListClusters": { + "methods": [ + "listClusters", + "listClustersStream", + "listClustersAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ClusterControllerClient", + "rpcs": { + "GetCluster": { + "methods": [ + "getCluster" + ] + }, + "CreateCluster": { + "methods": [ + "createCluster" + ] + }, + "UpdateCluster": { + "methods": [ + "updateCluster" + ] + }, + "StopCluster": { + "methods": [ + "stopCluster" + ] + }, + "StartCluster": { + "methods": [ + "startCluster" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "DiagnoseCluster": { + "methods": [ + "diagnoseCluster" + ] + }, + "ListClusters": { + "methods": [ + "listClusters", + "listClustersStream", + "listClustersAsync" + ] + } + } + } + } + }, + "JobController": { + "clients": { + "grpc": { + "libraryClient": "JobControllerClient", + "rpcs": { + "SubmitJob": { + "methods": [ + "submitJob" + ] + }, + "GetJob": { + "methods": [ + "getJob" + ] + }, + "UpdateJob": { + "methods": [ + "updateJob" + ] + }, + "CancelJob": { + "methods": [ + "cancelJob" + ] + }, + "DeleteJob": { + "methods": [ + "deleteJob" + ] + }, + "SubmitJobAsOperation": { + "methods": [ + "submitJobAsOperation" + ] + }, + "ListJobs": { + "methods": [ + "listJobs", + "listJobsStream", + "listJobsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "JobControllerClient", + "rpcs": { + "SubmitJob": { + "methods": [ + "submitJob" + ] + }, + "GetJob": { + "methods": [ + "getJob" + ] + }, + "UpdateJob": { + "methods": [ + "updateJob" + ] + }, + "CancelJob": { + "methods": [ + "cancelJob" + ] + }, + "DeleteJob": { + "methods": [ + "deleteJob" + ] + }, + "SubmitJobAsOperation": { + "methods": [ + "submitJobAsOperation" + ] + }, + "ListJobs": { + "methods": [ + "listJobs", + "listJobsStream", + "listJobsAsync" + ] + } + } + } + } + }, + "NodeGroupController": { + "clients": { + "grpc": { + "libraryClient": "NodeGroupControllerClient", + "rpcs": { + "GetNodeGroup": { + "methods": [ + "getNodeGroup" + ] + }, + "CreateNodeGroup": { + "methods": [ + "createNodeGroup" + ] + }, + "ResizeNodeGroup": { + "methods": [ + "resizeNodeGroup" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "NodeGroupControllerClient", + "rpcs": { + "GetNodeGroup": { + "methods": [ + "getNodeGroup" + ] + }, + "CreateNodeGroup": { + "methods": [ + "createNodeGroup" + ] + }, + "ResizeNodeGroup": { + "methods": [ + "resizeNodeGroup" + ] + } + } + } + } + }, + "SessionController": { + "clients": { + "grpc": { + "libraryClient": "SessionControllerClient", + "rpcs": { + "GetSession": { + "methods": [ + "getSession" + ] + }, + "CreateSession": { + "methods": [ + "createSession" + ] + }, + "TerminateSession": { + "methods": [ + "terminateSession" + ] + }, + "DeleteSession": { + "methods": [ + "deleteSession" + ] + }, + "ListSessions": { + "methods": [ + "listSessions", + "listSessionsStream", + "listSessionsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SessionControllerClient", + "rpcs": { + "GetSession": { + "methods": [ + "getSession" + ] + }, + "CreateSession": { + "methods": [ + "createSession" + ] + }, + "TerminateSession": { + "methods": [ + "terminateSession" + ] + }, + "DeleteSession": { + "methods": [ + "deleteSession" + ] + }, + "ListSessions": { + "methods": [ + "listSessions", + "listSessionsStream", + "listSessionsAsync" + ] + } + } + } + } + }, + "SessionTemplateController": { + "clients": { + "grpc": { + "libraryClient": "SessionTemplateControllerClient", + "rpcs": { + "CreateSessionTemplate": { + "methods": [ + "createSessionTemplate" + ] + }, + "UpdateSessionTemplate": { + "methods": [ + "updateSessionTemplate" + ] + }, + "GetSessionTemplate": { + "methods": [ + "getSessionTemplate" + ] + }, + "DeleteSessionTemplate": { + "methods": [ + "deleteSessionTemplate" + ] + }, + "ListSessionTemplates": { + "methods": [ + "listSessionTemplates", + "listSessionTemplatesStream", + "listSessionTemplatesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "SessionTemplateControllerClient", + "rpcs": { + "CreateSessionTemplate": { + "methods": [ + "createSessionTemplate" + ] + }, + "UpdateSessionTemplate": { + "methods": [ + "updateSessionTemplate" + ] + }, + "GetSessionTemplate": { + "methods": [ + "getSessionTemplate" + ] + }, + "DeleteSessionTemplate": { + "methods": [ + "deleteSessionTemplate" + ] + }, + "ListSessionTemplates": { + "methods": [ + "listSessionTemplates", + "listSessionTemplatesStream", + "listSessionTemplatesAsync" + ] + } + } + } + } + }, + "WorkflowTemplateService": { + "clients": { + "grpc": { + "libraryClient": "WorkflowTemplateServiceClient", + "rpcs": { + "CreateWorkflowTemplate": { + "methods": [ + "createWorkflowTemplate" + ] + }, + "GetWorkflowTemplate": { + "methods": [ + "getWorkflowTemplate" + ] + }, + "UpdateWorkflowTemplate": { + "methods": [ + "updateWorkflowTemplate" + ] + }, + "DeleteWorkflowTemplate": { + "methods": [ + "deleteWorkflowTemplate" + ] + }, + "InstantiateWorkflowTemplate": { + "methods": [ + "instantiateWorkflowTemplate" + ] + }, + "InstantiateInlineWorkflowTemplate": { + "methods": [ + "instantiateInlineWorkflowTemplate" + ] + }, + "ListWorkflowTemplates": { + "methods": [ + "listWorkflowTemplates", + "listWorkflowTemplatesStream", + "listWorkflowTemplatesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "WorkflowTemplateServiceClient", + "rpcs": { + "CreateWorkflowTemplate": { + "methods": [ + "createWorkflowTemplate" + ] + }, + "GetWorkflowTemplate": { + "methods": [ + "getWorkflowTemplate" + ] + }, + "UpdateWorkflowTemplate": { + "methods": [ + "updateWorkflowTemplate" + ] + }, + "DeleteWorkflowTemplate": { + "methods": [ + "deleteWorkflowTemplate" + ] + }, + "InstantiateWorkflowTemplate": { + "methods": [ + "instantiateWorkflowTemplate" + ] + }, + "InstantiateInlineWorkflowTemplate": { + "methods": [ + "instantiateInlineWorkflowTemplate" + ] + }, + "ListWorkflowTemplates": { + "methods": [ + "listWorkflowTemplates", + "listWorkflowTemplatesStream", + "listWorkflowTemplatesAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/index.ts b/owl-bot-staging/google-cloud-dataproc/src/v1/index.ts new file mode 100644 index 000000000000..1bc375b71d76 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/src/v1/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 {AutoscalingPolicyServiceClient} from './autoscaling_policy_service_client'; +export {BatchControllerClient} from './batch_controller_client'; +export {ClusterControllerClient} from './cluster_controller_client'; +export {JobControllerClient} from './job_controller_client'; +export {NodeGroupControllerClient} from './node_group_controller_client'; +export {SessionControllerClient} from './session_controller_client'; +export {SessionTemplateControllerClient} from './session_template_controller_client'; +export {WorkflowTemplateServiceClient} from './workflow_template_service_client'; diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/job_controller_client.ts b/owl-bot-staging/google-cloud-dataproc/src/v1/job_controller_client.ts new file mode 100644 index 000000000000..75640d4b5c86 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/src/v1/job_controller_client.ts @@ -0,0 +1,2119 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, IamClient, IamProtos} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/job_controller_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './job_controller_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The JobController provides methods to manage jobs. + * @class + * @memberof v1 + */ +export class JobControllerClient { + 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('dataproc'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + jobControllerStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of JobControllerClient. + * + * @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 JobControllerClient({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 JobControllerClient; + 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 = 'dataproc.' + 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.iamClient = new this._gaxModule.IamClient(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 = { + batchPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batches/{batch}' + ), + nodeGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{node_group}' + ), + projectLocationAutoscalingPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/autoscalingPolicies/{autoscaling_policy}' + ), + projectLocationWorkflowTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/workflowTemplates/{workflow_template}' + ), + projectRegionAutoscalingPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/regions/{region}/autoscalingPolicies/{autoscaling_policy}' + ), + projectRegionWorkflowTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/regions/{region}/workflowTemplates/{workflow_template}' + ), + sessionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/sessions/{session}' + ), + sessionTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/sessionTemplates/{template}' + ), + }; + + // 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.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1/{resource=projects/*/regions/*/clusters/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:getIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/regions/*/clusters/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/regions/*/clusters/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:testIamPermissions',body: '*',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/regions/*/operations/*}:cancel',additional_bindings: [{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/regions/*/operations/*}',additional_bindings: [{delete: '/v1/{name=projects/*/locations/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/regions/*/operations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/regions/*/operations}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*/operations}',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const submitJobAsOperationResponse = protoFilesRoot.lookup( + '.google.cloud.dataproc.v1.Job') as gax.protobuf.Type; + const submitJobAsOperationMetadata = protoFilesRoot.lookup( + '.google.cloud.dataproc.v1.JobMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + submitJobAsOperation: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + submitJobAsOperationResponse.decode.bind(submitJobAsOperationResponse), + submitJobAsOperationMetadata.decode.bind(submitJobAsOperationMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dataproc.v1.JobController', 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.jobControllerStub) { + return this.jobControllerStub; + } + + // Put together the "service stub" for + // google.cloud.dataproc.v1.JobController. + this.jobControllerStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.dataproc.v1.JobController') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dataproc.v1.JobController, + 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 jobControllerStubMethods = + ['submitJob', 'submitJobAsOperation', 'getJob', 'listJobs', 'updateJob', 'cancelJob', 'deleteJob']; + for (const methodName of jobControllerStubMethods) { + const callPromise = this.jobControllerStub.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.jobControllerStub; + } + + /** + * 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 'dataproc.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 'dataproc.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 job to a cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the Google Cloud Platform project that the job + * belongs to. + * @param {string} request.region + * Required. The Dataproc region in which to handle the request. + * @param {google.cloud.dataproc.v1.Job} request.job + * Required. The job resource. + * @param {string} [request.requestId] + * Optional. A unique id used to identify the request. If the server + * receives two + * [SubmitJobRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.SubmitJobRequest)s + * with the same id, then the second request will be ignored and the + * first {@link protos.google.cloud.dataproc.v1.Job|Job} created and stored in the backend + * is returned. + * + * It is recommended to always set this value to a + * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + * + * The id must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.dataproc.v1.Job|Job}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/job_controller.submit_job.js + * region_tag:dataproc_v1_generated_JobController_SubmitJob_async + */ + submitJob( + request?: protos.google.cloud.dataproc.v1.ISubmitJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataproc.v1.IJob, + protos.google.cloud.dataproc.v1.ISubmitJobRequest|undefined, {}|undefined + ]>; + submitJob( + request: protos.google.cloud.dataproc.v1.ISubmitJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataproc.v1.IJob, + protos.google.cloud.dataproc.v1.ISubmitJobRequest|null|undefined, + {}|null|undefined>): void; + submitJob( + request: protos.google.cloud.dataproc.v1.ISubmitJobRequest, + callback: Callback< + protos.google.cloud.dataproc.v1.IJob, + protos.google.cloud.dataproc.v1.ISubmitJobRequest|null|undefined, + {}|null|undefined>): void; + submitJob( + request?: protos.google.cloud.dataproc.v1.ISubmitJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataproc.v1.IJob, + protos.google.cloud.dataproc.v1.ISubmitJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataproc.v1.IJob, + protos.google.cloud.dataproc.v1.ISubmitJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataproc.v1.IJob, + protos.google.cloud.dataproc.v1.ISubmitJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'project_id': request.projectId?.toString() ?? '', + 'region': request.region ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('submitJob request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.dataproc.v1.IJob, + protos.google.cloud.dataproc.v1.ISubmitJobRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('submitJob response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.submitJob(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.dataproc.v1.IJob, + protos.google.cloud.dataproc.v1.ISubmitJobRequest|undefined, + {}|undefined + ]) => { + this._log.info('submitJob 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 resource representation for a job in a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the Google Cloud Platform project that the job + * belongs to. + * @param {string} request.region + * Required. The Dataproc region in which to handle the request. + * @param {string} request.jobId + * Required. The job ID. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.dataproc.v1.Job|Job}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/job_controller.get_job.js + * region_tag:dataproc_v1_generated_JobController_GetJob_async + */ + getJob( + request?: protos.google.cloud.dataproc.v1.IGetJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataproc.v1.IJob, + protos.google.cloud.dataproc.v1.IGetJobRequest|undefined, {}|undefined + ]>; + getJob( + request: protos.google.cloud.dataproc.v1.IGetJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataproc.v1.IJob, + protos.google.cloud.dataproc.v1.IGetJobRequest|null|undefined, + {}|null|undefined>): void; + getJob( + request: protos.google.cloud.dataproc.v1.IGetJobRequest, + callback: Callback< + protos.google.cloud.dataproc.v1.IJob, + protos.google.cloud.dataproc.v1.IGetJobRequest|null|undefined, + {}|null|undefined>): void; + getJob( + request?: protos.google.cloud.dataproc.v1.IGetJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataproc.v1.IJob, + protos.google.cloud.dataproc.v1.IGetJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataproc.v1.IJob, + protos.google.cloud.dataproc.v1.IGetJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataproc.v1.IJob, + protos.google.cloud.dataproc.v1.IGetJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'project_id': request.projectId?.toString() ?? '', + 'region': request.region ?? '', + 'job_id': request.jobId?.toString() ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getJob request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.dataproc.v1.IJob, + protos.google.cloud.dataproc.v1.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.dataproc.v1.IJob, + protos.google.cloud.dataproc.v1.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; + }); + } +/** + * Updates a job in a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the Google Cloud Platform project that the job + * belongs to. + * @param {string} request.region + * Required. The Dataproc region in which to handle the request. + * @param {string} request.jobId + * Required. The job ID. + * @param {google.cloud.dataproc.v1.Job} request.job + * Required. The changes to the job. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Specifies the path, relative to Job, of + * the field to update. For example, to update the labels of a Job the + * update_mask parameter would be specified as + * labels, and the `PATCH` request body would specify the new + * value. Note: Currently, labels is the only + * field that can be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.dataproc.v1.Job|Job}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/job_controller.update_job.js + * region_tag:dataproc_v1_generated_JobController_UpdateJob_async + */ + updateJob( + request?: protos.google.cloud.dataproc.v1.IUpdateJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataproc.v1.IJob, + protos.google.cloud.dataproc.v1.IUpdateJobRequest|undefined, {}|undefined + ]>; + updateJob( + request: protos.google.cloud.dataproc.v1.IUpdateJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataproc.v1.IJob, + protos.google.cloud.dataproc.v1.IUpdateJobRequest|null|undefined, + {}|null|undefined>): void; + updateJob( + request: protos.google.cloud.dataproc.v1.IUpdateJobRequest, + callback: Callback< + protos.google.cloud.dataproc.v1.IJob, + protos.google.cloud.dataproc.v1.IUpdateJobRequest|null|undefined, + {}|null|undefined>): void; + updateJob( + request?: protos.google.cloud.dataproc.v1.IUpdateJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataproc.v1.IJob, + protos.google.cloud.dataproc.v1.IUpdateJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataproc.v1.IJob, + protos.google.cloud.dataproc.v1.IUpdateJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataproc.v1.IJob, + protos.google.cloud.dataproc.v1.IUpdateJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'project_id': request.projectId?.toString() ?? '', + 'region': request.region ?? '', + 'job_id': request.jobId?.toString() ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateJob request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.dataproc.v1.IJob, + protos.google.cloud.dataproc.v1.IUpdateJobRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateJob response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateJob(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.dataproc.v1.IJob, + protos.google.cloud.dataproc.v1.IUpdateJobRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateJob 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; + }); + } +/** + * Starts a job cancellation request. To access the job resource + * after cancellation, call + * [regions/{region}/jobs.list](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/list) + * or + * [regions/{region}/jobs.get](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/get). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the Google Cloud Platform project that the job + * belongs to. + * @param {string} request.region + * Required. The Dataproc region in which to handle the request. + * @param {string} request.jobId + * Required. The job ID. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.dataproc.v1.Job|Job}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/job_controller.cancel_job.js + * region_tag:dataproc_v1_generated_JobController_CancelJob_async + */ + cancelJob( + request?: protos.google.cloud.dataproc.v1.ICancelJobRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataproc.v1.IJob, + protos.google.cloud.dataproc.v1.ICancelJobRequest|undefined, {}|undefined + ]>; + cancelJob( + request: protos.google.cloud.dataproc.v1.ICancelJobRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataproc.v1.IJob, + protos.google.cloud.dataproc.v1.ICancelJobRequest|null|undefined, + {}|null|undefined>): void; + cancelJob( + request: protos.google.cloud.dataproc.v1.ICancelJobRequest, + callback: Callback< + protos.google.cloud.dataproc.v1.IJob, + protos.google.cloud.dataproc.v1.ICancelJobRequest|null|undefined, + {}|null|undefined>): void; + cancelJob( + request?: protos.google.cloud.dataproc.v1.ICancelJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataproc.v1.IJob, + protos.google.cloud.dataproc.v1.ICancelJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataproc.v1.IJob, + protos.google.cloud.dataproc.v1.ICancelJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataproc.v1.IJob, + protos.google.cloud.dataproc.v1.ICancelJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'project_id': request.projectId?.toString() ?? '', + 'region': request.region ?? '', + 'job_id': request.jobId?.toString() ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('cancelJob request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.dataproc.v1.IJob, + protos.google.cloud.dataproc.v1.ICancelJobRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('cancelJob response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.cancelJob(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.dataproc.v1.IJob, + protos.google.cloud.dataproc.v1.ICancelJobRequest|undefined, + {}|undefined + ]) => { + this._log.info('cancelJob response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Deletes the job from the project. If the job is active, the delete fails, + * and the response returns `FAILED_PRECONDITION`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the Google Cloud Platform project that the job + * belongs to. + * @param {string} request.region + * Required. The Dataproc region in which to handle the request. + * @param {string} request.jobId + * Required. The job ID. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/job_controller.delete_job.js + * region_tag:dataproc_v1_generated_JobController_DeleteJob_async + */ + deleteJob( + request?: protos.google.cloud.dataproc.v1.IDeleteJobRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteJobRequest|undefined, {}|undefined + ]>; + deleteJob( + request: protos.google.cloud.dataproc.v1.IDeleteJobRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteJobRequest|null|undefined, + {}|null|undefined>): void; + deleteJob( + request: protos.google.cloud.dataproc.v1.IDeleteJobRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteJobRequest|null|undefined, + {}|null|undefined>): void; + deleteJob( + request?: protos.google.cloud.dataproc.v1.IDeleteJobRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteJobRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteJobRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteJobRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'project_id': request.projectId?.toString() ?? '', + 'region': request.region ?? '', + 'job_id': request.jobId?.toString() ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('deleteJob request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteJobRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteJob response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteJob(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteJobRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteJob 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; + }); + } + +/** + * Submits job to a cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the Google Cloud Platform project that the job + * belongs to. + * @param {string} request.region + * Required. The Dataproc region in which to handle the request. + * @param {google.cloud.dataproc.v1.Job} request.job + * Required. The job resource. + * @param {string} [request.requestId] + * Optional. A unique id used to identify the request. If the server + * receives two + * [SubmitJobRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.SubmitJobRequest)s + * with the same id, then the second request will be ignored and the + * first {@link protos.google.cloud.dataproc.v1.Job|Job} created and stored in the backend + * is returned. + * + * It is recommended to always set this value to a + * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + * + * The id must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/job_controller.submit_job_as_operation.js + * region_tag:dataproc_v1_generated_JobController_SubmitJobAsOperation_async + */ + submitJobAsOperation( + request?: protos.google.cloud.dataproc.v1.ISubmitJobRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + submitJobAsOperation( + request: protos.google.cloud.dataproc.v1.ISubmitJobRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + submitJobAsOperation( + request: protos.google.cloud.dataproc.v1.ISubmitJobRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + submitJobAsOperation( + request?: protos.google.cloud.dataproc.v1.ISubmitJobRequest, + 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({ + 'project_id': request.projectId?.toString() ?? '', + 'region': request.region ?? '', + }); + 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('submitJobAsOperation response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('submitJobAsOperation request %j', request); + return this.innerApiCalls.submitJobAsOperation(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('submitJobAsOperation response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `submitJobAsOperation()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/job_controller.submit_job_as_operation.js + * region_tag:dataproc_v1_generated_JobController_SubmitJobAsOperation_async + */ + async checkSubmitJobAsOperationProgress(name: string): Promise>{ + this._log.info('submitJobAsOperation 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.submitJobAsOperation, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists regions/{region}/jobs in a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the Google Cloud Platform project that the job + * belongs to. + * @param {string} request.region + * Required. The Dataproc region in which to handle the request. + * @param {number} [request.pageSize] + * Optional. The number of results to return in each response. + * @param {string} [request.pageToken] + * Optional. The page token, returned by a previous call, to request the + * next page of results. + * @param {string} [request.clusterName] + * Optional. If set, the returned jobs list includes only jobs that were + * submitted to the named cluster. + * @param {google.cloud.dataproc.v1.ListJobsRequest.JobStateMatcher} [request.jobStateMatcher] + * Optional. Specifies enumerated categories of jobs to list. + * (default = match ALL jobs). + * + * If `filter` is provided, `jobStateMatcher` will be ignored. + * @param {string} [request.filter] + * Optional. A filter constraining the jobs to list. Filters are + * case-sensitive and have the following syntax: + * + * [field = value] AND [field [= value]] ... + * + * where **field** is `status.state` or `labels.[KEY]`, and `[KEY]` is a label + * key. **value** can be `*` to match all values. + * `status.state` can be either `ACTIVE` or `NON_ACTIVE`. + * Only the logical `AND` operator is supported; space-separated items are + * treated as having an implicit `AND` operator. + * + * Example filter: + * + * status.state = ACTIVE AND labels.env = staging AND labels.starred = * + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.dataproc.v1.Job|Job}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listJobs( + request?: protos.google.cloud.dataproc.v1.IListJobsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataproc.v1.IJob[], + protos.google.cloud.dataproc.v1.IListJobsRequest|null, + protos.google.cloud.dataproc.v1.IListJobsResponse + ]>; + listJobs( + request: protos.google.cloud.dataproc.v1.IListJobsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dataproc.v1.IListJobsRequest, + protos.google.cloud.dataproc.v1.IListJobsResponse|null|undefined, + protos.google.cloud.dataproc.v1.IJob>): void; + listJobs( + request: protos.google.cloud.dataproc.v1.IListJobsRequest, + callback: PaginationCallback< + protos.google.cloud.dataproc.v1.IListJobsRequest, + protos.google.cloud.dataproc.v1.IListJobsResponse|null|undefined, + protos.google.cloud.dataproc.v1.IJob>): void; + listJobs( + request?: protos.google.cloud.dataproc.v1.IListJobsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.dataproc.v1.IListJobsRequest, + protos.google.cloud.dataproc.v1.IListJobsResponse|null|undefined, + protos.google.cloud.dataproc.v1.IJob>, + callback?: PaginationCallback< + protos.google.cloud.dataproc.v1.IListJobsRequest, + protos.google.cloud.dataproc.v1.IListJobsResponse|null|undefined, + protos.google.cloud.dataproc.v1.IJob>): + Promise<[ + protos.google.cloud.dataproc.v1.IJob[], + protos.google.cloud.dataproc.v1.IListJobsRequest|null, + protos.google.cloud.dataproc.v1.IListJobsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'project_id': request.projectId?.toString() ?? '', + 'region': request.region ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.dataproc.v1.IListJobsRequest, + protos.google.cloud.dataproc.v1.IListJobsResponse|null|undefined, + protos.google.cloud.dataproc.v1.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.dataproc.v1.IJob[], + protos.google.cloud.dataproc.v1.IListJobsRequest|null, + protos.google.cloud.dataproc.v1.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.projectId + * Required. The ID of the Google Cloud Platform project that the job + * belongs to. + * @param {string} request.region + * Required. The Dataproc region in which to handle the request. + * @param {number} [request.pageSize] + * Optional. The number of results to return in each response. + * @param {string} [request.pageToken] + * Optional. The page token, returned by a previous call, to request the + * next page of results. + * @param {string} [request.clusterName] + * Optional. If set, the returned jobs list includes only jobs that were + * submitted to the named cluster. + * @param {google.cloud.dataproc.v1.ListJobsRequest.JobStateMatcher} [request.jobStateMatcher] + * Optional. Specifies enumerated categories of jobs to list. + * (default = match ALL jobs). + * + * If `filter` is provided, `jobStateMatcher` will be ignored. + * @param {string} [request.filter] + * Optional. A filter constraining the jobs to list. Filters are + * case-sensitive and have the following syntax: + * + * [field = value] AND [field [= value]] ... + * + * where **field** is `status.state` or `labels.[KEY]`, and `[KEY]` is a label + * key. **value** can be `*` to match all values. + * `status.state` can be either `ACTIVE` or `NON_ACTIVE`. + * Only the logical `AND` operator is supported; space-separated items are + * treated as having an implicit `AND` operator. + * + * Example filter: + * + * status.state = ACTIVE AND labels.env = staging AND labels.starred = * + * @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.dataproc.v1.Job|Job} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listJobsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listJobsStream( + request?: protos.google.cloud.dataproc.v1.IListJobsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'project_id': request.projectId?.toString() ?? '', + 'region': request.region ?? '', + }); + 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.projectId + * Required. The ID of the Google Cloud Platform project that the job + * belongs to. + * @param {string} request.region + * Required. The Dataproc region in which to handle the request. + * @param {number} [request.pageSize] + * Optional. The number of results to return in each response. + * @param {string} [request.pageToken] + * Optional. The page token, returned by a previous call, to request the + * next page of results. + * @param {string} [request.clusterName] + * Optional. If set, the returned jobs list includes only jobs that were + * submitted to the named cluster. + * @param {google.cloud.dataproc.v1.ListJobsRequest.JobStateMatcher} [request.jobStateMatcher] + * Optional. Specifies enumerated categories of jobs to list. + * (default = match ALL jobs). + * + * If `filter` is provided, `jobStateMatcher` will be ignored. + * @param {string} [request.filter] + * Optional. A filter constraining the jobs to list. Filters are + * case-sensitive and have the following syntax: + * + * [field = value] AND [field [= value]] ... + * + * where **field** is `status.state` or `labels.[KEY]`, and `[KEY]` is a label + * key. **value** can be `*` to match all values. + * `status.state` can be either `ACTIVE` or `NON_ACTIVE`. + * Only the logical `AND` operator is supported; space-separated items are + * treated as having an implicit `AND` operator. + * + * Example filter: + * + * status.state = ACTIVE AND labels.env = staging AND labels.starred = * + * @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.dataproc.v1.Job|Job}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/job_controller.list_jobs.js + * region_tag:dataproc_v1_generated_JobController_ListJobs_async + */ + listJobsAsync( + request?: protos.google.cloud.dataproc.v1.IListJobsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'project_id': request.projectId?.toString() ?? '', + 'region': request.region ?? '', + }); + 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 the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @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 {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @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/interfaces/CallOptions.html | 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.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@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 batch resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch + * @returns {string} Resource name string. + */ + batchPath(project:string,location:string,batch:string) { + return this.pathTemplates.batchPathTemplate.render({ + project: project, + location: location, + batch: batch, + }); + } + + /** + * Parse the project from Batch resource. + * + * @param {string} batchName + * A fully-qualified path representing Batch resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchName(batchName: string) { + return this.pathTemplates.batchPathTemplate.match(batchName).project; + } + + /** + * Parse the location from Batch resource. + * + * @param {string} batchName + * A fully-qualified path representing Batch resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchName(batchName: string) { + return this.pathTemplates.batchPathTemplate.match(batchName).location; + } + + /** + * Parse the batch from Batch resource. + * + * @param {string} batchName + * A fully-qualified path representing Batch resource. + * @returns {string} A string representing the batch. + */ + matchBatchFromBatchName(batchName: string) { + return this.pathTemplates.batchPathTemplate.match(batchName).batch; + } + + /** + * Return a fully-qualified nodeGroup resource name string. + * + * @param {string} project + * @param {string} region + * @param {string} cluster + * @param {string} node_group + * @returns {string} Resource name string. + */ + nodeGroupPath(project:string,region:string,cluster:string,nodeGroup:string) { + return this.pathTemplates.nodeGroupPathTemplate.render({ + project: project, + region: region, + cluster: cluster, + node_group: nodeGroup, + }); + } + + /** + * Parse the project from NodeGroup resource. + * + * @param {string} nodeGroupName + * A fully-qualified path representing NodeGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNodeGroupName(nodeGroupName: string) { + return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).project; + } + + /** + * Parse the region from NodeGroup resource. + * + * @param {string} nodeGroupName + * A fully-qualified path representing NodeGroup resource. + * @returns {string} A string representing the region. + */ + matchRegionFromNodeGroupName(nodeGroupName: string) { + return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).region; + } + + /** + * Parse the cluster from NodeGroup resource. + * + * @param {string} nodeGroupName + * A fully-qualified path representing NodeGroup resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromNodeGroupName(nodeGroupName: string) { + return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).cluster; + } + + /** + * Parse the node_group from NodeGroup resource. + * + * @param {string} nodeGroupName + * A fully-qualified path representing NodeGroup resource. + * @returns {string} A string representing the node_group. + */ + matchNodeGroupFromNodeGroupName(nodeGroupName: string) { + return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).node_group; + } + + /** + * Return a fully-qualified projectLocationAutoscalingPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} autoscaling_policy + * @returns {string} Resource name string. + */ + projectLocationAutoscalingPolicyPath(project:string,location:string,autoscalingPolicy:string) { + return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render({ + project: project, + location: location, + autoscaling_policy: autoscalingPolicy, + }); + } + + /** + * Parse the project from ProjectLocationAutoscalingPolicy resource. + * + * @param {string} projectLocationAutoscalingPolicyName + * A fully-qualified path representing project_location_autoscaling_policy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { + return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).project; + } + + /** + * Parse the location from ProjectLocationAutoscalingPolicy resource. + * + * @param {string} projectLocationAutoscalingPolicyName + * A fully-qualified path representing project_location_autoscaling_policy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { + return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).location; + } + + /** + * Parse the autoscaling_policy from ProjectLocationAutoscalingPolicy resource. + * + * @param {string} projectLocationAutoscalingPolicyName + * A fully-qualified path representing project_location_autoscaling_policy resource. + * @returns {string} A string representing the autoscaling_policy. + */ + matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { + return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).autoscaling_policy; + } + + /** + * Return a fully-qualified projectLocationWorkflowTemplate resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} workflow_template + * @returns {string} Resource name string. + */ + projectLocationWorkflowTemplatePath(project:string,location:string,workflowTemplate:string) { + return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render({ + project: project, + location: location, + workflow_template: workflowTemplate, + }); + } + + /** + * Parse the project from ProjectLocationWorkflowTemplate resource. + * + * @param {string} projectLocationWorkflowTemplateName + * A fully-qualified path representing project_location_workflow_template resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { + return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).project; + } + + /** + * Parse the location from ProjectLocationWorkflowTemplate resource. + * + * @param {string} projectLocationWorkflowTemplateName + * A fully-qualified path representing project_location_workflow_template resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { + return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).location; + } + + /** + * Parse the workflow_template from ProjectLocationWorkflowTemplate resource. + * + * @param {string} projectLocationWorkflowTemplateName + * A fully-qualified path representing project_location_workflow_template resource. + * @returns {string} A string representing the workflow_template. + */ + matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { + return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).workflow_template; + } + + /** + * Return a fully-qualified projectRegionAutoscalingPolicy resource name string. + * + * @param {string} project + * @param {string} region + * @param {string} autoscaling_policy + * @returns {string} Resource name string. + */ + projectRegionAutoscalingPolicyPath(project:string,region:string,autoscalingPolicy:string) { + return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render({ + project: project, + region: region, + autoscaling_policy: autoscalingPolicy, + }); + } + + /** + * Parse the project from ProjectRegionAutoscalingPolicy resource. + * + * @param {string} projectRegionAutoscalingPolicyName + * A fully-qualified path representing project_region_autoscaling_policy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { + return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).project; + } + + /** + * Parse the region from ProjectRegionAutoscalingPolicy resource. + * + * @param {string} projectRegionAutoscalingPolicyName + * A fully-qualified path representing project_region_autoscaling_policy resource. + * @returns {string} A string representing the region. + */ + matchRegionFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { + return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).region; + } + + /** + * Parse the autoscaling_policy from ProjectRegionAutoscalingPolicy resource. + * + * @param {string} projectRegionAutoscalingPolicyName + * A fully-qualified path representing project_region_autoscaling_policy resource. + * @returns {string} A string representing the autoscaling_policy. + */ + matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { + return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).autoscaling_policy; + } + + /** + * Return a fully-qualified projectRegionWorkflowTemplate resource name string. + * + * @param {string} project + * @param {string} region + * @param {string} workflow_template + * @returns {string} Resource name string. + */ + projectRegionWorkflowTemplatePath(project:string,region:string,workflowTemplate:string) { + return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render({ + project: project, + region: region, + workflow_template: workflowTemplate, + }); + } + + /** + * Parse the project from ProjectRegionWorkflowTemplate resource. + * + * @param {string} projectRegionWorkflowTemplateName + * A fully-qualified path representing project_region_workflow_template resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { + return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).project; + } + + /** + * Parse the region from ProjectRegionWorkflowTemplate resource. + * + * @param {string} projectRegionWorkflowTemplateName + * A fully-qualified path representing project_region_workflow_template resource. + * @returns {string} A string representing the region. + */ + matchRegionFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { + return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).region; + } + + /** + * Parse the workflow_template from ProjectRegionWorkflowTemplate resource. + * + * @param {string} projectRegionWorkflowTemplateName + * A fully-qualified path representing project_region_workflow_template resource. + * @returns {string} A string representing the workflow_template. + */ + matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { + return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).workflow_template; + } + + /** + * Return a fully-qualified session resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} session + * @returns {string} Resource name string. + */ + sessionPath(project:string,location:string,session:string) { + return this.pathTemplates.sessionPathTemplate.render({ + project: project, + location: location, + session: session, + }); + } + + /** + * Parse the project from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).project; + } + + /** + * Parse the location from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).location; + } + + /** + * Parse the session from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the session. + */ + matchSessionFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).session; + } + + /** + * Return a fully-qualified sessionTemplate resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} template + * @returns {string} Resource name string. + */ + sessionTemplatePath(project:string,location:string,template:string) { + return this.pathTemplates.sessionTemplatePathTemplate.render({ + project: project, + location: location, + template: template, + }); + } + + /** + * Parse the project from SessionTemplate resource. + * + * @param {string} sessionTemplateName + * A fully-qualified path representing SessionTemplate resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSessionTemplateName(sessionTemplateName: string) { + return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).project; + } + + /** + * Parse the location from SessionTemplate resource. + * + * @param {string} sessionTemplateName + * A fully-qualified path representing SessionTemplate resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSessionTemplateName(sessionTemplateName: string) { + return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).location; + } + + /** + * Parse the template from SessionTemplate resource. + * + * @param {string} sessionTemplateName + * A fully-qualified path representing SessionTemplate resource. + * @returns {string} A string representing the template. + */ + matchTemplateFromSessionTemplateName(sessionTemplateName: string) { + return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).template; + } + + /** + * 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.jobControllerStub && !this._terminated) { + return this.jobControllerStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.iamClient.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-dataproc/src/v1/job_controller_client_config.json b/owl-bot-staging/google-cloud-dataproc/src/v1/job_controller_client_config.json new file mode 100644 index 000000000000..5d75711034e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/src/v1/job_controller_client_config.json @@ -0,0 +1,69 @@ +{ + "interfaces": { + "google.cloud.dataproc.v1.JobController": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ], + "deadline_exceeded_internal_unavailable": [ + "DEADLINE_EXCEEDED", + "INTERNAL", + "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": { + "SubmitJob": { + "timeout_millis": 900000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "SubmitJobAsOperation": { + "timeout_millis": 900000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetJob": { + "timeout_millis": 900000, + "retry_codes_name": "deadline_exceeded_internal_unavailable", + "retry_params_name": "default" + }, + "ListJobs": { + "timeout_millis": 900000, + "retry_codes_name": "deadline_exceeded_internal_unavailable", + "retry_params_name": "default" + }, + "UpdateJob": { + "timeout_millis": 900000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CancelJob": { + "timeout_millis": 900000, + "retry_codes_name": "deadline_exceeded_internal_unavailable", + "retry_params_name": "default" + }, + "DeleteJob": { + "timeout_millis": 900000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/job_controller_proto_list.json b/owl-bot-staging/google-cloud-dataproc/src/v1/job_controller_proto_list.json new file mode 100644 index 000000000000..d6798f50ae7c --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/src/v1/job_controller_proto_list.json @@ -0,0 +1,12 @@ +[ + "../../protos/google/cloud/dataproc/v1/autoscaling_policies.proto", + "../../protos/google/cloud/dataproc/v1/batches.proto", + "../../protos/google/cloud/dataproc/v1/clusters.proto", + "../../protos/google/cloud/dataproc/v1/jobs.proto", + "../../protos/google/cloud/dataproc/v1/node_groups.proto", + "../../protos/google/cloud/dataproc/v1/operations.proto", + "../../protos/google/cloud/dataproc/v1/session_templates.proto", + "../../protos/google/cloud/dataproc/v1/sessions.proto", + "../../protos/google/cloud/dataproc/v1/shared.proto", + "../../protos/google/cloud/dataproc/v1/workflow_templates.proto" +] diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/node_group_controller_client.ts b/owl-bot-staging/google-cloud-dataproc/src/v1/node_group_controller_client.ts new file mode 100644 index 000000000000..9f4b7faf3085 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/src/v1/node_group_controller_client.ts @@ -0,0 +1,1673 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, IamClient, IamProtos} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/node_group_controller_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './node_group_controller_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The `NodeGroupControllerService` provides methods to manage node groups + * of Compute Engine managed instances. + * @class + * @memberof v1 + */ +export class NodeGroupControllerClient { + 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('dataproc'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + nodeGroupControllerStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of NodeGroupControllerClient. + * + * @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 NodeGroupControllerClient({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 NodeGroupControllerClient; + 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 = 'dataproc.' + 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.iamClient = new this._gaxModule.IamClient(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 = { + batchPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batches/{batch}' + ), + clusterRegionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/regions/{region}/clusters/{cluster}' + ), + nodeGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{node_group}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectLocationAutoscalingPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/autoscalingPolicies/{autoscaling_policy}' + ), + projectLocationWorkflowTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/workflowTemplates/{workflow_template}' + ), + projectRegionAutoscalingPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/regions/{region}/autoscalingPolicies/{autoscaling_policy}' + ), + projectRegionWorkflowTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/regions/{region}/workflowTemplates/{workflow_template}' + ), + regionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/regions/{region}' + ), + sessionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/sessions/{session}' + ), + sessionTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/sessionTemplates/{template}' + ), + }; + + 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.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1/{resource=projects/*/regions/*/clusters/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:getIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/regions/*/clusters/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/regions/*/clusters/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:testIamPermissions',body: '*',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/regions/*/operations/*}:cancel',additional_bindings: [{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/regions/*/operations/*}',additional_bindings: [{delete: '/v1/{name=projects/*/locations/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/regions/*/operations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/regions/*/operations}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*/operations}',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const createNodeGroupResponse = protoFilesRoot.lookup( + '.google.cloud.dataproc.v1.NodeGroup') as gax.protobuf.Type; + const createNodeGroupMetadata = protoFilesRoot.lookup( + '.google.cloud.dataproc.v1.NodeGroupOperationMetadata') as gax.protobuf.Type; + const resizeNodeGroupResponse = protoFilesRoot.lookup( + '.google.cloud.dataproc.v1.NodeGroup') as gax.protobuf.Type; + const resizeNodeGroupMetadata = protoFilesRoot.lookup( + '.google.cloud.dataproc.v1.NodeGroupOperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createNodeGroup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createNodeGroupResponse.decode.bind(createNodeGroupResponse), + createNodeGroupMetadata.decode.bind(createNodeGroupMetadata)), + resizeNodeGroup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + resizeNodeGroupResponse.decode.bind(resizeNodeGroupResponse), + resizeNodeGroupMetadata.decode.bind(resizeNodeGroupMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dataproc.v1.NodeGroupController', 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.nodeGroupControllerStub) { + return this.nodeGroupControllerStub; + } + + // Put together the "service stub" for + // google.cloud.dataproc.v1.NodeGroupController. + this.nodeGroupControllerStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.dataproc.v1.NodeGroupController') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dataproc.v1.NodeGroupController, + 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 nodeGroupControllerStubMethods = + ['createNodeGroup', 'resizeNodeGroup', 'getNodeGroup']; + for (const methodName of nodeGroupControllerStubMethods) { + const callPromise = this.nodeGroupControllerStub.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.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.nodeGroupControllerStub; + } + + /** + * 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 'dataproc.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 'dataproc.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 the resource representation for a node group in a + * cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the node group to retrieve. + * Format: + * `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.dataproc.v1.NodeGroup|NodeGroup}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/node_group_controller.get_node_group.js + * region_tag:dataproc_v1_generated_NodeGroupController_GetNodeGroup_async + */ + getNodeGroup( + request?: protos.google.cloud.dataproc.v1.IGetNodeGroupRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataproc.v1.INodeGroup, + protos.google.cloud.dataproc.v1.IGetNodeGroupRequest|undefined, {}|undefined + ]>; + getNodeGroup( + request: protos.google.cloud.dataproc.v1.IGetNodeGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataproc.v1.INodeGroup, + protos.google.cloud.dataproc.v1.IGetNodeGroupRequest|null|undefined, + {}|null|undefined>): void; + getNodeGroup( + request: protos.google.cloud.dataproc.v1.IGetNodeGroupRequest, + callback: Callback< + protos.google.cloud.dataproc.v1.INodeGroup, + protos.google.cloud.dataproc.v1.IGetNodeGroupRequest|null|undefined, + {}|null|undefined>): void; + getNodeGroup( + request?: protos.google.cloud.dataproc.v1.IGetNodeGroupRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataproc.v1.INodeGroup, + protos.google.cloud.dataproc.v1.IGetNodeGroupRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataproc.v1.INodeGroup, + protos.google.cloud.dataproc.v1.IGetNodeGroupRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataproc.v1.INodeGroup, + protos.google.cloud.dataproc.v1.IGetNodeGroupRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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('getNodeGroup request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.dataproc.v1.INodeGroup, + protos.google.cloud.dataproc.v1.IGetNodeGroupRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getNodeGroup response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getNodeGroup(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.dataproc.v1.INodeGroup, + protos.google.cloud.dataproc.v1.IGetNodeGroupRequest|undefined, + {}|undefined + ]) => { + this._log.info('getNodeGroup 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 node group in a cluster. The returned + * {@link protos.google.longrunning.Operation.metadata|Operation.metadata} is + * [NodeGroupOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource where this node group will be created. + * Format: `projects/{project}/regions/{region}/clusters/{cluster}` + * @param {google.cloud.dataproc.v1.NodeGroup} request.nodeGroup + * Required. The node group to create. + * @param {string} [request.nodeGroupId] + * Optional. An optional node group ID. Generated if not specified. + * + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). Cannot begin or end with underscore + * or hyphen. Must consist of from 3 to 33 characters. + * @param {string} [request.requestId] + * Optional. A unique ID used to identify the request. If the server receives + * two + * [CreateNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateNodeGroupRequests) + * with the same ID, the second request is ignored and the + * first {@link protos.google.longrunning.Operation|google.longrunning.Operation} created + * and stored in the backend is returned. + * + * Recommendation: Set this value to a + * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + * + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/node_group_controller.create_node_group.js + * region_tag:dataproc_v1_generated_NodeGroupController_CreateNodeGroup_async + */ + createNodeGroup( + request?: protos.google.cloud.dataproc.v1.ICreateNodeGroupRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createNodeGroup( + request: protos.google.cloud.dataproc.v1.ICreateNodeGroupRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createNodeGroup( + request: protos.google.cloud.dataproc.v1.ICreateNodeGroupRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createNodeGroup( + request?: protos.google.cloud.dataproc.v1.ICreateNodeGroupRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createNodeGroup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createNodeGroup request %j', request); + return this.innerApiCalls.createNodeGroup(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createNodeGroup response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createNodeGroup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/node_group_controller.create_node_group.js + * region_tag:dataproc_v1_generated_NodeGroupController_CreateNodeGroup_async + */ + async checkCreateNodeGroupProgress(name: string): Promise>{ + this._log.info('createNodeGroup 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.createNodeGroup, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Resizes a node group in a cluster. The returned + * {@link protos.google.longrunning.Operation.metadata|Operation.metadata} is + * [NodeGroupOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the node group to resize. + * Format: + * `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` + * @param {number} request.size + * Required. The number of running instances for the node group to maintain. + * The group adds or removes instances to maintain the number of instances + * specified by this parameter. + * @param {string} [request.requestId] + * Optional. A unique ID used to identify the request. If the server receives + * two + * [ResizeNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.ResizeNodeGroupRequests) + * with the same ID, the second request is ignored and the + * first {@link protos.google.longrunning.Operation|google.longrunning.Operation} created + * and stored in the backend is returned. + * + * Recommendation: Set this value to a + * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + * + * The ID must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + * @param {google.protobuf.Duration} [request.gracefulDecommissionTimeout] + * Optional. Timeout for graceful YARN decommissioning. [Graceful + * decommissioning] + * (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/scaling-clusters#graceful_decommissioning) + * allows the removal of nodes from the Compute Engine node group + * without interrupting jobs in progress. This timeout specifies how long to + * wait for jobs in progress to finish before forcefully removing nodes (and + * potentially interrupting jobs). Default timeout is 0 (for forceful + * decommission), and the maximum allowed timeout is 1 day. (see JSON + * representation of + * [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). + * + * Only supported on Dataproc image versions 1.2 and higher. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/node_group_controller.resize_node_group.js + * region_tag:dataproc_v1_generated_NodeGroupController_ResizeNodeGroup_async + */ + resizeNodeGroup( + request?: protos.google.cloud.dataproc.v1.IResizeNodeGroupRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + resizeNodeGroup( + request: protos.google.cloud.dataproc.v1.IResizeNodeGroupRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + resizeNodeGroup( + request: protos.google.cloud.dataproc.v1.IResizeNodeGroupRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + resizeNodeGroup( + request?: protos.google.cloud.dataproc.v1.IResizeNodeGroupRequest, + 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('resizeNodeGroup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('resizeNodeGroup request %j', request); + return this.innerApiCalls.resizeNodeGroup(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('resizeNodeGroup response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `resizeNodeGroup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/node_group_controller.resize_node_group.js + * region_tag:dataproc_v1_generated_NodeGroupController_ResizeNodeGroup_async + */ + async checkResizeNodeGroupProgress(name: string): Promise>{ + this._log.info('resizeNodeGroup 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.resizeNodeGroup, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @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 {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @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/interfaces/CallOptions.html | 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.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@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 batch resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch + * @returns {string} Resource name string. + */ + batchPath(project:string,location:string,batch:string) { + return this.pathTemplates.batchPathTemplate.render({ + project: project, + location: location, + batch: batch, + }); + } + + /** + * Parse the project from Batch resource. + * + * @param {string} batchName + * A fully-qualified path representing Batch resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchName(batchName: string) { + return this.pathTemplates.batchPathTemplate.match(batchName).project; + } + + /** + * Parse the location from Batch resource. + * + * @param {string} batchName + * A fully-qualified path representing Batch resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchName(batchName: string) { + return this.pathTemplates.batchPathTemplate.match(batchName).location; + } + + /** + * Parse the batch from Batch resource. + * + * @param {string} batchName + * A fully-qualified path representing Batch resource. + * @returns {string} A string representing the batch. + */ + matchBatchFromBatchName(batchName: string) { + return this.pathTemplates.batchPathTemplate.match(batchName).batch; + } + + /** + * Return a fully-qualified clusterRegion resource name string. + * + * @param {string} project + * @param {string} region + * @param {string} cluster + * @returns {string} Resource name string. + */ + clusterRegionPath(project:string,region:string,cluster:string) { + return this.pathTemplates.clusterRegionPathTemplate.render({ + project: project, + region: region, + cluster: cluster, + }); + } + + /** + * Parse the project from ClusterRegion resource. + * + * @param {string} clusterRegionName + * A fully-qualified path representing ClusterRegion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromClusterRegionName(clusterRegionName: string) { + return this.pathTemplates.clusterRegionPathTemplate.match(clusterRegionName).project; + } + + /** + * Parse the region from ClusterRegion resource. + * + * @param {string} clusterRegionName + * A fully-qualified path representing ClusterRegion resource. + * @returns {string} A string representing the region. + */ + matchRegionFromClusterRegionName(clusterRegionName: string) { + return this.pathTemplates.clusterRegionPathTemplate.match(clusterRegionName).region; + } + + /** + * Parse the cluster from ClusterRegion resource. + * + * @param {string} clusterRegionName + * A fully-qualified path representing ClusterRegion resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromClusterRegionName(clusterRegionName: string) { + return this.pathTemplates.clusterRegionPathTemplate.match(clusterRegionName).cluster; + } + + /** + * Return a fully-qualified nodeGroup resource name string. + * + * @param {string} project + * @param {string} region + * @param {string} cluster + * @param {string} node_group + * @returns {string} Resource name string. + */ + nodeGroupPath(project:string,region:string,cluster:string,nodeGroup:string) { + return this.pathTemplates.nodeGroupPathTemplate.render({ + project: project, + region: region, + cluster: cluster, + node_group: nodeGroup, + }); + } + + /** + * Parse the project from NodeGroup resource. + * + * @param {string} nodeGroupName + * A fully-qualified path representing NodeGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNodeGroupName(nodeGroupName: string) { + return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).project; + } + + /** + * Parse the region from NodeGroup resource. + * + * @param {string} nodeGroupName + * A fully-qualified path representing NodeGroup resource. + * @returns {string} A string representing the region. + */ + matchRegionFromNodeGroupName(nodeGroupName: string) { + return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).region; + } + + /** + * Parse the cluster from NodeGroup resource. + * + * @param {string} nodeGroupName + * A fully-qualified path representing NodeGroup resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromNodeGroupName(nodeGroupName: string) { + return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).cluster; + } + + /** + * Parse the node_group from NodeGroup resource. + * + * @param {string} nodeGroupName + * A fully-qualified path representing NodeGroup resource. + * @returns {string} A string representing the node_group. + */ + matchNodeGroupFromNodeGroupName(nodeGroupName: string) { + return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).node_group; + } + + /** + * 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 projectLocationAutoscalingPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} autoscaling_policy + * @returns {string} Resource name string. + */ + projectLocationAutoscalingPolicyPath(project:string,location:string,autoscalingPolicy:string) { + return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render({ + project: project, + location: location, + autoscaling_policy: autoscalingPolicy, + }); + } + + /** + * Parse the project from ProjectLocationAutoscalingPolicy resource. + * + * @param {string} projectLocationAutoscalingPolicyName + * A fully-qualified path representing project_location_autoscaling_policy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { + return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).project; + } + + /** + * Parse the location from ProjectLocationAutoscalingPolicy resource. + * + * @param {string} projectLocationAutoscalingPolicyName + * A fully-qualified path representing project_location_autoscaling_policy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { + return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).location; + } + + /** + * Parse the autoscaling_policy from ProjectLocationAutoscalingPolicy resource. + * + * @param {string} projectLocationAutoscalingPolicyName + * A fully-qualified path representing project_location_autoscaling_policy resource. + * @returns {string} A string representing the autoscaling_policy. + */ + matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { + return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).autoscaling_policy; + } + + /** + * Return a fully-qualified projectLocationWorkflowTemplate resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} workflow_template + * @returns {string} Resource name string. + */ + projectLocationWorkflowTemplatePath(project:string,location:string,workflowTemplate:string) { + return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render({ + project: project, + location: location, + workflow_template: workflowTemplate, + }); + } + + /** + * Parse the project from ProjectLocationWorkflowTemplate resource. + * + * @param {string} projectLocationWorkflowTemplateName + * A fully-qualified path representing project_location_workflow_template resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { + return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).project; + } + + /** + * Parse the location from ProjectLocationWorkflowTemplate resource. + * + * @param {string} projectLocationWorkflowTemplateName + * A fully-qualified path representing project_location_workflow_template resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { + return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).location; + } + + /** + * Parse the workflow_template from ProjectLocationWorkflowTemplate resource. + * + * @param {string} projectLocationWorkflowTemplateName + * A fully-qualified path representing project_location_workflow_template resource. + * @returns {string} A string representing the workflow_template. + */ + matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { + return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).workflow_template; + } + + /** + * Return a fully-qualified projectRegionAutoscalingPolicy resource name string. + * + * @param {string} project + * @param {string} region + * @param {string} autoscaling_policy + * @returns {string} Resource name string. + */ + projectRegionAutoscalingPolicyPath(project:string,region:string,autoscalingPolicy:string) { + return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render({ + project: project, + region: region, + autoscaling_policy: autoscalingPolicy, + }); + } + + /** + * Parse the project from ProjectRegionAutoscalingPolicy resource. + * + * @param {string} projectRegionAutoscalingPolicyName + * A fully-qualified path representing project_region_autoscaling_policy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { + return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).project; + } + + /** + * Parse the region from ProjectRegionAutoscalingPolicy resource. + * + * @param {string} projectRegionAutoscalingPolicyName + * A fully-qualified path representing project_region_autoscaling_policy resource. + * @returns {string} A string representing the region. + */ + matchRegionFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { + return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).region; + } + + /** + * Parse the autoscaling_policy from ProjectRegionAutoscalingPolicy resource. + * + * @param {string} projectRegionAutoscalingPolicyName + * A fully-qualified path representing project_region_autoscaling_policy resource. + * @returns {string} A string representing the autoscaling_policy. + */ + matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { + return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).autoscaling_policy; + } + + /** + * Return a fully-qualified projectRegionWorkflowTemplate resource name string. + * + * @param {string} project + * @param {string} region + * @param {string} workflow_template + * @returns {string} Resource name string. + */ + projectRegionWorkflowTemplatePath(project:string,region:string,workflowTemplate:string) { + return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render({ + project: project, + region: region, + workflow_template: workflowTemplate, + }); + } + + /** + * Parse the project from ProjectRegionWorkflowTemplate resource. + * + * @param {string} projectRegionWorkflowTemplateName + * A fully-qualified path representing project_region_workflow_template resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { + return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).project; + } + + /** + * Parse the region from ProjectRegionWorkflowTemplate resource. + * + * @param {string} projectRegionWorkflowTemplateName + * A fully-qualified path representing project_region_workflow_template resource. + * @returns {string} A string representing the region. + */ + matchRegionFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { + return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).region; + } + + /** + * Parse the workflow_template from ProjectRegionWorkflowTemplate resource. + * + * @param {string} projectRegionWorkflowTemplateName + * A fully-qualified path representing project_region_workflow_template resource. + * @returns {string} A string representing the workflow_template. + */ + matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { + return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).workflow_template; + } + + /** + * Return a fully-qualified region resource name string. + * + * @param {string} project + * @param {string} region + * @returns {string} Resource name string. + */ + regionPath(project:string,region:string) { + return this.pathTemplates.regionPathTemplate.render({ + project: project, + region: region, + }); + } + + /** + * Parse the project from Region resource. + * + * @param {string} regionName + * A fully-qualified path representing Region resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRegionName(regionName: string) { + return this.pathTemplates.regionPathTemplate.match(regionName).project; + } + + /** + * Parse the region from Region resource. + * + * @param {string} regionName + * A fully-qualified path representing Region resource. + * @returns {string} A string representing the region. + */ + matchRegionFromRegionName(regionName: string) { + return this.pathTemplates.regionPathTemplate.match(regionName).region; + } + + /** + * Return a fully-qualified session resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} session + * @returns {string} Resource name string. + */ + sessionPath(project:string,location:string,session:string) { + return this.pathTemplates.sessionPathTemplate.render({ + project: project, + location: location, + session: session, + }); + } + + /** + * Parse the project from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).project; + } + + /** + * Parse the location from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).location; + } + + /** + * Parse the session from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the session. + */ + matchSessionFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).session; + } + + /** + * Return a fully-qualified sessionTemplate resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} template + * @returns {string} Resource name string. + */ + sessionTemplatePath(project:string,location:string,template:string) { + return this.pathTemplates.sessionTemplatePathTemplate.render({ + project: project, + location: location, + template: template, + }); + } + + /** + * Parse the project from SessionTemplate resource. + * + * @param {string} sessionTemplateName + * A fully-qualified path representing SessionTemplate resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSessionTemplateName(sessionTemplateName: string) { + return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).project; + } + + /** + * Parse the location from SessionTemplate resource. + * + * @param {string} sessionTemplateName + * A fully-qualified path representing SessionTemplate resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSessionTemplateName(sessionTemplateName: string) { + return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).location; + } + + /** + * Parse the template from SessionTemplate resource. + * + * @param {string} sessionTemplateName + * A fully-qualified path representing SessionTemplate resource. + * @returns {string} A string representing the template. + */ + matchTemplateFromSessionTemplateName(sessionTemplateName: string) { + return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).template; + } + + /** + * 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.nodeGroupControllerStub && !this._terminated) { + return this.nodeGroupControllerStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.iamClient.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-dataproc/src/v1/node_group_controller_client_config.json b/owl-bot-staging/google-cloud-dataproc/src/v1/node_group_controller_client_config.json new file mode 100644 index 000000000000..3e7761ab670f --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/src/v1/node_group_controller_client_config.json @@ -0,0 +1,38 @@ +{ + "interfaces": { + "google.cloud.dataproc.v1.NodeGroupController": { + "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": { + "CreateNodeGroup": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ResizeNodeGroup": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetNodeGroup": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/node_group_controller_proto_list.json b/owl-bot-staging/google-cloud-dataproc/src/v1/node_group_controller_proto_list.json new file mode 100644 index 000000000000..d6798f50ae7c --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/src/v1/node_group_controller_proto_list.json @@ -0,0 +1,12 @@ +[ + "../../protos/google/cloud/dataproc/v1/autoscaling_policies.proto", + "../../protos/google/cloud/dataproc/v1/batches.proto", + "../../protos/google/cloud/dataproc/v1/clusters.proto", + "../../protos/google/cloud/dataproc/v1/jobs.proto", + "../../protos/google/cloud/dataproc/v1/node_groups.proto", + "../../protos/google/cloud/dataproc/v1/operations.proto", + "../../protos/google/cloud/dataproc/v1/session_templates.proto", + "../../protos/google/cloud/dataproc/v1/sessions.proto", + "../../protos/google/cloud/dataproc/v1/shared.proto", + "../../protos/google/cloud/dataproc/v1/workflow_templates.proto" +] diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/session_controller_client.ts b/owl-bot-staging/google-cloud-dataproc/src/v1/session_controller_client.ts new file mode 100644 index 000000000000..4bd0dc14e797 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/src/v1/session_controller_client.ts @@ -0,0 +1,1972 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, IamClient, IamProtos} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/session_controller_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './session_controller_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The `SessionController` provides methods to manage interactive sessions. + * @class + * @memberof v1 + */ +export class SessionControllerClient { + 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('dataproc'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + sessionControllerStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SessionControllerClient. + * + * @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 SessionControllerClient({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 SessionControllerClient; + 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 = 'dataproc.' + 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.iamClient = new this._gaxModule.IamClient(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 = { + batchPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batches/{batch}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + nodeGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{node_group}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectLocationAutoscalingPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/autoscalingPolicies/{autoscaling_policy}' + ), + projectLocationWorkflowTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/workflowTemplates/{workflow_template}' + ), + projectRegionAutoscalingPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/regions/{region}/autoscalingPolicies/{autoscaling_policy}' + ), + projectRegionWorkflowTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/regions/{region}/workflowTemplates/{workflow_template}' + ), + sessionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/sessions/{session}' + ), + sessionTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/sessionTemplates/{template}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listSessions: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'sessions') + }; + + 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.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1/{resource=projects/*/regions/*/clusters/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:getIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/regions/*/clusters/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/regions/*/clusters/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:testIamPermissions',body: '*',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/regions/*/operations/*}:cancel',additional_bindings: [{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/regions/*/operations/*}',additional_bindings: [{delete: '/v1/{name=projects/*/locations/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/regions/*/operations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/regions/*/operations}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*/operations}',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const createSessionResponse = protoFilesRoot.lookup( + '.google.cloud.dataproc.v1.Session') as gax.protobuf.Type; + const createSessionMetadata = protoFilesRoot.lookup( + '.google.cloud.dataproc.v1.SessionOperationMetadata') as gax.protobuf.Type; + const terminateSessionResponse = protoFilesRoot.lookup( + '.google.cloud.dataproc.v1.Session') as gax.protobuf.Type; + const terminateSessionMetadata = protoFilesRoot.lookup( + '.google.cloud.dataproc.v1.SessionOperationMetadata') as gax.protobuf.Type; + const deleteSessionResponse = protoFilesRoot.lookup( + '.google.cloud.dataproc.v1.Session') as gax.protobuf.Type; + const deleteSessionMetadata = protoFilesRoot.lookup( + '.google.cloud.dataproc.v1.SessionOperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createSession: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createSessionResponse.decode.bind(createSessionResponse), + createSessionMetadata.decode.bind(createSessionMetadata)), + terminateSession: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + terminateSessionResponse.decode.bind(terminateSessionResponse), + terminateSessionMetadata.decode.bind(terminateSessionMetadata)), + deleteSession: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteSessionResponse.decode.bind(deleteSessionResponse), + deleteSessionMetadata.decode.bind(deleteSessionMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dataproc.v1.SessionController', 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.sessionControllerStub) { + return this.sessionControllerStub; + } + + // Put together the "service stub" for + // google.cloud.dataproc.v1.SessionController. + this.sessionControllerStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.dataproc.v1.SessionController') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dataproc.v1.SessionController, + 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 sessionControllerStubMethods = + ['createSession', 'getSession', 'listSessions', 'terminateSession', 'deleteSession']; + for (const methodName of sessionControllerStubMethods) { + const callPromise = this.sessionControllerStub.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.sessionControllerStub; + } + + /** + * 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 'dataproc.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 'dataproc.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 the resource representation for an interactive session. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the session to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.dataproc.v1.Session|Session}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/session_controller.get_session.js + * region_tag:dataproc_v1_generated_SessionController_GetSession_async + */ + getSession( + request?: protos.google.cloud.dataproc.v1.IGetSessionRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataproc.v1.ISession, + protos.google.cloud.dataproc.v1.IGetSessionRequest|undefined, {}|undefined + ]>; + getSession( + request: protos.google.cloud.dataproc.v1.IGetSessionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataproc.v1.ISession, + protos.google.cloud.dataproc.v1.IGetSessionRequest|null|undefined, + {}|null|undefined>): void; + getSession( + request: protos.google.cloud.dataproc.v1.IGetSessionRequest, + callback: Callback< + protos.google.cloud.dataproc.v1.ISession, + protos.google.cloud.dataproc.v1.IGetSessionRequest|null|undefined, + {}|null|undefined>): void; + getSession( + request?: protos.google.cloud.dataproc.v1.IGetSessionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataproc.v1.ISession, + protos.google.cloud.dataproc.v1.IGetSessionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataproc.v1.ISession, + protos.google.cloud.dataproc.v1.IGetSessionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataproc.v1.ISession, + protos.google.cloud.dataproc.v1.IGetSessionRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('getSession request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.dataproc.v1.ISession, + protos.google.cloud.dataproc.v1.IGetSessionRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSession response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getSession(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.dataproc.v1.ISession, + protos.google.cloud.dataproc.v1.IGetSessionRequest|undefined, + {}|undefined + ]) => { + this._log.info('getSession response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Create an interactive session asynchronously. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource where this session will be created. + * @param {google.cloud.dataproc.v1.Session} request.session + * Required. The interactive session to create. + * @param {string} request.sessionId + * Required. The ID to use for the session, which becomes the final component + * of the session's resource name. + * + * This value must be 4-63 characters. Valid characters + * are /{@link protos.0-9|a-z}-/. + * @param {string} [request.requestId] + * Optional. A unique ID used to identify the request. If the service + * receives two + * [CreateSessionRequests](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateSessionRequest)s + * with the same ID, the second request is ignored, and the + * first {@link protos.google.cloud.dataproc.v1.Session|Session} is created and stored in + * the backend. + * + * Recommendation: Set this value to a + * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + * + * The value must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/session_controller.create_session.js + * region_tag:dataproc_v1_generated_SessionController_CreateSession_async + */ + createSession( + request?: protos.google.cloud.dataproc.v1.ICreateSessionRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createSession( + request: protos.google.cloud.dataproc.v1.ICreateSessionRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createSession( + request: protos.google.cloud.dataproc.v1.ICreateSessionRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createSession( + request?: protos.google.cloud.dataproc.v1.ICreateSessionRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createSession response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createSession request %j', request); + return this.innerApiCalls.createSession(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createSession response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createSession()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/session_controller.create_session.js + * region_tag:dataproc_v1_generated_SessionController_CreateSession_async + */ + async checkCreateSessionProgress(name: string): Promise>{ + this._log.info('createSession 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.createSession, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Terminates the interactive session. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the session resource to terminate. + * @param {string} [request.requestId] + * Optional. A unique ID used to identify the request. If the service + * receives two + * [TerminateSessionRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.TerminateSessionRequest)s + * with the same ID, the second request is ignored. + * + * Recommendation: Set this value to a + * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + * + * The value must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/session_controller.terminate_session.js + * region_tag:dataproc_v1_generated_SessionController_TerminateSession_async + */ + terminateSession( + request?: protos.google.cloud.dataproc.v1.ITerminateSessionRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + terminateSession( + request: protos.google.cloud.dataproc.v1.ITerminateSessionRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + terminateSession( + request: protos.google.cloud.dataproc.v1.ITerminateSessionRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + terminateSession( + request?: protos.google.cloud.dataproc.v1.ITerminateSessionRequest, + 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('terminateSession response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('terminateSession request %j', request); + return this.innerApiCalls.terminateSession(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('terminateSession response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `terminateSession()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/session_controller.terminate_session.js + * region_tag:dataproc_v1_generated_SessionController_TerminateSession_async + */ + async checkTerminateSessionProgress(name: string): Promise>{ + this._log.info('terminateSession 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.terminateSession, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes the interactive session resource. If the session is not in terminal + * state, it is terminated, and then deleted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the session resource to delete. + * @param {string} [request.requestId] + * Optional. A unique ID used to identify the request. If the service + * receives two + * [DeleteSessionRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteSessionRequest)s + * with the same ID, the second request is ignored. + * + * Recommendation: Set this value to a + * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + * + * The value must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/session_controller.delete_session.js + * region_tag:dataproc_v1_generated_SessionController_DeleteSession_async + */ + deleteSession( + request?: protos.google.cloud.dataproc.v1.IDeleteSessionRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteSession( + request: protos.google.cloud.dataproc.v1.IDeleteSessionRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteSession( + request: protos.google.cloud.dataproc.v1.IDeleteSessionRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteSession( + request?: protos.google.cloud.dataproc.v1.IDeleteSessionRequest, + 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('deleteSession response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteSession request %j', request); + return this.innerApiCalls.deleteSession(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteSession response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteSession()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/session_controller.delete_session.js + * region_tag:dataproc_v1_generated_SessionController_DeleteSession_async + */ + async checkDeleteSessionProgress(name: string): Promise>{ + this._log.info('deleteSession 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.deleteSession, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists interactive sessions. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of sessions. + * @param {number} [request.pageSize] + * Optional. The maximum number of sessions to return in each response. + * The service may return fewer than this value. + * @param {string} [request.pageToken] + * Optional. A page token received from a previous `ListSessions` call. + * Provide this token to retrieve the subsequent page. + * @param {string} [request.filter] + * Optional. A filter for the sessions to return in the response. + * + * A filter is a logical expression constraining the values of various fields + * in each session resource. Filters are case sensitive, and may contain + * multiple clauses combined with logical operators (AND, OR). + * Supported fields are `session_id`, `session_uuid`, `state`, `create_time`, + * and `labels`. + * + * Example: `state = ACTIVE and create_time < "2023-01-01T00:00:00Z"` + * is a filter for sessions in an ACTIVE state that were created before + * 2023-01-01. `state = ACTIVE and labels.environment=production` is a filter + * for sessions in an ACTIVE state that have a production environment label. + * + * See https://google.aip.dev/assets/misc/ebnf-filtering.txt for a detailed + * description of the filter syntax and a list of supported comparators. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.dataproc.v1.Session|Session}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listSessionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSessions( + request?: protos.google.cloud.dataproc.v1.IListSessionsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataproc.v1.ISession[], + protos.google.cloud.dataproc.v1.IListSessionsRequest|null, + protos.google.cloud.dataproc.v1.IListSessionsResponse + ]>; + listSessions( + request: protos.google.cloud.dataproc.v1.IListSessionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dataproc.v1.IListSessionsRequest, + protos.google.cloud.dataproc.v1.IListSessionsResponse|null|undefined, + protos.google.cloud.dataproc.v1.ISession>): void; + listSessions( + request: protos.google.cloud.dataproc.v1.IListSessionsRequest, + callback: PaginationCallback< + protos.google.cloud.dataproc.v1.IListSessionsRequest, + protos.google.cloud.dataproc.v1.IListSessionsResponse|null|undefined, + protos.google.cloud.dataproc.v1.ISession>): void; + listSessions( + request?: protos.google.cloud.dataproc.v1.IListSessionsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.dataproc.v1.IListSessionsRequest, + protos.google.cloud.dataproc.v1.IListSessionsResponse|null|undefined, + protos.google.cloud.dataproc.v1.ISession>, + callback?: PaginationCallback< + protos.google.cloud.dataproc.v1.IListSessionsRequest, + protos.google.cloud.dataproc.v1.IListSessionsResponse|null|undefined, + protos.google.cloud.dataproc.v1.ISession>): + Promise<[ + protos.google.cloud.dataproc.v1.ISession[], + protos.google.cloud.dataproc.v1.IListSessionsRequest|null, + protos.google.cloud.dataproc.v1.IListSessionsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: PaginationCallback< + protos.google.cloud.dataproc.v1.IListSessionsRequest, + protos.google.cloud.dataproc.v1.IListSessionsResponse|null|undefined, + protos.google.cloud.dataproc.v1.ISession>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSessions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSessions request %j', request); + return this.innerApiCalls + .listSessions(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.dataproc.v1.ISession[], + protos.google.cloud.dataproc.v1.IListSessionsRequest|null, + protos.google.cloud.dataproc.v1.IListSessionsResponse + ]) => { + this._log.info('listSessions values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listSessions`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of sessions. + * @param {number} [request.pageSize] + * Optional. The maximum number of sessions to return in each response. + * The service may return fewer than this value. + * @param {string} [request.pageToken] + * Optional. A page token received from a previous `ListSessions` call. + * Provide this token to retrieve the subsequent page. + * @param {string} [request.filter] + * Optional. A filter for the sessions to return in the response. + * + * A filter is a logical expression constraining the values of various fields + * in each session resource. Filters are case sensitive, and may contain + * multiple clauses combined with logical operators (AND, OR). + * Supported fields are `session_id`, `session_uuid`, `state`, `create_time`, + * and `labels`. + * + * Example: `state = ACTIVE and create_time < "2023-01-01T00:00:00Z"` + * is a filter for sessions in an ACTIVE state that were created before + * 2023-01-01. `state = ACTIVE and labels.environment=production` is a filter + * for sessions in an ACTIVE state that have a production environment label. + * + * See https://google.aip.dev/assets/misc/ebnf-filtering.txt for a detailed + * description of the filter syntax and a list of supported comparators. + * @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.dataproc.v1.Session|Session} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listSessionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSessionsStream( + request?: protos.google.cloud.dataproc.v1.IListSessionsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSessions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listSessions stream %j', request); + return this.descriptors.page.listSessions.createStream( + this.innerApiCalls.listSessions as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listSessions`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of sessions. + * @param {number} [request.pageSize] + * Optional. The maximum number of sessions to return in each response. + * The service may return fewer than this value. + * @param {string} [request.pageToken] + * Optional. A page token received from a previous `ListSessions` call. + * Provide this token to retrieve the subsequent page. + * @param {string} [request.filter] + * Optional. A filter for the sessions to return in the response. + * + * A filter is a logical expression constraining the values of various fields + * in each session resource. Filters are case sensitive, and may contain + * multiple clauses combined with logical operators (AND, OR). + * Supported fields are `session_id`, `session_uuid`, `state`, `create_time`, + * and `labels`. + * + * Example: `state = ACTIVE and create_time < "2023-01-01T00:00:00Z"` + * is a filter for sessions in an ACTIVE state that were created before + * 2023-01-01. `state = ACTIVE and labels.environment=production` is a filter + * for sessions in an ACTIVE state that have a production environment label. + * + * See https://google.aip.dev/assets/misc/ebnf-filtering.txt for a detailed + * description of the filter syntax and a list of supported comparators. + * @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.dataproc.v1.Session|Session}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/session_controller.list_sessions.js + * region_tag:dataproc_v1_generated_SessionController_ListSessions_async + */ + listSessionsAsync( + request?: protos.google.cloud.dataproc.v1.IListSessionsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSessions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listSessions iterate %j', request); + return this.descriptors.page.listSessions.asyncIterate( + this.innerApiCalls['listSessions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @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 {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @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/interfaces/CallOptions.html | 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.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@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 batch resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch + * @returns {string} Resource name string. + */ + batchPath(project:string,location:string,batch:string) { + return this.pathTemplates.batchPathTemplate.render({ + project: project, + location: location, + batch: batch, + }); + } + + /** + * Parse the project from Batch resource. + * + * @param {string} batchName + * A fully-qualified path representing Batch resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchName(batchName: string) { + return this.pathTemplates.batchPathTemplate.match(batchName).project; + } + + /** + * Parse the location from Batch resource. + * + * @param {string} batchName + * A fully-qualified path representing Batch resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchName(batchName: string) { + return this.pathTemplates.batchPathTemplate.match(batchName).location; + } + + /** + * Parse the batch from Batch resource. + * + * @param {string} batchName + * A fully-qualified path representing Batch resource. + * @returns {string} A string representing the batch. + */ + matchBatchFromBatchName(batchName: string) { + return this.pathTemplates.batchPathTemplate.match(batchName).batch; + } + + /** + * 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 nodeGroup resource name string. + * + * @param {string} project + * @param {string} region + * @param {string} cluster + * @param {string} node_group + * @returns {string} Resource name string. + */ + nodeGroupPath(project:string,region:string,cluster:string,nodeGroup:string) { + return this.pathTemplates.nodeGroupPathTemplate.render({ + project: project, + region: region, + cluster: cluster, + node_group: nodeGroup, + }); + } + + /** + * Parse the project from NodeGroup resource. + * + * @param {string} nodeGroupName + * A fully-qualified path representing NodeGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNodeGroupName(nodeGroupName: string) { + return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).project; + } + + /** + * Parse the region from NodeGroup resource. + * + * @param {string} nodeGroupName + * A fully-qualified path representing NodeGroup resource. + * @returns {string} A string representing the region. + */ + matchRegionFromNodeGroupName(nodeGroupName: string) { + return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).region; + } + + /** + * Parse the cluster from NodeGroup resource. + * + * @param {string} nodeGroupName + * A fully-qualified path representing NodeGroup resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromNodeGroupName(nodeGroupName: string) { + return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).cluster; + } + + /** + * Parse the node_group from NodeGroup resource. + * + * @param {string} nodeGroupName + * A fully-qualified path representing NodeGroup resource. + * @returns {string} A string representing the node_group. + */ + matchNodeGroupFromNodeGroupName(nodeGroupName: string) { + return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).node_group; + } + + /** + * 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 projectLocationAutoscalingPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} autoscaling_policy + * @returns {string} Resource name string. + */ + projectLocationAutoscalingPolicyPath(project:string,location:string,autoscalingPolicy:string) { + return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render({ + project: project, + location: location, + autoscaling_policy: autoscalingPolicy, + }); + } + + /** + * Parse the project from ProjectLocationAutoscalingPolicy resource. + * + * @param {string} projectLocationAutoscalingPolicyName + * A fully-qualified path representing project_location_autoscaling_policy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { + return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).project; + } + + /** + * Parse the location from ProjectLocationAutoscalingPolicy resource. + * + * @param {string} projectLocationAutoscalingPolicyName + * A fully-qualified path representing project_location_autoscaling_policy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { + return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).location; + } + + /** + * Parse the autoscaling_policy from ProjectLocationAutoscalingPolicy resource. + * + * @param {string} projectLocationAutoscalingPolicyName + * A fully-qualified path representing project_location_autoscaling_policy resource. + * @returns {string} A string representing the autoscaling_policy. + */ + matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { + return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).autoscaling_policy; + } + + /** + * Return a fully-qualified projectLocationWorkflowTemplate resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} workflow_template + * @returns {string} Resource name string. + */ + projectLocationWorkflowTemplatePath(project:string,location:string,workflowTemplate:string) { + return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render({ + project: project, + location: location, + workflow_template: workflowTemplate, + }); + } + + /** + * Parse the project from ProjectLocationWorkflowTemplate resource. + * + * @param {string} projectLocationWorkflowTemplateName + * A fully-qualified path representing project_location_workflow_template resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { + return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).project; + } + + /** + * Parse the location from ProjectLocationWorkflowTemplate resource. + * + * @param {string} projectLocationWorkflowTemplateName + * A fully-qualified path representing project_location_workflow_template resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { + return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).location; + } + + /** + * Parse the workflow_template from ProjectLocationWorkflowTemplate resource. + * + * @param {string} projectLocationWorkflowTemplateName + * A fully-qualified path representing project_location_workflow_template resource. + * @returns {string} A string representing the workflow_template. + */ + matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { + return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).workflow_template; + } + + /** + * Return a fully-qualified projectRegionAutoscalingPolicy resource name string. + * + * @param {string} project + * @param {string} region + * @param {string} autoscaling_policy + * @returns {string} Resource name string. + */ + projectRegionAutoscalingPolicyPath(project:string,region:string,autoscalingPolicy:string) { + return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render({ + project: project, + region: region, + autoscaling_policy: autoscalingPolicy, + }); + } + + /** + * Parse the project from ProjectRegionAutoscalingPolicy resource. + * + * @param {string} projectRegionAutoscalingPolicyName + * A fully-qualified path representing project_region_autoscaling_policy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { + return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).project; + } + + /** + * Parse the region from ProjectRegionAutoscalingPolicy resource. + * + * @param {string} projectRegionAutoscalingPolicyName + * A fully-qualified path representing project_region_autoscaling_policy resource. + * @returns {string} A string representing the region. + */ + matchRegionFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { + return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).region; + } + + /** + * Parse the autoscaling_policy from ProjectRegionAutoscalingPolicy resource. + * + * @param {string} projectRegionAutoscalingPolicyName + * A fully-qualified path representing project_region_autoscaling_policy resource. + * @returns {string} A string representing the autoscaling_policy. + */ + matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { + return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).autoscaling_policy; + } + + /** + * Return a fully-qualified projectRegionWorkflowTemplate resource name string. + * + * @param {string} project + * @param {string} region + * @param {string} workflow_template + * @returns {string} Resource name string. + */ + projectRegionWorkflowTemplatePath(project:string,region:string,workflowTemplate:string) { + return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render({ + project: project, + region: region, + workflow_template: workflowTemplate, + }); + } + + /** + * Parse the project from ProjectRegionWorkflowTemplate resource. + * + * @param {string} projectRegionWorkflowTemplateName + * A fully-qualified path representing project_region_workflow_template resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { + return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).project; + } + + /** + * Parse the region from ProjectRegionWorkflowTemplate resource. + * + * @param {string} projectRegionWorkflowTemplateName + * A fully-qualified path representing project_region_workflow_template resource. + * @returns {string} A string representing the region. + */ + matchRegionFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { + return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).region; + } + + /** + * Parse the workflow_template from ProjectRegionWorkflowTemplate resource. + * + * @param {string} projectRegionWorkflowTemplateName + * A fully-qualified path representing project_region_workflow_template resource. + * @returns {string} A string representing the workflow_template. + */ + matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { + return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).workflow_template; + } + + /** + * Return a fully-qualified session resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} session + * @returns {string} Resource name string. + */ + sessionPath(project:string,location:string,session:string) { + return this.pathTemplates.sessionPathTemplate.render({ + project: project, + location: location, + session: session, + }); + } + + /** + * Parse the project from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).project; + } + + /** + * Parse the location from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).location; + } + + /** + * Parse the session from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the session. + */ + matchSessionFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).session; + } + + /** + * Return a fully-qualified sessionTemplate resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} template + * @returns {string} Resource name string. + */ + sessionTemplatePath(project:string,location:string,template:string) { + return this.pathTemplates.sessionTemplatePathTemplate.render({ + project: project, + location: location, + template: template, + }); + } + + /** + * Parse the project from SessionTemplate resource. + * + * @param {string} sessionTemplateName + * A fully-qualified path representing SessionTemplate resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSessionTemplateName(sessionTemplateName: string) { + return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).project; + } + + /** + * Parse the location from SessionTemplate resource. + * + * @param {string} sessionTemplateName + * A fully-qualified path representing SessionTemplate resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSessionTemplateName(sessionTemplateName: string) { + return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).location; + } + + /** + * Parse the template from SessionTemplate resource. + * + * @param {string} sessionTemplateName + * A fully-qualified path representing SessionTemplate resource. + * @returns {string} A string representing the template. + */ + matchTemplateFromSessionTemplateName(sessionTemplateName: string) { + return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).template; + } + + /** + * 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.sessionControllerStub && !this._terminated) { + return this.sessionControllerStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.iamClient.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-dataproc/src/v1/session_controller_client_config.json b/owl-bot-staging/google-cloud-dataproc/src/v1/session_controller_client_config.json new file mode 100644 index 000000000000..df8b2d0cba47 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/src/v1/session_controller_client_config.json @@ -0,0 +1,46 @@ +{ + "interfaces": { + "google.cloud.dataproc.v1.SessionController": { + "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": { + "CreateSession": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetSession": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListSessions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TerminateSession": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteSession": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/session_controller_proto_list.json b/owl-bot-staging/google-cloud-dataproc/src/v1/session_controller_proto_list.json new file mode 100644 index 000000000000..d6798f50ae7c --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/src/v1/session_controller_proto_list.json @@ -0,0 +1,12 @@ +[ + "../../protos/google/cloud/dataproc/v1/autoscaling_policies.proto", + "../../protos/google/cloud/dataproc/v1/batches.proto", + "../../protos/google/cloud/dataproc/v1/clusters.proto", + "../../protos/google/cloud/dataproc/v1/jobs.proto", + "../../protos/google/cloud/dataproc/v1/node_groups.proto", + "../../protos/google/cloud/dataproc/v1/operations.proto", + "../../protos/google/cloud/dataproc/v1/session_templates.proto", + "../../protos/google/cloud/dataproc/v1/sessions.proto", + "../../protos/google/cloud/dataproc/v1/shared.proto", + "../../protos/google/cloud/dataproc/v1/workflow_templates.proto" +] diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/session_template_controller_client.ts b/owl-bot-staging/google-cloud-dataproc/src/v1/session_template_controller_client.ts new file mode 100644 index 000000000000..3bc0a772c4a1 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/src/v1/session_template_controller_client.ts @@ -0,0 +1,1583 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, IamClient, IamProtos} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/session_template_controller_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './session_template_controller_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The SessionTemplateController provides methods to manage session templates. + * @class + * @memberof v1 + */ +export class SessionTemplateControllerClient { + 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('dataproc'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + sessionTemplateControllerStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of SessionTemplateControllerClient. + * + * @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 SessionTemplateControllerClient({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 SessionTemplateControllerClient; + 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 = 'dataproc.' + 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.iamClient = new this._gaxModule.IamClient(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 = { + batchPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batches/{batch}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + nodeGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{node_group}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectLocationAutoscalingPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/autoscalingPolicies/{autoscaling_policy}' + ), + projectLocationWorkflowTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/workflowTemplates/{workflow_template}' + ), + projectRegionAutoscalingPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/regions/{region}/autoscalingPolicies/{autoscaling_policy}' + ), + projectRegionWorkflowTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/regions/{region}/workflowTemplates/{workflow_template}' + ), + sessionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/sessions/{session}' + ), + sessionTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/sessionTemplates/{template}' + ), + }; + + // 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 = { + listSessionTemplates: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'sessionTemplates') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dataproc.v1.SessionTemplateController', 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.sessionTemplateControllerStub) { + return this.sessionTemplateControllerStub; + } + + // Put together the "service stub" for + // google.cloud.dataproc.v1.SessionTemplateController. + this.sessionTemplateControllerStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.dataproc.v1.SessionTemplateController') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dataproc.v1.SessionTemplateController, + 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 sessionTemplateControllerStubMethods = + ['createSessionTemplate', 'updateSessionTemplate', 'getSessionTemplate', 'listSessionTemplates', 'deleteSessionTemplate']; + for (const methodName of sessionTemplateControllerStubMethods) { + const callPromise = this.sessionTemplateControllerStub.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.sessionTemplateControllerStub; + } + + /** + * 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 'dataproc.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 'dataproc.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Create a session template synchronously. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource where this session template will be created. + * @param {google.cloud.dataproc.v1.SessionTemplate} request.sessionTemplate + * Required. The session template to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.dataproc.v1.SessionTemplate|SessionTemplate}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/session_template_controller.create_session_template.js + * region_tag:dataproc_v1_generated_SessionTemplateController_CreateSessionTemplate_async + */ + createSessionTemplate( + request?: protos.google.cloud.dataproc.v1.ICreateSessionTemplateRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataproc.v1.ISessionTemplate, + protos.google.cloud.dataproc.v1.ICreateSessionTemplateRequest|undefined, {}|undefined + ]>; + createSessionTemplate( + request: protos.google.cloud.dataproc.v1.ICreateSessionTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataproc.v1.ISessionTemplate, + protos.google.cloud.dataproc.v1.ICreateSessionTemplateRequest|null|undefined, + {}|null|undefined>): void; + createSessionTemplate( + request: protos.google.cloud.dataproc.v1.ICreateSessionTemplateRequest, + callback: Callback< + protos.google.cloud.dataproc.v1.ISessionTemplate, + protos.google.cloud.dataproc.v1.ICreateSessionTemplateRequest|null|undefined, + {}|null|undefined>): void; + createSessionTemplate( + request?: protos.google.cloud.dataproc.v1.ICreateSessionTemplateRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataproc.v1.ISessionTemplate, + protos.google.cloud.dataproc.v1.ICreateSessionTemplateRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataproc.v1.ISessionTemplate, + protos.google.cloud.dataproc.v1.ICreateSessionTemplateRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataproc.v1.ISessionTemplate, + protos.google.cloud.dataproc.v1.ICreateSessionTemplateRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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('createSessionTemplate request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.dataproc.v1.ISessionTemplate, + protos.google.cloud.dataproc.v1.ICreateSessionTemplateRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createSessionTemplate response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createSessionTemplate(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.dataproc.v1.ISessionTemplate, + protos.google.cloud.dataproc.v1.ICreateSessionTemplateRequest|undefined, + {}|undefined + ]) => { + this._log.info('createSessionTemplate response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates the session template synchronously. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dataproc.v1.SessionTemplate} request.sessionTemplate + * Required. The updated session template. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.dataproc.v1.SessionTemplate|SessionTemplate}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/session_template_controller.update_session_template.js + * region_tag:dataproc_v1_generated_SessionTemplateController_UpdateSessionTemplate_async + */ + updateSessionTemplate( + request?: protos.google.cloud.dataproc.v1.IUpdateSessionTemplateRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataproc.v1.ISessionTemplate, + protos.google.cloud.dataproc.v1.IUpdateSessionTemplateRequest|undefined, {}|undefined + ]>; + updateSessionTemplate( + request: protos.google.cloud.dataproc.v1.IUpdateSessionTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataproc.v1.ISessionTemplate, + protos.google.cloud.dataproc.v1.IUpdateSessionTemplateRequest|null|undefined, + {}|null|undefined>): void; + updateSessionTemplate( + request: protos.google.cloud.dataproc.v1.IUpdateSessionTemplateRequest, + callback: Callback< + protos.google.cloud.dataproc.v1.ISessionTemplate, + protos.google.cloud.dataproc.v1.IUpdateSessionTemplateRequest|null|undefined, + {}|null|undefined>): void; + updateSessionTemplate( + request?: protos.google.cloud.dataproc.v1.IUpdateSessionTemplateRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataproc.v1.ISessionTemplate, + protos.google.cloud.dataproc.v1.IUpdateSessionTemplateRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataproc.v1.ISessionTemplate, + protos.google.cloud.dataproc.v1.IUpdateSessionTemplateRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataproc.v1.ISessionTemplate, + protos.google.cloud.dataproc.v1.IUpdateSessionTemplateRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'session_template.name': request.sessionTemplate!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateSessionTemplate request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.dataproc.v1.ISessionTemplate, + protos.google.cloud.dataproc.v1.IUpdateSessionTemplateRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateSessionTemplate response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateSessionTemplate(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.dataproc.v1.ISessionTemplate, + protos.google.cloud.dataproc.v1.IUpdateSessionTemplateRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateSessionTemplate 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 resource representation for a session template. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the session template to retrieve. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.dataproc.v1.SessionTemplate|SessionTemplate}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/session_template_controller.get_session_template.js + * region_tag:dataproc_v1_generated_SessionTemplateController_GetSessionTemplate_async + */ + getSessionTemplate( + request?: protos.google.cloud.dataproc.v1.IGetSessionTemplateRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataproc.v1.ISessionTemplate, + protos.google.cloud.dataproc.v1.IGetSessionTemplateRequest|undefined, {}|undefined + ]>; + getSessionTemplate( + request: protos.google.cloud.dataproc.v1.IGetSessionTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataproc.v1.ISessionTemplate, + protos.google.cloud.dataproc.v1.IGetSessionTemplateRequest|null|undefined, + {}|null|undefined>): void; + getSessionTemplate( + request: protos.google.cloud.dataproc.v1.IGetSessionTemplateRequest, + callback: Callback< + protos.google.cloud.dataproc.v1.ISessionTemplate, + protos.google.cloud.dataproc.v1.IGetSessionTemplateRequest|null|undefined, + {}|null|undefined>): void; + getSessionTemplate( + request?: protos.google.cloud.dataproc.v1.IGetSessionTemplateRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataproc.v1.ISessionTemplate, + protos.google.cloud.dataproc.v1.IGetSessionTemplateRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataproc.v1.ISessionTemplate, + protos.google.cloud.dataproc.v1.IGetSessionTemplateRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataproc.v1.ISessionTemplate, + protos.google.cloud.dataproc.v1.IGetSessionTemplateRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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('getSessionTemplate request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.dataproc.v1.ISessionTemplate, + protos.google.cloud.dataproc.v1.IGetSessionTemplateRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSessionTemplate response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getSessionTemplate(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.dataproc.v1.ISessionTemplate, + protos.google.cloud.dataproc.v1.IGetSessionTemplateRequest|undefined, + {}|undefined + ]) => { + this._log.info('getSessionTemplate 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 session template. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the session template resource to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/session_template_controller.delete_session_template.js + * region_tag:dataproc_v1_generated_SessionTemplateController_DeleteSessionTemplate_async + */ + deleteSessionTemplate( + request?: protos.google.cloud.dataproc.v1.IDeleteSessionTemplateRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteSessionTemplateRequest|undefined, {}|undefined + ]>; + deleteSessionTemplate( + request: protos.google.cloud.dataproc.v1.IDeleteSessionTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteSessionTemplateRequest|null|undefined, + {}|null|undefined>): void; + deleteSessionTemplate( + request: protos.google.cloud.dataproc.v1.IDeleteSessionTemplateRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteSessionTemplateRequest|null|undefined, + {}|null|undefined>): void; + deleteSessionTemplate( + request?: protos.google.cloud.dataproc.v1.IDeleteSessionTemplateRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteSessionTemplateRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteSessionTemplateRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteSessionTemplateRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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('deleteSessionTemplate request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteSessionTemplateRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteSessionTemplate response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteSessionTemplate(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteSessionTemplateRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteSessionTemplate 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 session templates. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent that owns this collection of session templates. + * @param {number} [request.pageSize] + * Optional. The maximum number of sessions to return in each response. + * The service may return fewer than this value. + * @param {string} [request.pageToken] + * Optional. A page token received from a previous `ListSessions` call. + * Provide this token to retrieve the subsequent page. + * @param {string} [request.filter] + * Optional. A filter for the session templates to return in the response. + * Filters are case sensitive and have the following syntax: + * + * [field = value] AND [field [= value]] ... + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.dataproc.v1.SessionTemplate|SessionTemplate}. + * 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 `listSessionTemplatesAsync()` + * 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. + */ + listSessionTemplates( + request?: protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataproc.v1.ISessionTemplate[], + protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest|null, + protos.google.cloud.dataproc.v1.IListSessionTemplatesResponse + ]>; + listSessionTemplates( + request: protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest, + protos.google.cloud.dataproc.v1.IListSessionTemplatesResponse|null|undefined, + protos.google.cloud.dataproc.v1.ISessionTemplate>): void; + listSessionTemplates( + request: protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest, + callback: PaginationCallback< + protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest, + protos.google.cloud.dataproc.v1.IListSessionTemplatesResponse|null|undefined, + protos.google.cloud.dataproc.v1.ISessionTemplate>): void; + listSessionTemplates( + request?: protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest, + protos.google.cloud.dataproc.v1.IListSessionTemplatesResponse|null|undefined, + protos.google.cloud.dataproc.v1.ISessionTemplate>, + callback?: PaginationCallback< + protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest, + protos.google.cloud.dataproc.v1.IListSessionTemplatesResponse|null|undefined, + protos.google.cloud.dataproc.v1.ISessionTemplate>): + Promise<[ + protos.google.cloud.dataproc.v1.ISessionTemplate[], + protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest|null, + protos.google.cloud.dataproc.v1.IListSessionTemplatesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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.dataproc.v1.IListSessionTemplatesRequest, + protos.google.cloud.dataproc.v1.IListSessionTemplatesResponse|null|undefined, + protos.google.cloud.dataproc.v1.ISessionTemplate>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSessionTemplates values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSessionTemplates request %j', request); + return this.innerApiCalls + .listSessionTemplates(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.dataproc.v1.ISessionTemplate[], + protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest|null, + protos.google.cloud.dataproc.v1.IListSessionTemplatesResponse + ]) => { + this._log.info('listSessionTemplates values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listSessionTemplates`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent that owns this collection of session templates. + * @param {number} [request.pageSize] + * Optional. The maximum number of sessions to return in each response. + * The service may return fewer than this value. + * @param {string} [request.pageToken] + * Optional. A page token received from a previous `ListSessions` call. + * Provide this token to retrieve the subsequent page. + * @param {string} [request.filter] + * Optional. A filter for the session templates to return in the response. + * Filters are case sensitive and have the following syntax: + * + * [field = value] AND [field [= value]] ... + * @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.dataproc.v1.SessionTemplate|SessionTemplate} 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 `listSessionTemplatesAsync()` + * 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. + */ + listSessionTemplatesStream( + request?: protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest, + 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['listSessionTemplates']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listSessionTemplates stream %j', request); + return this.descriptors.page.listSessionTemplates.createStream( + this.innerApiCalls.listSessionTemplates as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listSessionTemplates`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent that owns this collection of session templates. + * @param {number} [request.pageSize] + * Optional. The maximum number of sessions to return in each response. + * The service may return fewer than this value. + * @param {string} [request.pageToken] + * Optional. A page token received from a previous `ListSessions` call. + * Provide this token to retrieve the subsequent page. + * @param {string} [request.filter] + * Optional. A filter for the session templates to return in the response. + * Filters are case sensitive and have the following syntax: + * + * [field = value] AND [field [= value]] ... + * @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.dataproc.v1.SessionTemplate|SessionTemplate}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/session_template_controller.list_session_templates.js + * region_tag:dataproc_v1_generated_SessionTemplateController_ListSessionTemplates_async + */ + listSessionTemplatesAsync( + request?: protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest, + 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['listSessionTemplates']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listSessionTemplates iterate %j', request); + return this.descriptors.page.listSessionTemplates.asyncIterate( + this.innerApiCalls['listSessionTemplates'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @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 {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @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/interfaces/CallOptions.html | 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.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified batch resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch + * @returns {string} Resource name string. + */ + batchPath(project:string,location:string,batch:string) { + return this.pathTemplates.batchPathTemplate.render({ + project: project, + location: location, + batch: batch, + }); + } + + /** + * Parse the project from Batch resource. + * + * @param {string} batchName + * A fully-qualified path representing Batch resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchName(batchName: string) { + return this.pathTemplates.batchPathTemplate.match(batchName).project; + } + + /** + * Parse the location from Batch resource. + * + * @param {string} batchName + * A fully-qualified path representing Batch resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchName(batchName: string) { + return this.pathTemplates.batchPathTemplate.match(batchName).location; + } + + /** + * Parse the batch from Batch resource. + * + * @param {string} batchName + * A fully-qualified path representing Batch resource. + * @returns {string} A string representing the batch. + */ + matchBatchFromBatchName(batchName: string) { + return this.pathTemplates.batchPathTemplate.match(batchName).batch; + } + + /** + * 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 nodeGroup resource name string. + * + * @param {string} project + * @param {string} region + * @param {string} cluster + * @param {string} node_group + * @returns {string} Resource name string. + */ + nodeGroupPath(project:string,region:string,cluster:string,nodeGroup:string) { + return this.pathTemplates.nodeGroupPathTemplate.render({ + project: project, + region: region, + cluster: cluster, + node_group: nodeGroup, + }); + } + + /** + * Parse the project from NodeGroup resource. + * + * @param {string} nodeGroupName + * A fully-qualified path representing NodeGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNodeGroupName(nodeGroupName: string) { + return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).project; + } + + /** + * Parse the region from NodeGroup resource. + * + * @param {string} nodeGroupName + * A fully-qualified path representing NodeGroup resource. + * @returns {string} A string representing the region. + */ + matchRegionFromNodeGroupName(nodeGroupName: string) { + return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).region; + } + + /** + * Parse the cluster from NodeGroup resource. + * + * @param {string} nodeGroupName + * A fully-qualified path representing NodeGroup resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromNodeGroupName(nodeGroupName: string) { + return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).cluster; + } + + /** + * Parse the node_group from NodeGroup resource. + * + * @param {string} nodeGroupName + * A fully-qualified path representing NodeGroup resource. + * @returns {string} A string representing the node_group. + */ + matchNodeGroupFromNodeGroupName(nodeGroupName: string) { + return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).node_group; + } + + /** + * 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 projectLocationAutoscalingPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} autoscaling_policy + * @returns {string} Resource name string. + */ + projectLocationAutoscalingPolicyPath(project:string,location:string,autoscalingPolicy:string) { + return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render({ + project: project, + location: location, + autoscaling_policy: autoscalingPolicy, + }); + } + + /** + * Parse the project from ProjectLocationAutoscalingPolicy resource. + * + * @param {string} projectLocationAutoscalingPolicyName + * A fully-qualified path representing project_location_autoscaling_policy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { + return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).project; + } + + /** + * Parse the location from ProjectLocationAutoscalingPolicy resource. + * + * @param {string} projectLocationAutoscalingPolicyName + * A fully-qualified path representing project_location_autoscaling_policy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { + return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).location; + } + + /** + * Parse the autoscaling_policy from ProjectLocationAutoscalingPolicy resource. + * + * @param {string} projectLocationAutoscalingPolicyName + * A fully-qualified path representing project_location_autoscaling_policy resource. + * @returns {string} A string representing the autoscaling_policy. + */ + matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { + return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).autoscaling_policy; + } + + /** + * Return a fully-qualified projectLocationWorkflowTemplate resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} workflow_template + * @returns {string} Resource name string. + */ + projectLocationWorkflowTemplatePath(project:string,location:string,workflowTemplate:string) { + return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render({ + project: project, + location: location, + workflow_template: workflowTemplate, + }); + } + + /** + * Parse the project from ProjectLocationWorkflowTemplate resource. + * + * @param {string} projectLocationWorkflowTemplateName + * A fully-qualified path representing project_location_workflow_template resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { + return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).project; + } + + /** + * Parse the location from ProjectLocationWorkflowTemplate resource. + * + * @param {string} projectLocationWorkflowTemplateName + * A fully-qualified path representing project_location_workflow_template resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { + return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).location; + } + + /** + * Parse the workflow_template from ProjectLocationWorkflowTemplate resource. + * + * @param {string} projectLocationWorkflowTemplateName + * A fully-qualified path representing project_location_workflow_template resource. + * @returns {string} A string representing the workflow_template. + */ + matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { + return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).workflow_template; + } + + /** + * Return a fully-qualified projectRegionAutoscalingPolicy resource name string. + * + * @param {string} project + * @param {string} region + * @param {string} autoscaling_policy + * @returns {string} Resource name string. + */ + projectRegionAutoscalingPolicyPath(project:string,region:string,autoscalingPolicy:string) { + return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render({ + project: project, + region: region, + autoscaling_policy: autoscalingPolicy, + }); + } + + /** + * Parse the project from ProjectRegionAutoscalingPolicy resource. + * + * @param {string} projectRegionAutoscalingPolicyName + * A fully-qualified path representing project_region_autoscaling_policy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { + return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).project; + } + + /** + * Parse the region from ProjectRegionAutoscalingPolicy resource. + * + * @param {string} projectRegionAutoscalingPolicyName + * A fully-qualified path representing project_region_autoscaling_policy resource. + * @returns {string} A string representing the region. + */ + matchRegionFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { + return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).region; + } + + /** + * Parse the autoscaling_policy from ProjectRegionAutoscalingPolicy resource. + * + * @param {string} projectRegionAutoscalingPolicyName + * A fully-qualified path representing project_region_autoscaling_policy resource. + * @returns {string} A string representing the autoscaling_policy. + */ + matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { + return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).autoscaling_policy; + } + + /** + * Return a fully-qualified projectRegionWorkflowTemplate resource name string. + * + * @param {string} project + * @param {string} region + * @param {string} workflow_template + * @returns {string} Resource name string. + */ + projectRegionWorkflowTemplatePath(project:string,region:string,workflowTemplate:string) { + return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render({ + project: project, + region: region, + workflow_template: workflowTemplate, + }); + } + + /** + * Parse the project from ProjectRegionWorkflowTemplate resource. + * + * @param {string} projectRegionWorkflowTemplateName + * A fully-qualified path representing project_region_workflow_template resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { + return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).project; + } + + /** + * Parse the region from ProjectRegionWorkflowTemplate resource. + * + * @param {string} projectRegionWorkflowTemplateName + * A fully-qualified path representing project_region_workflow_template resource. + * @returns {string} A string representing the region. + */ + matchRegionFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { + return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).region; + } + + /** + * Parse the workflow_template from ProjectRegionWorkflowTemplate resource. + * + * @param {string} projectRegionWorkflowTemplateName + * A fully-qualified path representing project_region_workflow_template resource. + * @returns {string} A string representing the workflow_template. + */ + matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { + return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).workflow_template; + } + + /** + * Return a fully-qualified session resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} session + * @returns {string} Resource name string. + */ + sessionPath(project:string,location:string,session:string) { + return this.pathTemplates.sessionPathTemplate.render({ + project: project, + location: location, + session: session, + }); + } + + /** + * Parse the project from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).project; + } + + /** + * Parse the location from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).location; + } + + /** + * Parse the session from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the session. + */ + matchSessionFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).session; + } + + /** + * Return a fully-qualified sessionTemplate resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} template + * @returns {string} Resource name string. + */ + sessionTemplatePath(project:string,location:string,template:string) { + return this.pathTemplates.sessionTemplatePathTemplate.render({ + project: project, + location: location, + template: template, + }); + } + + /** + * Parse the project from SessionTemplate resource. + * + * @param {string} sessionTemplateName + * A fully-qualified path representing SessionTemplate resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSessionTemplateName(sessionTemplateName: string) { + return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).project; + } + + /** + * Parse the location from SessionTemplate resource. + * + * @param {string} sessionTemplateName + * A fully-qualified path representing SessionTemplate resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSessionTemplateName(sessionTemplateName: string) { + return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).location; + } + + /** + * Parse the template from SessionTemplate resource. + * + * @param {string} sessionTemplateName + * A fully-qualified path representing SessionTemplate resource. + * @returns {string} A string representing the template. + */ + matchTemplateFromSessionTemplateName(sessionTemplateName: string) { + return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).template; + } + + /** + * 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.sessionTemplateControllerStub && !this._terminated) { + return this.sessionTemplateControllerStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.iamClient.close().catch(err => {throw err}); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/session_template_controller_client_config.json b/owl-bot-staging/google-cloud-dataproc/src/v1/session_template_controller_client_config.json new file mode 100644 index 000000000000..b7fed36bf851 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/src/v1/session_template_controller_client_config.json @@ -0,0 +1,46 @@ +{ + "interfaces": { + "google.cloud.dataproc.v1.SessionTemplateController": { + "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": { + "CreateSessionTemplate": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateSessionTemplate": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetSessionTemplate": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListSessionTemplates": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteSessionTemplate": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/session_template_controller_proto_list.json b/owl-bot-staging/google-cloud-dataproc/src/v1/session_template_controller_proto_list.json new file mode 100644 index 000000000000..d6798f50ae7c --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/src/v1/session_template_controller_proto_list.json @@ -0,0 +1,12 @@ +[ + "../../protos/google/cloud/dataproc/v1/autoscaling_policies.proto", + "../../protos/google/cloud/dataproc/v1/batches.proto", + "../../protos/google/cloud/dataproc/v1/clusters.proto", + "../../protos/google/cloud/dataproc/v1/jobs.proto", + "../../protos/google/cloud/dataproc/v1/node_groups.proto", + "../../protos/google/cloud/dataproc/v1/operations.proto", + "../../protos/google/cloud/dataproc/v1/session_templates.proto", + "../../protos/google/cloud/dataproc/v1/sessions.proto", + "../../protos/google/cloud/dataproc/v1/shared.proto", + "../../protos/google/cloud/dataproc/v1/workflow_templates.proto" +] diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/workflow_template_service_client.ts b/owl-bot-staging/google-cloud-dataproc/src/v1/workflow_template_service_client.ts new file mode 100644 index 000000000000..4ce5d8aa5068 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/src/v1/workflow_template_service_client.ts @@ -0,0 +1,2209 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, IamClient, IamProtos} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/workflow_template_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './workflow_template_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The API interface for managing Workflow Templates in the + * Dataproc API. + * @class + * @memberof v1 + */ +export class WorkflowTemplateServiceClient { + 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('dataproc'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + workflowTemplateServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of WorkflowTemplateServiceClient. + * + * @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 WorkflowTemplateServiceClient({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 WorkflowTemplateServiceClient; + 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 = 'dataproc.' + 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.iamClient = new this._gaxModule.IamClient(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 = { + batchPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batches/{batch}' + ), + nodeGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{node_group}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectLocationAutoscalingPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/autoscalingPolicies/{autoscaling_policy}' + ), + projectLocationWorkflowTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/workflowTemplates/{workflow_template}' + ), + projectRegionAutoscalingPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/regions/{region}/autoscalingPolicies/{autoscaling_policy}' + ), + projectRegionWorkflowTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/regions/{region}/workflowTemplates/{workflow_template}' + ), + regionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/regions/{region}' + ), + sessionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/sessions/{session}' + ), + sessionTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/sessionTemplates/{template}' + ), + }; + + // 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 = { + listWorkflowTemplates: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'templates') + }; + + 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.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1/{resource=projects/*/regions/*/clusters/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:getIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/regions/*/clusters/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:setIamPolicy',body: '*',}], + },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/regions/*/clusters/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:testIamPermissions',body: '*',}], + },{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/regions/*/operations/*}:cancel',additional_bindings: [{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',}], + },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/regions/*/operations/*}',additional_bindings: [{delete: '/v1/{name=projects/*/locations/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/regions/*/operations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*/operations/*}',}], + },{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/regions/*/operations}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*/operations}',}], + }]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const instantiateWorkflowTemplateResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const instantiateWorkflowTemplateMetadata = protoFilesRoot.lookup( + '.google.cloud.dataproc.v1.WorkflowMetadata') as gax.protobuf.Type; + const instantiateInlineWorkflowTemplateResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const instantiateInlineWorkflowTemplateMetadata = protoFilesRoot.lookup( + '.google.cloud.dataproc.v1.WorkflowMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + instantiateWorkflowTemplate: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + instantiateWorkflowTemplateResponse.decode.bind(instantiateWorkflowTemplateResponse), + instantiateWorkflowTemplateMetadata.decode.bind(instantiateWorkflowTemplateMetadata)), + instantiateInlineWorkflowTemplate: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + instantiateInlineWorkflowTemplateResponse.decode.bind(instantiateInlineWorkflowTemplateResponse), + instantiateInlineWorkflowTemplateMetadata.decode.bind(instantiateInlineWorkflowTemplateMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dataproc.v1.WorkflowTemplateService', 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.workflowTemplateServiceStub) { + return this.workflowTemplateServiceStub; + } + + // Put together the "service stub" for + // google.cloud.dataproc.v1.WorkflowTemplateService. + this.workflowTemplateServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.dataproc.v1.WorkflowTemplateService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dataproc.v1.WorkflowTemplateService, + 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 workflowTemplateServiceStubMethods = + ['createWorkflowTemplate', 'getWorkflowTemplate', 'instantiateWorkflowTemplate', 'instantiateInlineWorkflowTemplate', 'updateWorkflowTemplate', 'listWorkflowTemplates', 'deleteWorkflowTemplate']; + for (const methodName of workflowTemplateServiceStubMethods) { + const callPromise = this.workflowTemplateServiceStub.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.workflowTemplateServiceStub; + } + + /** + * 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 'dataproc.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 'dataproc.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 -- + // ------------------- +/** + * Creates new workflow template. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the region or location, as described + * in https://cloud.google.com/apis/design/resource_names. + * + * * For `projects.regions.workflowTemplates.create`, the resource name of the + * region has the following format: + * `projects/{project_id}/regions/{region}` + * + * * For `projects.locations.workflowTemplates.create`, the resource name of + * the location has the following format: + * `projects/{project_id}/locations/{location}` + * @param {google.cloud.dataproc.v1.WorkflowTemplate} request.template + * Required. The Dataproc workflow template to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.dataproc.v1.WorkflowTemplate|WorkflowTemplate}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/workflow_template_service.create_workflow_template.js + * region_tag:dataproc_v1_generated_WorkflowTemplateService_CreateWorkflowTemplate_async + */ + createWorkflowTemplate( + request?: protos.google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataproc.v1.IWorkflowTemplate, + protos.google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest|undefined, {}|undefined + ]>; + createWorkflowTemplate( + request: protos.google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataproc.v1.IWorkflowTemplate, + protos.google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest|null|undefined, + {}|null|undefined>): void; + createWorkflowTemplate( + request: protos.google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest, + callback: Callback< + protos.google.cloud.dataproc.v1.IWorkflowTemplate, + protos.google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest|null|undefined, + {}|null|undefined>): void; + createWorkflowTemplate( + request?: protos.google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataproc.v1.IWorkflowTemplate, + protos.google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataproc.v1.IWorkflowTemplate, + protos.google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataproc.v1.IWorkflowTemplate, + protos.google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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('createWorkflowTemplate request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.dataproc.v1.IWorkflowTemplate, + protos.google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createWorkflowTemplate response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.createWorkflowTemplate(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.dataproc.v1.IWorkflowTemplate, + protos.google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest|undefined, + {}|undefined + ]) => { + this._log.info('createWorkflowTemplate 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; + }); + } +/** + * Retrieves the latest workflow template. + * + * Can retrieve previously instantiated template by specifying optional + * version parameter. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the workflow template, as described + * in https://cloud.google.com/apis/design/resource_names. + * + * * For `projects.regions.workflowTemplates.get`, the resource name of the + * template has the following format: + * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` + * + * * For `projects.locations.workflowTemplates.get`, the resource name of the + * template has the following format: + * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` + * @param {number} [request.version] + * Optional. The version of workflow template to retrieve. Only previously + * instantiated versions can be retrieved. + * + * If unspecified, retrieves the current version. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.dataproc.v1.WorkflowTemplate|WorkflowTemplate}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/workflow_template_service.get_workflow_template.js + * region_tag:dataproc_v1_generated_WorkflowTemplateService_GetWorkflowTemplate_async + */ + getWorkflowTemplate( + request?: protos.google.cloud.dataproc.v1.IGetWorkflowTemplateRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataproc.v1.IWorkflowTemplate, + protos.google.cloud.dataproc.v1.IGetWorkflowTemplateRequest|undefined, {}|undefined + ]>; + getWorkflowTemplate( + request: protos.google.cloud.dataproc.v1.IGetWorkflowTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataproc.v1.IWorkflowTemplate, + protos.google.cloud.dataproc.v1.IGetWorkflowTemplateRequest|null|undefined, + {}|null|undefined>): void; + getWorkflowTemplate( + request: protos.google.cloud.dataproc.v1.IGetWorkflowTemplateRequest, + callback: Callback< + protos.google.cloud.dataproc.v1.IWorkflowTemplate, + protos.google.cloud.dataproc.v1.IGetWorkflowTemplateRequest|null|undefined, + {}|null|undefined>): void; + getWorkflowTemplate( + request?: protos.google.cloud.dataproc.v1.IGetWorkflowTemplateRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataproc.v1.IWorkflowTemplate, + protos.google.cloud.dataproc.v1.IGetWorkflowTemplateRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataproc.v1.IWorkflowTemplate, + protos.google.cloud.dataproc.v1.IGetWorkflowTemplateRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataproc.v1.IWorkflowTemplate, + protos.google.cloud.dataproc.v1.IGetWorkflowTemplateRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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('getWorkflowTemplate request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.dataproc.v1.IWorkflowTemplate, + protos.google.cloud.dataproc.v1.IGetWorkflowTemplateRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getWorkflowTemplate response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getWorkflowTemplate(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.dataproc.v1.IWorkflowTemplate, + protos.google.cloud.dataproc.v1.IGetWorkflowTemplateRequest|undefined, + {}|undefined + ]) => { + this._log.info('getWorkflowTemplate response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } +/** + * Updates (replaces) workflow template. The updated template + * must contain version that matches the current server version. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dataproc.v1.WorkflowTemplate} request.template + * Required. The updated workflow template. + * + * The `template.version` field must match the current version. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.dataproc.v1.WorkflowTemplate|WorkflowTemplate}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/workflow_template_service.update_workflow_template.js + * region_tag:dataproc_v1_generated_WorkflowTemplateService_UpdateWorkflowTemplate_async + */ + updateWorkflowTemplate( + request?: protos.google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataproc.v1.IWorkflowTemplate, + protos.google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest|undefined, {}|undefined + ]>; + updateWorkflowTemplate( + request: protos.google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dataproc.v1.IWorkflowTemplate, + protos.google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest|null|undefined, + {}|null|undefined>): void; + updateWorkflowTemplate( + request: protos.google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest, + callback: Callback< + protos.google.cloud.dataproc.v1.IWorkflowTemplate, + protos.google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest|null|undefined, + {}|null|undefined>): void; + updateWorkflowTemplate( + request?: protos.google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.dataproc.v1.IWorkflowTemplate, + protos.google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.dataproc.v1.IWorkflowTemplate, + protos.google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.dataproc.v1.IWorkflowTemplate, + protos.google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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({ + 'template.name': request.template!.name ?? '', + }); + this.initialize().catch(err => {throw err}); + this._log.info('updateWorkflowTemplate request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.dataproc.v1.IWorkflowTemplate, + protos.google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateWorkflowTemplate response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.updateWorkflowTemplate(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.dataproc.v1.IWorkflowTemplate, + protos.google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest|undefined, + {}|undefined + ]) => { + this._log.info('updateWorkflowTemplate 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 workflow template. It does not cancel in-progress workflows. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the workflow template, as described + * in https://cloud.google.com/apis/design/resource_names. + * + * * For `projects.regions.workflowTemplates.delete`, the resource name + * of the template has the following format: + * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` + * + * * For `projects.locations.workflowTemplates.instantiate`, the resource name + * of the template has the following format: + * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` + * @param {number} [request.version] + * Optional. The version of workflow template to delete. If specified, + * will only delete the template if the current server version matches + * specified version. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/workflow_template_service.delete_workflow_template.js + * region_tag:dataproc_v1_generated_WorkflowTemplateService_DeleteWorkflowTemplate_async + */ + deleteWorkflowTemplate( + request?: protos.google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest|undefined, {}|undefined + ]>; + deleteWorkflowTemplate( + request: protos.google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest|null|undefined, + {}|null|undefined>): void; + deleteWorkflowTemplate( + request: protos.google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest|null|undefined, + {}|null|undefined>): void; + deleteWorkflowTemplate( + request?: protos.google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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('deleteWorkflowTemplate request %j', request); + const wrappedCallback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteWorkflowTemplate response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.deleteWorkflowTemplate(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest|undefined, + {}|undefined + ]) => { + this._log.info('deleteWorkflowTemplate 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; + }); + } + +/** + * Instantiates a template and begins execution. + * + * The returned Operation can be used to track execution of + * workflow by polling + * {@link protos.google.longrunning.Operations.GetOperation|operations.get}. + * The Operation will complete when entire workflow is finished. + * + * The running workflow can be aborted via + * {@link protos.google.longrunning.Operations.CancelOperation|operations.cancel}. + * This will cause any inflight jobs to be cancelled and workflow-owned + * clusters to be deleted. + * + * The {@link protos.google.longrunning.Operation.metadata|Operation.metadata} will be + * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). + * Also see [Using + * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). + * + * On successful completion, + * {@link protos.google.longrunning.Operation.response|Operation.response} will be + * {@link protos.google.protobuf.Empty|Empty}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the workflow template, as described + * in https://cloud.google.com/apis/design/resource_names. + * + * * For `projects.regions.workflowTemplates.instantiate`, the resource name + * of the template has the following format: + * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` + * + * * For `projects.locations.workflowTemplates.instantiate`, the resource name + * of the template has the following format: + * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` + * @param {number} [request.version] + * Optional. The version of workflow template to instantiate. If specified, + * the workflow will be instantiated only if the current version of + * the workflow template has the supplied version. + * + * This option cannot be used to instantiate a previous version of + * workflow template. + * @param {string} [request.requestId] + * Optional. A tag that prevents multiple concurrent workflow + * instances with the same tag from running. This mitigates risk of + * concurrent instances started due to retries. + * + * It is recommended to always set this value to a + * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + * + * The tag must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + * @param {number[]} [request.parameters] + * Optional. Map from parameter names to values that should be used for those + * parameters. Values may not exceed 1000 characters. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/workflow_template_service.instantiate_workflow_template.js + * region_tag:dataproc_v1_generated_WorkflowTemplateService_InstantiateWorkflowTemplate_async + */ + instantiateWorkflowTemplate( + request?: protos.google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + instantiateWorkflowTemplate( + request: protos.google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + instantiateWorkflowTemplate( + request: protos.google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + instantiateWorkflowTemplate( + request?: protos.google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest, + 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('instantiateWorkflowTemplate response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('instantiateWorkflowTemplate request %j', request); + return this.innerApiCalls.instantiateWorkflowTemplate(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('instantiateWorkflowTemplate response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `instantiateWorkflowTemplate()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/workflow_template_service.instantiate_workflow_template.js + * region_tag:dataproc_v1_generated_WorkflowTemplateService_InstantiateWorkflowTemplate_async + */ + async checkInstantiateWorkflowTemplateProgress(name: string): Promise>{ + this._log.info('instantiateWorkflowTemplate 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.instantiateWorkflowTemplate, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Instantiates a template and begins execution. + * + * This method is equivalent to executing the sequence + * {@link protos.google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate|CreateWorkflowTemplate}, + * {@link protos.google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate|InstantiateWorkflowTemplate}, + * {@link protos.google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate|DeleteWorkflowTemplate}. + * + * The returned Operation can be used to track execution of + * workflow by polling + * {@link protos.google.longrunning.Operations.GetOperation|operations.get}. + * The Operation will complete when entire workflow is finished. + * + * The running workflow can be aborted via + * {@link protos.google.longrunning.Operations.CancelOperation|operations.cancel}. + * This will cause any inflight jobs to be cancelled and workflow-owned + * clusters to be deleted. + * + * The {@link protos.google.longrunning.Operation.metadata|Operation.metadata} will be + * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). + * Also see [Using + * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). + * + * On successful completion, + * {@link protos.google.longrunning.Operation.response|Operation.response} will be + * {@link protos.google.protobuf.Empty|Empty}. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the region or location, as described + * in https://cloud.google.com/apis/design/resource_names. + * + * * For `projects.regions.workflowTemplates,instantiateinline`, the resource + * name of the region has the following format: + * `projects/{project_id}/regions/{region}` + * + * * For `projects.locations.workflowTemplates.instantiateinline`, the + * resource name of the location has the following format: + * `projects/{project_id}/locations/{location}` + * @param {google.cloud.dataproc.v1.WorkflowTemplate} request.template + * Required. The workflow template to instantiate. + * @param {string} [request.requestId] + * Optional. A tag that prevents multiple concurrent workflow + * instances with the same tag from running. This mitigates risk of + * concurrent instances started due to retries. + * + * It is recommended to always set this value to a + * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). + * + * The tag must contain only letters (a-z, A-Z), numbers (0-9), + * underscores (_), and hyphens (-). The maximum length is 40 characters. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/workflow_template_service.instantiate_inline_workflow_template.js + * region_tag:dataproc_v1_generated_WorkflowTemplateService_InstantiateInlineWorkflowTemplate_async + */ + instantiateInlineWorkflowTemplate( + request?: protos.google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + instantiateInlineWorkflowTemplate( + request: protos.google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + instantiateInlineWorkflowTemplate( + request: protos.google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + instantiateInlineWorkflowTemplate( + request?: protos.google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize().catch(err => {throw err}); + const wrappedCallback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('instantiateInlineWorkflowTemplate response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('instantiateInlineWorkflowTemplate request %j', request); + return this.innerApiCalls.instantiateInlineWorkflowTemplate(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('instantiateInlineWorkflowTemplate response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `instantiateInlineWorkflowTemplate()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/workflow_template_service.instantiate_inline_workflow_template.js + * region_tag:dataproc_v1_generated_WorkflowTemplateService_InstantiateInlineWorkflowTemplate_async + */ + async checkInstantiateInlineWorkflowTemplateProgress(name: string): Promise>{ + this._log.info('instantiateInlineWorkflowTemplate 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.instantiateInlineWorkflowTemplate, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists workflows that match the specified filter in the request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the region or location, as described + * in https://cloud.google.com/apis/design/resource_names. + * + * * For `projects.regions.workflowTemplates,list`, the resource + * name of the region has the following format: + * `projects/{project_id}/regions/{region}` + * + * * For `projects.locations.workflowTemplates.list`, the + * resource name of the location has the following format: + * `projects/{project_id}/locations/{location}` + * @param {number} [request.pageSize] + * Optional. The maximum number of results to return in each response. + * @param {string} [request.pageToken] + * Optional. The page token, returned by a previous call, to request the + * next page of results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.dataproc.v1.WorkflowTemplate|WorkflowTemplate}. + * 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 `listWorkflowTemplatesAsync()` + * 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. + */ + listWorkflowTemplates( + request?: protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.dataproc.v1.IWorkflowTemplate[], + protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest|null, + protos.google.cloud.dataproc.v1.IListWorkflowTemplatesResponse + ]>; + listWorkflowTemplates( + request: protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest, + protos.google.cloud.dataproc.v1.IListWorkflowTemplatesResponse|null|undefined, + protos.google.cloud.dataproc.v1.IWorkflowTemplate>): void; + listWorkflowTemplates( + request: protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest, + callback: PaginationCallback< + protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest, + protos.google.cloud.dataproc.v1.IListWorkflowTemplatesResponse|null|undefined, + protos.google.cloud.dataproc.v1.IWorkflowTemplate>): void; + listWorkflowTemplates( + request?: protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest, + protos.google.cloud.dataproc.v1.IListWorkflowTemplatesResponse|null|undefined, + protos.google.cloud.dataproc.v1.IWorkflowTemplate>, + callback?: PaginationCallback< + protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest, + protos.google.cloud.dataproc.v1.IListWorkflowTemplatesResponse|null|undefined, + protos.google.cloud.dataproc.v1.IWorkflowTemplate>): + Promise<[ + protos.google.cloud.dataproc.v1.IWorkflowTemplate[], + protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest|null, + protos.google.cloud.dataproc.v1.IListWorkflowTemplatesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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.dataproc.v1.IListWorkflowTemplatesRequest, + protos.google.cloud.dataproc.v1.IListWorkflowTemplatesResponse|null|undefined, + protos.google.cloud.dataproc.v1.IWorkflowTemplate>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listWorkflowTemplates values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listWorkflowTemplates request %j', request); + return this.innerApiCalls + .listWorkflowTemplates(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.dataproc.v1.IWorkflowTemplate[], + protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest|null, + protos.google.cloud.dataproc.v1.IListWorkflowTemplatesResponse + ]) => { + this._log.info('listWorkflowTemplates values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listWorkflowTemplates`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the region or location, as described + * in https://cloud.google.com/apis/design/resource_names. + * + * * For `projects.regions.workflowTemplates,list`, the resource + * name of the region has the following format: + * `projects/{project_id}/regions/{region}` + * + * * For `projects.locations.workflowTemplates.list`, the + * resource name of the location has the following format: + * `projects/{project_id}/locations/{location}` + * @param {number} [request.pageSize] + * Optional. The maximum number of results to return in each response. + * @param {string} [request.pageToken] + * Optional. The page token, returned by a previous call, to request the + * next page of results. + * @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.dataproc.v1.WorkflowTemplate|WorkflowTemplate} 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 `listWorkflowTemplatesAsync()` + * 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. + */ + listWorkflowTemplatesStream( + request?: protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest, + 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['listWorkflowTemplates']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listWorkflowTemplates stream %j', request); + return this.descriptors.page.listWorkflowTemplates.createStream( + this.innerApiCalls.listWorkflowTemplates as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listWorkflowTemplates`, 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 resource name of the region or location, as described + * in https://cloud.google.com/apis/design/resource_names. + * + * * For `projects.regions.workflowTemplates,list`, the resource + * name of the region has the following format: + * `projects/{project_id}/regions/{region}` + * + * * For `projects.locations.workflowTemplates.list`, the + * resource name of the location has the following format: + * `projects/{project_id}/locations/{location}` + * @param {number} [request.pageSize] + * Optional. The maximum number of results to return in each response. + * @param {string} [request.pageToken] + * Optional. The page token, returned by a previous call, to request the + * next page of results. + * @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.dataproc.v1.WorkflowTemplate|WorkflowTemplate}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/workflow_template_service.list_workflow_templates.js + * region_tag:dataproc_v1_generated_WorkflowTemplateService_ListWorkflowTemplates_async + */ + listWorkflowTemplatesAsync( + request?: protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest, + 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['listWorkflowTemplates']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listWorkflowTemplates iterate %j', request); + return this.descriptors.page.listWorkflowTemplates.asyncIterate( + this.innerApiCalls['listWorkflowTemplates'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @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 {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @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/interfaces/CallOptions.html | 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.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + +/** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@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 batch resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch + * @returns {string} Resource name string. + */ + batchPath(project:string,location:string,batch:string) { + return this.pathTemplates.batchPathTemplate.render({ + project: project, + location: location, + batch: batch, + }); + } + + /** + * Parse the project from Batch resource. + * + * @param {string} batchName + * A fully-qualified path representing Batch resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchName(batchName: string) { + return this.pathTemplates.batchPathTemplate.match(batchName).project; + } + + /** + * Parse the location from Batch resource. + * + * @param {string} batchName + * A fully-qualified path representing Batch resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchName(batchName: string) { + return this.pathTemplates.batchPathTemplate.match(batchName).location; + } + + /** + * Parse the batch from Batch resource. + * + * @param {string} batchName + * A fully-qualified path representing Batch resource. + * @returns {string} A string representing the batch. + */ + matchBatchFromBatchName(batchName: string) { + return this.pathTemplates.batchPathTemplate.match(batchName).batch; + } + + /** + * Return a fully-qualified nodeGroup resource name string. + * + * @param {string} project + * @param {string} region + * @param {string} cluster + * @param {string} node_group + * @returns {string} Resource name string. + */ + nodeGroupPath(project:string,region:string,cluster:string,nodeGroup:string) { + return this.pathTemplates.nodeGroupPathTemplate.render({ + project: project, + region: region, + cluster: cluster, + node_group: nodeGroup, + }); + } + + /** + * Parse the project from NodeGroup resource. + * + * @param {string} nodeGroupName + * A fully-qualified path representing NodeGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNodeGroupName(nodeGroupName: string) { + return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).project; + } + + /** + * Parse the region from NodeGroup resource. + * + * @param {string} nodeGroupName + * A fully-qualified path representing NodeGroup resource. + * @returns {string} A string representing the region. + */ + matchRegionFromNodeGroupName(nodeGroupName: string) { + return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).region; + } + + /** + * Parse the cluster from NodeGroup resource. + * + * @param {string} nodeGroupName + * A fully-qualified path representing NodeGroup resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromNodeGroupName(nodeGroupName: string) { + return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).cluster; + } + + /** + * Parse the node_group from NodeGroup resource. + * + * @param {string} nodeGroupName + * A fully-qualified path representing NodeGroup resource. + * @returns {string} A string representing the node_group. + */ + matchNodeGroupFromNodeGroupName(nodeGroupName: string) { + return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).node_group; + } + + /** + * 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 projectLocationAutoscalingPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} autoscaling_policy + * @returns {string} Resource name string. + */ + projectLocationAutoscalingPolicyPath(project:string,location:string,autoscalingPolicy:string) { + return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render({ + project: project, + location: location, + autoscaling_policy: autoscalingPolicy, + }); + } + + /** + * Parse the project from ProjectLocationAutoscalingPolicy resource. + * + * @param {string} projectLocationAutoscalingPolicyName + * A fully-qualified path representing project_location_autoscaling_policy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { + return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).project; + } + + /** + * Parse the location from ProjectLocationAutoscalingPolicy resource. + * + * @param {string} projectLocationAutoscalingPolicyName + * A fully-qualified path representing project_location_autoscaling_policy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { + return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).location; + } + + /** + * Parse the autoscaling_policy from ProjectLocationAutoscalingPolicy resource. + * + * @param {string} projectLocationAutoscalingPolicyName + * A fully-qualified path representing project_location_autoscaling_policy resource. + * @returns {string} A string representing the autoscaling_policy. + */ + matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { + return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).autoscaling_policy; + } + + /** + * Return a fully-qualified projectLocationWorkflowTemplate resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} workflow_template + * @returns {string} Resource name string. + */ + projectLocationWorkflowTemplatePath(project:string,location:string,workflowTemplate:string) { + return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render({ + project: project, + location: location, + workflow_template: workflowTemplate, + }); + } + + /** + * Parse the project from ProjectLocationWorkflowTemplate resource. + * + * @param {string} projectLocationWorkflowTemplateName + * A fully-qualified path representing project_location_workflow_template resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { + return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).project; + } + + /** + * Parse the location from ProjectLocationWorkflowTemplate resource. + * + * @param {string} projectLocationWorkflowTemplateName + * A fully-qualified path representing project_location_workflow_template resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { + return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).location; + } + + /** + * Parse the workflow_template from ProjectLocationWorkflowTemplate resource. + * + * @param {string} projectLocationWorkflowTemplateName + * A fully-qualified path representing project_location_workflow_template resource. + * @returns {string} A string representing the workflow_template. + */ + matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { + return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).workflow_template; + } + + /** + * Return a fully-qualified projectRegionAutoscalingPolicy resource name string. + * + * @param {string} project + * @param {string} region + * @param {string} autoscaling_policy + * @returns {string} Resource name string. + */ + projectRegionAutoscalingPolicyPath(project:string,region:string,autoscalingPolicy:string) { + return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render({ + project: project, + region: region, + autoscaling_policy: autoscalingPolicy, + }); + } + + /** + * Parse the project from ProjectRegionAutoscalingPolicy resource. + * + * @param {string} projectRegionAutoscalingPolicyName + * A fully-qualified path representing project_region_autoscaling_policy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { + return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).project; + } + + /** + * Parse the region from ProjectRegionAutoscalingPolicy resource. + * + * @param {string} projectRegionAutoscalingPolicyName + * A fully-qualified path representing project_region_autoscaling_policy resource. + * @returns {string} A string representing the region. + */ + matchRegionFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { + return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).region; + } + + /** + * Parse the autoscaling_policy from ProjectRegionAutoscalingPolicy resource. + * + * @param {string} projectRegionAutoscalingPolicyName + * A fully-qualified path representing project_region_autoscaling_policy resource. + * @returns {string} A string representing the autoscaling_policy. + */ + matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { + return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).autoscaling_policy; + } + + /** + * Return a fully-qualified projectRegionWorkflowTemplate resource name string. + * + * @param {string} project + * @param {string} region + * @param {string} workflow_template + * @returns {string} Resource name string. + */ + projectRegionWorkflowTemplatePath(project:string,region:string,workflowTemplate:string) { + return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render({ + project: project, + region: region, + workflow_template: workflowTemplate, + }); + } + + /** + * Parse the project from ProjectRegionWorkflowTemplate resource. + * + * @param {string} projectRegionWorkflowTemplateName + * A fully-qualified path representing project_region_workflow_template resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { + return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).project; + } + + /** + * Parse the region from ProjectRegionWorkflowTemplate resource. + * + * @param {string} projectRegionWorkflowTemplateName + * A fully-qualified path representing project_region_workflow_template resource. + * @returns {string} A string representing the region. + */ + matchRegionFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { + return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).region; + } + + /** + * Parse the workflow_template from ProjectRegionWorkflowTemplate resource. + * + * @param {string} projectRegionWorkflowTemplateName + * A fully-qualified path representing project_region_workflow_template resource. + * @returns {string} A string representing the workflow_template. + */ + matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { + return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).workflow_template; + } + + /** + * Return a fully-qualified region resource name string. + * + * @param {string} project + * @param {string} region + * @returns {string} Resource name string. + */ + regionPath(project:string,region:string) { + return this.pathTemplates.regionPathTemplate.render({ + project: project, + region: region, + }); + } + + /** + * Parse the project from Region resource. + * + * @param {string} regionName + * A fully-qualified path representing Region resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRegionName(regionName: string) { + return this.pathTemplates.regionPathTemplate.match(regionName).project; + } + + /** + * Parse the region from Region resource. + * + * @param {string} regionName + * A fully-qualified path representing Region resource. + * @returns {string} A string representing the region. + */ + matchRegionFromRegionName(regionName: string) { + return this.pathTemplates.regionPathTemplate.match(regionName).region; + } + + /** + * Return a fully-qualified session resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} session + * @returns {string} Resource name string. + */ + sessionPath(project:string,location:string,session:string) { + return this.pathTemplates.sessionPathTemplate.render({ + project: project, + location: location, + session: session, + }); + } + + /** + * Parse the project from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).project; + } + + /** + * Parse the location from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).location; + } + + /** + * Parse the session from Session resource. + * + * @param {string} sessionName + * A fully-qualified path representing Session resource. + * @returns {string} A string representing the session. + */ + matchSessionFromSessionName(sessionName: string) { + return this.pathTemplates.sessionPathTemplate.match(sessionName).session; + } + + /** + * Return a fully-qualified sessionTemplate resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} template + * @returns {string} Resource name string. + */ + sessionTemplatePath(project:string,location:string,template:string) { + return this.pathTemplates.sessionTemplatePathTemplate.render({ + project: project, + location: location, + template: template, + }); + } + + /** + * Parse the project from SessionTemplate resource. + * + * @param {string} sessionTemplateName + * A fully-qualified path representing SessionTemplate resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSessionTemplateName(sessionTemplateName: string) { + return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).project; + } + + /** + * Parse the location from SessionTemplate resource. + * + * @param {string} sessionTemplateName + * A fully-qualified path representing SessionTemplate resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSessionTemplateName(sessionTemplateName: string) { + return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).location; + } + + /** + * Parse the template from SessionTemplate resource. + * + * @param {string} sessionTemplateName + * A fully-qualified path representing SessionTemplate resource. + * @returns {string} A string representing the template. + */ + matchTemplateFromSessionTemplateName(sessionTemplateName: string) { + return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).template; + } + + /** + * 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.workflowTemplateServiceStub && !this._terminated) { + return this.workflowTemplateServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.iamClient.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-dataproc/src/v1/workflow_template_service_client_config.json b/owl-bot-staging/google-cloud-dataproc/src/v1/workflow_template_service_client_config.json new file mode 100644 index 000000000000..62d3aa9b9a02 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/src/v1/workflow_template_service_client_config.json @@ -0,0 +1,69 @@ +{ + "interfaces": { + "google.cloud.dataproc.v1.WorkflowTemplateService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ], + "deadline_exceeded_internal_unavailable": [ + "DEADLINE_EXCEEDED", + "INTERNAL", + "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": { + "CreateWorkflowTemplate": { + "timeout_millis": 600000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetWorkflowTemplate": { + "timeout_millis": 600000, + "retry_codes_name": "deadline_exceeded_internal_unavailable", + "retry_params_name": "default" + }, + "InstantiateWorkflowTemplate": { + "timeout_millis": 600000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "InstantiateInlineWorkflowTemplate": { + "timeout_millis": 600000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateWorkflowTemplate": { + "timeout_millis": 600000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListWorkflowTemplates": { + "timeout_millis": 600000, + "retry_codes_name": "deadline_exceeded_internal_unavailable", + "retry_params_name": "default" + }, + "DeleteWorkflowTemplate": { + "timeout_millis": 600000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/workflow_template_service_proto_list.json b/owl-bot-staging/google-cloud-dataproc/src/v1/workflow_template_service_proto_list.json new file mode 100644 index 000000000000..d6798f50ae7c --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/src/v1/workflow_template_service_proto_list.json @@ -0,0 +1,12 @@ +[ + "../../protos/google/cloud/dataproc/v1/autoscaling_policies.proto", + "../../protos/google/cloud/dataproc/v1/batches.proto", + "../../protos/google/cloud/dataproc/v1/clusters.proto", + "../../protos/google/cloud/dataproc/v1/jobs.proto", + "../../protos/google/cloud/dataproc/v1/node_groups.proto", + "../../protos/google/cloud/dataproc/v1/operations.proto", + "../../protos/google/cloud/dataproc/v1/session_templates.proto", + "../../protos/google/cloud/dataproc/v1/sessions.proto", + "../../protos/google/cloud/dataproc/v1/shared.proto", + "../../protos/google/cloud/dataproc/v1/workflow_templates.proto" +] diff --git a/owl-bot-staging/google-cloud-dataproc/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-dataproc/system-test/fixtures/sample/src/index.js new file mode 100644 index 000000000000..614acc37b5cf --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/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 dataproc = require('@google-cloud/dataproc'); + +function main() { + const autoscalingPolicyServiceClient = new dataproc.AutoscalingPolicyServiceClient(); + const batchControllerClient = new dataproc.BatchControllerClient(); + const clusterControllerClient = new dataproc.ClusterControllerClient(); + const jobControllerClient = new dataproc.JobControllerClient(); + const nodeGroupControllerClient = new dataproc.NodeGroupControllerClient(); + const sessionControllerClient = new dataproc.SessionControllerClient(); + const sessionTemplateControllerClient = new dataproc.SessionTemplateControllerClient(); + const workflowTemplateServiceClient = new dataproc.WorkflowTemplateServiceClient(); +} + +main(); diff --git a/owl-bot-staging/google-cloud-dataproc/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-dataproc/system-test/fixtures/sample/src/index.ts new file mode 100644 index 000000000000..1fb8c08a3116 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/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 {AutoscalingPolicyServiceClient, BatchControllerClient, ClusterControllerClient, JobControllerClient, NodeGroupControllerClient, SessionControllerClient, SessionTemplateControllerClient, WorkflowTemplateServiceClient} from '@google-cloud/dataproc'; + +// check that the client class type name can be used +function doStuffWithAutoscalingPolicyServiceClient(client: AutoscalingPolicyServiceClient) { + client.close(); +} +function doStuffWithBatchControllerClient(client: BatchControllerClient) { + client.close(); +} +function doStuffWithClusterControllerClient(client: ClusterControllerClient) { + client.close(); +} +function doStuffWithJobControllerClient(client: JobControllerClient) { + client.close(); +} +function doStuffWithNodeGroupControllerClient(client: NodeGroupControllerClient) { + client.close(); +} +function doStuffWithSessionControllerClient(client: SessionControllerClient) { + client.close(); +} +function doStuffWithSessionTemplateControllerClient(client: SessionTemplateControllerClient) { + client.close(); +} +function doStuffWithWorkflowTemplateServiceClient(client: WorkflowTemplateServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const autoscalingPolicyServiceClient = new AutoscalingPolicyServiceClient(); + doStuffWithAutoscalingPolicyServiceClient(autoscalingPolicyServiceClient); + // check that the client instance can be created + const batchControllerClient = new BatchControllerClient(); + doStuffWithBatchControllerClient(batchControllerClient); + // check that the client instance can be created + const clusterControllerClient = new ClusterControllerClient(); + doStuffWithClusterControllerClient(clusterControllerClient); + // check that the client instance can be created + const jobControllerClient = new JobControllerClient(); + doStuffWithJobControllerClient(jobControllerClient); + // check that the client instance can be created + const nodeGroupControllerClient = new NodeGroupControllerClient(); + doStuffWithNodeGroupControllerClient(nodeGroupControllerClient); + // check that the client instance can be created + const sessionControllerClient = new SessionControllerClient(); + doStuffWithSessionControllerClient(sessionControllerClient); + // check that the client instance can be created + const sessionTemplateControllerClient = new SessionTemplateControllerClient(); + doStuffWithSessionTemplateControllerClient(sessionTemplateControllerClient); + // check that the client instance can be created + const workflowTemplateServiceClient = new WorkflowTemplateServiceClient(); + doStuffWithWorkflowTemplateServiceClient(workflowTemplateServiceClient); +} + +main(); diff --git a/owl-bot-staging/google-cloud-dataproc/system-test/install.ts b/owl-bot-staging/google-cloud-dataproc/system-test/install.ts new file mode 100644 index 000000000000..f66069aa3940 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/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', + cjs: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/google-cloud-dataproc/test/gapic_autoscaling_policy_service_v1.ts b/owl-bot-staging/google-cloud-dataproc/test/gapic_autoscaling_policy_service_v1.ts new file mode 100644 index 000000000000..aa9d2a84883a --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/test/gapic_autoscaling_policy_service_v1.ts @@ -0,0 +1,1665 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 autoscalingpolicyserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, IamProtos} 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('v1.AutoscalingPolicyServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dataproc.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient(); + 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 = autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient.servicePath; + assert.strictEqual(servicePath, 'dataproc.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dataproc.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dataproc.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dataproc.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 autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dataproc.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 autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dataproc.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 autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.autoscalingPolicyServiceStub, undefined); + await client.initialize(); + assert(client.autoscalingPolicyServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.autoscalingPolicyServiceStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.autoscalingPolicyServiceStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + 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 autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + 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('createAutoscalingPolicy', () => { + it('invokes createAutoscalingPolicy without error', async () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataproc.v1.AutoscalingPolicy() + ); + client.innerApiCalls.createAutoscalingPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.createAutoscalingPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createAutoscalingPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAutoscalingPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAutoscalingPolicy without error using callback', async () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataproc.v1.AutoscalingPolicy() + ); + client.innerApiCalls.createAutoscalingPolicy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createAutoscalingPolicy( + request, + (err?: Error|null, result?: protos.google.cloud.dataproc.v1.IAutoscalingPolicy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createAutoscalingPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAutoscalingPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAutoscalingPolicy with error', async () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createAutoscalingPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createAutoscalingPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.createAutoscalingPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createAutoscalingPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createAutoscalingPolicy with closed client', async () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createAutoscalingPolicy(request), expectedError); + }); + }); + + describe('updateAutoscalingPolicy', () => { + it('invokes updateAutoscalingPolicy without error', async () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest() + ); + request.policy ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest', ['policy', 'name']); + request.policy.name = defaultValue1; + const expectedHeaderRequestParams = `policy.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataproc.v1.AutoscalingPolicy() + ); + client.innerApiCalls.updateAutoscalingPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.updateAutoscalingPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateAutoscalingPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAutoscalingPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAutoscalingPolicy without error using callback', async () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest() + ); + request.policy ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest', ['policy', 'name']); + request.policy.name = defaultValue1; + const expectedHeaderRequestParams = `policy.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataproc.v1.AutoscalingPolicy() + ); + client.innerApiCalls.updateAutoscalingPolicy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateAutoscalingPolicy( + request, + (err?: Error|null, result?: protos.google.cloud.dataproc.v1.IAutoscalingPolicy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateAutoscalingPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAutoscalingPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAutoscalingPolicy with error', async () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest() + ); + request.policy ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest', ['policy', 'name']); + request.policy.name = defaultValue1; + const expectedHeaderRequestParams = `policy.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAutoscalingPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateAutoscalingPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.updateAutoscalingPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateAutoscalingPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateAutoscalingPolicy with closed client', async () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest() + ); + request.policy ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest', ['policy', 'name']); + request.policy.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateAutoscalingPolicy(request), expectedError); + }); + }); + + describe('getAutoscalingPolicy', () => { + it('invokes getAutoscalingPolicy without error', async () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataproc.v1.AutoscalingPolicy() + ); + client.innerApiCalls.getAutoscalingPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getAutoscalingPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAutoscalingPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAutoscalingPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAutoscalingPolicy without error using callback', async () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataproc.v1.AutoscalingPolicy() + ); + client.innerApiCalls.getAutoscalingPolicy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getAutoscalingPolicy( + request, + (err?: Error|null, result?: protos.google.cloud.dataproc.v1.IAutoscalingPolicy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getAutoscalingPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAutoscalingPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAutoscalingPolicy with error', async () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getAutoscalingPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getAutoscalingPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.getAutoscalingPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getAutoscalingPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getAutoscalingPolicy with closed client', async () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getAutoscalingPolicy(request), expectedError); + }); + }); + + describe('deleteAutoscalingPolicy', () => { + it('invokes deleteAutoscalingPolicy without error', async () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAutoscalingPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.deleteAutoscalingPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteAutoscalingPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAutoscalingPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAutoscalingPolicy without error using callback', async () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteAutoscalingPolicy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteAutoscalingPolicy( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteAutoscalingPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAutoscalingPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAutoscalingPolicy with error', async () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteAutoscalingPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteAutoscalingPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteAutoscalingPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteAutoscalingPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteAutoscalingPolicy with closed client', async () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteAutoscalingPolicy(request), expectedError); + }); + }); + + describe('listAutoscalingPolicies', () => { + it('invokes listAutoscalingPolicies without error', async () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataproc.v1.AutoscalingPolicy()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.AutoscalingPolicy()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.AutoscalingPolicy()), + ]; + client.innerApiCalls.listAutoscalingPolicies = stubSimpleCall(expectedResponse); + const [response] = await client.listAutoscalingPolicies(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAutoscalingPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAutoscalingPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAutoscalingPolicies without error using callback', async () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataproc.v1.AutoscalingPolicy()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.AutoscalingPolicy()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.AutoscalingPolicy()), + ]; + client.innerApiCalls.listAutoscalingPolicies = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAutoscalingPolicies( + request, + (err?: Error|null, result?: protos.google.cloud.dataproc.v1.IAutoscalingPolicy[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAutoscalingPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAutoscalingPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAutoscalingPolicies with error', async () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAutoscalingPolicies = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAutoscalingPolicies(request), expectedError); + const actualRequest = (client.innerApiCalls.listAutoscalingPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAutoscalingPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAutoscalingPoliciesStream without error', async () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataproc.v1.AutoscalingPolicy()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.AutoscalingPolicy()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.AutoscalingPolicy()), + ]; + client.descriptors.page.listAutoscalingPolicies.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listAutoscalingPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataproc.v1.AutoscalingPolicy[] = []; + stream.on('data', (response: protos.google.cloud.dataproc.v1.AutoscalingPolicy) => { + 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.listAutoscalingPolicies.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAutoscalingPolicies, request)); + assert( + (client.descriptors.page.listAutoscalingPolicies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAutoscalingPoliciesStream with error', async () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listAutoscalingPolicies.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listAutoscalingPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataproc.v1.AutoscalingPolicy[] = []; + stream.on('data', (response: protos.google.cloud.dataproc.v1.AutoscalingPolicy) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listAutoscalingPolicies.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAutoscalingPolicies, request)); + assert( + (client.descriptors.page.listAutoscalingPolicies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAutoscalingPolicies without error', async () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataproc.v1.AutoscalingPolicy()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.AutoscalingPolicy()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.AutoscalingPolicy()), + ]; + client.descriptors.page.listAutoscalingPolicies.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dataproc.v1.IAutoscalingPolicy[] = []; + const iterable = client.listAutoscalingPoliciesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAutoscalingPolicies.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAutoscalingPolicies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAutoscalingPolicies with error', async () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listAutoscalingPolicies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAutoscalingPoliciesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dataproc.v1.IAutoscalingPolicy[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAutoscalingPolicies.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAutoscalingPolicies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + + describe('Path templates', () => { + + describe('batch', async () => { + const fakePath = "/rendered/path/batch"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch: "batchValue", + }; + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.batchPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPath', () => { + const result = client.batchPath("projectValue", "locationValue", "batchValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchName', () => { + const result = client.matchProjectFromBatchName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchName', () => { + const result = client.matchLocationFromBatchName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchFromBatchName', () => { + const result = client.matchBatchFromBatchName(fakePath); + assert.strictEqual(result, "batchValue"); + assert((client.pathTemplates.batchPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + 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('nodeGroup', async () => { + const fakePath = "/rendered/path/nodeGroup"; + const expectedParameters = { + project: "projectValue", + region: "regionValue", + cluster: "clusterValue", + node_group: "nodeGroupValue", + }; + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.nodeGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nodeGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nodeGroupPath', () => { + const result = client.nodeGroupPath("projectValue", "regionValue", "clusterValue", "nodeGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nodeGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNodeGroupName', () => { + const result = client.matchProjectFromNodeGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRegionFromNodeGroupName', () => { + const result = client.matchRegionFromNodeGroupName(fakePath); + assert.strictEqual(result, "regionValue"); + assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromNodeGroupName', () => { + const result = client.matchClusterFromNodeGroupName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNodeGroupFromNodeGroupName', () => { + const result = client.matchNodeGroupFromNodeGroupName(fakePath); + assert.strictEqual(result, "nodeGroupValue"); + assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + 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('projectLocationAutoscalingPolicy', async () => { + const fakePath = "/rendered/path/projectLocationAutoscalingPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + autoscaling_policy: "autoscalingPolicyValue", + }; + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAutoscalingPolicyPath', () => { + const result = client.projectLocationAutoscalingPolicyPath("projectValue", "locationValue", "autoscalingPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationAutoscalingPolicyName', () => { + const result = client.matchProjectFromProjectLocationAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationAutoscalingPolicyName', () => { + const result = client.matchLocationFromProjectLocationAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName', () => { + const result = client.matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "autoscalingPolicyValue"); + assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationWorkflowTemplate', async () => { + const fakePath = "/rendered/path/projectLocationWorkflowTemplate"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + workflow_template: "workflowTemplateValue", + }; + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationWorkflowTemplatePath', () => { + const result = client.projectLocationWorkflowTemplatePath("projectValue", "locationValue", "workflowTemplateValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationWorkflowTemplateName', () => { + const result = client.matchProjectFromProjectLocationWorkflowTemplateName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationWorkflowTemplateName', () => { + const result = client.matchLocationFromProjectLocationWorkflowTemplateName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchWorkflowTemplateFromProjectLocationWorkflowTemplateName', () => { + const result = client.matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(fakePath); + assert.strictEqual(result, "workflowTemplateValue"); + assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectRegionAutoscalingPolicy', async () => { + const fakePath = "/rendered/path/projectRegionAutoscalingPolicy"; + const expectedParameters = { + project: "projectValue", + region: "regionValue", + autoscaling_policy: "autoscalingPolicyValue", + }; + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectRegionAutoscalingPolicyPath', () => { + const result = client.projectRegionAutoscalingPolicyPath("projectValue", "regionValue", "autoscalingPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectRegionAutoscalingPolicyName', () => { + const result = client.matchProjectFromProjectRegionAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRegionFromProjectRegionAutoscalingPolicyName', () => { + const result = client.matchRegionFromProjectRegionAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "regionValue"); + assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName', () => { + const result = client.matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "autoscalingPolicyValue"); + assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectRegionWorkflowTemplate', async () => { + const fakePath = "/rendered/path/projectRegionWorkflowTemplate"; + const expectedParameters = { + project: "projectValue", + region: "regionValue", + workflow_template: "workflowTemplateValue", + }; + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectRegionWorkflowTemplatePath', () => { + const result = client.projectRegionWorkflowTemplatePath("projectValue", "regionValue", "workflowTemplateValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectRegionWorkflowTemplateName', () => { + const result = client.matchProjectFromProjectRegionWorkflowTemplateName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRegionFromProjectRegionWorkflowTemplateName', () => { + const result = client.matchRegionFromProjectRegionWorkflowTemplateName(fakePath); + assert.strictEqual(result, "regionValue"); + assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchWorkflowTemplateFromProjectRegionWorkflowTemplateName', () => { + const result = client.matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(fakePath); + assert.strictEqual(result, "workflowTemplateValue"); + assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('session', async () => { + const fakePath = "/rendered/path/session"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + session: "sessionValue", + }; + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.sessionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.sessionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('sessionPath', () => { + const result = client.sessionPath("projectValue", "locationValue", "sessionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.sessionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSessionName', () => { + const result = client.matchProjectFromSessionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSessionName', () => { + const result = client.matchLocationFromSessionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSessionFromSessionName', () => { + const result = client.matchSessionFromSessionName(fakePath); + assert.strictEqual(result, "sessionValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('sessionTemplate', async () => { + const fakePath = "/rendered/path/sessionTemplate"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + template: "templateValue", + }; + const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.sessionTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.sessionTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('sessionTemplatePath', () => { + const result = client.sessionTemplatePath("projectValue", "locationValue", "templateValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.sessionTemplatePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSessionTemplateName', () => { + const result = client.matchProjectFromSessionTemplateName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSessionTemplateName', () => { + const result = client.matchLocationFromSessionTemplateName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTemplateFromSessionTemplateName', () => { + const result = client.matchTemplateFromSessionTemplateName(fakePath); + assert.strictEqual(result, "templateValue"); + assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dataproc/test/gapic_batch_controller_v1.ts b/owl-bot-staging/google-cloud-dataproc/test/gapic_batch_controller_v1.ts new file mode 100644 index 000000000000..444d1494efb4 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/test/gapic_batch_controller_v1.ts @@ -0,0 +1,1870 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 batchcontrollerModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos, IamProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.BatchControllerClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new batchcontrollerModule.v1.BatchControllerClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dataproc.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new batchcontrollerModule.v1.BatchControllerClient(); + 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 = batchcontrollerModule.v1.BatchControllerClient.servicePath; + assert.strictEqual(servicePath, 'dataproc.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = batchcontrollerModule.v1.BatchControllerClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dataproc.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new batchcontrollerModule.v1.BatchControllerClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dataproc.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new batchcontrollerModule.v1.BatchControllerClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dataproc.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 batchcontrollerModule.v1.BatchControllerClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dataproc.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 batchcontrollerModule.v1.BatchControllerClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dataproc.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 batchcontrollerModule.v1.BatchControllerClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = batchcontrollerModule.v1.BatchControllerClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new batchcontrollerModule.v1.BatchControllerClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new batchcontrollerModule.v1.BatchControllerClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.batchControllerStub, undefined); + await client.initialize(); + assert(client.batchControllerStub); + }); + + it('has close method for the initialized client', done => { + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.batchControllerStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.batchControllerStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new batchcontrollerModule.v1.BatchControllerClient({ + 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 batchcontrollerModule.v1.BatchControllerClient({ + 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('getBatch', () => { + it('invokes getBatch without error', async () => { + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.GetBatchRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetBatchRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataproc.v1.Batch() + ); + client.innerApiCalls.getBatch = stubSimpleCall(expectedResponse); + const [response] = await client.getBatch(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getBatch as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBatch as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBatch without error using callback', async () => { + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.GetBatchRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetBatchRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataproc.v1.Batch() + ); + client.innerApiCalls.getBatch = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBatch( + request, + (err?: Error|null, result?: protos.google.cloud.dataproc.v1.IBatch|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getBatch as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBatch as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBatch with error', async () => { + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.GetBatchRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetBatchRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getBatch = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getBatch(request), expectedError); + const actualRequest = (client.innerApiCalls.getBatch as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBatch as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBatch with closed client', async () => { + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.GetBatchRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetBatchRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getBatch(request), expectedError); + }); + }); + + describe('deleteBatch', () => { + it('invokes deleteBatch without error', async () => { + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.DeleteBatchRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteBatchRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteBatch = stubSimpleCall(expectedResponse); + const [response] = await client.deleteBatch(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteBatch as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBatch as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBatch without error using callback', async () => { + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.DeleteBatchRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteBatchRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteBatch = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteBatch( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteBatch as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBatch as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBatch with error', async () => { + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.DeleteBatchRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteBatchRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBatch = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteBatch(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteBatch as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBatch as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBatch with closed client', async () => { + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.DeleteBatchRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteBatchRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteBatch(request), expectedError); + }); + }); + + describe('createBatch', () => { + it('invokes createBatch without error', async () => { + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.CreateBatchRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CreateBatchRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBatch = stubLongRunningCall(expectedResponse); + const [operation] = await client.createBatch(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createBatch as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBatch as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBatch without error using callback', async () => { + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.CreateBatchRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CreateBatchRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBatch = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createBatch( + 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.createBatch as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBatch as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBatch with call error', async () => { + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.CreateBatchRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CreateBatchRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBatch = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createBatch(request), expectedError); + const actualRequest = (client.innerApiCalls.createBatch as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBatch as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBatch with LRO error', async () => { + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.CreateBatchRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CreateBatchRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBatch = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createBatch(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createBatch as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBatch as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateBatchProgress without error', async () => { + const client = new batchcontrollerModule.v1.BatchControllerClient({ + 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.checkCreateBatchProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateBatchProgress with error', async () => { + const client = new batchcontrollerModule.v1.BatchControllerClient({ + 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.checkCreateBatchProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listBatches', () => { + it('invokes listBatches without error', async () => { + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListBatchesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListBatchesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataproc.v1.Batch()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.Batch()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.Batch()), + ]; + client.innerApiCalls.listBatches = stubSimpleCall(expectedResponse); + const [response] = await client.listBatches(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listBatches as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBatches as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBatches without error using callback', async () => { + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListBatchesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListBatchesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataproc.v1.Batch()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.Batch()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.Batch()), + ]; + client.innerApiCalls.listBatches = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBatches( + request, + (err?: Error|null, result?: protos.google.cloud.dataproc.v1.IBatch[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listBatches as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBatches as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBatches with error', async () => { + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListBatchesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListBatchesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listBatches = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listBatches(request), expectedError); + const actualRequest = (client.innerApiCalls.listBatches as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBatches as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBatchesStream without error', async () => { + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListBatchesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListBatchesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataproc.v1.Batch()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.Batch()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.Batch()), + ]; + client.descriptors.page.listBatches.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listBatchesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataproc.v1.Batch[] = []; + stream.on('data', (response: protos.google.cloud.dataproc.v1.Batch) => { + 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.listBatches.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBatches, request)); + assert( + (client.descriptors.page.listBatches.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listBatchesStream with error', async () => { + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListBatchesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListBatchesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listBatches.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listBatchesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataproc.v1.Batch[] = []; + stream.on('data', (response: protos.google.cloud.dataproc.v1.Batch) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listBatches.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBatches, request)); + assert( + (client.descriptors.page.listBatches.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBatches without error', async () => { + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListBatchesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListBatchesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataproc.v1.Batch()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.Batch()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.Batch()), + ]; + client.descriptors.page.listBatches.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dataproc.v1.IBatch[] = []; + const iterable = client.listBatchesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listBatches.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listBatches.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBatches with error', async () => { + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListBatchesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListBatchesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listBatches.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listBatchesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dataproc.v1.IBatch[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listBatches.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listBatches.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new batchcontrollerModule.v1.BatchControllerClient({ + 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 batchcontrollerModule.v1.BatchControllerClient({ + 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 batchcontrollerModule.v1.BatchControllerClient({ + 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 batchcontrollerModule.v1.BatchControllerClient({ + 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 batchcontrollerModule.v1.BatchControllerClient({ + 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 batchcontrollerModule.v1.BatchControllerClient({ + 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 batchcontrollerModule.v1.BatchControllerClient({ + 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 batchcontrollerModule.v1.BatchControllerClient({ + 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 batchcontrollerModule.v1.BatchControllerClient({ + 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 batchcontrollerModule.v1.BatchControllerClient({ + 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 batchcontrollerModule.v1.BatchControllerClient({ + 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('batch', async () => { + const fakePath = "/rendered/path/batch"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch: "batchValue", + }; + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.batchPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPath', () => { + const result = client.batchPath("projectValue", "locationValue", "batchValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchName', () => { + const result = client.matchProjectFromBatchName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchName', () => { + const result = client.matchLocationFromBatchName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchFromBatchName', () => { + const result = client.matchBatchFromBatchName(fakePath); + assert.strictEqual(result, "batchValue"); + assert((client.pathTemplates.batchPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new batchcontrollerModule.v1.BatchControllerClient({ + 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('nodeGroup', async () => { + const fakePath = "/rendered/path/nodeGroup"; + const expectedParameters = { + project: "projectValue", + region: "regionValue", + cluster: "clusterValue", + node_group: "nodeGroupValue", + }; + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.nodeGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nodeGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nodeGroupPath', () => { + const result = client.nodeGroupPath("projectValue", "regionValue", "clusterValue", "nodeGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nodeGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNodeGroupName', () => { + const result = client.matchProjectFromNodeGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRegionFromNodeGroupName', () => { + const result = client.matchRegionFromNodeGroupName(fakePath); + assert.strictEqual(result, "regionValue"); + assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromNodeGroupName', () => { + const result = client.matchClusterFromNodeGroupName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNodeGroupFromNodeGroupName', () => { + const result = client.matchNodeGroupFromNodeGroupName(fakePath); + assert.strictEqual(result, "nodeGroupValue"); + assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new batchcontrollerModule.v1.BatchControllerClient({ + 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('projectLocationAutoscalingPolicy', async () => { + const fakePath = "/rendered/path/projectLocationAutoscalingPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + autoscaling_policy: "autoscalingPolicyValue", + }; + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAutoscalingPolicyPath', () => { + const result = client.projectLocationAutoscalingPolicyPath("projectValue", "locationValue", "autoscalingPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationAutoscalingPolicyName', () => { + const result = client.matchProjectFromProjectLocationAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationAutoscalingPolicyName', () => { + const result = client.matchLocationFromProjectLocationAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName', () => { + const result = client.matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "autoscalingPolicyValue"); + assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationWorkflowTemplate', async () => { + const fakePath = "/rendered/path/projectLocationWorkflowTemplate"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + workflow_template: "workflowTemplateValue", + }; + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationWorkflowTemplatePath', () => { + const result = client.projectLocationWorkflowTemplatePath("projectValue", "locationValue", "workflowTemplateValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationWorkflowTemplateName', () => { + const result = client.matchProjectFromProjectLocationWorkflowTemplateName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationWorkflowTemplateName', () => { + const result = client.matchLocationFromProjectLocationWorkflowTemplateName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchWorkflowTemplateFromProjectLocationWorkflowTemplateName', () => { + const result = client.matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(fakePath); + assert.strictEqual(result, "workflowTemplateValue"); + assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectRegionAutoscalingPolicy', async () => { + const fakePath = "/rendered/path/projectRegionAutoscalingPolicy"; + const expectedParameters = { + project: "projectValue", + region: "regionValue", + autoscaling_policy: "autoscalingPolicyValue", + }; + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectRegionAutoscalingPolicyPath', () => { + const result = client.projectRegionAutoscalingPolicyPath("projectValue", "regionValue", "autoscalingPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectRegionAutoscalingPolicyName', () => { + const result = client.matchProjectFromProjectRegionAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRegionFromProjectRegionAutoscalingPolicyName', () => { + const result = client.matchRegionFromProjectRegionAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "regionValue"); + assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName', () => { + const result = client.matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "autoscalingPolicyValue"); + assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectRegionWorkflowTemplate', async () => { + const fakePath = "/rendered/path/projectRegionWorkflowTemplate"; + const expectedParameters = { + project: "projectValue", + region: "regionValue", + workflow_template: "workflowTemplateValue", + }; + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectRegionWorkflowTemplatePath', () => { + const result = client.projectRegionWorkflowTemplatePath("projectValue", "regionValue", "workflowTemplateValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectRegionWorkflowTemplateName', () => { + const result = client.matchProjectFromProjectRegionWorkflowTemplateName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRegionFromProjectRegionWorkflowTemplateName', () => { + const result = client.matchRegionFromProjectRegionWorkflowTemplateName(fakePath); + assert.strictEqual(result, "regionValue"); + assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchWorkflowTemplateFromProjectRegionWorkflowTemplateName', () => { + const result = client.matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(fakePath); + assert.strictEqual(result, "workflowTemplateValue"); + assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('session', async () => { + const fakePath = "/rendered/path/session"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + session: "sessionValue", + }; + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.sessionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.sessionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('sessionPath', () => { + const result = client.sessionPath("projectValue", "locationValue", "sessionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.sessionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSessionName', () => { + const result = client.matchProjectFromSessionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSessionName', () => { + const result = client.matchLocationFromSessionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSessionFromSessionName', () => { + const result = client.matchSessionFromSessionName(fakePath); + assert.strictEqual(result, "sessionValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('sessionTemplate', async () => { + const fakePath = "/rendered/path/sessionTemplate"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + template: "templateValue", + }; + const client = new batchcontrollerModule.v1.BatchControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.sessionTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.sessionTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('sessionTemplatePath', () => { + const result = client.sessionTemplatePath("projectValue", "locationValue", "templateValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.sessionTemplatePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSessionTemplateName', () => { + const result = client.matchProjectFromSessionTemplateName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSessionTemplateName', () => { + const result = client.matchLocationFromSessionTemplateName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTemplateFromSessionTemplateName', () => { + const result = client.matchTemplateFromSessionTemplateName(fakePath); + assert.strictEqual(result, "templateValue"); + assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dataproc/test/gapic_cluster_controller_v1.ts b/owl-bot-staging/google-cloud-dataproc/test/gapic_cluster_controller_v1.ts new file mode 100644 index 000000000000..41d831ea1add --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/test/gapic_cluster_controller_v1.ts @@ -0,0 +1,2741 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 clustercontrollerModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos, IamProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.ClusterControllerClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dataproc.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient(); + 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 = clustercontrollerModule.v1.ClusterControllerClient.servicePath; + assert.strictEqual(servicePath, 'dataproc.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = clustercontrollerModule.v1.ClusterControllerClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dataproc.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dataproc.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dataproc.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 clustercontrollerModule.v1.ClusterControllerClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dataproc.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 clustercontrollerModule.v1.ClusterControllerClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dataproc.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 clustercontrollerModule.v1.ClusterControllerClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = clustercontrollerModule.v1.ClusterControllerClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.clusterControllerStub, undefined); + await client.initialize(); + assert(client.clusterControllerStub); + }); + + it('has close method for the initialized client', done => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.clusterControllerStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.clusterControllerStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + 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 clustercontrollerModule.v1.ClusterControllerClient({ + 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('getCluster', () => { + it('invokes getCluster without error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.GetClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetClusterRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetClusterRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetClusterRequest', ['clusterName']); + request.clusterName = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataproc.v1.Cluster() + ); + client.innerApiCalls.getCluster = stubSimpleCall(expectedResponse); + const [response] = await client.getCluster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster without error using callback', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.GetClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetClusterRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetClusterRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetClusterRequest', ['clusterName']); + request.clusterName = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataproc.v1.Cluster() + ); + client.innerApiCalls.getCluster = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCluster( + request, + (err?: Error|null, result?: protos.google.cloud.dataproc.v1.ICluster|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster with error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.GetClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetClusterRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetClusterRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetClusterRequest', ['clusterName']); + request.clusterName = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCluster = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster with closed client', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.GetClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetClusterRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetClusterRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetClusterRequest', ['clusterName']); + request.clusterName = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getCluster(request), expectedError); + }); + }); + + describe('createCluster', () => { + it('invokes createCluster without error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.CreateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CreateClusterRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CreateClusterRequest', ['region']); + request.region = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.createCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster without error using callback', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.CreateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CreateClusterRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CreateClusterRequest', ['region']); + request.region = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCluster( + 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.createCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster with call error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.CreateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CreateClusterRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CreateClusterRequest', ['region']); + request.region = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster with LRO error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.CreateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CreateClusterRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CreateClusterRequest', ['region']); + request.region = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateClusterProgress without error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + 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.checkCreateClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateClusterProgress with error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + 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.checkCreateClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateCluster', () => { + it('invokes updateCluster without error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.UpdateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateClusterRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateClusterRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateClusterRequest', ['clusterName']); + request.clusterName = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster without error using callback', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.UpdateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateClusterRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateClusterRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateClusterRequest', ['clusterName']); + request.clusterName = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCluster( + 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.updateCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster with call error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.UpdateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateClusterRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateClusterRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateClusterRequest', ['clusterName']); + request.clusterName = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster with LRO error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.UpdateClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateClusterRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateClusterRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateClusterRequest', ['clusterName']); + request.clusterName = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateClusterProgress without error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + 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.checkUpdateClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateClusterProgress with error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + 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.checkUpdateClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('stopCluster', () => { + it('invokes stopCluster without error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.StopClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.StopClusterRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.StopClusterRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.StopClusterRequest', ['clusterName']); + request.clusterName = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.stopCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.stopCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.stopCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.stopCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopCluster without error using callback', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.StopClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.StopClusterRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.StopClusterRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.StopClusterRequest', ['clusterName']); + request.clusterName = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.stopCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.stopCluster( + 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.stopCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.stopCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopCluster with call error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.StopClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.StopClusterRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.StopClusterRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.StopClusterRequest', ['clusterName']); + request.clusterName = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.stopCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.stopCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.stopCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.stopCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopCluster with LRO error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.StopClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.StopClusterRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.StopClusterRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.StopClusterRequest', ['clusterName']); + request.clusterName = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.stopCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.stopCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.stopCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.stopCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkStopClusterProgress without error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + 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.checkStopClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkStopClusterProgress with error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + 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.checkStopClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('startCluster', () => { + it('invokes startCluster without error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.StartClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.StartClusterRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.StartClusterRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.StartClusterRequest', ['clusterName']); + request.clusterName = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.startCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.startCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.startCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.startCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startCluster without error using callback', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.StartClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.StartClusterRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.StartClusterRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.StartClusterRequest', ['clusterName']); + request.clusterName = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.startCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.startCluster( + 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.startCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.startCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startCluster with call error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.StartClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.StartClusterRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.StartClusterRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.StartClusterRequest', ['clusterName']); + request.clusterName = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.startCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.startCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.startCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.startCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startCluster with LRO error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.StartClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.StartClusterRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.StartClusterRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.StartClusterRequest', ['clusterName']); + request.clusterName = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.startCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.startCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.startCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.startCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkStartClusterProgress without error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + 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.checkStartClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkStartClusterProgress with error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + 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.checkStartClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteCluster', () => { + it('invokes deleteCluster without error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.DeleteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteClusterRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteClusterRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteClusterRequest', ['clusterName']); + request.clusterName = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster without error using callback', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.DeleteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteClusterRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteClusterRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteClusterRequest', ['clusterName']); + request.clusterName = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCluster( + 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.deleteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster with call error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.DeleteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteClusterRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteClusterRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteClusterRequest', ['clusterName']); + request.clusterName = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster with LRO error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.DeleteClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteClusterRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteClusterRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteClusterRequest', ['clusterName']); + request.clusterName = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteClusterProgress without error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + 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.checkDeleteClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteClusterProgress with error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + 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.checkDeleteClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('diagnoseCluster', () => { + it('invokes diagnoseCluster without error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.DiagnoseClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DiagnoseClusterRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DiagnoseClusterRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DiagnoseClusterRequest', ['clusterName']); + request.clusterName = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.diagnoseCluster = stubLongRunningCall(expectedResponse); + const [operation] = await client.diagnoseCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.diagnoseCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.diagnoseCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes diagnoseCluster without error using callback', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.DiagnoseClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DiagnoseClusterRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DiagnoseClusterRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DiagnoseClusterRequest', ['clusterName']); + request.clusterName = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.diagnoseCluster = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.diagnoseCluster( + 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.diagnoseCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.diagnoseCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes diagnoseCluster with call error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.DiagnoseClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DiagnoseClusterRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DiagnoseClusterRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DiagnoseClusterRequest', ['clusterName']); + request.clusterName = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.diagnoseCluster = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.diagnoseCluster(request), expectedError); + const actualRequest = (client.innerApiCalls.diagnoseCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.diagnoseCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes diagnoseCluster with LRO error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.DiagnoseClusterRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DiagnoseClusterRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DiagnoseClusterRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DiagnoseClusterRequest', ['clusterName']); + request.clusterName = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.diagnoseCluster = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.diagnoseCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.diagnoseCluster as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.diagnoseCluster as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDiagnoseClusterProgress without error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + 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.checkDiagnoseClusterProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDiagnoseClusterProgress with error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + 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.checkDiagnoseClusterProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listClusters', () => { + it('invokes listClusters without error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListClustersRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListClustersRequest', ['region']); + request.region = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataproc.v1.Cluster()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.Cluster()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.Cluster()), + ]; + client.innerApiCalls.listClusters = stubSimpleCall(expectedResponse); + const [response] = await client.listClusters(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters without error using callback', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListClustersRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListClustersRequest', ['region']); + request.region = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataproc.v1.Cluster()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.Cluster()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.Cluster()), + ]; + client.innerApiCalls.listClusters = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listClusters( + request, + (err?: Error|null, result?: protos.google.cloud.dataproc.v1.ICluster[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters with error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListClustersRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListClustersRequest', ['region']); + request.region = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listClusters = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listClusters(request), expectedError); + const actualRequest = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClustersStream without error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListClustersRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListClustersRequest', ['region']); + request.region = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataproc.v1.Cluster()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.Cluster()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.Cluster()), + ]; + client.descriptors.page.listClusters.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listClustersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataproc.v1.Cluster[] = []; + stream.on('data', (response: protos.google.cloud.dataproc.v1.Cluster) => { + 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.listClusters.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listClusters, request)); + assert( + (client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listClustersStream with error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListClustersRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListClustersRequest', ['region']); + request.region = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listClusters.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listClustersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataproc.v1.Cluster[] = []; + stream.on('data', (response: protos.google.cloud.dataproc.v1.Cluster) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listClusters, request)); + assert( + (client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listClusters without error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListClustersRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListClustersRequest', ['region']); + request.region = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataproc.v1.Cluster()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.Cluster()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.Cluster()), + ]; + client.descriptors.page.listClusters.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dataproc.v1.ICluster[] = []; + const iterable = client.listClustersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listClusters.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listClusters.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listClusters with error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListClustersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListClustersRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListClustersRequest', ['region']); + request.region = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listClusters.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listClustersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dataproc.v1.ICluster[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listClusters.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listClusters.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + 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 clustercontrollerModule.v1.ClusterControllerClient({ + 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 clustercontrollerModule.v1.ClusterControllerClient({ + 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 clustercontrollerModule.v1.ClusterControllerClient({ + 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 clustercontrollerModule.v1.ClusterControllerClient({ + 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 clustercontrollerModule.v1.ClusterControllerClient({ + 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 clustercontrollerModule.v1.ClusterControllerClient({ + 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 clustercontrollerModule.v1.ClusterControllerClient({ + 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 clustercontrollerModule.v1.ClusterControllerClient({ + 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 clustercontrollerModule.v1.ClusterControllerClient({ + 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 clustercontrollerModule.v1.ClusterControllerClient({ + 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('batch', async () => { + const fakePath = "/rendered/path/batch"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch: "batchValue", + }; + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.batchPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPath', () => { + const result = client.batchPath("projectValue", "locationValue", "batchValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchName', () => { + const result = client.matchProjectFromBatchName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchName', () => { + const result = client.matchLocationFromBatchName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchFromBatchName', () => { + const result = client.matchBatchFromBatchName(fakePath); + assert.strictEqual(result, "batchValue"); + assert((client.pathTemplates.batchPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('cryptoKey', async () => { + const fakePath = "/rendered/path/cryptoKey"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + key_ring: "keyRingValue", + crypto_key: "cryptoKeyValue", + }; + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + 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('nodeGroup', async () => { + const fakePath = "/rendered/path/nodeGroup"; + const expectedParameters = { + project: "projectValue", + region: "regionValue", + cluster: "clusterValue", + node_group: "nodeGroupValue", + }; + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.nodeGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nodeGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nodeGroupPath', () => { + const result = client.nodeGroupPath("projectValue", "regionValue", "clusterValue", "nodeGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nodeGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNodeGroupName', () => { + const result = client.matchProjectFromNodeGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRegionFromNodeGroupName', () => { + const result = client.matchRegionFromNodeGroupName(fakePath); + assert.strictEqual(result, "regionValue"); + assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromNodeGroupName', () => { + const result = client.matchClusterFromNodeGroupName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNodeGroupFromNodeGroupName', () => { + const result = client.matchNodeGroupFromNodeGroupName(fakePath); + assert.strictEqual(result, "nodeGroupValue"); + assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationAutoscalingPolicy', async () => { + const fakePath = "/rendered/path/projectLocationAutoscalingPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + autoscaling_policy: "autoscalingPolicyValue", + }; + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAutoscalingPolicyPath', () => { + const result = client.projectLocationAutoscalingPolicyPath("projectValue", "locationValue", "autoscalingPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationAutoscalingPolicyName', () => { + const result = client.matchProjectFromProjectLocationAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationAutoscalingPolicyName', () => { + const result = client.matchLocationFromProjectLocationAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName', () => { + const result = client.matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "autoscalingPolicyValue"); + assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationWorkflowTemplate', async () => { + const fakePath = "/rendered/path/projectLocationWorkflowTemplate"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + workflow_template: "workflowTemplateValue", + }; + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationWorkflowTemplatePath', () => { + const result = client.projectLocationWorkflowTemplatePath("projectValue", "locationValue", "workflowTemplateValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationWorkflowTemplateName', () => { + const result = client.matchProjectFromProjectLocationWorkflowTemplateName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationWorkflowTemplateName', () => { + const result = client.matchLocationFromProjectLocationWorkflowTemplateName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchWorkflowTemplateFromProjectLocationWorkflowTemplateName', () => { + const result = client.matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(fakePath); + assert.strictEqual(result, "workflowTemplateValue"); + assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectRegionAutoscalingPolicy', async () => { + const fakePath = "/rendered/path/projectRegionAutoscalingPolicy"; + const expectedParameters = { + project: "projectValue", + region: "regionValue", + autoscaling_policy: "autoscalingPolicyValue", + }; + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectRegionAutoscalingPolicyPath', () => { + const result = client.projectRegionAutoscalingPolicyPath("projectValue", "regionValue", "autoscalingPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectRegionAutoscalingPolicyName', () => { + const result = client.matchProjectFromProjectRegionAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRegionFromProjectRegionAutoscalingPolicyName', () => { + const result = client.matchRegionFromProjectRegionAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "regionValue"); + assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName', () => { + const result = client.matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "autoscalingPolicyValue"); + assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectRegionWorkflowTemplate', async () => { + const fakePath = "/rendered/path/projectRegionWorkflowTemplate"; + const expectedParameters = { + project: "projectValue", + region: "regionValue", + workflow_template: "workflowTemplateValue", + }; + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectRegionWorkflowTemplatePath', () => { + const result = client.projectRegionWorkflowTemplatePath("projectValue", "regionValue", "workflowTemplateValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectRegionWorkflowTemplateName', () => { + const result = client.matchProjectFromProjectRegionWorkflowTemplateName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRegionFromProjectRegionWorkflowTemplateName', () => { + const result = client.matchRegionFromProjectRegionWorkflowTemplateName(fakePath); + assert.strictEqual(result, "regionValue"); + assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchWorkflowTemplateFromProjectRegionWorkflowTemplateName', () => { + const result = client.matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(fakePath); + assert.strictEqual(result, "workflowTemplateValue"); + assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.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 clustercontrollerModule.v1.ClusterControllerClient({ + 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('session', async () => { + const fakePath = "/rendered/path/session"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + session: "sessionValue", + }; + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.sessionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.sessionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('sessionPath', () => { + const result = client.sessionPath("projectValue", "locationValue", "sessionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.sessionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSessionName', () => { + const result = client.matchProjectFromSessionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSessionName', () => { + const result = client.matchLocationFromSessionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSessionFromSessionName', () => { + const result = client.matchSessionFromSessionName(fakePath); + assert.strictEqual(result, "sessionValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('sessionTemplate', async () => { + const fakePath = "/rendered/path/sessionTemplate"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + template: "templateValue", + }; + const client = new clustercontrollerModule.v1.ClusterControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.sessionTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.sessionTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('sessionTemplatePath', () => { + const result = client.sessionTemplatePath("projectValue", "locationValue", "templateValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.sessionTemplatePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSessionTemplateName', () => { + const result = client.matchProjectFromSessionTemplateName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSessionTemplateName', () => { + const result = client.matchLocationFromSessionTemplateName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTemplateFromSessionTemplateName', () => { + const result = client.matchTemplateFromSessionTemplateName(fakePath); + assert.strictEqual(result, "templateValue"); + assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dataproc/test/gapic_job_controller_v1.ts b/owl-bot-staging/google-cloud-dataproc/test/gapic_job_controller_v1.ts new file mode 100644 index 000000000000..923a04d1d1d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/test/gapic_job_controller_v1.ts @@ -0,0 +1,2267 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 jobcontrollerModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos, IamProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.JobControllerClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new jobcontrollerModule.v1.JobControllerClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dataproc.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new jobcontrollerModule.v1.JobControllerClient(); + 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 = jobcontrollerModule.v1.JobControllerClient.servicePath; + assert.strictEqual(servicePath, 'dataproc.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = jobcontrollerModule.v1.JobControllerClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dataproc.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new jobcontrollerModule.v1.JobControllerClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dataproc.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new jobcontrollerModule.v1.JobControllerClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dataproc.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 jobcontrollerModule.v1.JobControllerClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dataproc.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 jobcontrollerModule.v1.JobControllerClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dataproc.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 jobcontrollerModule.v1.JobControllerClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = jobcontrollerModule.v1.JobControllerClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new jobcontrollerModule.v1.JobControllerClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.jobControllerStub, undefined); + await client.initialize(); + assert(client.jobControllerStub); + }); + + it('has close method for the initialized client', done => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.jobControllerStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.jobControllerStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new jobcontrollerModule.v1.JobControllerClient({ + 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 jobcontrollerModule.v1.JobControllerClient({ + 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('submitJob', () => { + it('invokes submitJob without error', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.SubmitJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.SubmitJobRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.SubmitJobRequest', ['region']); + request.region = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataproc.v1.Job() + ); + client.innerApiCalls.submitJob = stubSimpleCall(expectedResponse); + const [response] = await client.submitJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.submitJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.submitJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes submitJob without error using callback', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.SubmitJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.SubmitJobRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.SubmitJobRequest', ['region']); + request.region = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataproc.v1.Job() + ); + client.innerApiCalls.submitJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.submitJob( + request, + (err?: Error|null, result?: protos.google.cloud.dataproc.v1.IJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.submitJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.submitJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes submitJob with error', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.SubmitJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.SubmitJobRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.SubmitJobRequest', ['region']); + request.region = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.submitJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.submitJob(request), expectedError); + const actualRequest = (client.innerApiCalls.submitJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.submitJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes submitJob with closed client', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.SubmitJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.SubmitJobRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.SubmitJobRequest', ['region']); + request.region = defaultValue2; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.submitJob(request), expectedError); + }); + }); + + describe('getJob', () => { + it('invokes getJob without error', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.GetJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetJobRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetJobRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetJobRequest', ['jobId']); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&job_id=${defaultValue3 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataproc.v1.Job() + ); + client.innerApiCalls.getJob = stubSimpleCall(expectedResponse); + const [response] = await client.getJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJob without error using callback', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.GetJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetJobRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetJobRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetJobRequest', ['jobId']); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&job_id=${defaultValue3 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataproc.v1.Job() + ); + client.innerApiCalls.getJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getJob( + request, + (err?: Error|null, result?: protos.google.cloud.dataproc.v1.IJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getJob with error', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.GetJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetJobRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetJobRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetJobRequest', ['jobId']); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&job_id=${defaultValue3 ?? '' }`; + 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 jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.GetJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetJobRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetJobRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetJobRequest', ['jobId']); + request.jobId = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getJob(request), expectedError); + }); + }); + + describe('updateJob', () => { + it('invokes updateJob without error', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.UpdateJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateJobRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateJobRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateJobRequest', ['jobId']); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&job_id=${defaultValue3 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataproc.v1.Job() + ); + client.innerApiCalls.updateJob = stubSimpleCall(expectedResponse); + const [response] = await client.updateJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateJob without error using callback', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.UpdateJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateJobRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateJobRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateJobRequest', ['jobId']); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&job_id=${defaultValue3 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataproc.v1.Job() + ); + client.innerApiCalls.updateJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateJob( + request, + (err?: Error|null, result?: protos.google.cloud.dataproc.v1.IJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateJob with error', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.UpdateJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateJobRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateJobRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateJobRequest', ['jobId']); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&job_id=${defaultValue3 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateJob(request), expectedError); + const actualRequest = (client.innerApiCalls.updateJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateJob with closed client', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.UpdateJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateJobRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateJobRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateJobRequest', ['jobId']); + request.jobId = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateJob(request), expectedError); + }); + }); + + describe('cancelJob', () => { + it('invokes cancelJob without error', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.CancelJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CancelJobRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CancelJobRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CancelJobRequest', ['jobId']); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&job_id=${defaultValue3 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataproc.v1.Job() + ); + client.innerApiCalls.cancelJob = stubSimpleCall(expectedResponse); + const [response] = await client.cancelJob(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.cancelJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelJob without error using callback', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.CancelJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CancelJobRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CancelJobRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CancelJobRequest', ['jobId']); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&job_id=${defaultValue3 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataproc.v1.Job() + ); + client.innerApiCalls.cancelJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelJob( + request, + (err?: Error|null, result?: protos.google.cloud.dataproc.v1.IJob|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.cancelJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelJob with error', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.CancelJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CancelJobRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CancelJobRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CancelJobRequest', ['jobId']); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&job_id=${defaultValue3 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelJob = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.cancelJob(request), expectedError); + const actualRequest = (client.innerApiCalls.cancelJob as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.cancelJob as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelJob with closed client', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.CancelJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CancelJobRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CancelJobRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CancelJobRequest', ['jobId']); + request.jobId = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.cancelJob(request), expectedError); + }); + }); + + describe('deleteJob', () => { + it('invokes deleteJob without error', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.DeleteJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteJobRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteJobRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteJobRequest', ['jobId']); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&job_id=${defaultValue3 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteJob = stubSimpleCall(expectedResponse); + const [response] = await client.deleteJob(request); + 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 jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.DeleteJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteJobRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteJobRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteJobRequest', ['jobId']); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&job_id=${defaultValue3 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteJob = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteJob( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.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 error', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.DeleteJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteJobRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteJobRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteJobRequest', ['jobId']); + request.jobId = defaultValue3; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&job_id=${defaultValue3 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteJob = stubSimpleCall(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 closed client', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.DeleteJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteJobRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteJobRequest', ['region']); + request.region = defaultValue2; + const defaultValue3 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteJobRequest', ['jobId']); + request.jobId = defaultValue3; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteJob(request), expectedError); + }); + }); + + describe('submitJobAsOperation', () => { + it('invokes submitJobAsOperation without error', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.SubmitJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.SubmitJobRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.SubmitJobRequest', ['region']); + request.region = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.submitJobAsOperation = stubLongRunningCall(expectedResponse); + const [operation] = await client.submitJobAsOperation(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.submitJobAsOperation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.submitJobAsOperation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes submitJobAsOperation without error using callback', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.SubmitJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.SubmitJobRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.SubmitJobRequest', ['region']); + request.region = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.submitJobAsOperation = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.submitJobAsOperation( + 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.submitJobAsOperation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.submitJobAsOperation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes submitJobAsOperation with call error', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.SubmitJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.SubmitJobRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.SubmitJobRequest', ['region']); + request.region = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.submitJobAsOperation = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.submitJobAsOperation(request), expectedError); + const actualRequest = (client.innerApiCalls.submitJobAsOperation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.submitJobAsOperation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes submitJobAsOperation with LRO error', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.SubmitJobRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.SubmitJobRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.SubmitJobRequest', ['region']); + request.region = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.submitJobAsOperation = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.submitJobAsOperation(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.submitJobAsOperation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.submitJobAsOperation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkSubmitJobAsOperationProgress without error', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + 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.checkSubmitJobAsOperationProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkSubmitJobAsOperationProgress with error', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + 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.checkSubmitJobAsOperationProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listJobs', () => { + it('invokes listJobs without error', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListJobsRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListJobsRequest', ['region']); + request.region = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataproc.v1.Job()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.Job()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.Job()), + ]; + client.innerApiCalls.listJobs = stubSimpleCall(expectedResponse); + const [response] = await client.listJobs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobs without error using callback', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListJobsRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListJobsRequest', ['region']); + request.region = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataproc.v1.Job()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.Job()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.Job()), + ]; + client.innerApiCalls.listJobs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listJobs( + request, + (err?: Error|null, result?: protos.google.cloud.dataproc.v1.IJob[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listJobs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listJobs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listJobs with error', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListJobsRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListJobsRequest', ['region']); + request.region = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; + 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 jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListJobsRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListJobsRequest', ['region']); + request.region = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataproc.v1.Job()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.Job()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.Job()), + ]; + client.descriptors.page.listJobs.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listJobsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataproc.v1.Job[] = []; + stream.on('data', (response: protos.google.cloud.dataproc.v1.Job) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listJobs, request)); + assert( + (client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listJobsStream with error', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListJobsRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListJobsRequest', ['region']); + request.region = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; + 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.dataproc.v1.Job[] = []; + stream.on('data', (response: protos.google.cloud.dataproc.v1.Job) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listJobs, request)); + assert( + (client.descriptors.page.listJobs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listJobs without error', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListJobsRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListJobsRequest', ['region']); + request.region = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataproc.v1.Job()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.Job()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.Job()), + ]; + client.descriptors.page.listJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dataproc.v1.IJob[] = []; + const iterable = client.listJobsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listJobs with error', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListJobsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListJobsRequest', ['projectId']); + request.projectId = defaultValue1; + const defaultValue2 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListJobsRequest', ['region']); + request.region = defaultValue2; + const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; + 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.dataproc.v1.IJob[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listJobs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listJobs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new jobcontrollerModule.v1.JobControllerClient({ + 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 jobcontrollerModule.v1.JobControllerClient({ + 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 jobcontrollerModule.v1.JobControllerClient({ + 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 jobcontrollerModule.v1.JobControllerClient({ + 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 jobcontrollerModule.v1.JobControllerClient({ + 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 jobcontrollerModule.v1.JobControllerClient({ + 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 jobcontrollerModule.v1.JobControllerClient({ + 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 jobcontrollerModule.v1.JobControllerClient({ + 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 jobcontrollerModule.v1.JobControllerClient({ + 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 jobcontrollerModule.v1.JobControllerClient({ + 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 jobcontrollerModule.v1.JobControllerClient({ + 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('batch', async () => { + const fakePath = "/rendered/path/batch"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch: "batchValue", + }; + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.batchPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPath', () => { + const result = client.batchPath("projectValue", "locationValue", "batchValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchName', () => { + const result = client.matchProjectFromBatchName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchName', () => { + const result = client.matchLocationFromBatchName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchFromBatchName', () => { + const result = client.matchBatchFromBatchName(fakePath); + assert.strictEqual(result, "batchValue"); + assert((client.pathTemplates.batchPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nodeGroup', async () => { + const fakePath = "/rendered/path/nodeGroup"; + const expectedParameters = { + project: "projectValue", + region: "regionValue", + cluster: "clusterValue", + node_group: "nodeGroupValue", + }; + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.nodeGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nodeGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nodeGroupPath', () => { + const result = client.nodeGroupPath("projectValue", "regionValue", "clusterValue", "nodeGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nodeGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNodeGroupName', () => { + const result = client.matchProjectFromNodeGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRegionFromNodeGroupName', () => { + const result = client.matchRegionFromNodeGroupName(fakePath); + assert.strictEqual(result, "regionValue"); + assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromNodeGroupName', () => { + const result = client.matchClusterFromNodeGroupName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNodeGroupFromNodeGroupName', () => { + const result = client.matchNodeGroupFromNodeGroupName(fakePath); + assert.strictEqual(result, "nodeGroupValue"); + assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationAutoscalingPolicy', async () => { + const fakePath = "/rendered/path/projectLocationAutoscalingPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + autoscaling_policy: "autoscalingPolicyValue", + }; + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAutoscalingPolicyPath', () => { + const result = client.projectLocationAutoscalingPolicyPath("projectValue", "locationValue", "autoscalingPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationAutoscalingPolicyName', () => { + const result = client.matchProjectFromProjectLocationAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationAutoscalingPolicyName', () => { + const result = client.matchLocationFromProjectLocationAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName', () => { + const result = client.matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "autoscalingPolicyValue"); + assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationWorkflowTemplate', async () => { + const fakePath = "/rendered/path/projectLocationWorkflowTemplate"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + workflow_template: "workflowTemplateValue", + }; + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationWorkflowTemplatePath', () => { + const result = client.projectLocationWorkflowTemplatePath("projectValue", "locationValue", "workflowTemplateValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationWorkflowTemplateName', () => { + const result = client.matchProjectFromProjectLocationWorkflowTemplateName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationWorkflowTemplateName', () => { + const result = client.matchLocationFromProjectLocationWorkflowTemplateName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchWorkflowTemplateFromProjectLocationWorkflowTemplateName', () => { + const result = client.matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(fakePath); + assert.strictEqual(result, "workflowTemplateValue"); + assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectRegionAutoscalingPolicy', async () => { + const fakePath = "/rendered/path/projectRegionAutoscalingPolicy"; + const expectedParameters = { + project: "projectValue", + region: "regionValue", + autoscaling_policy: "autoscalingPolicyValue", + }; + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectRegionAutoscalingPolicyPath', () => { + const result = client.projectRegionAutoscalingPolicyPath("projectValue", "regionValue", "autoscalingPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectRegionAutoscalingPolicyName', () => { + const result = client.matchProjectFromProjectRegionAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRegionFromProjectRegionAutoscalingPolicyName', () => { + const result = client.matchRegionFromProjectRegionAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "regionValue"); + assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName', () => { + const result = client.matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "autoscalingPolicyValue"); + assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectRegionWorkflowTemplate', async () => { + const fakePath = "/rendered/path/projectRegionWorkflowTemplate"; + const expectedParameters = { + project: "projectValue", + region: "regionValue", + workflow_template: "workflowTemplateValue", + }; + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectRegionWorkflowTemplatePath', () => { + const result = client.projectRegionWorkflowTemplatePath("projectValue", "regionValue", "workflowTemplateValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectRegionWorkflowTemplateName', () => { + const result = client.matchProjectFromProjectRegionWorkflowTemplateName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRegionFromProjectRegionWorkflowTemplateName', () => { + const result = client.matchRegionFromProjectRegionWorkflowTemplateName(fakePath); + assert.strictEqual(result, "regionValue"); + assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchWorkflowTemplateFromProjectRegionWorkflowTemplateName', () => { + const result = client.matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(fakePath); + assert.strictEqual(result, "workflowTemplateValue"); + assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('session', async () => { + const fakePath = "/rendered/path/session"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + session: "sessionValue", + }; + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.sessionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.sessionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('sessionPath', () => { + const result = client.sessionPath("projectValue", "locationValue", "sessionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.sessionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSessionName', () => { + const result = client.matchProjectFromSessionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSessionName', () => { + const result = client.matchLocationFromSessionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSessionFromSessionName', () => { + const result = client.matchSessionFromSessionName(fakePath); + assert.strictEqual(result, "sessionValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('sessionTemplate', async () => { + const fakePath = "/rendered/path/sessionTemplate"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + template: "templateValue", + }; + const client = new jobcontrollerModule.v1.JobControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.sessionTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.sessionTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('sessionTemplatePath', () => { + const result = client.sessionTemplatePath("projectValue", "locationValue", "templateValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.sessionTemplatePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSessionTemplateName', () => { + const result = client.matchProjectFromSessionTemplateName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSessionTemplateName', () => { + const result = client.matchLocationFromSessionTemplateName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTemplateFromSessionTemplateName', () => { + const result = client.matchTemplateFromSessionTemplateName(fakePath); + assert.strictEqual(result, "templateValue"); + assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dataproc/test/gapic_node_group_controller_v1.ts b/owl-bot-staging/google-cloud-dataproc/test/gapic_node_group_controller_v1.ts new file mode 100644 index 000000000000..9113bb3fcb9c --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/test/gapic_node_group_controller_v1.ts @@ -0,0 +1,1690 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 nodegroupcontrollerModule from '../src'; + +import {protobuf, LROperation, operationsProtos, IamProtos} 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 stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.NodeGroupControllerClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dataproc.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient(); + 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 = nodegroupcontrollerModule.v1.NodeGroupControllerClient.servicePath; + assert.strictEqual(servicePath, 'dataproc.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = nodegroupcontrollerModule.v1.NodeGroupControllerClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dataproc.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dataproc.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dataproc.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 nodegroupcontrollerModule.v1.NodeGroupControllerClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dataproc.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 nodegroupcontrollerModule.v1.NodeGroupControllerClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dataproc.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 nodegroupcontrollerModule.v1.NodeGroupControllerClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = nodegroupcontrollerModule.v1.NodeGroupControllerClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.nodeGroupControllerStub, undefined); + await client.initialize(); + assert(client.nodeGroupControllerStub); + }); + + it('has close method for the initialized client', done => { + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.nodeGroupControllerStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.nodeGroupControllerStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + 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 nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + 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('getNodeGroup', () => { + it('invokes getNodeGroup without error', async () => { + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.GetNodeGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetNodeGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataproc.v1.NodeGroup() + ); + client.innerApiCalls.getNodeGroup = stubSimpleCall(expectedResponse); + const [response] = await client.getNodeGroup(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getNodeGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getNodeGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNodeGroup without error using callback', async () => { + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.GetNodeGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetNodeGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataproc.v1.NodeGroup() + ); + client.innerApiCalls.getNodeGroup = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getNodeGroup( + request, + (err?: Error|null, result?: protos.google.cloud.dataproc.v1.INodeGroup|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getNodeGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getNodeGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNodeGroup with error', async () => { + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.GetNodeGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetNodeGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getNodeGroup = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getNodeGroup(request), expectedError); + const actualRequest = (client.innerApiCalls.getNodeGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getNodeGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNodeGroup with closed client', async () => { + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.GetNodeGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetNodeGroupRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getNodeGroup(request), expectedError); + }); + }); + + describe('createNodeGroup', () => { + it('invokes createNodeGroup without error', async () => { + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.CreateNodeGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CreateNodeGroupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createNodeGroup = stubLongRunningCall(expectedResponse); + const [operation] = await client.createNodeGroup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createNodeGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createNodeGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createNodeGroup without error using callback', async () => { + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.CreateNodeGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CreateNodeGroupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createNodeGroup = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createNodeGroup( + 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.createNodeGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createNodeGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createNodeGroup with call error', async () => { + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.CreateNodeGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CreateNodeGroupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createNodeGroup = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createNodeGroup(request), expectedError); + const actualRequest = (client.innerApiCalls.createNodeGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createNodeGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createNodeGroup with LRO error', async () => { + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.CreateNodeGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CreateNodeGroupRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createNodeGroup = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createNodeGroup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createNodeGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createNodeGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateNodeGroupProgress without error', async () => { + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + 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.checkCreateNodeGroupProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateNodeGroupProgress with error', async () => { + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + 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.checkCreateNodeGroupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('resizeNodeGroup', () => { + it('invokes resizeNodeGroup without error', async () => { + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ResizeNodeGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ResizeNodeGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.resizeNodeGroup = stubLongRunningCall(expectedResponse); + const [operation] = await client.resizeNodeGroup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.resizeNodeGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.resizeNodeGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resizeNodeGroup without error using callback', async () => { + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ResizeNodeGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ResizeNodeGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.resizeNodeGroup = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.resizeNodeGroup( + 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.resizeNodeGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.resizeNodeGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resizeNodeGroup with call error', async () => { + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ResizeNodeGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ResizeNodeGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.resizeNodeGroup = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.resizeNodeGroup(request), expectedError); + const actualRequest = (client.innerApiCalls.resizeNodeGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.resizeNodeGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resizeNodeGroup with LRO error', async () => { + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ResizeNodeGroupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ResizeNodeGroupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.resizeNodeGroup = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.resizeNodeGroup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.resizeNodeGroup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.resizeNodeGroup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkResizeNodeGroupProgress without error', async () => { + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + 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.checkResizeNodeGroupProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkResizeNodeGroupProgress with error', async () => { + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + 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.checkResizeNodeGroupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + 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 nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + 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 nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + 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 nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + 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 nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + 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 nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + 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 nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + 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 nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + 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 nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + 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 nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + 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 nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + 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('batch', async () => { + const fakePath = "/rendered/path/batch"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch: "batchValue", + }; + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.batchPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPath', () => { + const result = client.batchPath("projectValue", "locationValue", "batchValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchName', () => { + const result = client.matchProjectFromBatchName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchName', () => { + const result = client.matchLocationFromBatchName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchFromBatchName', () => { + const result = client.matchBatchFromBatchName(fakePath); + assert.strictEqual(result, "batchValue"); + assert((client.pathTemplates.batchPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('clusterRegion', async () => { + const fakePath = "/rendered/path/clusterRegion"; + const expectedParameters = { + project: "projectValue", + region: "regionValue", + cluster: "clusterValue", + }; + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.clusterRegionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.clusterRegionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('clusterRegionPath', () => { + const result = client.clusterRegionPath("projectValue", "regionValue", "clusterValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.clusterRegionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromClusterRegionName', () => { + const result = client.matchProjectFromClusterRegionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.clusterRegionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRegionFromClusterRegionName', () => { + const result = client.matchRegionFromClusterRegionName(fakePath); + assert.strictEqual(result, "regionValue"); + assert((client.pathTemplates.clusterRegionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromClusterRegionName', () => { + const result = client.matchClusterFromClusterRegionName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.clusterRegionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nodeGroup', async () => { + const fakePath = "/rendered/path/nodeGroup"; + const expectedParameters = { + project: "projectValue", + region: "regionValue", + cluster: "clusterValue", + node_group: "nodeGroupValue", + }; + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.nodeGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nodeGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nodeGroupPath', () => { + const result = client.nodeGroupPath("projectValue", "regionValue", "clusterValue", "nodeGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nodeGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNodeGroupName', () => { + const result = client.matchProjectFromNodeGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRegionFromNodeGroupName', () => { + const result = client.matchRegionFromNodeGroupName(fakePath); + assert.strictEqual(result, "regionValue"); + assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromNodeGroupName', () => { + const result = client.matchClusterFromNodeGroupName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNodeGroupFromNodeGroupName', () => { + const result = client.matchNodeGroupFromNodeGroupName(fakePath); + assert.strictEqual(result, "nodeGroupValue"); + assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + 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('projectLocationAutoscalingPolicy', async () => { + const fakePath = "/rendered/path/projectLocationAutoscalingPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + autoscaling_policy: "autoscalingPolicyValue", + }; + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAutoscalingPolicyPath', () => { + const result = client.projectLocationAutoscalingPolicyPath("projectValue", "locationValue", "autoscalingPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationAutoscalingPolicyName', () => { + const result = client.matchProjectFromProjectLocationAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationAutoscalingPolicyName', () => { + const result = client.matchLocationFromProjectLocationAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName', () => { + const result = client.matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "autoscalingPolicyValue"); + assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationWorkflowTemplate', async () => { + const fakePath = "/rendered/path/projectLocationWorkflowTemplate"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + workflow_template: "workflowTemplateValue", + }; + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationWorkflowTemplatePath', () => { + const result = client.projectLocationWorkflowTemplatePath("projectValue", "locationValue", "workflowTemplateValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationWorkflowTemplateName', () => { + const result = client.matchProjectFromProjectLocationWorkflowTemplateName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationWorkflowTemplateName', () => { + const result = client.matchLocationFromProjectLocationWorkflowTemplateName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchWorkflowTemplateFromProjectLocationWorkflowTemplateName', () => { + const result = client.matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(fakePath); + assert.strictEqual(result, "workflowTemplateValue"); + assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectRegionAutoscalingPolicy', async () => { + const fakePath = "/rendered/path/projectRegionAutoscalingPolicy"; + const expectedParameters = { + project: "projectValue", + region: "regionValue", + autoscaling_policy: "autoscalingPolicyValue", + }; + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectRegionAutoscalingPolicyPath', () => { + const result = client.projectRegionAutoscalingPolicyPath("projectValue", "regionValue", "autoscalingPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectRegionAutoscalingPolicyName', () => { + const result = client.matchProjectFromProjectRegionAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRegionFromProjectRegionAutoscalingPolicyName', () => { + const result = client.matchRegionFromProjectRegionAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "regionValue"); + assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName', () => { + const result = client.matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "autoscalingPolicyValue"); + assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectRegionWorkflowTemplate', async () => { + const fakePath = "/rendered/path/projectRegionWorkflowTemplate"; + const expectedParameters = { + project: "projectValue", + region: "regionValue", + workflow_template: "workflowTemplateValue", + }; + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectRegionWorkflowTemplatePath', () => { + const result = client.projectRegionWorkflowTemplatePath("projectValue", "regionValue", "workflowTemplateValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectRegionWorkflowTemplateName', () => { + const result = client.matchProjectFromProjectRegionWorkflowTemplateName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRegionFromProjectRegionWorkflowTemplateName', () => { + const result = client.matchRegionFromProjectRegionWorkflowTemplateName(fakePath); + assert.strictEqual(result, "regionValue"); + assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchWorkflowTemplateFromProjectRegionWorkflowTemplateName', () => { + const result = client.matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(fakePath); + assert.strictEqual(result, "workflowTemplateValue"); + assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('region', async () => { + const fakePath = "/rendered/path/region"; + const expectedParameters = { + project: "projectValue", + region: "regionValue", + }; + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.regionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.regionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('regionPath', () => { + const result = client.regionPath("projectValue", "regionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.regionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromRegionName', () => { + const result = client.matchProjectFromRegionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.regionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRegionFromRegionName', () => { + const result = client.matchRegionFromRegionName(fakePath); + assert.strictEqual(result, "regionValue"); + assert((client.pathTemplates.regionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('session', async () => { + const fakePath = "/rendered/path/session"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + session: "sessionValue", + }; + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.sessionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.sessionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('sessionPath', () => { + const result = client.sessionPath("projectValue", "locationValue", "sessionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.sessionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSessionName', () => { + const result = client.matchProjectFromSessionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSessionName', () => { + const result = client.matchLocationFromSessionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSessionFromSessionName', () => { + const result = client.matchSessionFromSessionName(fakePath); + assert.strictEqual(result, "sessionValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('sessionTemplate', async () => { + const fakePath = "/rendered/path/sessionTemplate"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + template: "templateValue", + }; + const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.sessionTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.sessionTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('sessionTemplatePath', () => { + const result = client.sessionTemplatePath("projectValue", "locationValue", "templateValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.sessionTemplatePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSessionTemplateName', () => { + const result = client.matchProjectFromSessionTemplateName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSessionTemplateName', () => { + const result = client.matchLocationFromSessionTemplateName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTemplateFromSessionTemplateName', () => { + const result = client.matchTemplateFromSessionTemplateName(fakePath); + assert.strictEqual(result, "templateValue"); + assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dataproc/test/gapic_session_controller_v1.ts b/owl-bot-staging/google-cloud-dataproc/test/gapic_session_controller_v1.ts new file mode 100644 index 000000000000..342680072047 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/test/gapic_session_controller_v1.ts @@ -0,0 +1,2070 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 sessioncontrollerModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos, IamProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.SessionControllerClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dataproc.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient(); + 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 = sessioncontrollerModule.v1.SessionControllerClient.servicePath; + assert.strictEqual(servicePath, 'dataproc.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = sessioncontrollerModule.v1.SessionControllerClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dataproc.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dataproc.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dataproc.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 sessioncontrollerModule.v1.SessionControllerClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dataproc.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 sessioncontrollerModule.v1.SessionControllerClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dataproc.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 sessioncontrollerModule.v1.SessionControllerClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = sessioncontrollerModule.v1.SessionControllerClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.sessionControllerStub, undefined); + await client.initialize(); + assert(client.sessionControllerStub); + }); + + it('has close method for the initialized client', done => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.sessionControllerStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.sessionControllerStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + 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 sessioncontrollerModule.v1.SessionControllerClient({ + 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('getSession', () => { + it('invokes getSession without error', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.GetSessionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetSessionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataproc.v1.Session() + ); + client.innerApiCalls.getSession = stubSimpleCall(expectedResponse); + const [response] = await client.getSession(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSession as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSession as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSession without error using callback', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.GetSessionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetSessionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataproc.v1.Session() + ); + client.innerApiCalls.getSession = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSession( + request, + (err?: Error|null, result?: protos.google.cloud.dataproc.v1.ISession|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSession as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSession as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSession with error', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.GetSessionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetSessionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSession = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSession(request), expectedError); + const actualRequest = (client.innerApiCalls.getSession as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSession as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSession with closed client', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.GetSessionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetSessionRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getSession(request), expectedError); + }); + }); + + describe('createSession', () => { + it('invokes createSession without error', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.CreateSessionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CreateSessionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createSession = stubLongRunningCall(expectedResponse); + const [operation] = await client.createSession(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSession as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSession as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSession without error using callback', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.CreateSessionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CreateSessionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createSession = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSession( + 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.createSession as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSession as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSession with call error', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.CreateSessionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CreateSessionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSession = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createSession(request), expectedError); + const actualRequest = (client.innerApiCalls.createSession as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSession as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSession with LRO error', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.CreateSessionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CreateSessionRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSession = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createSession(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createSession as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSession as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateSessionProgress without error', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + 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.checkCreateSessionProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateSessionProgress with error', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + 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.checkCreateSessionProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('terminateSession', () => { + it('invokes terminateSession without error', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.TerminateSessionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.TerminateSessionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.terminateSession = stubLongRunningCall(expectedResponse); + const [operation] = await client.terminateSession(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.terminateSession as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.terminateSession as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes terminateSession without error using callback', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.TerminateSessionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.TerminateSessionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.terminateSession = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.terminateSession( + 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.terminateSession as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.terminateSession as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes terminateSession with call error', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.TerminateSessionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.TerminateSessionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.terminateSession = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.terminateSession(request), expectedError); + const actualRequest = (client.innerApiCalls.terminateSession as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.terminateSession as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes terminateSession with LRO error', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.TerminateSessionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.TerminateSessionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.terminateSession = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.terminateSession(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.terminateSession as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.terminateSession as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkTerminateSessionProgress without error', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + 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.checkTerminateSessionProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkTerminateSessionProgress with error', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + 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.checkTerminateSessionProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteSession', () => { + it('invokes deleteSession without error', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.DeleteSessionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteSessionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteSession = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteSession(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteSession as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSession as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSession without error using callback', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.DeleteSessionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteSessionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteSession = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSession( + 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.deleteSession as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSession as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSession with call error', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.DeleteSessionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteSessionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSession = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteSession(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteSession as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSession as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSession with LRO error', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.DeleteSessionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteSessionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSession = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteSession(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteSession as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSession as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteSessionProgress without error', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + 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.checkDeleteSessionProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteSessionProgress with error', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + 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.checkDeleteSessionProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listSessions', () => { + it('invokes listSessions without error', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListSessionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListSessionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataproc.v1.Session()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.Session()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.Session()), + ]; + client.innerApiCalls.listSessions = stubSimpleCall(expectedResponse); + const [response] = await client.listSessions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSessions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSessions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSessions without error using callback', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListSessionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListSessionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataproc.v1.Session()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.Session()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.Session()), + ]; + client.innerApiCalls.listSessions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSessions( + request, + (err?: Error|null, result?: protos.google.cloud.dataproc.v1.ISession[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSessions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSessions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSessions with error', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListSessionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListSessionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSessions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listSessions(request), expectedError); + const actualRequest = (client.innerApiCalls.listSessions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSessions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSessionsStream without error', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListSessionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListSessionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataproc.v1.Session()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.Session()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.Session()), + ]; + client.descriptors.page.listSessions.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listSessionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataproc.v1.Session[] = []; + stream.on('data', (response: protos.google.cloud.dataproc.v1.Session) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listSessions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSessions, request)); + assert( + (client.descriptors.page.listSessions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSessionsStream with error', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListSessionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListSessionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listSessions.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listSessionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataproc.v1.Session[] = []; + stream.on('data', (response: protos.google.cloud.dataproc.v1.Session) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listSessions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSessions, request)); + assert( + (client.descriptors.page.listSessions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSessions without error', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListSessionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListSessionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataproc.v1.Session()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.Session()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.Session()), + ]; + client.descriptors.page.listSessions.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dataproc.v1.ISession[] = []; + const iterable = client.listSessionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSessions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSessions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSessions with error', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListSessionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListSessionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listSessions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSessionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dataproc.v1.ISession[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSessions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSessions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + 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 sessioncontrollerModule.v1.SessionControllerClient({ + 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 sessioncontrollerModule.v1.SessionControllerClient({ + 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 sessioncontrollerModule.v1.SessionControllerClient({ + 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 sessioncontrollerModule.v1.SessionControllerClient({ + 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 sessioncontrollerModule.v1.SessionControllerClient({ + 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 sessioncontrollerModule.v1.SessionControllerClient({ + 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 sessioncontrollerModule.v1.SessionControllerClient({ + 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 sessioncontrollerModule.v1.SessionControllerClient({ + 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 sessioncontrollerModule.v1.SessionControllerClient({ + 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 sessioncontrollerModule.v1.SessionControllerClient({ + 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('batch', async () => { + const fakePath = "/rendered/path/batch"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch: "batchValue", + }; + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.batchPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPath', () => { + const result = client.batchPath("projectValue", "locationValue", "batchValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchName', () => { + const result = client.matchProjectFromBatchName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchName', () => { + const result = client.matchLocationFromBatchName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchFromBatchName', () => { + const result = client.matchBatchFromBatchName(fakePath); + assert.strictEqual(result, "batchValue"); + assert((client.pathTemplates.batchPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + 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('nodeGroup', async () => { + const fakePath = "/rendered/path/nodeGroup"; + const expectedParameters = { + project: "projectValue", + region: "regionValue", + cluster: "clusterValue", + node_group: "nodeGroupValue", + }; + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.nodeGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nodeGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nodeGroupPath', () => { + const result = client.nodeGroupPath("projectValue", "regionValue", "clusterValue", "nodeGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nodeGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNodeGroupName', () => { + const result = client.matchProjectFromNodeGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRegionFromNodeGroupName', () => { + const result = client.matchRegionFromNodeGroupName(fakePath); + assert.strictEqual(result, "regionValue"); + assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromNodeGroupName', () => { + const result = client.matchClusterFromNodeGroupName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNodeGroupFromNodeGroupName', () => { + const result = client.matchNodeGroupFromNodeGroupName(fakePath); + assert.strictEqual(result, "nodeGroupValue"); + assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + 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('projectLocationAutoscalingPolicy', async () => { + const fakePath = "/rendered/path/projectLocationAutoscalingPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + autoscaling_policy: "autoscalingPolicyValue", + }; + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAutoscalingPolicyPath', () => { + const result = client.projectLocationAutoscalingPolicyPath("projectValue", "locationValue", "autoscalingPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationAutoscalingPolicyName', () => { + const result = client.matchProjectFromProjectLocationAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationAutoscalingPolicyName', () => { + const result = client.matchLocationFromProjectLocationAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName', () => { + const result = client.matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "autoscalingPolicyValue"); + assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationWorkflowTemplate', async () => { + const fakePath = "/rendered/path/projectLocationWorkflowTemplate"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + workflow_template: "workflowTemplateValue", + }; + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationWorkflowTemplatePath', () => { + const result = client.projectLocationWorkflowTemplatePath("projectValue", "locationValue", "workflowTemplateValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationWorkflowTemplateName', () => { + const result = client.matchProjectFromProjectLocationWorkflowTemplateName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationWorkflowTemplateName', () => { + const result = client.matchLocationFromProjectLocationWorkflowTemplateName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchWorkflowTemplateFromProjectLocationWorkflowTemplateName', () => { + const result = client.matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(fakePath); + assert.strictEqual(result, "workflowTemplateValue"); + assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectRegionAutoscalingPolicy', async () => { + const fakePath = "/rendered/path/projectRegionAutoscalingPolicy"; + const expectedParameters = { + project: "projectValue", + region: "regionValue", + autoscaling_policy: "autoscalingPolicyValue", + }; + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectRegionAutoscalingPolicyPath', () => { + const result = client.projectRegionAutoscalingPolicyPath("projectValue", "regionValue", "autoscalingPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectRegionAutoscalingPolicyName', () => { + const result = client.matchProjectFromProjectRegionAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRegionFromProjectRegionAutoscalingPolicyName', () => { + const result = client.matchRegionFromProjectRegionAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "regionValue"); + assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName', () => { + const result = client.matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "autoscalingPolicyValue"); + assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectRegionWorkflowTemplate', async () => { + const fakePath = "/rendered/path/projectRegionWorkflowTemplate"; + const expectedParameters = { + project: "projectValue", + region: "regionValue", + workflow_template: "workflowTemplateValue", + }; + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectRegionWorkflowTemplatePath', () => { + const result = client.projectRegionWorkflowTemplatePath("projectValue", "regionValue", "workflowTemplateValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectRegionWorkflowTemplateName', () => { + const result = client.matchProjectFromProjectRegionWorkflowTemplateName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRegionFromProjectRegionWorkflowTemplateName', () => { + const result = client.matchRegionFromProjectRegionWorkflowTemplateName(fakePath); + assert.strictEqual(result, "regionValue"); + assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchWorkflowTemplateFromProjectRegionWorkflowTemplateName', () => { + const result = client.matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(fakePath); + assert.strictEqual(result, "workflowTemplateValue"); + assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('session', async () => { + const fakePath = "/rendered/path/session"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + session: "sessionValue", + }; + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.sessionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.sessionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('sessionPath', () => { + const result = client.sessionPath("projectValue", "locationValue", "sessionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.sessionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSessionName', () => { + const result = client.matchProjectFromSessionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSessionName', () => { + const result = client.matchLocationFromSessionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSessionFromSessionName', () => { + const result = client.matchSessionFromSessionName(fakePath); + assert.strictEqual(result, "sessionValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('sessionTemplate', async () => { + const fakePath = "/rendered/path/sessionTemplate"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + template: "templateValue", + }; + const client = new sessioncontrollerModule.v1.SessionControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.sessionTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.sessionTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('sessionTemplatePath', () => { + const result = client.sessionTemplatePath("projectValue", "locationValue", "templateValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.sessionTemplatePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSessionTemplateName', () => { + const result = client.matchProjectFromSessionTemplateName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSessionTemplateName', () => { + const result = client.matchLocationFromSessionTemplateName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTemplateFromSessionTemplateName', () => { + const result = client.matchTemplateFromSessionTemplateName(fakePath); + assert.strictEqual(result, "templateValue"); + assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dataproc/test/gapic_session_template_controller_v1.ts b/owl-bot-staging/google-cloud-dataproc/test/gapic_session_template_controller_v1.ts new file mode 100644 index 000000000000..3387d28ae53a --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/test/gapic_session_template_controller_v1.ts @@ -0,0 +1,1665 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 sessiontemplatecontrollerModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, IamProtos} 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('v1.SessionTemplateControllerClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dataproc.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient(); + 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 = sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient.servicePath; + assert.strictEqual(servicePath, 'dataproc.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dataproc.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dataproc.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dataproc.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 sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dataproc.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 sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dataproc.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 sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.sessionTemplateControllerStub, undefined); + await client.initialize(); + assert(client.sessionTemplateControllerStub); + }); + + it('has close method for the initialized client', done => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.sessionTemplateControllerStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.sessionTemplateControllerStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + 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 sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + 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('createSessionTemplate', () => { + it('invokes createSessionTemplate without error', async () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.CreateSessionTemplateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CreateSessionTemplateRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataproc.v1.SessionTemplate() + ); + client.innerApiCalls.createSessionTemplate = stubSimpleCall(expectedResponse); + const [response] = await client.createSessionTemplate(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSessionTemplate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSessionTemplate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSessionTemplate without error using callback', async () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.CreateSessionTemplateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CreateSessionTemplateRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataproc.v1.SessionTemplate() + ); + client.innerApiCalls.createSessionTemplate = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSessionTemplate( + request, + (err?: Error|null, result?: protos.google.cloud.dataproc.v1.ISessionTemplate|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSessionTemplate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSessionTemplate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSessionTemplate with error', async () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.CreateSessionTemplateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CreateSessionTemplateRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSessionTemplate = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createSessionTemplate(request), expectedError); + const actualRequest = (client.innerApiCalls.createSessionTemplate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSessionTemplate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSessionTemplate with closed client', async () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.CreateSessionTemplateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CreateSessionTemplateRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createSessionTemplate(request), expectedError); + }); + }); + + describe('updateSessionTemplate', () => { + it('invokes updateSessionTemplate without error', async () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.UpdateSessionTemplateRequest() + ); + request.sessionTemplate ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateSessionTemplateRequest', ['sessionTemplate', 'name']); + request.sessionTemplate.name = defaultValue1; + const expectedHeaderRequestParams = `session_template.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataproc.v1.SessionTemplate() + ); + client.innerApiCalls.updateSessionTemplate = stubSimpleCall(expectedResponse); + const [response] = await client.updateSessionTemplate(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateSessionTemplate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSessionTemplate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSessionTemplate without error using callback', async () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.UpdateSessionTemplateRequest() + ); + request.sessionTemplate ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateSessionTemplateRequest', ['sessionTemplate', 'name']); + request.sessionTemplate.name = defaultValue1; + const expectedHeaderRequestParams = `session_template.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataproc.v1.SessionTemplate() + ); + client.innerApiCalls.updateSessionTemplate = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSessionTemplate( + request, + (err?: Error|null, result?: protos.google.cloud.dataproc.v1.ISessionTemplate|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateSessionTemplate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSessionTemplate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSessionTemplate with error', async () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.UpdateSessionTemplateRequest() + ); + request.sessionTemplate ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateSessionTemplateRequest', ['sessionTemplate', 'name']); + request.sessionTemplate.name = defaultValue1; + const expectedHeaderRequestParams = `session_template.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSessionTemplate = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateSessionTemplate(request), expectedError); + const actualRequest = (client.innerApiCalls.updateSessionTemplate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSessionTemplate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSessionTemplate with closed client', async () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.UpdateSessionTemplateRequest() + ); + request.sessionTemplate ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateSessionTemplateRequest', ['sessionTemplate', 'name']); + request.sessionTemplate.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateSessionTemplate(request), expectedError); + }); + }); + + describe('getSessionTemplate', () => { + it('invokes getSessionTemplate without error', async () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.GetSessionTemplateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetSessionTemplateRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataproc.v1.SessionTemplate() + ); + client.innerApiCalls.getSessionTemplate = stubSimpleCall(expectedResponse); + const [response] = await client.getSessionTemplate(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSessionTemplate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSessionTemplate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSessionTemplate without error using callback', async () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.GetSessionTemplateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetSessionTemplateRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataproc.v1.SessionTemplate() + ); + client.innerApiCalls.getSessionTemplate = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSessionTemplate( + request, + (err?: Error|null, result?: protos.google.cloud.dataproc.v1.ISessionTemplate|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSessionTemplate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSessionTemplate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSessionTemplate with error', async () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.GetSessionTemplateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetSessionTemplateRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSessionTemplate = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSessionTemplate(request), expectedError); + const actualRequest = (client.innerApiCalls.getSessionTemplate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSessionTemplate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSessionTemplate with closed client', async () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.GetSessionTemplateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetSessionTemplateRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getSessionTemplate(request), expectedError); + }); + }); + + describe('deleteSessionTemplate', () => { + it('invokes deleteSessionTemplate without error', async () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.DeleteSessionTemplateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteSessionTemplateRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSessionTemplate = stubSimpleCall(expectedResponse); + const [response] = await client.deleteSessionTemplate(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteSessionTemplate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSessionTemplate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSessionTemplate without error using callback', async () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.DeleteSessionTemplateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteSessionTemplateRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSessionTemplate = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSessionTemplate( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteSessionTemplate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSessionTemplate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSessionTemplate with error', async () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.DeleteSessionTemplateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteSessionTemplateRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSessionTemplate = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteSessionTemplate(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteSessionTemplate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSessionTemplate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSessionTemplate with closed client', async () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.DeleteSessionTemplateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteSessionTemplateRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteSessionTemplate(request), expectedError); + }); + }); + + describe('listSessionTemplates', () => { + it('invokes listSessionTemplates without error', async () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListSessionTemplatesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListSessionTemplatesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataproc.v1.SessionTemplate()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.SessionTemplate()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.SessionTemplate()), + ]; + client.innerApiCalls.listSessionTemplates = stubSimpleCall(expectedResponse); + const [response] = await client.listSessionTemplates(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSessionTemplates as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSessionTemplates as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSessionTemplates without error using callback', async () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListSessionTemplatesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListSessionTemplatesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataproc.v1.SessionTemplate()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.SessionTemplate()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.SessionTemplate()), + ]; + client.innerApiCalls.listSessionTemplates = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSessionTemplates( + request, + (err?: Error|null, result?: protos.google.cloud.dataproc.v1.ISessionTemplate[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSessionTemplates as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSessionTemplates as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSessionTemplates with error', async () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListSessionTemplatesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListSessionTemplatesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSessionTemplates = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listSessionTemplates(request), expectedError); + const actualRequest = (client.innerApiCalls.listSessionTemplates as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSessionTemplates as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSessionTemplatesStream without error', async () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListSessionTemplatesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListSessionTemplatesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataproc.v1.SessionTemplate()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.SessionTemplate()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.SessionTemplate()), + ]; + client.descriptors.page.listSessionTemplates.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listSessionTemplatesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataproc.v1.SessionTemplate[] = []; + stream.on('data', (response: protos.google.cloud.dataproc.v1.SessionTemplate) => { + 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.listSessionTemplates.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSessionTemplates, request)); + assert( + (client.descriptors.page.listSessionTemplates.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSessionTemplatesStream with error', async () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListSessionTemplatesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListSessionTemplatesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listSessionTemplates.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listSessionTemplatesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataproc.v1.SessionTemplate[] = []; + stream.on('data', (response: protos.google.cloud.dataproc.v1.SessionTemplate) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listSessionTemplates.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSessionTemplates, request)); + assert( + (client.descriptors.page.listSessionTemplates.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSessionTemplates without error', async () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListSessionTemplatesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListSessionTemplatesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataproc.v1.SessionTemplate()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.SessionTemplate()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.SessionTemplate()), + ]; + client.descriptors.page.listSessionTemplates.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dataproc.v1.ISessionTemplate[] = []; + const iterable = client.listSessionTemplatesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSessionTemplates.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSessionTemplates.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSessionTemplates with error', async () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListSessionTemplatesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListSessionTemplatesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listSessionTemplates.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSessionTemplatesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dataproc.v1.ISessionTemplate[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSessionTemplates.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSessionTemplates.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + + describe('Path templates', () => { + + describe('batch', async () => { + const fakePath = "/rendered/path/batch"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch: "batchValue", + }; + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.batchPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPath', () => { + const result = client.batchPath("projectValue", "locationValue", "batchValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchName', () => { + const result = client.matchProjectFromBatchName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchName', () => { + const result = client.matchLocationFromBatchName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchFromBatchName', () => { + const result = client.matchBatchFromBatchName(fakePath); + assert.strictEqual(result, "batchValue"); + assert((client.pathTemplates.batchPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + 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('nodeGroup', async () => { + const fakePath = "/rendered/path/nodeGroup"; + const expectedParameters = { + project: "projectValue", + region: "regionValue", + cluster: "clusterValue", + node_group: "nodeGroupValue", + }; + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.nodeGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nodeGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nodeGroupPath', () => { + const result = client.nodeGroupPath("projectValue", "regionValue", "clusterValue", "nodeGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nodeGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNodeGroupName', () => { + const result = client.matchProjectFromNodeGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRegionFromNodeGroupName', () => { + const result = client.matchRegionFromNodeGroupName(fakePath); + assert.strictEqual(result, "regionValue"); + assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromNodeGroupName', () => { + const result = client.matchClusterFromNodeGroupName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNodeGroupFromNodeGroupName', () => { + const result = client.matchNodeGroupFromNodeGroupName(fakePath); + assert.strictEqual(result, "nodeGroupValue"); + assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + 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('projectLocationAutoscalingPolicy', async () => { + const fakePath = "/rendered/path/projectLocationAutoscalingPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + autoscaling_policy: "autoscalingPolicyValue", + }; + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAutoscalingPolicyPath', () => { + const result = client.projectLocationAutoscalingPolicyPath("projectValue", "locationValue", "autoscalingPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationAutoscalingPolicyName', () => { + const result = client.matchProjectFromProjectLocationAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationAutoscalingPolicyName', () => { + const result = client.matchLocationFromProjectLocationAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName', () => { + const result = client.matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "autoscalingPolicyValue"); + assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationWorkflowTemplate', async () => { + const fakePath = "/rendered/path/projectLocationWorkflowTemplate"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + workflow_template: "workflowTemplateValue", + }; + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationWorkflowTemplatePath', () => { + const result = client.projectLocationWorkflowTemplatePath("projectValue", "locationValue", "workflowTemplateValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationWorkflowTemplateName', () => { + const result = client.matchProjectFromProjectLocationWorkflowTemplateName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationWorkflowTemplateName', () => { + const result = client.matchLocationFromProjectLocationWorkflowTemplateName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchWorkflowTemplateFromProjectLocationWorkflowTemplateName', () => { + const result = client.matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(fakePath); + assert.strictEqual(result, "workflowTemplateValue"); + assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectRegionAutoscalingPolicy', async () => { + const fakePath = "/rendered/path/projectRegionAutoscalingPolicy"; + const expectedParameters = { + project: "projectValue", + region: "regionValue", + autoscaling_policy: "autoscalingPolicyValue", + }; + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectRegionAutoscalingPolicyPath', () => { + const result = client.projectRegionAutoscalingPolicyPath("projectValue", "regionValue", "autoscalingPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectRegionAutoscalingPolicyName', () => { + const result = client.matchProjectFromProjectRegionAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRegionFromProjectRegionAutoscalingPolicyName', () => { + const result = client.matchRegionFromProjectRegionAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "regionValue"); + assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName', () => { + const result = client.matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "autoscalingPolicyValue"); + assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectRegionWorkflowTemplate', async () => { + const fakePath = "/rendered/path/projectRegionWorkflowTemplate"; + const expectedParameters = { + project: "projectValue", + region: "regionValue", + workflow_template: "workflowTemplateValue", + }; + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectRegionWorkflowTemplatePath', () => { + const result = client.projectRegionWorkflowTemplatePath("projectValue", "regionValue", "workflowTemplateValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectRegionWorkflowTemplateName', () => { + const result = client.matchProjectFromProjectRegionWorkflowTemplateName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRegionFromProjectRegionWorkflowTemplateName', () => { + const result = client.matchRegionFromProjectRegionWorkflowTemplateName(fakePath); + assert.strictEqual(result, "regionValue"); + assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchWorkflowTemplateFromProjectRegionWorkflowTemplateName', () => { + const result = client.matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(fakePath); + assert.strictEqual(result, "workflowTemplateValue"); + assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('session', async () => { + const fakePath = "/rendered/path/session"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + session: "sessionValue", + }; + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.sessionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.sessionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('sessionPath', () => { + const result = client.sessionPath("projectValue", "locationValue", "sessionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.sessionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSessionName', () => { + const result = client.matchProjectFromSessionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSessionName', () => { + const result = client.matchLocationFromSessionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSessionFromSessionName', () => { + const result = client.matchSessionFromSessionName(fakePath); + assert.strictEqual(result, "sessionValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('sessionTemplate', async () => { + const fakePath = "/rendered/path/sessionTemplate"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + template: "templateValue", + }; + const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.sessionTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.sessionTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('sessionTemplatePath', () => { + const result = client.sessionTemplatePath("projectValue", "locationValue", "templateValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.sessionTemplatePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSessionTemplateName', () => { + const result = client.matchProjectFromSessionTemplateName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSessionTemplateName', () => { + const result = client.matchLocationFromSessionTemplateName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTemplateFromSessionTemplateName', () => { + const result = client.matchTemplateFromSessionTemplateName(fakePath); + assert.strictEqual(result, "templateValue"); + assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dataproc/test/gapic_workflow_template_service_v1.ts b/owl-bot-staging/google-cloud-dataproc/test/gapic_workflow_template_service_v1.ts new file mode 100644 index 000000000000..902e80dbe365 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/test/gapic_workflow_template_service_v1.ts @@ -0,0 +1,2244 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 workflowtemplateserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos, IamProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.WorkflowTemplateServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dataproc.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient(); + 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 = workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient.servicePath; + assert.strictEqual(servicePath, 'dataproc.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'dataproc.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dataproc.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dataproc.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 workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dataproc.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 workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'dataproc.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 workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.workflowTemplateServiceStub, undefined); + await client.initialize(); + assert(client.workflowTemplateServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.workflowTemplateServiceStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.workflowTemplateServiceStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + 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 workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + 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('createWorkflowTemplate', () => { + it('invokes createWorkflowTemplate without error', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataproc.v1.WorkflowTemplate() + ); + client.innerApiCalls.createWorkflowTemplate = stubSimpleCall(expectedResponse); + const [response] = await client.createWorkflowTemplate(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createWorkflowTemplate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createWorkflowTemplate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createWorkflowTemplate without error using callback', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataproc.v1.WorkflowTemplate() + ); + client.innerApiCalls.createWorkflowTemplate = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createWorkflowTemplate( + request, + (err?: Error|null, result?: protos.google.cloud.dataproc.v1.IWorkflowTemplate|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createWorkflowTemplate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createWorkflowTemplate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createWorkflowTemplate with error', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createWorkflowTemplate = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createWorkflowTemplate(request), expectedError); + const actualRequest = (client.innerApiCalls.createWorkflowTemplate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createWorkflowTemplate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createWorkflowTemplate with closed client', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.createWorkflowTemplate(request), expectedError); + }); + }); + + describe('getWorkflowTemplate', () => { + it('invokes getWorkflowTemplate without error', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.GetWorkflowTemplateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetWorkflowTemplateRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataproc.v1.WorkflowTemplate() + ); + client.innerApiCalls.getWorkflowTemplate = stubSimpleCall(expectedResponse); + const [response] = await client.getWorkflowTemplate(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getWorkflowTemplate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getWorkflowTemplate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getWorkflowTemplate without error using callback', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.GetWorkflowTemplateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetWorkflowTemplateRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataproc.v1.WorkflowTemplate() + ); + client.innerApiCalls.getWorkflowTemplate = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getWorkflowTemplate( + request, + (err?: Error|null, result?: protos.google.cloud.dataproc.v1.IWorkflowTemplate|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getWorkflowTemplate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getWorkflowTemplate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getWorkflowTemplate with error', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.GetWorkflowTemplateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetWorkflowTemplateRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getWorkflowTemplate = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getWorkflowTemplate(request), expectedError); + const actualRequest = (client.innerApiCalls.getWorkflowTemplate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getWorkflowTemplate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getWorkflowTemplate with closed client', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.GetWorkflowTemplateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.GetWorkflowTemplateRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getWorkflowTemplate(request), expectedError); + }); + }); + + describe('updateWorkflowTemplate', () => { + it('invokes updateWorkflowTemplate without error', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest() + ); + request.template ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest', ['template', 'name']); + request.template.name = defaultValue1; + const expectedHeaderRequestParams = `template.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataproc.v1.WorkflowTemplate() + ); + client.innerApiCalls.updateWorkflowTemplate = stubSimpleCall(expectedResponse); + const [response] = await client.updateWorkflowTemplate(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateWorkflowTemplate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateWorkflowTemplate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateWorkflowTemplate without error using callback', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest() + ); + request.template ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest', ['template', 'name']); + request.template.name = defaultValue1; + const expectedHeaderRequestParams = `template.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dataproc.v1.WorkflowTemplate() + ); + client.innerApiCalls.updateWorkflowTemplate = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateWorkflowTemplate( + request, + (err?: Error|null, result?: protos.google.cloud.dataproc.v1.IWorkflowTemplate|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateWorkflowTemplate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateWorkflowTemplate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateWorkflowTemplate with error', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest() + ); + request.template ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest', ['template', 'name']); + request.template.name = defaultValue1; + const expectedHeaderRequestParams = `template.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateWorkflowTemplate = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateWorkflowTemplate(request), expectedError); + const actualRequest = (client.innerApiCalls.updateWorkflowTemplate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateWorkflowTemplate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateWorkflowTemplate with closed client', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest() + ); + request.template ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest', ['template', 'name']); + request.template.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.updateWorkflowTemplate(request), expectedError); + }); + }); + + describe('deleteWorkflowTemplate', () => { + it('invokes deleteWorkflowTemplate without error', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteWorkflowTemplate = stubSimpleCall(expectedResponse); + const [response] = await client.deleteWorkflowTemplate(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteWorkflowTemplate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteWorkflowTemplate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteWorkflowTemplate without error using callback', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteWorkflowTemplate = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteWorkflowTemplate( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteWorkflowTemplate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteWorkflowTemplate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteWorkflowTemplate with error', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteWorkflowTemplate = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteWorkflowTemplate(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteWorkflowTemplate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteWorkflowTemplate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteWorkflowTemplate with closed client', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.deleteWorkflowTemplate(request), expectedError); + }); + }); + + describe('instantiateWorkflowTemplate', () => { + it('invokes instantiateWorkflowTemplate without error', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.instantiateWorkflowTemplate = stubLongRunningCall(expectedResponse); + const [operation] = await client.instantiateWorkflowTemplate(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.instantiateWorkflowTemplate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.instantiateWorkflowTemplate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes instantiateWorkflowTemplate without error using callback', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.instantiateWorkflowTemplate = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.instantiateWorkflowTemplate( + 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.instantiateWorkflowTemplate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.instantiateWorkflowTemplate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes instantiateWorkflowTemplate with call error', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.instantiateWorkflowTemplate = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.instantiateWorkflowTemplate(request), expectedError); + const actualRequest = (client.innerApiCalls.instantiateWorkflowTemplate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.instantiateWorkflowTemplate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes instantiateWorkflowTemplate with LRO error', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.instantiateWorkflowTemplate = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.instantiateWorkflowTemplate(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.instantiateWorkflowTemplate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.instantiateWorkflowTemplate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkInstantiateWorkflowTemplateProgress without error', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + 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.checkInstantiateWorkflowTemplateProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkInstantiateWorkflowTemplateProgress with error', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + 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.checkInstantiateWorkflowTemplateProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('instantiateInlineWorkflowTemplate', () => { + it('invokes instantiateInlineWorkflowTemplate without error', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.instantiateInlineWorkflowTemplate = stubLongRunningCall(expectedResponse); + const [operation] = await client.instantiateInlineWorkflowTemplate(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.instantiateInlineWorkflowTemplate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.instantiateInlineWorkflowTemplate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes instantiateInlineWorkflowTemplate without error using callback', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.instantiateInlineWorkflowTemplate = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.instantiateInlineWorkflowTemplate( + 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.instantiateInlineWorkflowTemplate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.instantiateInlineWorkflowTemplate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes instantiateInlineWorkflowTemplate with call error', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.instantiateInlineWorkflowTemplate = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.instantiateInlineWorkflowTemplate(request), expectedError); + const actualRequest = (client.innerApiCalls.instantiateInlineWorkflowTemplate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.instantiateInlineWorkflowTemplate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes instantiateInlineWorkflowTemplate with LRO error', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.instantiateInlineWorkflowTemplate = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.instantiateInlineWorkflowTemplate(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.instantiateInlineWorkflowTemplate as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.instantiateInlineWorkflowTemplate as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkInstantiateInlineWorkflowTemplateProgress without error', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + 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.checkInstantiateInlineWorkflowTemplateProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkInstantiateInlineWorkflowTemplateProgress with error', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + 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.checkInstantiateInlineWorkflowTemplateProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listWorkflowTemplates', () => { + it('invokes listWorkflowTemplates without error', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataproc.v1.WorkflowTemplate()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.WorkflowTemplate()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.WorkflowTemplate()), + ]; + client.innerApiCalls.listWorkflowTemplates = stubSimpleCall(expectedResponse); + const [response] = await client.listWorkflowTemplates(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listWorkflowTemplates as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listWorkflowTemplates as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listWorkflowTemplates without error using callback', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataproc.v1.WorkflowTemplate()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.WorkflowTemplate()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.WorkflowTemplate()), + ]; + client.innerApiCalls.listWorkflowTemplates = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listWorkflowTemplates( + request, + (err?: Error|null, result?: protos.google.cloud.dataproc.v1.IWorkflowTemplate[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listWorkflowTemplates as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listWorkflowTemplates as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listWorkflowTemplates with error', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listWorkflowTemplates = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listWorkflowTemplates(request), expectedError); + const actualRequest = (client.innerApiCalls.listWorkflowTemplates as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listWorkflowTemplates as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listWorkflowTemplatesStream without error', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataproc.v1.WorkflowTemplate()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.WorkflowTemplate()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.WorkflowTemplate()), + ]; + client.descriptors.page.listWorkflowTemplates.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listWorkflowTemplatesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataproc.v1.WorkflowTemplate[] = []; + stream.on('data', (response: protos.google.cloud.dataproc.v1.WorkflowTemplate) => { + 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.listWorkflowTemplates.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listWorkflowTemplates, request)); + assert( + (client.descriptors.page.listWorkflowTemplates.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listWorkflowTemplatesStream with error', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listWorkflowTemplates.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listWorkflowTemplatesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dataproc.v1.WorkflowTemplate[] = []; + stream.on('data', (response: protos.google.cloud.dataproc.v1.WorkflowTemplate) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listWorkflowTemplates.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listWorkflowTemplates, request)); + assert( + (client.descriptors.page.listWorkflowTemplates.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listWorkflowTemplates without error', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dataproc.v1.WorkflowTemplate()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.WorkflowTemplate()), + generateSampleMessage(new protos.google.cloud.dataproc.v1.WorkflowTemplate()), + ]; + client.descriptors.page.listWorkflowTemplates.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.dataproc.v1.IWorkflowTemplate[] = []; + const iterable = client.listWorkflowTemplatesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listWorkflowTemplates.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listWorkflowTemplates.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listWorkflowTemplates with error', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listWorkflowTemplates.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listWorkflowTemplatesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dataproc.v1.IWorkflowTemplate[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listWorkflowTemplates.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listWorkflowTemplates.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.getIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); + assert((client.iamClient.setIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }).catch(err => {throw err}); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); + assert((client.iamClient.testIamPermissions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + 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 workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + 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 workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + 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 workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + 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 workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + 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 workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + 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 workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + 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 workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + 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 workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + 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 workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + 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 workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + 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('batch', async () => { + const fakePath = "/rendered/path/batch"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + batch: "batchValue", + }; + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.batchPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.batchPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('batchPath', () => { + const result = client.batchPath("projectValue", "locationValue", "batchValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.batchPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBatchName', () => { + const result = client.matchProjectFromBatchName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.batchPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBatchName', () => { + const result = client.matchLocationFromBatchName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.batchPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBatchFromBatchName', () => { + const result = client.matchBatchFromBatchName(fakePath); + assert.strictEqual(result, "batchValue"); + assert((client.pathTemplates.batchPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('nodeGroup', async () => { + const fakePath = "/rendered/path/nodeGroup"; + const expectedParameters = { + project: "projectValue", + region: "regionValue", + cluster: "clusterValue", + node_group: "nodeGroupValue", + }; + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.nodeGroupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.nodeGroupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('nodeGroupPath', () => { + const result = client.nodeGroupPath("projectValue", "regionValue", "clusterValue", "nodeGroupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.nodeGroupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNodeGroupName', () => { + const result = client.matchProjectFromNodeGroupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRegionFromNodeGroupName', () => { + const result = client.matchRegionFromNodeGroupName(fakePath); + assert.strictEqual(result, "regionValue"); + assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchClusterFromNodeGroupName', () => { + const result = client.matchClusterFromNodeGroupName(fakePath); + assert.strictEqual(result, "clusterValue"); + assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNodeGroupFromNodeGroupName', () => { + const result = client.matchNodeGroupFromNodeGroupName(fakePath); + assert.strictEqual(result, "nodeGroupValue"); + assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + 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('projectLocationAutoscalingPolicy', async () => { + const fakePath = "/rendered/path/projectLocationAutoscalingPolicy"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + autoscaling_policy: "autoscalingPolicyValue", + }; + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationAutoscalingPolicyPath', () => { + const result = client.projectLocationAutoscalingPolicyPath("projectValue", "locationValue", "autoscalingPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationAutoscalingPolicyName', () => { + const result = client.matchProjectFromProjectLocationAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationAutoscalingPolicyName', () => { + const result = client.matchLocationFromProjectLocationAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName', () => { + const result = client.matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "autoscalingPolicyValue"); + assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectLocationWorkflowTemplate', async () => { + const fakePath = "/rendered/path/projectLocationWorkflowTemplate"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + workflow_template: "workflowTemplateValue", + }; + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationWorkflowTemplatePath', () => { + const result = client.projectLocationWorkflowTemplatePath("projectValue", "locationValue", "workflowTemplateValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectLocationWorkflowTemplateName', () => { + const result = client.matchProjectFromProjectLocationWorkflowTemplateName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromProjectLocationWorkflowTemplateName', () => { + const result = client.matchLocationFromProjectLocationWorkflowTemplateName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchWorkflowTemplateFromProjectLocationWorkflowTemplateName', () => { + const result = client.matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(fakePath); + assert.strictEqual(result, "workflowTemplateValue"); + assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectRegionAutoscalingPolicy', async () => { + const fakePath = "/rendered/path/projectRegionAutoscalingPolicy"; + const expectedParameters = { + project: "projectValue", + region: "regionValue", + autoscaling_policy: "autoscalingPolicyValue", + }; + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectRegionAutoscalingPolicyPath', () => { + const result = client.projectRegionAutoscalingPolicyPath("projectValue", "regionValue", "autoscalingPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectRegionAutoscalingPolicyName', () => { + const result = client.matchProjectFromProjectRegionAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRegionFromProjectRegionAutoscalingPolicyName', () => { + const result = client.matchRegionFromProjectRegionAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "regionValue"); + assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName', () => { + const result = client.matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(fakePath); + assert.strictEqual(result, "autoscalingPolicyValue"); + assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectRegionWorkflowTemplate', async () => { + const fakePath = "/rendered/path/projectRegionWorkflowTemplate"; + const expectedParameters = { + project: "projectValue", + region: "regionValue", + workflow_template: "workflowTemplateValue", + }; + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectRegionWorkflowTemplatePath', () => { + const result = client.projectRegionWorkflowTemplatePath("projectValue", "regionValue", "workflowTemplateValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectRegionWorkflowTemplateName', () => { + const result = client.matchProjectFromProjectRegionWorkflowTemplateName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRegionFromProjectRegionWorkflowTemplateName', () => { + const result = client.matchRegionFromProjectRegionWorkflowTemplateName(fakePath); + assert.strictEqual(result, "regionValue"); + assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchWorkflowTemplateFromProjectRegionWorkflowTemplateName', () => { + const result = client.matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(fakePath); + assert.strictEqual(result, "workflowTemplateValue"); + assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('region', async () => { + const fakePath = "/rendered/path/region"; + const expectedParameters = { + project: "projectValue", + region: "regionValue", + }; + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.regionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.regionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('regionPath', () => { + const result = client.regionPath("projectValue", "regionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.regionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromRegionName', () => { + const result = client.matchProjectFromRegionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.regionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRegionFromRegionName', () => { + const result = client.matchRegionFromRegionName(fakePath); + assert.strictEqual(result, "regionValue"); + assert((client.pathTemplates.regionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('session', async () => { + const fakePath = "/rendered/path/session"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + session: "sessionValue", + }; + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.sessionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.sessionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('sessionPath', () => { + const result = client.sessionPath("projectValue", "locationValue", "sessionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.sessionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSessionName', () => { + const result = client.matchProjectFromSessionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSessionName', () => { + const result = client.matchLocationFromSessionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSessionFromSessionName', () => { + const result = client.matchSessionFromSessionName(fakePath); + assert.strictEqual(result, "sessionValue"); + assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('sessionTemplate', async () => { + const fakePath = "/rendered/path/sessionTemplate"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + template: "templateValue", + }; + const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.sessionTemplatePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.sessionTemplatePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('sessionTemplatePath', () => { + const result = client.sessionTemplatePath("projectValue", "locationValue", "templateValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.sessionTemplatePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromSessionTemplateName', () => { + const result = client.matchProjectFromSessionTemplateName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromSessionTemplateName', () => { + const result = client.matchLocationFromSessionTemplateName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchTemplateFromSessionTemplateName', () => { + const result = client.matchTemplateFromSessionTemplateName(fakePath); + assert.strictEqual(result, "templateValue"); + assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-dataproc/tsconfig.json b/owl-bot-staging/google-cloud-dataproc/tsconfig.json new file mode 100644 index 000000000000..ca73e7bfc824 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/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-dataproc/webpack.config.js b/owl-bot-staging/google-cloud-dataproc/webpack.config.js new file mode 100644 index 000000000000..050b272c0e03 --- /dev/null +++ b/owl-bot-staging/google-cloud-dataproc/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: 'dataproc', + filename: './dataproc.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 8a5a18bb1be5c6800bbe5544e130ab5ce29a68b5 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 5 May 2026 21:22:35 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../google-cloud-dataproc/.OwlBot.yaml | 19 - .../google-cloud-dataproc/.eslintignore | 7 - .../google-cloud-dataproc/.eslintrc.json | 4 - .../google-cloud-dataproc/.gitignore | 14 - .../google-cloud-dataproc/.jsdoc.js | 55 - .../google-cloud-dataproc/.mocharc.js | 33 - owl-bot-staging/google-cloud-dataproc/.nycrc | 24 - .../google-cloud-dataproc/README.md | 158 - .../dataproc/v1/autoscaling_policies.proto | 399 - .../google/cloud/dataproc/v1/batches.proto | 436 - .../google/cloud/dataproc/v1/clusters.proto | 1791 - .../google/cloud/dataproc/v1/jobs.proto | 1045 - .../cloud/dataproc/v1/node_groups.proto | 174 - .../google/cloud/dataproc/v1/operations.proto | 212 - .../cloud/dataproc/v1/session_templates.proto | 217 - .../google/cloud/dataproc/v1/sessions.proto | 379 - .../google/cloud/dataproc/v1/shared.proto | 627 - .../dataproc/v1/workflow_templates.proto | 890 - .../google-cloud-dataproc/protos/protos.d.ts | 29074 ------ .../google-cloud-dataproc/protos/protos.js | 77201 ---------------- .../google-cloud-dataproc/protos/protos.json | 9294 -- ...olicy_service.create_autoscaling_policy.js | 73 - ...olicy_service.delete_autoscaling_policy.js | 68 - ...g_policy_service.get_autoscaling_policy.js | 68 - ...olicy_service.list_autoscaling_policies.js | 80 - ...olicy_service.update_autoscaling_policy.js | 61 - .../v1/batch_controller.create_batch.js | 86 - .../v1/batch_controller.delete_batch.js | 63 - .../v1/batch_controller.get_batch.js | 63 - .../v1/batch_controller.list_batches.js | 93 - .../v1/cluster_controller.create_cluster.js | 90 - .../v1/cluster_controller.delete_cluster.js | 91 - .../v1/cluster_controller.diagnose_cluster.js | 99 - .../v1/cluster_controller.get_cluster.js | 72 - .../v1/cluster_controller.list_clusters.js | 95 - .../v1/cluster_controller.start_cluster.js | 91 - .../v1/cluster_controller.stop_cluster.js | 91 - .../v1/cluster_controller.update_cluster.js | 154 - .../generated/v1/job_controller.cancel_job.js | 72 - .../generated/v1/job_controller.delete_job.js | 72 - .../generated/v1/job_controller.get_job.js | 72 - .../generated/v1/job_controller.list_jobs.js | 102 - .../generated/v1/job_controller.submit_job.js | 85 - .../job_controller.submit_job_as_operation.js | 86 - .../generated/v1/job_controller.update_job.js | 87 - ...node_group_controller.create_node_group.js | 88 - .../node_group_controller.get_node_group.js | 63 - ...node_group_controller.resize_node_group.js | 98 - .../v1/session_controller.create_session.js | 88 - .../v1/session_controller.delete_session.js | 73 - .../v1/session_controller.get_session.js | 61 - .../v1/session_controller.list_sessions.js | 88 - .../session_controller.terminate_session.js | 73 - ...late_controller.create_session_template.js | 66 - ...late_controller.delete_session_template.js | 61 - ...emplate_controller.get_session_template.js | 61 - ...plate_controller.list_session_templates.js | 79 - ...late_controller.update_session_template.js | 61 - ...pet_metadata_google.cloud.dataproc.v1.json | 2155 - ...mplate_service.create_workflow_template.js | 73 - ...mplate_service.delete_workflow_template.js | 74 - ..._template_service.get_workflow_template.js | 74 - ...ce.instantiate_inline_workflow_template.js | 84 - ...e_service.instantiate_workflow_template.js | 92 - ...emplate_service.list_workflow_templates.js | 79 - ...mplate_service.update_workflow_template.js | 62 - .../google-cloud-dataproc/src/index.ts | 41 - .../v1/autoscaling_policy_service_client.ts | 1627 - ...oscaling_policy_service_client_config.json | 51 - ...autoscaling_policy_service_proto_list.json | 12 - .../src/v1/batch_controller_client.ts | 1832 - .../v1/batch_controller_client_config.json | 42 - .../src/v1/batch_controller_proto_list.json | 12 - .../src/v1/cluster_controller_client.ts | 2563 - .../v1/cluster_controller_client_config.json | 72 - .../src/v1/cluster_controller_proto_list.json | 12 - .../src/v1/gapic_metadata.json | 589 - .../google-cloud-dataproc/src/v1/index.ts | 26 - .../src/v1/job_controller_client.ts | 2119 - .../src/v1/job_controller_client_config.json | 69 - .../src/v1/job_controller_proto_list.json | 12 - .../src/v1/node_group_controller_client.ts | 1673 - .../node_group_controller_client_config.json | 38 - .../v1/node_group_controller_proto_list.json | 12 - .../src/v1/session_controller_client.ts | 1972 - .../v1/session_controller_client_config.json | 46 - .../src/v1/session_controller_proto_list.json | 12 - .../v1/session_template_controller_client.ts | 1583 - ...ion_template_controller_client_config.json | 46 - ...ession_template_controller_proto_list.json | 12 - .../v1/workflow_template_service_client.ts | 2209 - ...rkflow_template_service_client_config.json | 69 - .../workflow_template_service_proto_list.json | 12 - .../system-test/fixtures/sample/src/index.js | 34 - .../system-test/fixtures/sample/src/index.ts | 74 - .../system-test/install.ts | 49 - .../gapic_autoscaling_policy_service_v1.ts | 1665 - .../test/gapic_batch_controller_v1.ts | 1870 - .../test/gapic_cluster_controller_v1.ts | 2741 - .../test/gapic_job_controller_v1.ts | 2267 - .../test/gapic_node_group_controller_v1.ts | 1690 - .../test/gapic_session_controller_v1.ts | 2070 - .../gapic_session_template_controller_v1.ts | 1665 - .../gapic_workflow_template_service_v1.ts | 2244 - .../google-cloud-dataproc/tsconfig.json | 22 - .../google-cloud-dataproc/webpack.config.js | 64 - .../google-cloud-dataproc/.gitattributes | 0 .../google-cloud-dataproc/.prettierignore | 0 .../google-cloud-dataproc/.prettierrc.js | 0 .../google-cloud-dataproc/CODE_OF_CONDUCT.md | 0 .../google-cloud-dataproc/CONTRIBUTING.md | 0 .../google-cloud-dataproc/LICENSE | 0 .../google/cloud/dataproc/v1/batches.proto | 30 +- .../google-cloud-dataproc/protos/protos.d.ts | 135 +- .../google-cloud-dataproc/protos/protos.js | 461 +- .../google-cloud-dataproc/protos/protos.json | 61 +- ...pet_metadata_google.cloud.dataproc.v1.json | 2 +- packages/google-cloud-dataproc/src/index.ts | 2 +- .../google-cloud-dataproc/webpack.config.js | 2 +- 119 files changed, 685 insertions(+), 160946 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-dataproc/.OwlBot.yaml delete mode 100644 owl-bot-staging/google-cloud-dataproc/.eslintignore delete mode 100644 owl-bot-staging/google-cloud-dataproc/.eslintrc.json delete mode 100644 owl-bot-staging/google-cloud-dataproc/.gitignore delete mode 100644 owl-bot-staging/google-cloud-dataproc/.jsdoc.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/.mocharc.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/.nycrc delete mode 100644 owl-bot-staging/google-cloud-dataproc/README.md delete mode 100644 owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/autoscaling_policies.proto delete mode 100644 owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/batches.proto delete mode 100644 owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/clusters.proto delete mode 100644 owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/jobs.proto delete mode 100644 owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/node_groups.proto delete mode 100644 owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/operations.proto delete mode 100644 owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/session_templates.proto delete mode 100644 owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/sessions.proto delete mode 100644 owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/shared.proto delete mode 100644 owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/workflow_templates.proto delete mode 100644 owl-bot-staging/google-cloud-dataproc/protos/protos.d.ts delete mode 100644 owl-bot-staging/google-cloud-dataproc/protos/protos.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/protos/protos.json delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.create_autoscaling_policy.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.delete_autoscaling_policy.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.get_autoscaling_policy.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.list_autoscaling_policies.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.update_autoscaling_policy.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/batch_controller.create_batch.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/batch_controller.delete_batch.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/batch_controller.get_batch.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/batch_controller.list_batches.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.create_cluster.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.delete_cluster.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.diagnose_cluster.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.get_cluster.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.list_clusters.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.start_cluster.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.stop_cluster.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.update_cluster.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.cancel_job.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.delete_job.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.get_job.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.list_jobs.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.submit_job.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.submit_job_as_operation.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.update_job.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/node_group_controller.create_node_group.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/node_group_controller.get_node_group.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/node_group_controller.resize_node_group.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_controller.create_session.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_controller.delete_session.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_controller.get_session.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_controller.list_sessions.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_controller.terminate_session.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_template_controller.create_session_template.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_template_controller.delete_session_template.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_template_controller.get_session_template.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_template_controller.list_session_templates.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_template_controller.update_session_template.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/snippet_metadata_google.cloud.dataproc.v1.json delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.create_workflow_template.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.delete_workflow_template.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.get_workflow_template.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.instantiate_inline_workflow_template.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.instantiate_workflow_template.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.list_workflow_templates.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.update_workflow_template.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/autoscaling_policy_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/autoscaling_policy_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/autoscaling_policy_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/batch_controller_client.ts delete mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/batch_controller_client_config.json delete mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/batch_controller_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/cluster_controller_client.ts delete mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/cluster_controller_client_config.json delete mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/cluster_controller_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/index.ts delete mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/job_controller_client.ts delete mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/job_controller_client_config.json delete mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/job_controller_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/node_group_controller_client.ts delete mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/node_group_controller_client_config.json delete mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/node_group_controller_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/session_controller_client.ts delete mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/session_controller_client_config.json delete mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/session_controller_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/session_template_controller_client.ts delete mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/session_template_controller_client_config.json delete mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/session_template_controller_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/workflow_template_service_client.ts delete mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/workflow_template_service_client_config.json delete mode 100644 owl-bot-staging/google-cloud-dataproc/src/v1/workflow_template_service_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-dataproc/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-cloud-dataproc/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-dataproc/system-test/install.ts delete mode 100644 owl-bot-staging/google-cloud-dataproc/test/gapic_autoscaling_policy_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-dataproc/test/gapic_batch_controller_v1.ts delete mode 100644 owl-bot-staging/google-cloud-dataproc/test/gapic_cluster_controller_v1.ts delete mode 100644 owl-bot-staging/google-cloud-dataproc/test/gapic_job_controller_v1.ts delete mode 100644 owl-bot-staging/google-cloud-dataproc/test/gapic_node_group_controller_v1.ts delete mode 100644 owl-bot-staging/google-cloud-dataproc/test/gapic_session_controller_v1.ts delete mode 100644 owl-bot-staging/google-cloud-dataproc/test/gapic_session_template_controller_v1.ts delete mode 100644 owl-bot-staging/google-cloud-dataproc/test/gapic_workflow_template_service_v1.ts delete mode 100644 owl-bot-staging/google-cloud-dataproc/tsconfig.json delete mode 100644 owl-bot-staging/google-cloud-dataproc/webpack.config.js rename {owl-bot-staging => packages}/google-cloud-dataproc/.gitattributes (100%) rename {owl-bot-staging => packages}/google-cloud-dataproc/.prettierignore (100%) rename {owl-bot-staging => packages}/google-cloud-dataproc/.prettierrc.js (100%) rename {owl-bot-staging => packages}/google-cloud-dataproc/CODE_OF_CONDUCT.md (100%) rename {owl-bot-staging => packages}/google-cloud-dataproc/CONTRIBUTING.md (100%) rename {owl-bot-staging => packages}/google-cloud-dataproc/LICENSE (100%) diff --git a/owl-bot-staging/google-cloud-dataproc/.OwlBot.yaml b/owl-bot-staging/google-cloud-dataproc/.OwlBot.yaml deleted file mode 100644 index eb0d3ad0b3be..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/.OwlBot.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -deep-copy-regex: - - source: /google/cloud/dataproc/google-cloud-dataproc-nodejs - dest: /owl-bot-staging/google-cloud-dataproc - -api-name: dataproc \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-dataproc/.eslintignore b/owl-bot-staging/google-cloud-dataproc/.eslintignore deleted file mode 100644 index cfc348ec4d11..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/.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-dataproc/.eslintrc.json b/owl-bot-staging/google-cloud-dataproc/.eslintrc.json deleted file mode 100644 index 3e8d97ccb390..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/.eslintrc.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "./node_modules/gts", - "root": true -} diff --git a/owl-bot-staging/google-cloud-dataproc/.gitignore b/owl-bot-staging/google-cloud-dataproc/.gitignore deleted file mode 100644 index d4f03a0df2e8..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/.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-dataproc/.jsdoc.js b/owl-bot-staging/google-cloud-dataproc/.jsdoc.js deleted file mode 100644 index df3c31bed8ee..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/.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/dataproc', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/google-cloud-dataproc/.mocharc.js b/owl-bot-staging/google-cloud-dataproc/.mocharc.js deleted file mode 100644 index 5eb34e86c874..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/.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-dataproc/.nycrc b/owl-bot-staging/google-cloud-dataproc/.nycrc deleted file mode 100644 index 81a95fc94b00..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/.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-dataproc/README.md b/owl-bot-staging/google-cloud-dataproc/README.md deleted file mode 100644 index f03edb07a90c..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/README.md +++ /dev/null @@ -1,158 +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 Dataproc 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/dataproc.svg)](https://www.npmjs.org/package/@google-cloud/dataproc) - -Cloud Dataproc API client for Node.js - -[//]: # "partials.introduction" - -A comprehensive list of changes in each version may be found in -[the CHANGELOG][homepage_changelog]. - -* [Cloud Dataproc API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/dataproc/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 Dataproc 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/dataproc -``` - -[//]: # "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 | -| --------------------------- | --------------------------------- | -| create autoscaling policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.create_autoscaling_policy.js) | -| delete autoscaling policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.delete_autoscaling_policy.js) | -| get autoscaling policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.get_autoscaling_policy.js) | -| list autoscaling policies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.list_autoscaling_policies.js) | -| update autoscaling policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.update_autoscaling_policy.js) | -| create batch | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/batch_controller.create_batch.js) | -| delete batch | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/batch_controller.delete_batch.js) | -| get batch | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/batch_controller.get_batch.js) | -| list batches | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/batch_controller.list_batches.js) | -| create cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/cluster_controller.create_cluster.js) | -| delete cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/cluster_controller.delete_cluster.js) | -| diagnose cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/cluster_controller.diagnose_cluster.js) | -| get cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/cluster_controller.get_cluster.js) | -| list clusters | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/cluster_controller.list_clusters.js) | -| start cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/cluster_controller.start_cluster.js) | -| stop cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/cluster_controller.stop_cluster.js) | -| update cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/cluster_controller.update_cluster.js) | -| cancel job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/job_controller.cancel_job.js) | -| delete job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/job_controller.delete_job.js) | -| get job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/job_controller.get_job.js) | -| list jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/job_controller.list_jobs.js) | -| submit job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/job_controller.submit_job.js) | -| submit job as operation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/job_controller.submit_job_as_operation.js) | -| update job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/job_controller.update_job.js) | -| create node group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/node_group_controller.create_node_group.js) | -| get node group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/node_group_controller.get_node_group.js) | -| resize node group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/node_group_controller.resize_node_group.js) | -| create session | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/session_controller.create_session.js) | -| delete session | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/session_controller.delete_session.js) | -| get session | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/session_controller.get_session.js) | -| list sessions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/session_controller.list_sessions.js) | -| terminate session | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/session_controller.terminate_session.js) | -| create session template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/session_template_controller.create_session_template.js) | -| delete session template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/session_template_controller.delete_session_template.js) | -| get session template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/session_template_controller.get_session_template.js) | -| list session templates | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/session_template_controller.list_session_templates.js) | -| update session template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/session_template_controller.update_session_template.js) | -| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/snippet_metadata_google.cloud.dataproc.v1.json) | -| create workflow template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/workflow_template_service.create_workflow_template.js) | -| delete workflow template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/workflow_template_service.delete_workflow_template.js) | -| get workflow template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/workflow_template_service.get_workflow_template.js) | -| instantiate inline workflow template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/workflow_template_service.instantiate_inline_workflow_template.js) | -| instantiate workflow template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/workflow_template_service.instantiate_workflow_template.js) | -| list workflow templates | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/workflow_template_service.list_workflow_templates.js) | -| update workflow template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/samples/generated/v1/workflow_template_service.update_workflow_template.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/dataproc@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-dataproc/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-dataproc/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=dataproc.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-dataproc/samples -[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc/CHANGELOG.md -[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-dataproc diff --git a/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/autoscaling_policies.proto b/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/autoscaling_policies.proto deleted file mode 100644 index e9d6fa76ff7b..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/autoscaling_policies.proto +++ /dev/null @@ -1,399 +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.dataproc.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/empty.proto"; - -option go_package = "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpb"; -option java_multiple_files = true; -option java_outer_classname = "AutoscalingPoliciesProto"; -option java_package = "com.google.cloud.dataproc.v1"; -option (google.api.resource_definition) = { - type: "dataproc.googleapis.com/Region" - pattern: "projects/{project}/regions/{region}" -}; - -// The API interface for managing autoscaling policies in the -// Dataproc API. -service AutoscalingPolicyService { - option (google.api.default_host) = "dataproc.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Creates new autoscaling policy. - rpc CreateAutoscalingPolicy(CreateAutoscalingPolicyRequest) - returns (AutoscalingPolicy) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/autoscalingPolicies" - body: "policy" - additional_bindings { - post: "/v1/{parent=projects/*/regions/*}/autoscalingPolicies" - body: "policy" - } - }; - option (google.api.method_signature) = "parent,policy"; - } - - // Updates (replaces) autoscaling policy. - // - // Disabled check for update_mask, because all updates will be full - // replacements. - rpc UpdateAutoscalingPolicy(UpdateAutoscalingPolicyRequest) - returns (AutoscalingPolicy) { - option (google.api.http) = { - put: "/v1/{policy.name=projects/*/locations/*/autoscalingPolicies/*}" - body: "policy" - additional_bindings { - put: "/v1/{policy.name=projects/*/regions/*/autoscalingPolicies/*}" - body: "policy" - } - }; - option (google.api.method_signature) = "policy"; - } - - // Retrieves autoscaling policy. - rpc GetAutoscalingPolicy(GetAutoscalingPolicyRequest) - returns (AutoscalingPolicy) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/autoscalingPolicies/*}" - additional_bindings { - get: "/v1/{name=projects/*/regions/*/autoscalingPolicies/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Lists autoscaling policies in the project. - rpc ListAutoscalingPolicies(ListAutoscalingPoliciesRequest) - returns (ListAutoscalingPoliciesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/autoscalingPolicies" - additional_bindings { - get: "/v1/{parent=projects/*/regions/*}/autoscalingPolicies" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes an autoscaling policy. It is an error to delete an autoscaling - // policy that is in use by one or more clusters. - rpc DeleteAutoscalingPolicy(DeleteAutoscalingPolicyRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/autoscalingPolicies/*}" - additional_bindings { - delete: "/v1/{name=projects/*/regions/*/autoscalingPolicies/*}" - } - }; - option (google.api.method_signature) = "name"; - } -} - -// Describes an autoscaling policy for Dataproc cluster autoscaler. -message AutoscalingPolicy { - option (google.api.resource) = { - type: "dataproc.googleapis.com/AutoscalingPolicy" - pattern: "projects/{project}/locations/{location}/autoscalingPolicies/{autoscaling_policy}" - pattern: "projects/{project}/regions/{region}/autoscalingPolicies/{autoscaling_policy}" - }; - - // The type of the clusters for which this autoscaling policy is to be - // configured. - enum ClusterType { - // Not set. - CLUSTER_TYPE_UNSPECIFIED = 0; - - // Standard dataproc cluster with a minimum of two primary workers. - STANDARD = 1; - - // Clusters that can use only secondary workers and be scaled down to zero - // secondary worker nodes. - ZERO_SCALE = 2; - } - - // Required. The policy id. - // - // The id must contain only letters (a-z, A-Z), numbers (0-9), - // underscores (_), and hyphens (-). Cannot begin or end with underscore - // or hyphen. Must consist of between 3 and 50 characters. - // - string id = 1; - - // Output only. The "resource name" of the autoscaling policy, as described - // in https://cloud.google.com/apis/design/resource_names. - // - // * For `projects.regions.autoscalingPolicies`, the resource name of the - // policy has the following format: - // `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` - // - // * For `projects.locations.autoscalingPolicies`, the resource name of the - // policy has the following format: - // `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` - string name = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Autoscaling algorithm for policy. - oneof algorithm { - BasicAutoscalingAlgorithm basic_algorithm = 3 - [(google.api.field_behavior) = REQUIRED]; - } - - // Required. Describes how the autoscaler will operate for primary workers. - InstanceGroupAutoscalingPolicyConfig worker_config = 4 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. Describes how the autoscaler will operate for secondary workers. - InstanceGroupAutoscalingPolicyConfig secondary_worker_config = 5 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The labels to associate with this autoscaling policy. - // Label **keys** must contain 1 to 63 characters, and must conform to - // [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). - // Label **values** may be empty, but, if present, must contain 1 to 63 - // characters, and must conform to [RFC - // 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be - // associated with an autoscaling policy. - map labels = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The type of the clusters for which this autoscaling policy is to - // be configured. - ClusterType cluster_type = 7 [(google.api.field_behavior) = OPTIONAL]; -} - -// Basic algorithm for autoscaling. -message BasicAutoscalingAlgorithm { - oneof config { - // Required. YARN autoscaling configuration. - BasicYarnAutoscalingConfig yarn_config = 1 - [(google.api.field_behavior) = REQUIRED]; - } - - // Optional. Duration between scaling events. A scaling period starts after - // the update operation from the previous event has completed. - // - // Bounds: [2m, 1d]. Default: 2m. - google.protobuf.Duration cooldown_period = 2 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Basic autoscaling configurations for YARN. -message BasicYarnAutoscalingConfig { - // Required. Timeout for YARN graceful decommissioning of Node Managers. - // Specifies the duration to wait for jobs to complete before forcefully - // removing workers (and potentially interrupting jobs). Only applicable to - // downscaling operations. - // - // Bounds: [0s, 1d]. - google.protobuf.Duration graceful_decommission_timeout = 5 - [(google.api.field_behavior) = REQUIRED]; - - // Required. Fraction of average YARN pending memory in the last cooldown - // period for which to add workers. A scale-up factor of 1.0 will result in - // scaling up so that there is no pending memory remaining after the update - // (more aggressive scaling). A scale-up factor closer to 0 will result in a - // smaller magnitude of scaling up (less aggressive scaling). See [How - // autoscaling - // works](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/autoscaling#how_autoscaling_works) - // for more information. - // - // Bounds: [0.0, 1.0]. - double scale_up_factor = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Fraction of average YARN pending memory in the last cooldown - // period for which to remove workers. A scale-down factor of 1 will result in - // scaling down so that there is no available memory remaining after the - // update (more aggressive scaling). A scale-down factor of 0 disables - // removing workers, which can be beneficial for autoscaling a single job. - // See [How autoscaling - // works](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/autoscaling#how_autoscaling_works) - // for more information. - // - // Bounds: [0.0, 1.0]. - double scale_down_factor = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Minimum scale-up threshold as a fraction of total cluster size - // before scaling occurs. For example, in a 20-worker cluster, a threshold of - // 0.1 means the autoscaler must recommend at least a 2-worker scale-up for - // the cluster to scale. A threshold of 0 means the autoscaler will scale up - // on any recommended change. - // - // Bounds: [0.0, 1.0]. Default: 0.0. - double scale_up_min_worker_fraction = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Minimum scale-down threshold as a fraction of total cluster size - // before scaling occurs. For example, in a 20-worker cluster, a threshold of - // 0.1 means the autoscaler must recommend at least a 2 worker scale-down for - // the cluster to scale. A threshold of 0 means the autoscaler will scale down - // on any recommended change. - // - // Bounds: [0.0, 1.0]. Default: 0.0. - double scale_down_min_worker_fraction = 4 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Configuration for the size bounds of an instance group, including its -// proportional size to other groups. -message InstanceGroupAutoscalingPolicyConfig { - // Optional. Minimum number of instances for this group. - // - // Primary workers - Bounds: [2, max_instances]. Default: 2. - // Secondary workers - Bounds: [0, max_instances]. Default: 0. - int32 min_instances = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Required. Maximum number of instances for this group. Required for primary - // workers. Note that by default, clusters will not use secondary workers. - // Required for secondary workers if the minimum secondary instances is set. - // - // Primary workers - Bounds: [min_instances, ). - // Secondary workers - Bounds: [min_instances, ). Default: 0. - int32 max_instances = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Weight for the instance group, which is used to determine the - // fraction of total workers in the cluster from this instance group. - // For example, if primary workers have weight 2, and secondary workers have - // weight 1, the cluster will have approximately 2 primary workers for each - // secondary worker. - // - // The cluster may not reach the specified balance if constrained - // by min/max bounds or other autoscaling settings. For example, if - // `max_instances` for secondary workers is 0, then only primary workers will - // be added. The cluster can also be out of balance when created. - // - // If weight is not set on any instance group, the cluster will default to - // equal weight for all groups: the cluster will attempt to maintain an equal - // number of workers in each group within the configured size bounds for each - // group. If weight is set for one group only, the cluster will default to - // zero weight on the unset group. For example if weight is set only on - // primary workers, the cluster will use primary workers only and no - // secondary workers. - int32 weight = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// A request to create an autoscaling policy. -message CreateAutoscalingPolicyRequest { - // Required. The "resource name" of the region or location, as described - // in https://cloud.google.com/apis/design/resource_names. - // - // * For `projects.regions.autoscalingPolicies.create`, the resource name - // of the region has the following format: - // `projects/{project_id}/regions/{region}` - // - // * For `projects.locations.autoscalingPolicies.create`, the resource name - // of the location has the following format: - // `projects/{project_id}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "dataproc.googleapis.com/AutoscalingPolicy" - } - ]; - - // Required. The autoscaling policy to create. - AutoscalingPolicy policy = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// A request to fetch an autoscaling policy. -message GetAutoscalingPolicyRequest { - // Required. The "resource name" of the autoscaling policy, as described - // in https://cloud.google.com/apis/design/resource_names. - // - // * For `projects.regions.autoscalingPolicies.get`, the resource name - // of the policy has the following format: - // `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` - // - // * For `projects.locations.autoscalingPolicies.get`, the resource name - // of the policy has the following format: - // `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataproc.googleapis.com/AutoscalingPolicy" - } - ]; -} - -// A request to update an autoscaling policy. -message UpdateAutoscalingPolicyRequest { - // Required. The updated autoscaling policy. - AutoscalingPolicy policy = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// A request to delete an autoscaling policy. -// -// Autoscaling policies in use by one or more clusters will not be deleted. -message DeleteAutoscalingPolicyRequest { - // Required. The "resource name" of the autoscaling policy, as described - // in https://cloud.google.com/apis/design/resource_names. - // - // * For `projects.regions.autoscalingPolicies.delete`, the resource name - // of the policy has the following format: - // `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` - // - // * For `projects.locations.autoscalingPolicies.delete`, the resource name - // of the policy has the following format: - // `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataproc.googleapis.com/AutoscalingPolicy" - } - ]; -} - -// A request to list autoscaling policies in a project. -message ListAutoscalingPoliciesRequest { - // Required. The "resource name" of the region or location, as described - // in https://cloud.google.com/apis/design/resource_names. - // - // * For `projects.regions.autoscalingPolicies.list`, the resource name - // of the region has the following format: - // `projects/{project_id}/regions/{region}` - // - // * For `projects.locations.autoscalingPolicies.list`, the resource name - // of the location has the following format: - // `projects/{project_id}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "dataproc.googleapis.com/AutoscalingPolicy" - } - ]; - - // Optional. The maximum number of results to return in each response. - // Must be less than or equal to 1000. Defaults to 100. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The page token, returned by a previous call, to request the - // next page of results. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// A response to a request to list autoscaling policies in a project. -message ListAutoscalingPoliciesResponse { - // Output only. Autoscaling policies list. - repeated AutoscalingPolicy policies = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. This token is included in the response if there are more - // results to fetch. - string next_page_token = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/batches.proto b/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/batches.proto deleted file mode 100644 index 04bec6acd990..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/batches.proto +++ /dev/null @@ -1,436 +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.dataproc.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/dataproc/v1/shared.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpb"; -option java_multiple_files = true; -option java_outer_classname = "BatchesProto"; -option java_package = "com.google.cloud.dataproc.v1"; - -// The BatchController provides methods to manage batch workloads. -service BatchController { - option (google.api.default_host) = "dataproc.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Creates a batch workload that executes asynchronously. - rpc CreateBatch(CreateBatchRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/batches" - body: "batch" - }; - option (google.api.method_signature) = "parent,batch,batch_id"; - option (google.longrunning.operation_info) = { - response_type: "Batch" - metadata_type: "google.cloud.dataproc.v1.BatchOperationMetadata" - }; - } - - // Gets the batch workload resource representation. - rpc GetBatch(GetBatchRequest) returns (Batch) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/batches/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists batch workloads. - rpc ListBatches(ListBatchesRequest) returns (ListBatchesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/batches" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes the batch workload resource. If the batch is not in terminal state, - // the delete fails and the response returns `FAILED_PRECONDITION`. - rpc DeleteBatch(DeleteBatchRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/batches/*}" - }; - option (google.api.method_signature) = "name"; - } -} - -// A request to create a batch workload. -message CreateBatchRequest { - // Required. The parent resource where this batch will be created. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "dataproc.googleapis.com/Batch" - } - ]; - - // Required. The batch to create. - Batch batch = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The ID to use for the batch, which will become the final - // component of the batch's resource name. - // - // This value must be 4-63 characters. Valid characters are `/[a-z][0-9]-/`. - string batch_id = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A unique ID used to identify the request. If the service - // receives two - // [CreateBatchRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateBatchRequest)s - // with the same request_id, the second request is ignored and the - // Operation that corresponds to the first Batch created and stored - // in the backend is returned. - // - // Recommendation: Set this value to a - // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - // - // The value must contain only letters (a-z, A-Z), numbers (0-9), - // underscores (_), and hyphens (-). The maximum length is 40 characters. - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// A request to get the resource representation for a batch workload. -message GetBatchRequest { - // Required. The fully qualified name of the batch to retrieve - // in the format - // "projects/PROJECT_ID/locations/DATAPROC_REGION/batches/BATCH_ID" - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "dataproc.googleapis.com/Batch" } - ]; -} - -// A request to list batch workloads in a project. -message ListBatchesRequest { - // Required. The parent, which owns this collection of batches. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "dataproc.googleapis.com/Batch" - } - ]; - - // Optional. The maximum number of batches to return in each response. - // The service may return fewer than this value. - // The default page size is 20; the maximum page size is 1000. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A page token received from a previous `ListBatches` call. - // Provide this token to retrieve the subsequent page. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A filter for the batches to return in the response. - // - // A filter is a logical expression constraining the values of various fields - // in each batch resource. Filters are case sensitive, and may contain - // multiple clauses combined with logical operators (AND/OR). - // Supported fields are `batch_id`, `batch_uuid`, `state`, and `create_time`. - // - // e.g. `state = RUNNING and create_time < "2023-01-01T00:00:00Z"` - // filters for batches in state RUNNING that were created before 2023-01-01 - // - // See https://google.aip.dev/assets/misc/ebnf-filtering.txt for a detailed - // description of the filter syntax and a list of supported comparisons. - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Field(s) on which to sort the list of batches. - // - // Currently the only supported sort orders are unspecified (empty) and - // `create_time desc` to sort by most recently created batches first. - // - // See https://google.aip.dev/132#ordering for more details. - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// A list of batch workloads. -message ListBatchesResponse { - // The batches from the specified collection. - repeated Batch batches = 1; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; - - // Output only. List of Batches that could not be included in the response. - // Attempting to get one of these resources may indicate why it was not - // included in the list response. - repeated string unreachable = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// A request to delete a batch workload. -message DeleteBatchRequest { - // Required. The fully qualified name of the batch to retrieve - // in the format - // "projects/PROJECT_ID/locations/DATAPROC_REGION/batches/BATCH_ID" - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "dataproc.googleapis.com/Batch" } - ]; -} - -// A representation of a batch workload in the service. -message Batch { - option (google.api.resource) = { - type: "dataproc.googleapis.com/Batch" - pattern: "projects/{project}/locations/{location}/batches/{batch}" - }; - - // The batch state. - enum State { - // The batch state is unknown. - STATE_UNSPECIFIED = 0; - - // The batch is created before running. - PENDING = 1; - - // The batch is running. - RUNNING = 2; - - // The batch is cancelling. - CANCELLING = 3; - - // The batch cancellation was successful. - CANCELLED = 4; - - // The batch completed successfully. - SUCCEEDED = 5; - - // The batch is no longer running due to an error. - FAILED = 6; - } - - // Historical state information. - message StateHistory { - // Output only. The state of the batch at this point in history. - State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Details about the state at this point in history. - string state_message = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time when the batch entered the historical state. - google.protobuf.Timestamp state_start_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Output only. The resource name of the batch. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A batch UUID (Unique Universal Identifier). The service - // generates this value when it creates the batch. - string uuid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time when the batch was created. - google.protobuf.Timestamp create_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The application/framework-specific portion of the batch configuration. - oneof batch_config { - // Optional. PySpark batch config. - PySparkBatch pyspark_batch = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Spark batch config. - SparkBatch spark_batch = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. SparkR batch config. - SparkRBatch spark_r_batch = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. SparkSql batch config. - SparkSqlBatch spark_sql_batch = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. PySpark notebook batch config. - PySparkNotebookBatch pyspark_notebook_batch = 19 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Output only. Runtime information about batch execution. - RuntimeInfo runtime_info = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The state of the batch. - State state = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Batch state details, such as a failure - // description if the state is `FAILED`. - string state_message = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time when the batch entered a current state. - google.protobuf.Timestamp state_time = 11 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The email address of the user who created the batch. - string creator = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The labels to associate with this batch. - // Label **keys** must contain 1 to 63 characters, and must conform to - // [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). - // Label **values** may be empty, but, if present, must contain 1 to 63 - // characters, and must conform to [RFC - // 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be - // associated with a batch. - map labels = 13 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Runtime configuration for the batch execution. - RuntimeConfig runtime_config = 14 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Environment configuration for the batch execution. - EnvironmentConfig environment_config = 15 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The resource name of the operation associated with this batch. - string operation = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Historical state information for the batch. - repeated StateHistory state_history = 17 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// A configuration for running an -// [Apache -// PySpark](https://spark.apache.org/docs/latest/api/python/getting_started/quickstart.html) -// batch workload. -message PySparkBatch { - // Required. The HCFS URI of the main Python file to use as the Spark driver. - // Must be a .py file. - string main_python_file_uri = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The arguments to pass to the driver. Do not include arguments - // that can be set as batch properties, such as `--conf`, since a collision - // can occur that causes an incorrect batch submission. - repeated string args = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. HCFS file URIs of Python files to pass to the PySpark - // framework. Supported file types: `.py`, `.egg`, and `.zip`. - repeated string python_file_uris = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. HCFS URIs of jar files to add to the classpath of the - // Spark driver and tasks. - repeated string jar_file_uris = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. HCFS URIs of files to be placed in the working directory of - // each executor. - repeated string file_uris = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. HCFS URIs of archives to be extracted into the working directory - // of each executor. Supported file types: - // `.jar`, `.tar`, `.tar.gz`, `.tgz`, and `.zip`. - repeated string archive_uris = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// A configuration for running an [Apache Spark](https://spark.apache.org/) -// batch workload. -message SparkBatch { - // The specification of the main method to call to drive the Spark - // workload. Specify either the jar file that contains the main class or the - // main class name. To pass both a main jar and a main class in that jar, add - // the jar to `jar_file_uris`, and then specify the main class - // name in `main_class`. - oneof driver { - // Optional. The HCFS URI of the jar file that contains the main class. - string main_jar_file_uri = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The name of the driver main class. The jar file that contains - // the class must be in the classpath or specified in `jar_file_uris`. - string main_class = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // Optional. The arguments to pass to the driver. Do not include arguments - // that can be set as batch properties, such as `--conf`, since a collision - // can occur that causes an incorrect batch submission. - repeated string args = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. HCFS URIs of jar files to add to the classpath of the - // Spark driver and tasks. - repeated string jar_file_uris = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. HCFS URIs of files to be placed in the working directory of - // each executor. - repeated string file_uris = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. HCFS URIs of archives to be extracted into the working directory - // of each executor. Supported file types: - // `.jar`, `.tar`, `.tar.gz`, `.tgz`, and `.zip`. - repeated string archive_uris = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// A configuration for running an -// [Apache SparkR](https://spark.apache.org/docs/latest/sparkr.html) -// batch workload. -message SparkRBatch { - // Required. The HCFS URI of the main R file to use as the driver. - // Must be a `.R` or `.r` file. - string main_r_file_uri = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The arguments to pass to the Spark driver. Do not include - // arguments that can be set as batch properties, such as `--conf`, since a - // collision can occur that causes an incorrect batch submission. - repeated string args = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. HCFS URIs of files to be placed in the working directory of - // each executor. - repeated string file_uris = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. HCFS URIs of archives to be extracted into the working directory - // of each executor. Supported file types: - // `.jar`, `.tar`, `.tar.gz`, `.tgz`, and `.zip`. - repeated string archive_uris = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// A configuration for running -// [Apache Spark SQL](https://spark.apache.org/sql/) queries as a batch -// workload. -message SparkSqlBatch { - // Required. The HCFS URI of the script that contains Spark SQL queries to - // execute. - string query_file_uri = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Mapping of query variable names to values (equivalent to the - // Spark SQL command: `SET name="value";`). - map query_variables = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH. - repeated string jar_file_uris = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// A configuration for running a PySpark Notebook batch workload. -message PySparkNotebookBatch { - // Required. The HCFS URI of the notebook file to execute. - string notebook_file_uri = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The parameters to pass to the notebook. - map params = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. HCFS URIs of Python files to pass to the PySpark framework. - repeated string python_file_uris = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH. - repeated string jar_file_uris = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. HCFS URIs of files to be placed in the working directory of - // each executor - repeated string file_uris = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. HCFS URIs of archives to be extracted into the working directory - // of each executor. Supported file types: - // `.jar`, `.tar`, `.tar.gz`, `.tgz`, and `.zip`. - repeated string archive_uris = 6 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/clusters.proto b/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/clusters.proto deleted file mode 100644 index f1bc59a225e6..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/clusters.proto +++ /dev/null @@ -1,1791 +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.dataproc.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/dataproc/v1/operations.proto"; -import "google/cloud/dataproc/v1/shared.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/wrappers.proto"; -import "google/type/interval.proto"; - -option go_package = "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpb"; -option java_multiple_files = true; -option java_outer_classname = "ClustersProto"; -option java_package = "com.google.cloud.dataproc.v1"; - -// The ClusterControllerService provides methods to manage clusters -// of Compute Engine instances. -service ClusterController { - option (google.api.default_host) = "dataproc.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Creates a cluster in a project. The returned - // [Operation.metadata][google.longrunning.Operation.metadata] will be - // [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). - rpc CreateCluster(CreateClusterRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/projects/{project_id}/regions/{region}/clusters" - body: "cluster" - }; - option (google.api.method_signature) = "project_id,region,cluster"; - option (google.longrunning.operation_info) = { - response_type: "Cluster" - metadata_type: "google.cloud.dataproc.v1.ClusterOperationMetadata" - }; - } - - // Updates a cluster in a project. The returned - // [Operation.metadata][google.longrunning.Operation.metadata] will be - // [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). - // The cluster must be in a - // [`RUNNING`][google.cloud.dataproc.v1.ClusterStatus.State] state or an error - // is returned. - rpc UpdateCluster(UpdateClusterRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}" - body: "cluster" - }; - option (google.api.method_signature) = - "project_id,region,cluster_name,cluster,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "Cluster" - metadata_type: "google.cloud.dataproc.v1.ClusterOperationMetadata" - }; - } - - // Stops a cluster in a project. - rpc StopCluster(StopClusterRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:stop" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "Cluster" - metadata_type: "google.cloud.dataproc.v1.ClusterOperationMetadata" - }; - } - - // Starts a cluster in a project. - rpc StartCluster(StartClusterRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:start" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "Cluster" - metadata_type: "google.cloud.dataproc.v1.ClusterOperationMetadata" - }; - } - - // Deletes a cluster in a project. The returned - // [Operation.metadata][google.longrunning.Operation.metadata] will be - // [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). - rpc DeleteCluster(DeleteClusterRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}" - }; - option (google.api.method_signature) = "project_id,region,cluster_name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "google.cloud.dataproc.v1.ClusterOperationMetadata" - }; - } - - // Gets the resource representation for a cluster in a project. - rpc GetCluster(GetClusterRequest) returns (Cluster) { - option (google.api.http) = { - get: "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}" - }; - option (google.api.method_signature) = "project_id,region,cluster_name"; - } - - // Lists all regions/{region}/clusters in a project alphabetically. - rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) { - option (google.api.http) = { - get: "/v1/projects/{project_id}/regions/{region}/clusters" - }; - option (google.api.method_signature) = "project_id,region"; - option (google.api.method_signature) = "project_id,region,filter"; - } - - // Gets cluster diagnostic information. The returned - // [Operation.metadata][google.longrunning.Operation.metadata] will be - // [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). - // After the operation completes, - // [Operation.response][google.longrunning.Operation.response] - // contains - // [DiagnoseClusterResults](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults). - rpc DiagnoseCluster(DiagnoseClusterRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:diagnose" - body: "*" - }; - option (google.api.method_signature) = "project_id,region,cluster_name"; - option (google.longrunning.operation_info) = { - response_type: "DiagnoseClusterResults" - metadata_type: "google.cloud.dataproc.v1.ClusterOperationMetadata" - }; - } -} - -// Describes the identifying information, config, and status of -// a Dataproc cluster -message Cluster { - // Required. The Google Cloud Platform project ID that the cluster belongs to. - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The cluster name, which must be unique within a project. - // The name must start with a lowercase letter, and can contain - // up to 51 lowercase letters, numbers, and hyphens. It cannot end - // with a hyphen. The name of a deleted cluster can be reused. - string cluster_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The cluster config for a cluster of Compute Engine Instances. - // Note that Dataproc may set default values, and values may change - // when clusters are updated. - // - // Exactly one of ClusterConfig or VirtualClusterConfig must be specified. - ClusterConfig config = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The virtual cluster config is used when creating a Dataproc - // cluster that does not directly control the underlying compute resources, - // for example, when creating a [Dataproc-on-GKE - // cluster](https://cloud.google.com/dataproc/docs/guides/dpgke/dataproc-gke-overview). - // Dataproc may set default values, and values may change when - // clusters are updated. Exactly one of - // [config][google.cloud.dataproc.v1.Cluster.config] or - // [virtual_cluster_config][google.cloud.dataproc.v1.Cluster.virtual_cluster_config] - // must be specified. - VirtualClusterConfig virtual_cluster_config = 10 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The labels to associate with this cluster. - // Label **keys** must contain 1 to 63 characters, and must conform to - // [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). - // Label **values** may be empty, but, if present, must contain 1 to 63 - // characters, and must conform to [RFC - // 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be - // associated with a cluster. - map labels = 8 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Cluster status. - ClusterStatus status = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The previous cluster status. - repeated ClusterStatus status_history = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A cluster UUID (Unique Universal Identifier). Dataproc - // generates this value when it creates the cluster. - string cluster_uuid = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Contains cluster daemon metrics such as HDFS and YARN stats. - // - // **Beta Feature**: This report is available for testing purposes only. It - // may be changed before final release. - ClusterMetrics metrics = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// The cluster config. -message ClusterConfig { - // The type of the cluster. - enum ClusterType { - // Not set. - CLUSTER_TYPE_UNSPECIFIED = 0; - - // Standard dataproc cluster with a minimum of two primary workers. - STANDARD = 1; - - // https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/single-node-clusters - SINGLE_NODE = 2; - - // Clusters that can use only secondary workers and be scaled down to zero - // secondary worker nodes. - ZERO_SCALE = 3; - } - - // The cluster tier. - enum ClusterTier { - // Not set. Works the same as CLUSTER_TIER_STANDARD. - CLUSTER_TIER_UNSPECIFIED = 0; - - // Standard Dataproc cluster. - CLUSTER_TIER_STANDARD = 1; - - // Premium Dataproc cluster. - CLUSTER_TIER_PREMIUM = 2; - } - - // The cluster engine. - enum Engine { - // The engine is not specified. Works the same as ENGINE_DEFAULT. - ENGINE_UNSPECIFIED = 0; - - // The cluster is a default engine cluster. - DEFAULT = 1; - - // The cluster is a lightning engine cluster. - LIGHTNING = 2; - } - - // Optional. The type of the cluster. - ClusterType cluster_type = 27 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The cluster tier. - ClusterTier cluster_tier = 29 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The cluster engine. - Engine engine = 30 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A Cloud Storage bucket used to stage job - // dependencies, config files, and job driver console output. - // If you do not specify a staging bucket, Cloud - // Dataproc will determine a Cloud Storage location (US, - // ASIA, or EU) for your cluster's staging bucket according to the - // Compute Engine zone where your cluster is deployed, and then create - // and manage this project-level, per-location bucket (see - // [Dataproc staging and temp - // buckets](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/staging-bucket)). - // **This field requires a Cloud Storage bucket name, not a `gs://...` URI to - // a Cloud Storage bucket.** - string config_bucket = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A Cloud Storage bucket used to store ephemeral cluster and jobs - // data, such as Spark and MapReduce history files. If you do not specify a - // temp bucket, Dataproc will determine a Cloud Storage location (US, ASIA, or - // EU) for your cluster's temp bucket according to the Compute Engine zone - // where your cluster is deployed, and then create and manage this - // project-level, per-location bucket. The default bucket has a TTL of 90 - // days, but you can use any TTL (or none) if you specify a bucket (see - // [Dataproc staging and temp - // buckets](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/staging-bucket)). - // **This field requires a Cloud Storage bucket name, not a `gs://...` URI to - // a Cloud Storage bucket.** - string temp_bucket = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The shared Compute Engine config settings for - // all instances in a cluster. - GceClusterConfig gce_cluster_config = 8 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The Compute Engine config settings for - // the cluster's master instance. - InstanceGroupConfig master_config = 9 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The Compute Engine config settings for - // the cluster's worker instances. - InstanceGroupConfig worker_config = 10 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The Compute Engine config settings for - // a cluster's secondary worker instances - InstanceGroupConfig secondary_worker_config = 12 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The config settings for cluster software. - SoftwareConfig software_config = 13 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Commands to execute on each node after config is - // completed. By default, executables are run on master and all worker nodes. - // You can test a node's `role` metadata to run an executable on - // a master or worker node, as shown below using `curl` (you can also use - // `wget`): - // - // ROLE=$(curl -H Metadata-Flavor:Google - // http://metadata/computeMetadata/v1/instance/attributes/dataproc-role) - // if [[ "${ROLE}" == 'Master' ]]; then - // ... master specific actions ... - // else - // ... worker specific actions ... - // fi - repeated NodeInitializationAction initialization_actions = 11 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Encryption settings for the cluster. - EncryptionConfig encryption_config = 15 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Autoscaling config for the policy associated with the cluster. - // Cluster does not autoscale if this field is unset. - AutoscalingConfig autoscaling_config = 18 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Security settings for the cluster. - SecurityConfig security_config = 16 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Lifecycle setting for the cluster. - LifecycleConfig lifecycle_config = 17 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Port/endpoint configuration for this cluster - EndpointConfig endpoint_config = 19 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Metastore configuration. - MetastoreConfig metastore_config = 20 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The config for Dataproc metrics. - DataprocMetricConfig dataproc_metric_config = 23 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The node group settings. - repeated AuxiliaryNodeGroup auxiliary_node_groups = 25 - [(google.api.field_behavior) = OPTIONAL]; -} - -// The Dataproc cluster config for a cluster that does not directly control the -// underlying compute resources, such as a [Dataproc-on-GKE -// cluster](https://cloud.google.com/dataproc/docs/guides/dpgke/dataproc-gke-overview). -message VirtualClusterConfig { - // Optional. A Cloud Storage bucket used to stage job - // dependencies, config files, and job driver console output. - // If you do not specify a staging bucket, Cloud - // Dataproc will determine a Cloud Storage location (US, - // ASIA, or EU) for your cluster's staging bucket according to the - // Compute Engine zone where your cluster is deployed, and then create - // and manage this project-level, per-location bucket (see - // [Dataproc staging and temp - // buckets](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/staging-bucket)). - // **This field requires a Cloud Storage bucket name, not a `gs://...` URI to - // a Cloud Storage bucket.** - string staging_bucket = 1 [(google.api.field_behavior) = OPTIONAL]; - - oneof infrastructure_config { - // Required. The configuration for running the Dataproc cluster on - // Kubernetes. - KubernetesClusterConfig kubernetes_cluster_config = 6 - [(google.api.field_behavior) = REQUIRED]; - } - - // Optional. Configuration of auxiliary services used by this cluster. - AuxiliaryServicesConfig auxiliary_services_config = 7 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Auxiliary services configuration for a Cluster. -message AuxiliaryServicesConfig { - // Optional. The Hive Metastore configuration for this workload. - MetastoreConfig metastore_config = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The Spark History Server configuration for the workload. - SparkHistoryServerConfig spark_history_server_config = 2 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Endpoint config for this cluster -message EndpointConfig { - // Output only. The map of port descriptions to URLs. Will only be populated - // if enable_http_port_access is true. - map http_ports = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. If true, enable http access to specific ports on the cluster - // from external sources. Defaults to false. - bool enable_http_port_access = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Autoscaling Policy config associated with the cluster. -message AutoscalingConfig { - // Optional. The autoscaling policy used by the cluster. - // - // Only resource names including projectid and location (region) are valid. - // Examples: - // - // * `https://www.googleapis.com/compute/v1/projects/[project_id]/locations/[dataproc_region]/autoscalingPolicies/[policy_id]` - // * `projects/[project_id]/locations/[dataproc_region]/autoscalingPolicies/[policy_id]` - // - // Note that the policy must be in the same project and Dataproc region. - string policy_uri = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// Encryption settings for the cluster. -message EncryptionConfig { - // Optional. The Cloud KMS key resource name to use for persistent disk - // encryption for all instances in the cluster. See [Use CMEK with cluster - // data] - // (https://cloud.google.com//dataproc/docs/concepts/configuring-clusters/customer-managed-encryption#use_cmek_with_cluster_data) - // for more information. - string gce_pd_kms_key_name = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The Cloud KMS key resource name to use for cluster persistent - // disk and job argument encryption. See [Use CMEK with cluster data] - // (https://cloud.google.com//dataproc/docs/concepts/configuring-clusters/customer-managed-encryption#use_cmek_with_cluster_data) - // for more information. - // - // When this key resource name is provided, the following job arguments of - // the following job types submitted to the cluster are encrypted using CMEK: - // - // * [FlinkJob - // args](https://cloud.google.com/dataproc/docs/reference/rest/v1/FlinkJob) - // * [HadoopJob - // args](https://cloud.google.com/dataproc/docs/reference/rest/v1/HadoopJob) - // * [SparkJob - // args](https://cloud.google.com/dataproc/docs/reference/rest/v1/SparkJob) - // * [SparkRJob - // args](https://cloud.google.com/dataproc/docs/reference/rest/v1/SparkRJob) - // * [PySparkJob - // args](https://cloud.google.com/dataproc/docs/reference/rest/v1/PySparkJob) - // * [SparkSqlJob](https://cloud.google.com/dataproc/docs/reference/rest/v1/SparkSqlJob) - // scriptVariables and queryList.queries - // * [HiveJob](https://cloud.google.com/dataproc/docs/reference/rest/v1/HiveJob) - // scriptVariables and queryList.queries - // * [PigJob](https://cloud.google.com/dataproc/docs/reference/rest/v1/PigJob) - // scriptVariables and queryList.queries - // * [PrestoJob](https://cloud.google.com/dataproc/docs/reference/rest/v1/PrestoJob) - // scriptVariables and queryList.queries - string kms_key = 2 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - } - ]; -} - -// Common config settings for resources of Compute Engine cluster -// instances, applicable to all instances in the cluster. -message GceClusterConfig { - // `PrivateIpv6GoogleAccess` controls whether and how Dataproc cluster nodes - // can communicate with Google Services through gRPC over IPv6. - // These values are directly mapped to corresponding values in the - // [Compute Engine Instance - // fields](https://cloud.google.com/compute/docs/reference/rest/v1/instances). - enum PrivateIpv6GoogleAccess { - // If unspecified, Compute Engine default behavior will apply, which - // is the same as - // [INHERIT_FROM_SUBNETWORK][google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccess.INHERIT_FROM_SUBNETWORK]. - PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED = 0; - - // Private access to and from Google Services configuration - // inherited from the subnetwork configuration. This is the - // default Compute Engine behavior. - INHERIT_FROM_SUBNETWORK = 1; - - // Enables outbound private IPv6 access to Google Services from the Dataproc - // cluster. - OUTBOUND = 2; - - // Enables bidirectional private IPv6 access between Google Services and the - // Dataproc cluster. - BIDIRECTIONAL = 3; - } - - // Optional. The Compute Engine zone where the Dataproc cluster will be - // located. If omitted, the service will pick a zone in the cluster's Compute - // Engine region. On a get request, zone will always be present. - // - // A full URL, partial URI, or short name are valid. Examples: - // - // * `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]` - // * `projects/[project_id]/zones/[zone]` - // * `[zone]` - string zone_uri = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The Compute Engine network to be used for machine - // communications. Cannot be specified with subnetwork_uri. If neither - // `network_uri` nor `subnetwork_uri` is specified, the "default" network of - // the project is used, if it exists. Cannot be a "Custom Subnet Network" (see - // [Using Subnetworks](https://cloud.google.com/compute/docs/subnetworks) for - // more information). - // - // A full URL, partial URI, or short name are valid. Examples: - // - // * `https://www.googleapis.com/compute/v1/projects/[project_id]/global/networks/default` - // * `projects/[project_id]/global/networks/default` - // * `default` - string network_uri = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The Compute Engine subnetwork to be used for machine - // communications. Cannot be specified with network_uri. - // - // A full URL, partial URI, or short name are valid. Examples: - // - // * `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/[region]/subnetworks/sub0` - // * `projects/[project_id]/regions/[region]/subnetworks/sub0` - // * `sub0` - string subnetwork_uri = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. This setting applies to subnetwork-enabled networks. It is set to - // `true` by default in clusters created with image versions 2.2.x. - // - // When set to `true`: - // - // * All cluster VMs have internal IP addresses. - // * [Google Private Access] - // (https://cloud.google.com/vpc/docs/private-google-access) - // must be enabled to access Dataproc and other Google Cloud APIs. - // * Off-cluster dependencies must be configured to be accessible - // without external IP addresses. - // - // When set to `false`: - // - // * Cluster VMs are not restricted to internal IP addresses. - // * Ephemeral external IP addresses are assigned to each cluster VM. - optional bool internal_ip_only = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The type of IPv6 access for a cluster. - PrivateIpv6GoogleAccess private_ipv6_google_access = 12 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The [Dataproc service - // account](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/service-accounts#service_accounts_in_dataproc) - // (also see [VM Data Plane - // identity](https://cloud.google.com/dataproc/docs/concepts/iam/dataproc-principals#vm_service_account_data_plane_identity)) - // used by Dataproc cluster VM instances to access Google Cloud Platform - // services. - // - // If not specified, the - // [Compute Engine default service - // account](https://cloud.google.com/compute/docs/access/service-accounts#default_service_account) - // is used. - string service_account = 8 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The URIs of service account scopes to be included in - // Compute Engine instances. The following base set of scopes is always - // included: - // - // * https://www.googleapis.com/auth/cloud.useraccounts.readonly - // * https://www.googleapis.com/auth/devstorage.read_write - // * https://www.googleapis.com/auth/logging.write - // - // If no scopes are specified, the following defaults are also provided: - // - // * https://www.googleapis.com/auth/bigquery - // * https://www.googleapis.com/auth/bigtable.admin.table - // * https://www.googleapis.com/auth/bigtable.data - // * https://www.googleapis.com/auth/devstorage.full_control - repeated string service_account_scopes = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // The Compute Engine network tags to add to all instances (see [Tagging - // instances](https://cloud.google.com/vpc/docs/add-remove-network-tags)). - repeated string tags = 4; - - // Optional. The Compute Engine metadata entries to add to all instances (see - // [Project and instance - // metadata](https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)). - map metadata = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Reservation Affinity for consuming Zonal reservation. - ReservationAffinity reservation_affinity = 11 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Node Group Affinity for sole-tenant clusters. - NodeGroupAffinity node_group_affinity = 13 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Shielded Instance Config for clusters using [Compute Engine - // Shielded - // VMs](https://cloud.google.com/security/shielded-cloud/shielded-vm). - ShieldedInstanceConfig shielded_instance_config = 14 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Confidential Instance Config for clusters using [Confidential - // VMs](https://cloud.google.com/compute/confidential-vm/docs). - ConfidentialInstanceConfig confidential_instance_config = 15 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Node Group Affinity for clusters using sole-tenant node groups. -// **The Dataproc `NodeGroupAffinity` resource is not related to the -// Dataproc [NodeGroup][google.cloud.dataproc.v1.NodeGroup] resource.** -message NodeGroupAffinity { - // Required. The URI of a - // sole-tenant [node group - // resource](https://cloud.google.com/compute/docs/reference/rest/v1/nodeGroups) - // that the cluster will be created on. - // - // A full URL, partial URI, or node group name are valid. Examples: - // - // * `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]/nodeGroups/node-group-1` - // * `projects/[project_id]/zones/[zone]/nodeGroups/node-group-1` - // * `node-group-1` - string node_group_uri = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Shielded Instance Config for clusters using [Compute Engine Shielded -// VMs](https://cloud.google.com/security/shielded-cloud/shielded-vm). -message ShieldedInstanceConfig { - // Optional. Defines whether instances have Secure Boot enabled. - optional bool enable_secure_boot = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Defines whether instances have the vTPM enabled. - optional bool enable_vtpm = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Defines whether instances have integrity monitoring enabled. - optional bool enable_integrity_monitoring = 3 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Confidential Instance Config for clusters using [Confidential -// VMs](https://cloud.google.com/compute/confidential-vm/docs) -message ConfidentialInstanceConfig { - // Optional. Defines whether the instance should have confidential compute - // enabled. - bool enable_confidential_compute = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// The config settings for Compute Engine resources in -// an instance group, such as a master or worker group. -message InstanceGroupConfig { - // Controls the use of preemptible instances within the group. - enum Preemptibility { - // Preemptibility is unspecified, the system will choose the - // appropriate setting for each instance group. - PREEMPTIBILITY_UNSPECIFIED = 0; - - // Instances are non-preemptible. - // - // This option is allowed for all instance groups and is the only valid - // value for Master and Worker instance groups. - NON_PREEMPTIBLE = 1; - - // Instances are [preemptible] - // (https://cloud.google.com/compute/docs/instances/preemptible). - // - // This option is allowed only for [secondary worker] - // (https://cloud.google.com/dataproc/docs/concepts/compute/secondary-vms) - // groups. - PREEMPTIBLE = 2; - - // Instances are [Spot VMs] - // (https://cloud.google.com/compute/docs/instances/spot). - // - // This option is allowed only for [secondary worker] - // (https://cloud.google.com/dataproc/docs/concepts/compute/secondary-vms) - // groups. Spot VMs are the latest version of [preemptible VMs] - // (https://cloud.google.com/compute/docs/instances/preemptible), and - // provide additional features. - SPOT = 3; - } - - // Optional. The number of VM instances in the instance group. - // For [HA - // cluster](/dataproc/docs/concepts/configuring-clusters/high-availability) - // [master_config](#FIELDS.master_config) groups, **must be set to 3**. - // For standard cluster [master_config](#FIELDS.master_config) groups, - // **must be set to 1**. - int32 num_instances = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The list of instance names. Dataproc derives the names - // from `cluster_name`, `num_instances`, and the instance group. - repeated string instance_names = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. List of references to Compute Engine instances. - repeated InstanceReference instance_references = 11 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The Compute Engine image resource used for cluster instances. - // - // The URI can represent an image or image family. - // - // Image examples: - // - // * `https://www.googleapis.com/compute/v1/projects/[project_id]/global/images/[image-id]` - // * `projects/[project_id]/global/images/[image-id]` - // * `image-id` - // - // Image family examples. Dataproc will use the most recent - // image from the family: - // - // * `https://www.googleapis.com/compute/v1/projects/[project_id]/global/images/family/[custom-image-family-name]` - // * `projects/[project_id]/global/images/family/[custom-image-family-name]` - // - // If the URI is unspecified, it will be inferred from - // `SoftwareConfig.image_version` or the system default. - string image_uri = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The Compute Engine machine type used for cluster instances. - // - // A full URL, partial URI, or short name are valid. Examples: - // - // * `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]/machineTypes/n1-standard-2` - // * `projects/[project_id]/zones/[zone]/machineTypes/n1-standard-2` - // * `n1-standard-2` - // - // **Auto Zone Exception**: If you are using the Dataproc - // [Auto Zone - // Placement](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/auto-zone#using_auto_zone_placement) - // feature, you must use the short name of the machine type - // resource, for example, `n1-standard-2`. - string machine_type_uri = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Disk option config settings. - DiskConfig disk_config = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Specifies that this instance group contains preemptible - // instances. - bool is_preemptible = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Specifies the preemptibility of the instance group. - // - // The default value for master and worker groups is - // `NON_PREEMPTIBLE`. This default cannot be changed. - // - // The default value for secondary instances is - // `PREEMPTIBLE`. - Preemptibility preemptibility = 10 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The config for Compute Engine Instance Group - // Manager that manages this group. - // This is only used for preemptible instance groups. - ManagedGroupConfig managed_group_config = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The Compute Engine accelerator configuration for these - // instances. - repeated AcceleratorConfig accelerators = 8 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies the minimum cpu platform for the Instance Group. - // See [Dataproc -> Minimum CPU - // Platform](https://cloud.google.com/dataproc/docs/concepts/compute/dataproc-min-cpu). - string min_cpu_platform = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The minimum number of primary worker instances to create. - // If `min_num_instances` is set, cluster creation will succeed if - // the number of primary workers created is at least equal to the - // `min_num_instances` number. - // - // Example: Cluster creation request with `num_instances` = `5` and - // `min_num_instances` = `3`: - // - // * If 4 VMs are created and 1 instance fails, - // the failed VM is deleted. The cluster is - // resized to 4 instances and placed in a `RUNNING` state. - // * If 2 instances are created and 3 instances fail, - // the cluster in placed in an `ERROR` state. The failed VMs - // are not deleted. - int32 min_num_instances = 12 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Instance flexibility Policy allowing a mixture of VM shapes and - // provisioning models. - InstanceFlexibilityPolicy instance_flexibility_policy = 13 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Configuration to handle the startup of instances during cluster - // create and update process. - StartupConfig startup_config = 14 [(google.api.field_behavior) = OPTIONAL]; -} - -// Configuration to handle the startup of instances during cluster create and -// update process. -message StartupConfig { - // Optional. The config setting to enable cluster creation/ updation to be - // successful only after required_registration_fraction of instances are up - // and running. This configuration is applicable to only secondary workers for - // now. The cluster will fail if required_registration_fraction of instances - // are not available. This will include instance creation, agent registration, - // and service registration (if enabled). - optional double required_registration_fraction = 1 - [(google.api.field_behavior) = OPTIONAL]; -} - -// A reference to a Compute Engine instance. -message InstanceReference { - // The user-friendly name of the Compute Engine instance. - string instance_name = 1; - - // The unique identifier of the Compute Engine instance. - string instance_id = 2; - - // The public RSA key used for sharing data with this instance. - string public_key = 3; - - // The public ECIES key used for sharing data with this instance. - string public_ecies_key = 4; -} - -// Specifies the resources used to actively manage an instance group. -message ManagedGroupConfig { - // Output only. The name of the Instance Template used for the Managed - // Instance Group. - string instance_template_name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The name of the Instance Group Manager for this group. - string instance_group_manager_name = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The partial URI to the instance group manager for this group. - // E.g. projects/my-project/regions/us-central1/instanceGroupManagers/my-igm. - string instance_group_manager_uri = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Instance flexibility Policy allowing a mixture of VM shapes and provisioning -// models. -message InstanceFlexibilityPolicy { - // Defines how Dataproc should create VMs with a mixture of provisioning - // models. - message ProvisioningModelMix { - // Optional. The base capacity that will always use Standard VMs to avoid - // risk of more preemption than the minimum capacity you need. Dataproc will - // create only standard VMs until it reaches standard_capacity_base, then it - // will start using standard_capacity_percent_above_base to mix Spot with - // Standard VMs. eg. If 15 instances are requested and - // standard_capacity_base is 5, Dataproc will create 5 standard VMs and then - // start mixing spot and standard VMs for remaining 10 instances. - optional int32 standard_capacity_base = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The percentage of target capacity that should use Standard VM. - // The remaining percentage will use Spot VMs. The percentage applies only - // to the capacity above standard_capacity_base. eg. If 15 instances are - // requested and standard_capacity_base is 5 and - // standard_capacity_percent_above_base is 30, Dataproc will create 5 - // standard VMs and then start mixing spot and standard VMs for remaining 10 - // instances. The mix will be 30% standard and 70% spot. - optional int32 standard_capacity_percent_above_base = 2 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Defines machines types and a rank to which the machines types belong. - message InstanceSelection { - // Optional. Full machine-type names, e.g. "n1-standard-16". - repeated string machine_types = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Preference of this instance selection. Lower number means - // higher preference. Dataproc will first try to create a VM based on the - // machine-type with priority rank and fallback to next rank based on - // availability. Machine types and instance selections with the same - // priority have the same preference. - int32 rank = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // Defines a mapping from machine types to the number of VMs that are created - // with each machine type. - message InstanceSelectionResult { - // Output only. Full machine-type names, e.g. "n1-standard-16". - optional string machine_type = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Number of VM provisioned with the machine_type. - optional int32 vm_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Optional. Defines how the Group selects the provisioning model to ensure - // required reliability. - ProvisioningModelMix provisioning_model_mix = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. List of instance selection options that the group will use when - // creating new VMs. - repeated InstanceSelection instance_selection_list = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. A list of instance selection results in the group. - repeated InstanceSelectionResult instance_selection_results = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Specifies the type and number of accelerator cards attached to the instances -// of an instance. See [GPUs on Compute -// Engine](https://cloud.google.com/compute/docs/gpus/). -message AcceleratorConfig { - // Full URL, partial URI, or short name of the accelerator type resource to - // expose to this instance. See - // [Compute Engine - // AcceleratorTypes](https://cloud.google.com/compute/docs/reference/v1/acceleratorTypes). - // - // Examples: - // - // * `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]/acceleratorTypes/nvidia-tesla-t4` - // * `projects/[project_id]/zones/[zone]/acceleratorTypes/nvidia-tesla-t4` - // * `nvidia-tesla-t4` - // - // **Auto Zone Exception**: If you are using the Dataproc - // [Auto Zone - // Placement](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/auto-zone#using_auto_zone_placement) - // feature, you must use the short name of the accelerator type - // resource, for example, `nvidia-tesla-t4`. - string accelerator_type_uri = 1; - - // The number of the accelerator cards of this type exposed to this instance. - int32 accelerator_count = 2; -} - -// Specifies the config of disk options for a group of VM instances. -message DiskConfig { - // Optional. Type of the boot disk (default is "pd-standard"). - // Valid values: "pd-balanced" (Persistent Disk Balanced Solid State Drive), - // "pd-ssd" (Persistent Disk Solid State Drive), - // or "pd-standard" (Persistent Disk Hard Disk Drive). - // See [Disk types](https://cloud.google.com/compute/docs/disks#disk-types). - string boot_disk_type = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Size in GB of the boot disk (default is 500GB). - int32 boot_disk_size_gb = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Number of attached SSDs, from 0 to 8 (default is 0). - // If SSDs are not attached, the boot disk is used to store runtime logs and - // [HDFS](https://hadoop.apache.org/docs/r1.2.1/hdfs_user_guide.html) data. - // If one or more SSDs are attached, this runtime bulk - // data is spread across them, and the boot disk contains only basic - // config and installed binaries. - // - // Note: Local SSD options may vary by machine type and number of vCPUs - // selected. - int32 num_local_ssds = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Interface type of local SSDs (default is "scsi"). - // Valid values: "scsi" (Small Computer System Interface), - // "nvme" (Non-Volatile Memory Express). - // See [local SSD - // performance](https://cloud.google.com/compute/docs/disks/local-ssd#performance). - string local_ssd_interface = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Indicates how many IOPS to provision for the disk. This sets the - // number of I/O operations per second that the disk can handle. Note: This - // field is only supported if boot_disk_type is hyperdisk-balanced. - optional int64 boot_disk_provisioned_iops = 5 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Indicates how much throughput to provision for the disk. This - // sets the number of throughput mb per second that the disk can handle. - // Values must be greater than or equal to 1. Note: This field is only - // supported if boot_disk_type is hyperdisk-balanced. - optional int64 boot_disk_provisioned_throughput = 6 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Node group identification and configuration information. -message AuxiliaryNodeGroup { - // Required. Node group configuration. - NodeGroup node_group = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. A node group ID. Generated if not specified. - // - // The ID must contain only letters (a-z, A-Z), numbers (0-9), - // underscores (_), and hyphens (-). Cannot begin or end with underscore - // or hyphen. Must consist of from 3 to 33 characters. - string node_group_id = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Dataproc Node Group. -// **The Dataproc `NodeGroup` resource is not related to the -// Dataproc [NodeGroupAffinity][google.cloud.dataproc.v1.NodeGroupAffinity] -// resource.** -message NodeGroup { - option (google.api.resource) = { - type: "dataproc.googleapis.com/NodeGroup" - pattern: "projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{node_group}" - }; - - // Node pool roles. - enum Role { - // Required unspecified role. - ROLE_UNSPECIFIED = 0; - - // Job drivers run on the node pool. - DRIVER = 1; - } - - // The Node group [resource name](https://aip.dev/122). - string name = 1; - - // Required. Node group roles. - repeated Role roles = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The node group instance group configuration. - InstanceGroupConfig node_group_config = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Node group labels. - // - // * Label **keys** must consist of from 1 to 63 characters and conform to - // [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). - // * Label **values** can be empty. If specified, they must consist of from - // 1 to 63 characters and conform to [RFC 1035] - // (https://www.ietf.org/rfc/rfc1035.txt). - // * The node group must have no more than 32 labels. - map labels = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Specifies an executable to run on a fully configured node and a -// timeout period for executable completion. -message NodeInitializationAction { - // Required. Cloud Storage URI of executable file. - string executable_file = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Amount of time executable has to complete. Default is - // 10 minutes (see JSON representation of - // [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). - // - // Cluster creation fails with an explanatory error message (the - // name of the executable that caused the error and the exceeded timeout - // period) if the executable is not completed at end of the timeout period. - google.protobuf.Duration execution_timeout = 2 - [(google.api.field_behavior) = OPTIONAL]; -} - -// The status of a cluster and its instances. -message ClusterStatus { - // The cluster state. - enum State { - // The cluster state is unknown. - UNKNOWN = 0; - - // The cluster is being created and set up. It is not ready for use. - CREATING = 1; - - // The cluster is currently running and healthy. It is ready for use. - // - // **Note:** The cluster state changes from "creating" to "running" status - // after the master node(s), first two primary worker nodes (and the last - // primary worker node if primary workers > 2) are running. - RUNNING = 2; - - // The cluster encountered an error. It is not ready for use. - ERROR = 3; - - // The cluster has encountered an error while being updated. Jobs can - // be submitted to the cluster, but the cluster cannot be updated. - ERROR_DUE_TO_UPDATE = 9; - - // The cluster is being deleted. It cannot be used. - DELETING = 4; - - // The cluster is being updated. It continues to accept and process jobs. - UPDATING = 5; - - // The cluster is being stopped. It cannot be used. - STOPPING = 6; - - // The cluster is currently stopped. It is not ready for use. - STOPPED = 7; - - // The cluster is being started. It is not ready for use. - STARTING = 8; - - // The cluster is being repaired. It is not ready for use. - REPAIRING = 10; - } - - // The cluster substate. - enum Substate { - // The cluster substate is unknown. - UNSPECIFIED = 0; - - // The cluster is known to be in an unhealthy state - // (for example, critical daemons are not running or HDFS capacity is - // exhausted). - // - // Applies to RUNNING state. - UNHEALTHY = 1; - - // The agent-reported status is out of date (may occur if - // Dataproc loses communication with Agent). - // - // Applies to RUNNING state. - STALE_STATUS = 2; - } - - // Output only. The cluster's state. - State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Output only. Details of cluster's state. - string detail = 2 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.field_behavior) = OPTIONAL - ]; - - // Output only. Time when this state was entered (see JSON representation of - // [Timestamp](https://developers.google.com/protocol-buffers/docs/proto3#json)). - google.protobuf.Timestamp state_start_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Additional state information that includes - // status reported by the agent. - Substate substate = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Security related configuration, including encryption, Kerberos, etc. -message SecurityConfig { - // Optional. Kerberos related configuration. - KerberosConfig kerberos_config = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Identity related configuration, including service account based - // secure multi-tenancy user mappings. - IdentityConfig identity_config = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Specifies Kerberos related configuration. -message KerberosConfig { - // Optional. Flag to indicate whether to Kerberize the cluster (default: - // false). Set this field to true to enable Kerberos on a cluster. - bool enable_kerberos = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The Cloud Storage URI of a KMS encrypted file containing the root - // principal password. - string root_principal_password_uri = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The URI of the KMS key used to encrypt sensitive - // files. - string kms_key_uri = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The Cloud Storage URI of the keystore file used for SSL - // encryption. If not provided, Dataproc will provide a self-signed - // certificate. - string keystore_uri = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The Cloud Storage URI of the truststore file used for SSL - // encryption. If not provided, Dataproc will provide a self-signed - // certificate. - string truststore_uri = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The Cloud Storage URI of a KMS encrypted file containing the - // password to the user provided keystore. For the self-signed certificate, - // this password is generated by Dataproc. - string keystore_password_uri = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The Cloud Storage URI of a KMS encrypted file containing the - // password to the user provided key. For the self-signed certificate, this - // password is generated by Dataproc. - string key_password_uri = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The Cloud Storage URI of a KMS encrypted file containing the - // password to the user provided truststore. For the self-signed certificate, - // this password is generated by Dataproc. - string truststore_password_uri = 8 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The remote realm the Dataproc on-cluster KDC will trust, should - // the user enable cross realm trust. - string cross_realm_trust_realm = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The KDC (IP or hostname) for the remote trusted realm in a cross - // realm trust relationship. - string cross_realm_trust_kdc = 10 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The admin server (IP or hostname) for the remote trusted realm in - // a cross realm trust relationship. - string cross_realm_trust_admin_server = 11 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The Cloud Storage URI of a KMS encrypted file containing the - // shared password between the on-cluster Kerberos realm and the remote - // trusted realm, in a cross realm trust relationship. - string cross_realm_trust_shared_password_uri = 12 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The Cloud Storage URI of a KMS encrypted file containing the - // master key of the KDC database. - string kdc_db_key_uri = 13 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The lifetime of the ticket granting ticket, in hours. - // If not specified, or user specifies 0, then default value 10 - // will be used. - int32 tgt_lifetime_hours = 14 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The name of the on-cluster Kerberos realm. - // If not specified, the uppercased domain of hostnames will be the realm. - string realm = 15 [(google.api.field_behavior) = OPTIONAL]; -} - -// Identity related configuration, including service account based -// secure multi-tenancy user mappings. -message IdentityConfig { - // Required. Map of user to service account. - map user_service_account_mapping = 1 - [(google.api.field_behavior) = REQUIRED]; -} - -// Specifies the selection and config of software inside the cluster. -message SoftwareConfig { - // Optional. The version of software inside the cluster. It must be one of the - // supported [Dataproc - // Versions](https://cloud.google.com/dataproc/docs/concepts/versioning/dataproc-versions#supported-dataproc-image-versions), - // such as "1.2" (including a subminor version, such as "1.2.29"), or the - // ["preview" - // version](https://cloud.google.com/dataproc/docs/concepts/versioning/dataproc-versions#other_versions). - // If unspecified, it defaults to the latest Debian version. - string image_version = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The properties to set on daemon config files. - // - // Property keys are specified in `prefix:property` format, for example - // `core:hadoop.tmp.dir`. The following are supported prefixes - // and their mappings: - // - // * capacity-scheduler: `capacity-scheduler.xml` - // * core: `core-site.xml` - // * distcp: `distcp-default.xml` - // * hdfs: `hdfs-site.xml` - // * hive: `hive-site.xml` - // * mapred: `mapred-site.xml` - // * pig: `pig.properties` - // * spark: `spark-defaults.conf` - // * yarn: `yarn-site.xml` - // - // For more information, see [Cluster - // properties](https://cloud.google.com/dataproc/docs/concepts/cluster-properties). - map properties = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The set of components to activate on the cluster. - repeated Component optional_components = 3 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Specifies the cluster auto-delete schedule configuration. -message LifecycleConfig { - // Optional. The duration to keep the cluster alive while idling (when no jobs - // are running). Passing this threshold will cause the cluster to be - // deleted. Minimum value is 5 minutes; maximum value is 14 days (see JSON - // representation of - // [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). - google.protobuf.Duration idle_delete_ttl = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Either the exact time the cluster should be deleted at or - // the cluster maximum age. - oneof ttl { - // Optional. The time when cluster will be auto-deleted (see JSON - // representation of - // [Timestamp](https://developers.google.com/protocol-buffers/docs/proto3#json)). - google.protobuf.Timestamp auto_delete_time = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The lifetime duration of cluster. The cluster will be - // auto-deleted at the end of this period. Minimum value is 10 minutes; - // maximum value is 14 days (see JSON representation of - // [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). - google.protobuf.Duration auto_delete_ttl = 3 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Optional. The duration to keep the cluster started while idling (when no - // jobs are running). Passing this threshold will cause the cluster to be - // stopped. Minimum value is 5 minutes; maximum value is 14 days (see JSON - // representation of - // [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). - google.protobuf.Duration idle_stop_ttl = 5 - [(google.api.field_behavior) = OPTIONAL]; - - // Either the exact time the cluster should be stopped at or - // the cluster maximum age. - oneof stop_ttl { - // Optional. The time when cluster will be auto-stopped (see JSON - // representation of - // [Timestamp](https://developers.google.com/protocol-buffers/docs/proto3#json)). - google.protobuf.Timestamp auto_stop_time = 6 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The lifetime duration of the cluster. The cluster will be - // auto-stopped at the end of this period, calculated from the time of - // submission of the create or update cluster request. Minimum value is 10 - // minutes; maximum value is 14 days (see JSON representation of - // [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). - google.protobuf.Duration auto_stop_ttl = 7 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Output only. The time when cluster became idle (most recent job finished) - // and became eligible for deletion due to idleness (see JSON representation - // of - // [Timestamp](https://developers.google.com/protocol-buffers/docs/proto3#json)). - google.protobuf.Timestamp idle_start_time = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Specifies a Metastore configuration. -message MetastoreConfig { - // Required. Resource name of an existing Dataproc Metastore service. - // - // Example: - // - // * `projects/[project_id]/locations/[dataproc_region]/services/[service-name]` - string dataproc_metastore_service = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "metastore.googleapis.com/Service" - } - ]; -} - -// Contains cluster daemon metrics, such as HDFS and YARN stats. -// -// **Beta Feature**: This report is available for testing purposes only. It may -// be changed before final release. -message ClusterMetrics { - // The HDFS metrics. - map hdfs_metrics = 1; - - // YARN metrics. - map yarn_metrics = 2; -} - -// Dataproc metric config. -message DataprocMetricConfig { - // A source for the collection of Dataproc custom metrics (see [Custom - // metrics] - // (https://cloud.google.com//dataproc/docs/guides/dataproc-metrics#custom_metrics)). - enum MetricSource { - // Required unspecified metric source. - METRIC_SOURCE_UNSPECIFIED = 0; - - // Monitoring agent metrics. If this source is enabled, - // Dataproc enables the monitoring agent in Compute Engine, - // and collects monitoring agent metrics, which are published - // with an `agent.googleapis.com` prefix. - MONITORING_AGENT_DEFAULTS = 1; - - // HDFS metric source. - HDFS = 2; - - // Spark metric source. - SPARK = 3; - - // YARN metric source. - YARN = 4; - - // Spark History Server metric source. - SPARK_HISTORY_SERVER = 5; - - // Hiveserver2 metric source. - HIVESERVER2 = 6; - - // hivemetastore metric source - HIVEMETASTORE = 7; - - // flink metric source - FLINK = 8; - } - - // A Dataproc custom metric. - message Metric { - // Required. A standard set of metrics is collected unless `metricOverrides` - // are specified for the metric source (see [Custom metrics] - // (https://cloud.google.com/dataproc/docs/guides/dataproc-metrics#custom_metrics) - // for more information). - MetricSource metric_source = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Specify one or more [Custom metrics] - // (https://cloud.google.com/dataproc/docs/guides/dataproc-metrics#custom_metrics) - // to collect for the metric course (for the `SPARK` metric source (any - // [Spark metric] - // (https://spark.apache.org/docs/latest/monitoring.html#metrics) can be - // specified). - // - // Provide metrics in the following format: - // METRIC_SOURCE:INSTANCE:GROUP:METRIC - // Use camelcase as appropriate. - // - // Examples: - // - // ``` - // yarn:ResourceManager:QueueMetrics:AppsCompleted - // spark:driver:DAGScheduler:job.allJobs - // sparkHistoryServer:JVM:Memory:NonHeapMemoryUsage.committed - // hiveserver2:JVM:Memory:NonHeapMemoryUsage.used - // ``` - // - // Notes: - // - // * Only the specified overridden metrics are collected for the - // metric source. For example, if one or more `spark:executive` metrics - // are listed as metric overrides, other `SPARK` metrics are not - // collected. The collection of the metrics for other enabled custom - // metric sources is unaffected. For example, if both `SPARK` andd `YARN` - // metric sources are enabled, and overrides are provided for Spark - // metrics only, all YARN metrics are collected. - repeated string metric_overrides = 2 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Required. Metrics sources to enable. - repeated Metric metrics = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// A request to create a cluster. -message CreateClusterRequest { - // Required. The ID of the Google Cloud Platform project that the cluster - // belongs to. - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The Dataproc region in which to handle the request. - string region = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. The cluster to create. - Cluster cluster = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. A unique ID used to identify the request. If the server receives - // two - // [CreateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateClusterRequest)s - // with the same id, then the second request will be ignored and the - // first [google.longrunning.Operation][google.longrunning.Operation] created - // and stored in the backend is returned. - // - // It is recommended to always set this value to a - // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - // - // The ID must contain only letters (a-z, A-Z), numbers (0-9), - // underscores (_), and hyphens (-). The maximum length is 40 characters. - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Failure action when primary worker creation fails. - FailureAction action_on_failed_primary_workers = 5 - [(google.api.field_behavior) = OPTIONAL]; -} - -// A request to update a cluster. -message UpdateClusterRequest { - // Required. The ID of the Google Cloud Platform project the - // cluster belongs to. - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The Dataproc region in which to handle the request. - string region = 5 [(google.api.field_behavior) = REQUIRED]; - - // Required. The cluster name. - string cluster_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The changes to the cluster. - Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Timeout for graceful YARN decommissioning. Graceful - // decommissioning allows removing nodes from the cluster without - // interrupting jobs in progress. Timeout specifies how long to wait for jobs - // in progress to finish before forcefully removing nodes (and potentially - // interrupting jobs). Default timeout is 0 (for forceful decommission), and - // the maximum allowed timeout is 1 day. (see JSON representation of - // [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). - // - // Only supported on Dataproc image versions 1.2 and higher. - google.protobuf.Duration graceful_decommission_timeout = 6 - [(google.api.field_behavior) = OPTIONAL]; - - // Required. Specifies the path, relative to `Cluster`, of - // the field to update. For example, to change the number of workers - // in a cluster to 5, the `update_mask` parameter would be - // specified as `config.worker_config.num_instances`, - // and the `PATCH` request body would specify the new value, as follows: - // - // { - // "config":{ - // "workerConfig":{ - // "numInstances":"5" - // } - // } - // } - // Similarly, to change the number of preemptible workers in a cluster to 5, - // the `update_mask` parameter would be - // `config.secondary_worker_config.num_instances`, and the `PATCH` request - // body would be set as follows: - // - // { - // "config":{ - // "secondaryWorkerConfig":{ - // "numInstances":"5" - // } - // } - // } - // Note: Currently, only the following fields can be updated: - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - //
MaskPurpose
labelsUpdate labels
config.worker_config.num_instancesResize primary worker group
config.secondary_worker_config.num_instancesResize secondary worker group
config.autoscaling_config.policy_uriUse, stop using, or - // change autoscaling policies
- google.protobuf.FieldMask update_mask = 4 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. A unique ID used to identify the request. If the server - // receives two - // [UpdateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.UpdateClusterRequest)s - // with the same id, then the second request will be ignored and the - // first [google.longrunning.Operation][google.longrunning.Operation] created - // and stored in the backend is returned. - // - // It is recommended to always set this value to a - // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - // - // The ID must contain only letters (a-z, A-Z), numbers (0-9), - // underscores (_), and hyphens (-). The maximum length is 40 characters. - string request_id = 7 [(google.api.field_behavior) = OPTIONAL]; -} - -// A request to stop a cluster. -message StopClusterRequest { - // Required. The ID of the Google Cloud Platform project the - // cluster belongs to. - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The Dataproc region in which to handle the request. - string region = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The cluster name. - string cluster_name = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Specifying the `cluster_uuid` means the RPC will fail - // (with error NOT_FOUND) if a cluster with the specified UUID does not exist. - string cluster_uuid = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A unique ID used to identify the request. If the server - // receives two - // [StopClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StopClusterRequest)s - // with the same id, then the second request will be ignored and the - // first [google.longrunning.Operation][google.longrunning.Operation] created - // and stored in the backend is returned. - // - // Recommendation: Set this value to a - // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - // - // The ID must contain only letters (a-z, A-Z), numbers (0-9), - // underscores (_), and hyphens (-). The maximum length is 40 characters. - string request_id = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// A request to start a cluster. -message StartClusterRequest { - // Required. The ID of the Google Cloud Platform project the - // cluster belongs to. - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The Dataproc region in which to handle the request. - string region = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The cluster name. - string cluster_name = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Specifying the `cluster_uuid` means the RPC will fail - // (with error NOT_FOUND) if a cluster with the specified UUID does not exist. - string cluster_uuid = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A unique ID used to identify the request. If the server - // receives two - // [StartClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StartClusterRequest)s - // with the same id, then the second request will be ignored and the - // first [google.longrunning.Operation][google.longrunning.Operation] created - // and stored in the backend is returned. - // - // Recommendation: Set this value to a - // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - // - // The ID must contain only letters (a-z, A-Z), numbers (0-9), - // underscores (_), and hyphens (-). The maximum length is 40 characters. - string request_id = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// A request to delete a cluster. -message DeleteClusterRequest { - // Required. The ID of the Google Cloud Platform project that the cluster - // belongs to. - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The Dataproc region in which to handle the request. - string region = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. The cluster name. - string cluster_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Specifying the `cluster_uuid` means the RPC should fail - // (with error NOT_FOUND) if cluster with specified UUID does not exist. - string cluster_uuid = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A unique ID used to identify the request. If the server - // receives two - // [DeleteClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteClusterRequest)s - // with the same id, then the second request will be ignored and the - // first [google.longrunning.Operation][google.longrunning.Operation] created - // and stored in the backend is returned. - // - // It is recommended to always set this value to a - // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - // - // The ID must contain only letters (a-z, A-Z), numbers (0-9), - // underscores (_), and hyphens (-). The maximum length is 40 characters. - string request_id = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request to get the resource representation for a cluster in a project. -message GetClusterRequest { - // Required. The ID of the Google Cloud Platform project that the cluster - // belongs to. - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The Dataproc region in which to handle the request. - string region = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. The cluster name. - string cluster_name = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// A request to list the clusters in a project. -message ListClustersRequest { - // Required. The ID of the Google Cloud Platform project that the cluster - // belongs to. - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The Dataproc region in which to handle the request. - string region = 4 [(google.api.field_behavior) = REQUIRED]; - - // Optional. A filter constraining the clusters to list. Filters are - // case-sensitive and have the following syntax: - // - // field = value [AND [field = value]] ... - // - // where **field** is one of `status.state`, `clusterName`, or `labels.[KEY]`, - // and `[KEY]` is a label key. **value** can be `*` to match all values. - // `status.state` can be one of the following: `ACTIVE`, `INACTIVE`, - // `CREATING`, `RUNNING`, `ERROR`, `DELETING`, `UPDATING`, `STOPPING`, or - // `STOPPED`. `ACTIVE` contains the `CREATING`, `UPDATING`, and `RUNNING` - // states. `INACTIVE` contains the `DELETING`, `ERROR`, `STOPPING`, and - // `STOPPED` states. `clusterName` is the name of the cluster provided at - // creation time. Only the logical `AND` operator is supported; - // space-separated items are treated as having an implicit `AND` operator. - // - // Example filter: - // - // status.state = ACTIVE AND clusterName = mycluster - // AND labels.env = staging AND labels.starred = * - string filter = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The standard List page size. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The standard List page token. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// The list of all clusters in a project. -message ListClustersResponse { - // Output only. The clusters in the project. - repeated Cluster clusters = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. This token is included in the response if there are more - // results to fetch. To fetch additional results, provide this value as the - // `page_token` in a subsequent `ListClustersRequest`. - string next_page_token = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// A request to collect cluster diagnostic information. -message DiagnoseClusterRequest { - // Defines who has access to the diagnostic tarball - enum TarballAccess { - // Tarball Access unspecified. Falls back to default access of the bucket - TARBALL_ACCESS_UNSPECIFIED = 0; - - // Google Cloud Support group has read access to the - // diagnostic tarball - GOOGLE_CLOUD_SUPPORT = 1; - - // Google Cloud Dataproc Diagnose service account has read access to the - // diagnostic tarball - GOOGLE_DATAPROC_DIAGNOSE = 2; - } - - // Required. The ID of the Google Cloud Platform project that the cluster - // belongs to. - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The Dataproc region in which to handle the request. - string region = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. The cluster name. - string cluster_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. (Optional) The output Cloud Storage directory for the diagnostic - // tarball. If not specified, a task-specific directory in the cluster's - // staging bucket will be used. - string tarball_gcs_dir = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. (Optional) The access type to the diagnostic tarball. If not - // specified, falls back to default access of the bucket - TarballAccess tarball_access = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Time interval in which diagnosis should be carried out on the - // cluster. - google.type.Interval diagnosis_interval = 6 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies a list of jobs on which diagnosis is to be performed. - // Format: projects/{project}/regions/{region}/jobs/{job} - repeated string jobs = 10 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies a list of yarn applications on which diagnosis is to be - // performed. - repeated string yarn_application_ids = 11 - [(google.api.field_behavior) = OPTIONAL]; -} - -// The location of diagnostic output. -message DiagnoseClusterResults { - // Output only. The Cloud Storage URI of the diagnostic output. - // The output report is a plain text file with a summary of collected - // diagnostics. - string output_uri = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Reservation Affinity for consuming Zonal reservation. -message ReservationAffinity { - // Indicates whether to consume capacity from an reservation or not. - enum Type { - TYPE_UNSPECIFIED = 0; - - // Do not consume from any allocated capacity. - NO_RESERVATION = 1; - - // Consume any reservation available. - ANY_RESERVATION = 2; - - // Must consume from a specific reservation. Must specify key value fields - // for specifying the reservations. - SPECIFIC_RESERVATION = 3; - } - - // Optional. Type of reservation to consume - Type consume_reservation_type = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Corresponds to the label key of reservation resource. - string key = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Corresponds to the label values of reservation resource. - repeated string values = 3 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/jobs.proto b/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/jobs.proto deleted file mode 100644 index badfb5382b64..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/jobs.proto +++ /dev/null @@ -1,1045 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.dataproc.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpb"; -option java_multiple_files = true; -option java_outer_classname = "JobsProto"; -option java_package = "com.google.cloud.dataproc.v1"; - -// The JobController provides methods to manage jobs. -service JobController { - option (google.api.default_host) = "dataproc.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Submits a job to a cluster. - rpc SubmitJob(SubmitJobRequest) returns (Job) { - option (google.api.http) = { - post: "/v1/projects/{project_id}/regions/{region}/jobs:submit" - body: "*" - }; - option (google.api.method_signature) = "project_id,region,job"; - } - - // Submits job to a cluster. - rpc SubmitJobAsOperation(SubmitJobRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/projects/{project_id}/regions/{region}/jobs:submitAsOperation" - body: "*" - }; - option (google.api.method_signature) = "project_id, region, job"; - option (google.longrunning.operation_info) = { - response_type: "Job" - metadata_type: "JobMetadata" - }; - } - - // Gets the resource representation for a job in a project. - rpc GetJob(GetJobRequest) returns (Job) { - option (google.api.http) = { - get: "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}" - }; - option (google.api.method_signature) = "project_id,region,job_id"; - } - - // Lists regions/{region}/jobs in a project. - rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) { - option (google.api.http) = { - get: "/v1/projects/{project_id}/regions/{region}/jobs" - }; - option (google.api.method_signature) = "project_id,region"; - option (google.api.method_signature) = "project_id,region,filter"; - } - - // Updates a job in a project. - rpc UpdateJob(UpdateJobRequest) returns (Job) { - option (google.api.http) = { - patch: "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}" - body: "job" - }; - } - - // Starts a job cancellation request. To access the job resource - // after cancellation, call - // [regions/{region}/jobs.list](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/list) - // or - // [regions/{region}/jobs.get](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/get). - rpc CancelJob(CancelJobRequest) returns (Job) { - option (google.api.http) = { - post: "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}:cancel" - body: "*" - }; - option (google.api.method_signature) = "project_id,region,job_id"; - } - - // Deletes the job from the project. If the job is active, the delete fails, - // and the response returns `FAILED_PRECONDITION`. - rpc DeleteJob(DeleteJobRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}" - }; - option (google.api.method_signature) = "project_id,region,job_id"; - } -} - -// The runtime logging config of the job. -message LoggingConfig { - // The Log4j level for job execution. When running an - // [Apache Hive](https://hive.apache.org/) job, Cloud - // Dataproc configures the Hive client to an equivalent verbosity level. - enum Level { - // Level is unspecified. Use default level for log4j. - LEVEL_UNSPECIFIED = 0; - - // Use ALL level for log4j. - ALL = 1; - - // Use TRACE level for log4j. - TRACE = 2; - - // Use DEBUG level for log4j. - DEBUG = 3; - - // Use INFO level for log4j. - INFO = 4; - - // Use WARN level for log4j. - WARN = 5; - - // Use ERROR level for log4j. - ERROR = 6; - - // Use FATAL level for log4j. - FATAL = 7; - - // Turn off log4j. - OFF = 8; - } - - // The per-package log levels for the driver. This can include - // "root" package name to configure rootLogger. - // Examples: - // - 'com.google = FATAL' - // - 'root = INFO' - // - 'org.apache = DEBUG' - map driver_log_levels = 2; -} - -// A Dataproc job for running -// [Apache Hadoop -// MapReduce](https://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html) -// jobs on [Apache Hadoop -// YARN](https://hadoop.apache.org/docs/r2.7.1/hadoop-yarn/hadoop-yarn-site/YARN.html). -message HadoopJob { - // Required. Indicates the location of the driver's main class. Specify - // either the jar file that contains the main class or the main class name. - // To specify both, add the jar file to `jar_file_uris`, and then specify - // the main class name in this property. - oneof driver { - // The HCFS URI of the jar file containing the main class. - // Examples: - // 'gs://foo-bucket/analytics-binaries/extract-useful-metrics-mr.jar' - // 'hdfs:/tmp/test-samples/custom-wordcount.jar' - // 'file:///home/usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar' - string main_jar_file_uri = 1; - - // The name of the driver's main class. The jar file containing the class - // must be in the default CLASSPATH or specified in `jar_file_uris`. - string main_class = 2; - } - - // Optional. The arguments to pass to the driver. Do not - // include arguments, such as `-libjars` or `-Dfoo=bar`, that can be set as - // job properties, since a collision might occur that causes an incorrect job - // submission. - repeated string args = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Jar file URIs to add to the CLASSPATHs of the - // Hadoop driver and tasks. - repeated string jar_file_uris = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. HCFS (Hadoop Compatible Filesystem) URIs of files to be copied - // to the working directory of Hadoop drivers and distributed tasks. Useful - // for naively parallel tasks. - repeated string file_uris = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. HCFS URIs of archives to be extracted in the working directory of - // Hadoop drivers and tasks. Supported file types: - // .jar, .tar, .tar.gz, .tgz, or .zip. - repeated string archive_uris = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A mapping of property names to values, used to configure Hadoop. - // Properties that conflict with values set by the Dataproc API might be - // overwritten. Can include properties set in `/etc/hadoop/conf/*-site` and - // classes in user code. - map properties = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The runtime log config for job execution. - LoggingConfig logging_config = 8 [(google.api.field_behavior) = OPTIONAL]; -} - -// A Dataproc job for running [Apache Spark](https://spark.apache.org/) -// applications on YARN. -message SparkJob { - // Required. The specification of the main method to call to drive the job. - // Specify either the jar file that contains the main class or the main class - // name. To pass both a main jar and a main class in that jar, add the jar to - // [jarFileUris][google.cloud.dataproc.v1.SparkJob.jar_file_uris], and then - // specify the main class name in - // [mainClass][google.cloud.dataproc.v1.SparkJob.main_class]. - oneof driver { - // The HCFS URI of the jar file that contains the main class. - string main_jar_file_uri = 1; - - // The name of the driver's main class. The jar file that contains the class - // must be in the default CLASSPATH or specified in - // SparkJob.jar_file_uris. - string main_class = 2; - } - - // Optional. The arguments to pass to the driver. Do not include arguments, - // such as `--conf`, that can be set as job properties, since a collision may - // occur that causes an incorrect job submission. - repeated string args = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. HCFS URIs of jar files to add to the CLASSPATHs of the - // Spark driver and tasks. - repeated string jar_file_uris = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. HCFS URIs of files to be placed in the working directory of - // each executor. Useful for naively parallel tasks. - repeated string file_uris = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. HCFS URIs of archives to be extracted into the working directory - // of each executor. Supported file types: - // .jar, .tar, .tar.gz, .tgz, and .zip. - repeated string archive_uris = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A mapping of property names to values, used to configure Spark. - // Properties that conflict with values set by the Dataproc API might be - // overwritten. Can include properties set in - // /etc/spark/conf/spark-defaults.conf and classes in user code. - map properties = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The runtime log config for job execution. - LoggingConfig logging_config = 8 [(google.api.field_behavior) = OPTIONAL]; -} - -// A Dataproc job for running -// [Apache -// PySpark](https://spark.apache.org/docs/0.9.0/python-programming-guide.html) -// applications on YARN. -message PySparkJob { - // Required. The HCFS URI of the main Python file to use as the driver. Must - // be a .py file. - string main_python_file_uri = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The arguments to pass to the driver. Do not include arguments, - // such as `--conf`, that can be set as job properties, since a collision may - // occur that causes an incorrect job submission. - repeated string args = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. HCFS file URIs of Python files to pass to the PySpark - // framework. Supported file types: .py, .egg, and .zip. - repeated string python_file_uris = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. HCFS URIs of jar files to add to the CLASSPATHs of the - // Python driver and tasks. - repeated string jar_file_uris = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. HCFS URIs of files to be placed in the working directory of - // each executor. Useful for naively parallel tasks. - repeated string file_uris = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. HCFS URIs of archives to be extracted into the working directory - // of each executor. Supported file types: - // .jar, .tar, .tar.gz, .tgz, and .zip. - repeated string archive_uris = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A mapping of property names to values, used to configure PySpark. - // Properties that conflict with values set by the Dataproc API might be - // overwritten. Can include properties set in - // /etc/spark/conf/spark-defaults.conf and classes in user code. - map properties = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The runtime log config for job execution. - LoggingConfig logging_config = 8 [(google.api.field_behavior) = OPTIONAL]; -} - -// A list of queries to run on a cluster. -message QueryList { - // Required. The queries to execute. You do not need to end a query expression - // with a semicolon. Multiple queries can be specified in one - // string by separating each with a semicolon. Here is an example of a - // Dataproc API snippet that uses a QueryList to specify a HiveJob: - // - // "hiveJob": { - // "queryList": { - // "queries": [ - // "query1", - // "query2", - // "query3;query4", - // ] - // } - // } - repeated string queries = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// A Dataproc job for running [Apache Hive](https://hive.apache.org/) -// queries on YARN. -message HiveJob { - // Required. The sequence of Hive queries to execute, specified as either - // an HCFS file URI or a list of queries. - oneof queries { - // The HCFS URI of the script that contains Hive queries. - string query_file_uri = 1; - - // A list of queries. - QueryList query_list = 2; - } - - // Optional. Whether to continue executing queries if a query fails. - // The default value is `false`. Setting to `true` can be useful when - // executing independent parallel queries. - bool continue_on_failure = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Mapping of query variable names to values (equivalent to the - // Hive command: `SET name="value";`). - map script_variables = 4 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A mapping of property names and values, used to configure Hive. - // Properties that conflict with values set by the Dataproc API might be - // overwritten. Can include properties set in `/etc/hadoop/conf/*-site.xml`, - // /etc/hive/conf/hive-site.xml, and classes in user code. - map properties = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. HCFS URIs of jar files to add to the CLASSPATH of the - // Hive server and Hadoop MapReduce (MR) tasks. Can contain Hive SerDes - // and UDFs. - repeated string jar_file_uris = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// A Dataproc job for running [Apache Spark -// SQL](https://spark.apache.org/sql/) queries. -message SparkSqlJob { - // Required. The sequence of Spark SQL queries to execute, specified as - // either an HCFS file URI or as a list of queries. - oneof queries { - // The HCFS URI of the script that contains SQL queries. - string query_file_uri = 1; - - // A list of queries. - QueryList query_list = 2; - } - - // Optional. Mapping of query variable names to values (equivalent to the - // Spark SQL command: SET `name="value";`). - map script_variables = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A mapping of property names to values, used to configure - // Spark SQL's SparkConf. Properties that conflict with values set by the - // Dataproc API might be overwritten. - map properties = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH. - repeated string jar_file_uris = 56 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The runtime log config for job execution. - LoggingConfig logging_config = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// A Dataproc job for running [Apache Pig](https://pig.apache.org/) -// queries on YARN. -message PigJob { - // Required. The sequence of Pig queries to execute, specified as an HCFS - // file URI or a list of queries. - oneof queries { - // The HCFS URI of the script that contains the Pig queries. - string query_file_uri = 1; - - // A list of queries. - QueryList query_list = 2; - } - - // Optional. Whether to continue executing queries if a query fails. - // The default value is `false`. Setting to `true` can be useful when - // executing independent parallel queries. - bool continue_on_failure = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Mapping of query variable names to values (equivalent to the Pig - // command: `name=[value]`). - map script_variables = 4 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A mapping of property names to values, used to configure Pig. - // Properties that conflict with values set by the Dataproc API might be - // overwritten. Can include properties set in `/etc/hadoop/conf/*-site.xml`, - // /etc/pig/conf/pig.properties, and classes in user code. - map properties = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. HCFS URIs of jar files to add to the CLASSPATH of - // the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs. - repeated string jar_file_uris = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The runtime log config for job execution. - LoggingConfig logging_config = 7 [(google.api.field_behavior) = OPTIONAL]; -} - -// A Dataproc job for running -// [Apache SparkR](https://spark.apache.org/docs/latest/sparkr.html) -// applications on YARN. -message SparkRJob { - // Required. The HCFS URI of the main R file to use as the driver. - // Must be a .R file. - string main_r_file_uri = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The arguments to pass to the driver. Do not include arguments, - // such as `--conf`, that can be set as job properties, since a collision may - // occur that causes an incorrect job submission. - repeated string args = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. HCFS URIs of files to be placed in the working directory of - // each executor. Useful for naively parallel tasks. - repeated string file_uris = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. HCFS URIs of archives to be extracted into the working directory - // of each executor. Supported file types: - // .jar, .tar, .tar.gz, .tgz, and .zip. - repeated string archive_uris = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A mapping of property names to values, used to configure SparkR. - // Properties that conflict with values set by the Dataproc API might be - // overwritten. Can include properties set in - // /etc/spark/conf/spark-defaults.conf and classes in user code. - map properties = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The runtime log config for job execution. - LoggingConfig logging_config = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// A Dataproc job for running [Presto](https://prestosql.io/) queries. -// **IMPORTANT**: The [Dataproc Presto Optional -// Component](https://cloud.google.com/dataproc/docs/concepts/components/presto) -// must be enabled when the cluster is created to submit a Presto job to the -// cluster. -message PrestoJob { - // Required. The sequence of Presto queries to execute, specified as - // either an HCFS file URI or as a list of queries. - oneof queries { - // The HCFS URI of the script that contains SQL queries. - string query_file_uri = 1; - - // A list of queries. - QueryList query_list = 2; - } - - // Optional. Whether to continue executing queries if a query fails. - // The default value is `false`. Setting to `true` can be useful when - // executing independent parallel queries. - bool continue_on_failure = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The format in which query output will be displayed. See the - // Presto documentation for supported output formats - string output_format = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Presto client tags to attach to this query - repeated string client_tags = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A mapping of property names to values. Used to set Presto - // [session properties](https://prestodb.io/docs/current/sql/set-session.html) - // Equivalent to using the --session flag in the Presto CLI - map properties = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The runtime log config for job execution. - LoggingConfig logging_config = 7 [(google.api.field_behavior) = OPTIONAL]; -} - -// A Dataproc job for running [Trino](https://trino.io/) queries. -// **IMPORTANT**: The [Dataproc Trino Optional -// Component](https://cloud.google.com/dataproc/docs/concepts/components/trino) -// must be enabled when the cluster is created to submit a Trino job to the -// cluster. -message TrinoJob { - // Required. The sequence of Trino queries to execute, specified as - // either an HCFS file URI or as a list of queries. - oneof queries { - // The HCFS URI of the script that contains SQL queries. - string query_file_uri = 1; - - // A list of queries. - QueryList query_list = 2; - } - - // Optional. Whether to continue executing queries if a query fails. - // The default value is `false`. Setting to `true` can be useful when - // executing independent parallel queries. - bool continue_on_failure = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The format in which query output will be displayed. See the - // Trino documentation for supported output formats - string output_format = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Trino client tags to attach to this query - repeated string client_tags = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A mapping of property names to values. Used to set Trino - // [session properties](https://trino.io/docs/current/sql/set-session.html) - // Equivalent to using the --session flag in the Trino CLI - map properties = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The runtime log config for job execution. - LoggingConfig logging_config = 7 [(google.api.field_behavior) = OPTIONAL]; -} - -// A Dataproc job for running Apache Flink applications on YARN. -message FlinkJob { - // Required. The specification of the main method to call to drive the job. - // Specify either the jar file that contains the main class or the main class - // name. To pass both a main jar and a main class in the jar, add the jar to - // [jarFileUris][google.cloud.dataproc.v1.FlinkJob.jar_file_uris], and then - // specify the main class name in - // [mainClass][google.cloud.dataproc.v1.FlinkJob.main_class]. - oneof driver { - // The HCFS URI of the jar file that contains the main class. - string main_jar_file_uri = 1; - - // The name of the driver's main class. The jar file that contains the class - // must be in the default CLASSPATH or specified in - // [jarFileUris][google.cloud.dataproc.v1.FlinkJob.jar_file_uris]. - string main_class = 2; - } - - // Optional. The arguments to pass to the driver. Do not include arguments, - // such as `--conf`, that can be set as job properties, since a collision - // might occur that causes an incorrect job submission. - repeated string args = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. HCFS URIs of jar files to add to the CLASSPATHs of the - // Flink driver and tasks. - repeated string jar_file_uris = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. HCFS URI of the savepoint, which contains the last saved progress - // for starting the current job. - string savepoint_uri = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A mapping of property names to values, used to configure Flink. - // Properties that conflict with values set by the Dataproc API might be - // overwritten. Can include properties set in - // `/etc/flink/conf/flink-defaults.conf` and classes in user code. - map properties = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The runtime log config for job execution. - LoggingConfig logging_config = 8 [(google.api.field_behavior) = OPTIONAL]; -} - -// Dataproc job config. -message JobPlacement { - // Required. The name of the cluster where the job will be submitted. - string cluster_name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Output only. A cluster UUID generated by the Dataproc service when - // the job is submitted. - string cluster_uuid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Cluster labels to identify a cluster where the job will be - // submitted. - map cluster_labels = 3 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Dataproc job status. -message JobStatus { - // The job state. - enum State { - // The job state is unknown. - STATE_UNSPECIFIED = 0; - - // The job is pending; it has been submitted, but is not yet running. - PENDING = 1; - - // Job has been received by the service and completed initial setup; - // it will soon be submitted to the cluster. - SETUP_DONE = 8; - - // The job is running on the cluster. - RUNNING = 2; - - // A CancelJob request has been received, but is pending. - CANCEL_PENDING = 3; - - // Transient in-flight resources have been canceled, and the request to - // cancel the running job has been issued to the cluster. - CANCEL_STARTED = 7; - - // The job cancellation was successful. - CANCELLED = 4; - - // The job has completed successfully. - DONE = 5; - - // The job has completed, but encountered an error. - ERROR = 6; - - // Job attempt has failed. The detail field contains failure details for - // this attempt. - // - // Applies to restartable jobs only. - ATTEMPT_FAILURE = 9; - } - - // The job substate. - enum Substate { - // The job substate is unknown. - UNSPECIFIED = 0; - - // The Job is submitted to the agent. - // - // Applies to RUNNING state. - SUBMITTED = 1; - - // The Job has been received and is awaiting execution (it might be waiting - // for a condition to be met). See the "details" field for the reason for - // the delay. - // - // Applies to RUNNING state. - QUEUED = 2; - - // The agent-reported status is out of date, which can be caused by a - // loss of communication between the agent and Dataproc. If the - // agent does not send a timely update, the job will fail. - // - // Applies to RUNNING state. - STALE_STATUS = 3; - } - - // Output only. A state message specifying the overall job state. - State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Output only. Job state details, such as an error - // description if the state is `ERROR`. - string details = 2 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.field_behavior) = OPTIONAL - ]; - - // Output only. The time when this state was entered. - google.protobuf.Timestamp state_start_time = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Additional state information, which includes - // status reported by the agent. - Substate substate = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Encapsulates the full scoping used to reference a job. -message JobReference { - // Optional. The ID of the Google Cloud Platform project that the job belongs - // to. If specified, must match the request project ID. - string project_id = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The job ID, which must be unique within the project. - // - // The ID must contain only letters (a-z, A-Z), numbers (0-9), - // underscores (_), or hyphens (-). The maximum length is 100 characters. - // - // If not specified by the caller, the job ID will be provided by the server. - string job_id = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// A YARN application created by a job. Application information is a subset of -// org.apache.hadoop.yarn.proto.YarnProtos.ApplicationReportProto. -// -// **Beta Feature**: This report is available for testing purposes only. It may -// be changed before final release. -message YarnApplication { - // The application state, corresponding to - // YarnProtos.YarnApplicationStateProto. - enum State { - // Status is unspecified. - STATE_UNSPECIFIED = 0; - - // Status is NEW. - NEW = 1; - - // Status is NEW_SAVING. - NEW_SAVING = 2; - - // Status is SUBMITTED. - SUBMITTED = 3; - - // Status is ACCEPTED. - ACCEPTED = 4; - - // Status is RUNNING. - RUNNING = 5; - - // Status is FINISHED. - FINISHED = 6; - - // Status is FAILED. - FAILED = 7; - - // Status is KILLED. - KILLED = 8; - } - - // Required. The application name. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The application state. - State state = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The numerical progress of the application, from 1 to 100. - float progress = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The HTTP URL of the ApplicationMaster, HistoryServer, or - // TimelineServer that provides application-specific information. The URL uses - // the internal hostname, and requires a proxy server for resolution and, - // possibly, access. - string tracking_url = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// A Dataproc job resource. -message Job { - // Optional. The fully qualified reference to the job, which can be used to - // obtain the equivalent REST path of the job resource. If this property - // is not specified when a job is created, the server generates a - // job_id. - JobReference reference = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Required. Job information, including how, when, and where to - // run the job. - JobPlacement placement = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The application/framework-specific portion of the job. - oneof type_job { - // Optional. Job is a Hadoop job. - HadoopJob hadoop_job = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Job is a Spark job. - SparkJob spark_job = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Job is a PySpark job. - PySparkJob pyspark_job = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Job is a Hive job. - HiveJob hive_job = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Job is a Pig job. - PigJob pig_job = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Job is a SparkR job. - SparkRJob spark_r_job = 21 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Job is a SparkSql job. - SparkSqlJob spark_sql_job = 12 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Job is a Presto job. - PrestoJob presto_job = 23 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Job is a Trino job. - TrinoJob trino_job = 28 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Job is a Flink job. - FlinkJob flink_job = 29 [(google.api.field_behavior) = OPTIONAL]; - } - - // Output only. The job status. Additional application-specific - // status information might be contained in the type_job - // and yarn_applications fields. - JobStatus status = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The previous job status. - repeated JobStatus status_history = 13 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The collection of YARN applications spun up by this job. - // - // **Beta** Feature: This report is available for testing purposes only. It - // might be changed before final release. - repeated YarnApplication yarn_applications = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A URI pointing to the location of the stdout of the job's - // driver program. - string driver_output_resource_uri = 17 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. If present, the location of miscellaneous control files - // which can be used as part of job setup and handling. If not present, - // control files might be placed in the same location as `driver_output_uri`. - string driver_control_files_uri = 15 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The labels to associate with this job. - // Label **keys** must contain 1 to 63 characters, and must conform to - // [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). - // Label **values** can be empty, but, if present, must contain 1 to 63 - // characters, and must conform to [RFC - // 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be - // associated with a job. - map labels = 18 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Job scheduling configuration. - JobScheduling scheduling = 20 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. A UUID that uniquely identifies a job within the project - // over time. This is in contrast to a user-settable reference.job_id that - // might be reused over time. - string job_uuid = 22 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Indicates whether the job is completed. If the value is - // `false`, the job is still in progress. If `true`, the job is completed, and - // `status.state` field will indicate if it was successful, failed, - // or cancelled. - bool done = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Driver scheduling configuration. - DriverSchedulingConfig driver_scheduling_config = 27 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Driver scheduling configuration. -message DriverSchedulingConfig { - // Required. The amount of memory in MB the driver is requesting. - int32 memory_mb = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The number of vCPUs the driver is requesting. - int32 vcores = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Job scheduling options. -message JobScheduling { - // Optional. Maximum number of times per hour a driver can be restarted as - // a result of driver exiting with non-zero code before job is - // reported failed. - // - // A job might be reported as thrashing if the driver exits with a non-zero - // code four times within a 10-minute window. - // - // Maximum value is 10. - // - // **Note:** This restartable job option is not supported in Dataproc - // [workflow templates] - // (https://cloud.google.com/dataproc/docs/concepts/workflows/using-workflows#adding_jobs_to_a_template). - int32 max_failures_per_hour = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Maximum total number of times a driver can be restarted as a - // result of the driver exiting with a non-zero code. After the maximum number - // is reached, the job will be reported as failed. - // - // Maximum value is 240. - // - // **Note:** Currently, this restartable job option is - // not supported in Dataproc - // [workflow - // templates](https://cloud.google.com/dataproc/docs/concepts/workflows/using-workflows#adding_jobs_to_a_template). - int32 max_failures_total = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// A request to submit a job. -message SubmitJobRequest { - // Required. The ID of the Google Cloud Platform project that the job - // belongs to. - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The Dataproc region in which to handle the request. - string region = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. The job resource. - Job job = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. A unique id used to identify the request. If the server - // receives two - // [SubmitJobRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.SubmitJobRequest)s - // with the same id, then the second request will be ignored and the - // first [Job][google.cloud.dataproc.v1.Job] created and stored in the backend - // is returned. - // - // It is recommended to always set this value to a - // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - // - // The id must contain only letters (a-z, A-Z), numbers (0-9), - // underscores (_), and hyphens (-). The maximum length is 40 characters. - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Job Operation metadata. -message JobMetadata { - // Output only. The job id. - string job_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Most recent job status. - JobStatus status = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Operation type. - string operation_type = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Job submission time. - google.protobuf.Timestamp start_time = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// A request to get the resource representation for a job in a project. -message GetJobRequest { - // Required. The ID of the Google Cloud Platform project that the job - // belongs to. - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The Dataproc region in which to handle the request. - string region = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. The job ID. - string job_id = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// A request to list jobs in a project. -message ListJobsRequest { - // A matcher that specifies categories of job states. - enum JobStateMatcher { - // Match all jobs, regardless of state. - ALL = 0; - - // Only match jobs in non-terminal states: PENDING, RUNNING, or - // CANCEL_PENDING. - ACTIVE = 1; - - // Only match jobs in terminal states: CANCELLED, DONE, or ERROR. - NON_ACTIVE = 2; - } - - // Required. The ID of the Google Cloud Platform project that the job - // belongs to. - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The Dataproc region in which to handle the request. - string region = 6 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The number of results to return in each response. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The page token, returned by a previous call, to request the - // next page of results. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, the returned jobs list includes only jobs that were - // submitted to the named cluster. - string cluster_name = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies enumerated categories of jobs to list. - // (default = match ALL jobs). - // - // If `filter` is provided, `jobStateMatcher` will be ignored. - JobStateMatcher job_state_matcher = 5 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A filter constraining the jobs to list. Filters are - // case-sensitive and have the following syntax: - // - // [field = value] AND [field [= value]] ... - // - // where **field** is `status.state` or `labels.[KEY]`, and `[KEY]` is a label - // key. **value** can be `*` to match all values. - // `status.state` can be either `ACTIVE` or `NON_ACTIVE`. - // Only the logical `AND` operator is supported; space-separated items are - // treated as having an implicit `AND` operator. - // - // Example filter: - // - // status.state = ACTIVE AND labels.env = staging AND labels.starred = * - string filter = 7 [(google.api.field_behavior) = OPTIONAL]; -} - -// A request to update a job. -message UpdateJobRequest { - // Required. The ID of the Google Cloud Platform project that the job - // belongs to. - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The Dataproc region in which to handle the request. - string region = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The job ID. - string job_id = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. The changes to the job. - Job job = 4 [(google.api.field_behavior) = REQUIRED]; - - // Required. Specifies the path, relative to Job, of - // the field to update. For example, to update the labels of a Job the - // update_mask parameter would be specified as - // labels, and the `PATCH` request body would specify the new - // value. Note: Currently, labels is the only - // field that can be updated. - google.protobuf.FieldMask update_mask = 5 - [(google.api.field_behavior) = REQUIRED]; -} - -// A list of jobs in a project. -message ListJobsResponse { - // Output only. Jobs list. - repeated Job jobs = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. This token is included in the response if there are more results - // to fetch. To fetch additional results, provide this value as the - // `page_token` in a subsequent ListJobsRequest. - string next_page_token = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. List of jobs with - // [kms_key][google.cloud.dataproc.v1.EncryptionConfig.kms_key]-encrypted - // parameters that could not be decrypted. A response to a `jobs.get` request - // may indicate the reason for the decryption failure for a specific job. - repeated string unreachable = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// A request to cancel a job. -message CancelJobRequest { - // Required. The ID of the Google Cloud Platform project that the job - // belongs to. - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The Dataproc region in which to handle the request. - string region = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. The job ID. - string job_id = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// A request to delete a job. -message DeleteJobRequest { - // Required. The ID of the Google Cloud Platform project that the job - // belongs to. - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The Dataproc region in which to handle the request. - string region = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. The job ID. - string job_id = 2 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/node_groups.proto b/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/node_groups.proto deleted file mode 100644 index 0b69b6c84c9e..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/node_groups.proto +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.dataproc.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/dataproc/v1/clusters.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/duration.proto"; - -option go_package = "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpb"; -option java_multiple_files = true; -option java_outer_classname = "NodeGroupsProto"; -option java_package = "com.google.cloud.dataproc.v1"; -option (google.api.resource_definition) = { - type: "dataproc.googleapis.com/ClusterRegion" - pattern: "projects/{project}/regions/{region}/clusters/{cluster}" -}; - -// The `NodeGroupControllerService` provides methods to manage node groups -// of Compute Engine managed instances. -service NodeGroupController { - option (google.api.default_host) = "dataproc.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Creates a node group in a cluster. The returned - // [Operation.metadata][google.longrunning.Operation.metadata] is - // [NodeGroupOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata). - rpc CreateNodeGroup(CreateNodeGroupRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/regions/*/clusters/*}/nodeGroups" - body: "node_group" - }; - option (google.api.method_signature) = "parent,node_group,node_group_id"; - option (google.longrunning.operation_info) = { - response_type: "NodeGroup" - metadata_type: "google.cloud.dataproc.v1.NodeGroupOperationMetadata" - }; - } - - // Resizes a node group in a cluster. The returned - // [Operation.metadata][google.longrunning.Operation.metadata] is - // [NodeGroupOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata). - rpc ResizeNodeGroup(ResizeNodeGroupRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/regions/*/clusters/*/nodeGroups/*}:resize" - body: "*" - }; - option (google.api.method_signature) = "name,size"; - option (google.longrunning.operation_info) = { - response_type: "NodeGroup" - metadata_type: "google.cloud.dataproc.v1.NodeGroupOperationMetadata" - }; - } - - // Gets the resource representation for a node group in a - // cluster. - rpc GetNodeGroup(GetNodeGroupRequest) returns (NodeGroup) { - option (google.api.http) = { - get: "/v1/{name=projects/*/regions/*/clusters/*/nodeGroups/*}" - }; - option (google.api.method_signature) = "name"; - } -} - -// A request to create a node group. -message CreateNodeGroupRequest { - // Required. The parent resource where this node group will be created. - // Format: `projects/{project}/regions/{region}/clusters/{cluster}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "dataproc.googleapis.com/NodeGroup" - } - ]; - - // Required. The node group to create. - NodeGroup node_group = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. An optional node group ID. Generated if not specified. - // - // The ID must contain only letters (a-z, A-Z), numbers (0-9), - // underscores (_), and hyphens (-). Cannot begin or end with underscore - // or hyphen. Must consist of from 3 to 33 characters. - string node_group_id = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A unique ID used to identify the request. If the server receives - // two - // [CreateNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateNodeGroupRequests) - // with the same ID, the second request is ignored and the - // first [google.longrunning.Operation][google.longrunning.Operation] created - // and stored in the backend is returned. - // - // Recommendation: Set this value to a - // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - // - // The ID must contain only letters (a-z, A-Z), numbers (0-9), - // underscores (_), and hyphens (-). The maximum length is 40 characters. - string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// A request to resize a node group. -message ResizeNodeGroupRequest { - // Required. The name of the node group to resize. - // Format: - // `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The number of running instances for the node group to maintain. - // The group adds or removes instances to maintain the number of instances - // specified by this parameter. - int32 size = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. A unique ID used to identify the request. If the server receives - // two - // [ResizeNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.ResizeNodeGroupRequests) - // with the same ID, the second request is ignored and the - // first [google.longrunning.Operation][google.longrunning.Operation] created - // and stored in the backend is returned. - // - // Recommendation: Set this value to a - // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - // - // The ID must contain only letters (a-z, A-Z), numbers (0-9), - // underscores (_), and hyphens (-). The maximum length is 40 characters. - string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Timeout for graceful YARN decommissioning. [Graceful - // decommissioning] - // (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/scaling-clusters#graceful_decommissioning) - // allows the removal of nodes from the Compute Engine node group - // without interrupting jobs in progress. This timeout specifies how long to - // wait for jobs in progress to finish before forcefully removing nodes (and - // potentially interrupting jobs). Default timeout is 0 (for forceful - // decommission), and the maximum allowed timeout is 1 day. (see JSON - // representation of - // [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). - // - // Only supported on Dataproc image versions 1.2 and higher. - google.protobuf.Duration graceful_decommission_timeout = 4 - [(google.api.field_behavior) = OPTIONAL]; -} - -// A request to get a node group . -message GetNodeGroupRequest { - // Required. The name of the node group to retrieve. - // Format: - // `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataproc.googleapis.com/NodeGroup" - } - ]; -} diff --git a/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/operations.proto b/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/operations.proto deleted file mode 100644 index 02b26897e413..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/operations.proto +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.dataproc.v1; - -import "google/api/field_behavior.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpb"; -option java_multiple_files = true; -option java_outer_classname = "OperationsProto"; -option java_package = "com.google.cloud.dataproc.v1"; - -// Metadata describing the Batch operation. -message BatchOperationMetadata { - // Operation type for Batch resources - enum BatchOperationType { - // Batch operation type is unknown. - BATCH_OPERATION_TYPE_UNSPECIFIED = 0; - - // Batch operation type. - BATCH = 1; - } - - // Name of the batch for the operation. - string batch = 1; - - // Batch UUID for the operation. - string batch_uuid = 2; - - // The time when the operation was created. - google.protobuf.Timestamp create_time = 3; - - // The time when the operation finished. - google.protobuf.Timestamp done_time = 4; - - // The operation type. - BatchOperationType operation_type = 6; - - // Short description of the operation. - string description = 7; - - // Labels associated with the operation. - map labels = 8; - - // Warnings encountered during operation execution. - repeated string warnings = 9; -} - -// Metadata describing the Session operation. -message SessionOperationMetadata { - // Operation type for Session resources - enum SessionOperationType { - // Session operation type is unknown. - SESSION_OPERATION_TYPE_UNSPECIFIED = 0; - - // Create Session operation type. - CREATE = 1; - - // Terminate Session operation type. - TERMINATE = 2; - - // Delete Session operation type. - DELETE = 3; - } - - // Name of the session for the operation. - string session = 1; - - // Session UUID for the operation. - string session_uuid = 2; - - // The time when the operation was created. - google.protobuf.Timestamp create_time = 3; - - // The time when the operation was finished. - google.protobuf.Timestamp done_time = 4; - - // The operation type. - SessionOperationType operation_type = 6; - - // Short description of the operation. - string description = 7; - - // Labels associated with the operation. - map labels = 8; - - // Warnings encountered during operation execution. - repeated string warnings = 9; -} - -// The status of the operation. -message ClusterOperationStatus { - // The operation state. - enum State { - // Unused. - UNKNOWN = 0; - - // The operation has been created. - PENDING = 1; - - // The operation is running. - RUNNING = 2; - - // The operation is done; either cancelled or completed. - DONE = 3; - } - - // Output only. A message containing the operation state. - State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A message containing the detailed operation state. - string inner_state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A message containing any operation metadata details. - string details = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time this state was entered. - google.protobuf.Timestamp state_start_time = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Metadata describing the operation. -message ClusterOperationMetadata { - // Output only. Name of the cluster for the operation. - string cluster_name = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Cluster UUID for the operation. - string cluster_uuid = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Current operation status. - ClusterOperationStatus status = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The previous operation status. - repeated ClusterOperationStatus status_history = 10 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The operation type. - string operation_type = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Short description of operation. - string description = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Labels associated with the operation - map labels = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Errors encountered during operation execution. - repeated string warnings = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Child operation ids - repeated string child_operation_ids = 15 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Metadata describing the node group operation. -message NodeGroupOperationMetadata { - // Operation type for node group resources. - enum NodeGroupOperationType { - // Node group operation type is unknown. - NODE_GROUP_OPERATION_TYPE_UNSPECIFIED = 0; - - // Create node group operation type. - CREATE = 1; - - // Update node group operation type. - UPDATE = 2; - - // Delete node group operation type. - DELETE = 3; - - // Resize node group operation type. - RESIZE = 4; - } - - // Output only. Node group ID for the operation. - string node_group_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Cluster UUID associated with the node group operation. - string cluster_uuid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Current operation status. - ClusterOperationStatus status = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The previous operation status. - repeated ClusterOperationStatus status_history = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The operation type. - NodeGroupOperationType operation_type = 5; - - // Output only. Short description of operation. - string description = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Labels associated with the operation. - map labels = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Errors encountered during operation execution. - repeated string warnings = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/session_templates.proto b/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/session_templates.proto deleted file mode 100644 index a5bbeb6f3f1c..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/session_templates.proto +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.dataproc.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/dataproc/v1/sessions.proto"; -import "google/cloud/dataproc/v1/shared.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpb"; -option java_multiple_files = true; -option java_outer_classname = "SessionTemplatesProto"; -option java_package = "com.google.cloud.dataproc.v1"; - -// The SessionTemplateController provides methods to manage session templates. -service SessionTemplateController { - option (google.api.default_host) = "dataproc.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Create a session template synchronously. - rpc CreateSessionTemplate(CreateSessionTemplateRequest) - returns (SessionTemplate) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/sessionTemplates" - body: "session_template" - }; - option (google.api.method_signature) = "parent,session_template"; - } - - // Updates the session template synchronously. - rpc UpdateSessionTemplate(UpdateSessionTemplateRequest) - returns (SessionTemplate) { - option (google.api.http) = { - patch: "/v1/{session_template.name=projects/*/locations/*/sessionTemplates/*}" - body: "session_template" - }; - option (google.api.method_signature) = "session_template"; - } - - // Gets the resource representation for a session template. - rpc GetSessionTemplate(GetSessionTemplateRequest) returns (SessionTemplate) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/sessionTemplates/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists session templates. - rpc ListSessionTemplates(ListSessionTemplatesRequest) - returns (ListSessionTemplatesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/sessionTemplates" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a session template. - rpc DeleteSessionTemplate(DeleteSessionTemplateRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/sessionTemplates/*}" - }; - option (google.api.method_signature) = "name"; - } -} - -// A request to create a session template. -message CreateSessionTemplateRequest { - // Required. The parent resource where this session template will be created. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "dataproc.googleapis.com/SessionTemplate" - } - ]; - - // Required. The session template to create. - SessionTemplate session_template = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// A request to update a session template. -message UpdateSessionTemplateRequest { - // Required. The updated session template. - SessionTemplate session_template = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// A request to get the resource representation for a session template. -message GetSessionTemplateRequest { - // Required. The name of the session template to retrieve. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataproc.googleapis.com/SessionTemplate" - } - ]; -} - -// A request to list session templates in a project. -message ListSessionTemplatesRequest { - // Required. The parent that owns this collection of session templates. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "dataproc.googleapis.com/SessionTemplate" - } - ]; - - // Optional. The maximum number of sessions to return in each response. - // The service may return fewer than this value. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A page token received from a previous `ListSessions` call. - // Provide this token to retrieve the subsequent page. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A filter for the session templates to return in the response. - // Filters are case sensitive and have the following syntax: - // - // [field = value] AND [field [= value]] ... - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// A list of session templates. -message ListSessionTemplatesResponse { - // Output only. Session template list - repeated SessionTemplate session_templates = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // A token, which can be sent as `page_token` to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// A request to delete a session template. -message DeleteSessionTemplateRequest { - // Required. The name of the session template resource to delete. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataproc.googleapis.com/SessionTemplate" - } - ]; -} - -// A representation of a session template. -message SessionTemplate { - option (google.api.resource) = { - type: "dataproc.googleapis.com/SessionTemplate" - pattern: "projects/{project}/locations/{location}/sessionTemplates/{template}" - }; - - // Required. The resource name of the session template. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Brief description of the template. - string description = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The time when the template was created. - google.protobuf.Timestamp create_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The session configuration. - oneof session_config { - // Optional. Jupyter session config. - JupyterConfig jupyter_session = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Spark Connect session config. - SparkConnectConfig spark_connect_session = 11 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Output only. The email address of the user who created the template. - string creator = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Labels to associate with sessions created using this template. - // Label **keys** must contain 1 to 63 characters, and must conform to - // [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). - // Label **values** can be empty, but, if present, must contain 1 to 63 - // characters and conform to [RFC - // 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be - // associated with a session. - map labels = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Runtime configuration for session execution. - RuntimeConfig runtime_config = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Environment configuration for session execution. - EnvironmentConfig environment_config = 8 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The time the template was last updated. - google.protobuf.Timestamp update_time = 10 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A session template UUID (Unique Universal Identifier). The - // service generates this value when it creates the session template. - string uuid = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/sessions.proto b/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/sessions.proto deleted file mode 100644 index aed66dc8d7c0..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/sessions.proto +++ /dev/null @@ -1,379 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.dataproc.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/dataproc/v1/shared.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpb"; -option java_multiple_files = true; -option java_outer_classname = "SessionsProto"; -option java_package = "com.google.cloud.dataproc.v1"; - -// The `SessionController` provides methods to manage interactive sessions. -service SessionController { - option (google.api.default_host) = "dataproc.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Create an interactive session asynchronously. - rpc CreateSession(CreateSessionRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/sessions" - body: "session" - }; - option (google.api.method_signature) = "parent,session,session_id"; - option (google.longrunning.operation_info) = { - response_type: "Session" - metadata_type: "google.cloud.dataproc.v1.SessionOperationMetadata" - }; - } - - // Gets the resource representation for an interactive session. - rpc GetSession(GetSessionRequest) returns (Session) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/sessions/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists interactive sessions. - rpc ListSessions(ListSessionsRequest) returns (ListSessionsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/sessions" - }; - option (google.api.method_signature) = "parent"; - } - - // Terminates the interactive session. - rpc TerminateSession(TerminateSessionRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/sessions/*}:terminate" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "Session" - metadata_type: "google.cloud.dataproc.v1.SessionOperationMetadata" - }; - } - - // Deletes the interactive session resource. If the session is not in terminal - // state, it is terminated, and then deleted. - rpc DeleteSession(DeleteSessionRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/sessions/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "Session" - metadata_type: "google.cloud.dataproc.v1.SessionOperationMetadata" - }; - } -} - -// A request to create a session. -message CreateSessionRequest { - // Required. The parent resource where this session will be created. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "dataproc.googleapis.com/Session" - } - ]; - - // Required. The interactive session to create. - Session session = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The ID to use for the session, which becomes the final component - // of the session's resource name. - // - // This value must be 4-63 characters. Valid characters - // are /[a-z][0-9]-/. - string session_id = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optional. A unique ID used to identify the request. If the service - // receives two - // [CreateSessionRequests](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateSessionRequest)s - // with the same ID, the second request is ignored, and the - // first [Session][google.cloud.dataproc.v1.Session] is created and stored in - // the backend. - // - // Recommendation: Set this value to a - // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - // - // The value must contain only letters (a-z, A-Z), numbers (0-9), - // underscores (_), and hyphens (-). The maximum length is 40 characters. - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// A request to get the resource representation for a session. -message GetSessionRequest { - // Required. The name of the session to retrieve. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataproc.googleapis.com/Session" - } - ]; -} - -// A request to list sessions in a project. -message ListSessionsRequest { - // Required. The parent, which owns this collection of sessions. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "dataproc.googleapis.com/Session" - } - ]; - - // Optional. The maximum number of sessions to return in each response. - // The service may return fewer than this value. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A page token received from a previous `ListSessions` call. - // Provide this token to retrieve the subsequent page. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A filter for the sessions to return in the response. - // - // A filter is a logical expression constraining the values of various fields - // in each session resource. Filters are case sensitive, and may contain - // multiple clauses combined with logical operators (AND, OR). - // Supported fields are `session_id`, `session_uuid`, `state`, `create_time`, - // and `labels`. - // - // Example: `state = ACTIVE and create_time < "2023-01-01T00:00:00Z"` - // is a filter for sessions in an ACTIVE state that were created before - // 2023-01-01. `state = ACTIVE and labels.environment=production` is a filter - // for sessions in an ACTIVE state that have a production environment label. - // - // See https://google.aip.dev/assets/misc/ebnf-filtering.txt for a detailed - // description of the filter syntax and a list of supported comparators. - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// A list of interactive sessions. -message ListSessionsResponse { - // Output only. The sessions from the specified collection. - repeated Session sessions = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // A token, which can be sent as `page_token`, to retrieve the next page. - // If this field is omitted, there are no subsequent pages. - string next_page_token = 2; -} - -// A request to terminate an interactive session. -message TerminateSessionRequest { - // Required. The name of the session resource to terminate. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataproc.googleapis.com/Session" - } - ]; - - // Optional. A unique ID used to identify the request. If the service - // receives two - // [TerminateSessionRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.TerminateSessionRequest)s - // with the same ID, the second request is ignored. - // - // Recommendation: Set this value to a - // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - // - // The value must contain only letters (a-z, A-Z), numbers (0-9), - // underscores (_), and hyphens (-). The maximum length is 40 characters. - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// A request to delete a session. -message DeleteSessionRequest { - // Required. The name of the session resource to delete. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataproc.googleapis.com/Session" - } - ]; - - // Optional. A unique ID used to identify the request. If the service - // receives two - // [DeleteSessionRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteSessionRequest)s - // with the same ID, the second request is ignored. - // - // Recommendation: Set this value to a - // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - // - // The value must contain only letters (a-z, A-Z), numbers (0-9), - // underscores (_), and hyphens (-). The maximum length is 40 characters. - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// A representation of a session. -message Session { - option (google.api.resource) = { - type: "dataproc.googleapis.com/Session" - pattern: "projects/{project}/locations/{location}/sessions/{session}" - }; - - // The session state. - enum State { - // The session state is unknown. - STATE_UNSPECIFIED = 0; - - // The session is created prior to running. - CREATING = 1; - - // The session is running. - ACTIVE = 2; - - // The session is terminating. - TERMINATING = 3; - - // The session is terminated successfully. - TERMINATED = 4; - - // The session is no longer running due to an error. - FAILED = 5; - } - - // Historical state information. - message SessionStateHistory { - // Output only. The state of the session at this point in the session - // history. - State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Details about the state at this point in the session - // history. - string state_message = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time when the session entered the historical state. - google.protobuf.Timestamp state_start_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Required. The resource name of the session. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Output only. A session UUID (Unique Universal Identifier). The service - // generates this value when it creates the session. - string uuid = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time when the session was created. - google.protobuf.Timestamp create_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The session configuration. - oneof session_config { - // Optional. Jupyter session config. - JupyterConfig jupyter_session = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Spark Connect session config. - SparkConnectConfig spark_connect_session = 17 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Output only. Runtime information about session execution. - RuntimeInfo runtime_info = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A state of the session. - State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Session state details, such as the failure - // description if the state is `FAILED`. - string state_message = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time when the session entered the current state. - google.protobuf.Timestamp state_time = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The email address of the user who created the session. - string creator = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The labels to associate with the session. - // Label **keys** must contain 1 to 63 characters, and must conform to - // [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). - // Label **values** may be empty, but, if present, must contain 1 to 63 - // characters, and must conform to [RFC - // 1035](https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be - // associated with a session. - map labels = 11 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Runtime configuration for the session execution. - RuntimeConfig runtime_config = 12 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Environment configuration for the session execution. - EnvironmentConfig environment_config = 13 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The email address of the user who owns the session. - string user = 14 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Historical state information for the session. - repeated SessionStateHistory state_history = 15 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The session template used by the session. - // - // Only resource names, including project ID and location, are valid. - // - // Example: - // * `https://www.googleapis.com/compute/v1/projects/[project_id]/locations/[dataproc_region]/sessionTemplates/[template_id]` - // * `projects/[project_id]/locations/[dataproc_region]/sessionTemplates/[template_id]` - // - // The template must be in the same project and Dataproc region as the - // session. - string session_template = 16 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "dataproc.googleapis.com/SessionTemplate" - } - ]; -} - -// Jupyter configuration for an interactive session. -message JupyterConfig { - // Jupyter kernel types. - enum Kernel { - // The kernel is unknown. - KERNEL_UNSPECIFIED = 0; - - // Python kernel. - PYTHON = 1; - - // Scala kernel. - SCALA = 2; - } - - // Optional. Kernel - Kernel kernel = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Display name, shown in the Jupyter kernelspec card. - string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Spark Connect configuration for an interactive session. -message SparkConnectConfig {} diff --git a/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/shared.proto b/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/shared.proto deleted file mode 100644 index 33fb9aff3cae..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/shared.proto +++ /dev/null @@ -1,627 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.dataproc.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpb"; -option java_multiple_files = true; -option java_outer_classname = "SharedProto"; -option java_package = "com.google.cloud.dataproc.v1"; -option (google.api.resource_definition) = { - type: "container.googleapis.com/Cluster" - pattern: "projects/{project}/locations/{location}/clusters/{cluster}" -}; -option (google.api.resource_definition) = { - type: "metastore.googleapis.com/Service" - pattern: "projects/{project}/locations/{location}/services/{service}" -}; -option (google.api.resource_definition) = { - type: "cloudkms.googleapis.com/CryptoKey" - pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" -}; - -// Runtime configuration for a workload. -message RuntimeConfig { - // Optional. Version of the batch runtime. - string version = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Optional custom container image for the job runtime environment. - // If not specified, a default container image will be used. - string container_image = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A mapping of property names to values, which are used to - // configure workload execution. - map properties = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Dependency repository configuration. - RepositoryConfig repository_config = 5 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Autotuning configuration of the workload. - AutotuningConfig autotuning_config = 6 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Cohort identifier. Identifies families of the workloads having - // the same shape, e.g. daily ETL jobs. - string cohort = 7 [(google.api.field_behavior) = OPTIONAL]; -} - -// Environment configuration for a workload. -message EnvironmentConfig { - // Optional. Execution configuration for a workload. - ExecutionConfig execution_config = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Peripherals configuration that workload has access to. - PeripheralsConfig peripherals_config = 2 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Execution configuration for a workload. -message ExecutionConfig { - // Optional. Service account that used to execute workload. - string service_account = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Network configuration for workload execution. - oneof network { - // Optional. Network URI to connect workload to. - string network_uri = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Subnetwork URI to connect workload to. - string subnetwork_uri = 5 [(google.api.field_behavior) = OPTIONAL]; - } - - // Optional. Tags used for network traffic control. - repeated string network_tags = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The Cloud KMS key to use for encryption. - string kms_key = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Applies to sessions only. The duration to keep the session alive - // while it's idling. Exceeding this threshold causes the session to - // terminate. This field cannot be set on a batch workload. Minimum value is - // 10 minutes; maximum value is 14 days (see JSON representation of - // [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). - // Defaults to 1 hour if not set. - // If both `ttl` and `idle_ttl` are specified for an interactive session, - // the conditions are treated as `OR` conditions: the workload will be - // terminated when it has been idle for `idle_ttl` or when `ttl` has been - // exceeded, whichever occurs first. - google.protobuf.Duration idle_ttl = 8 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The duration after which the workload will be terminated, - // specified as the JSON representation for - // [Duration](https://protobuf.dev/programming-guides/proto3/#json). - // When the workload exceeds this duration, it will be unconditionally - // terminated without waiting for ongoing work to finish. If `ttl` is not - // specified for a batch workload, the workload will be allowed to run until - // it exits naturally (or run forever without exiting). If `ttl` is not - // specified for an interactive session, it defaults to 24 hours. If `ttl` is - // not specified for a batch that uses 2.1+ runtime version, it defaults to 4 - // hours. Minimum value is 10 minutes; maximum value is 14 days. If both `ttl` - // and `idle_ttl` are specified (for an interactive session), the conditions - // are treated as `OR` conditions: the workload will be terminated when it has - // been idle for `idle_ttl` or when `ttl` has been exceeded, whichever occurs - // first. - google.protobuf.Duration ttl = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A Cloud Storage bucket used to stage workload dependencies, - // config files, and store workload output and other ephemeral data, such as - // Spark history files. If you do not specify a staging bucket, Cloud Dataproc - // will determine a Cloud Storage location according to the region where your - // workload is running, and then create and manage project-level, per-location - // staging and temporary buckets. - // **This field requires a Cloud Storage bucket name, not a `gs://...` URI to - // a Cloud Storage bucket.** - string staging_bucket = 10 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Authentication configuration used to set the default identity for - // the workload execution. The config specifies the type of identity - // (service account or user) that will be used by workloads to access - // resources on the project(s). - AuthenticationConfig authentication_config = 11 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Spark History Server configuration for the workload. -message SparkHistoryServerConfig { - // Optional. Resource name of an existing Dataproc Cluster to act as a Spark - // History Server for the workload. - // - // Example: - // - // * `projects/[project_id]/regions/[region]/clusters/[cluster_name]` - string dataproc_cluster = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// Auxiliary services configuration for a workload. -message PeripheralsConfig { - // Optional. Resource name of an existing Dataproc Metastore service. - // - // Example: - // - // * `projects/[project_id]/locations/[region]/services/[service_id]` - string metastore_service = 1 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "metastore.googleapis.com/Service" - } - ]; - - // Optional. The Spark History Server configuration for the workload. - SparkHistoryServerConfig spark_history_server_config = 2 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Runtime information about workload execution. -message RuntimeInfo { - // Output only. Map of remote access endpoints (such as web interfaces and - // APIs) to their URIs. - map endpoints = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A URI pointing to the location of the stdout and stderr of the - // workload. - string output_uri = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A URI pointing to the location of the diagnostics tarball. - string diagnostic_output_uri = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Approximate workload resource usage, calculated when - // the workload completes (see [Dataproc Serverless pricing] - // (https://cloud.google.com/dataproc-serverless/pricing)). - // - // **Note:** This metric calculation may change in the future, for - // example, to capture cumulative workload resource - // consumption during workload execution (see the - // [Dataproc Serverless release notes] - // (https://cloud.google.com/dataproc-serverless/docs/release-notes) - // for announcements, changes, fixes - // and other Dataproc developments). - UsageMetrics approximate_usage = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Snapshot of current workload resource usage. - UsageSnapshot current_usage = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Usage metrics represent approximate total resources consumed by a workload. -message UsageMetrics { - // Optional. DCU (Dataproc Compute Units) usage in (`milliDCU` x `seconds`) - // (see [Dataproc Serverless pricing] - // (https://cloud.google.com/dataproc-serverless/pricing)). - int64 milli_dcu_seconds = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Shuffle storage usage in (`GB` x `seconds`) (see - // [Dataproc Serverless pricing] - // (https://cloud.google.com/dataproc-serverless/pricing)). - int64 shuffle_storage_gb_seconds = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Accelerator usage in (`milliAccelerator` x `seconds`) (see - // [Dataproc Serverless pricing] - // (https://cloud.google.com/dataproc-serverless/pricing)). - int64 milli_accelerator_seconds = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Accelerator type being used, if any - string accelerator_type = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// The usage snapshot represents the resources consumed by a workload at a -// specified time. -message UsageSnapshot { - // Optional. Milli (one-thousandth) Dataproc Compute Units (DCUs) (see - // [Dataproc Serverless pricing] - // (https://cloud.google.com/dataproc-serverless/pricing)). - int64 milli_dcu = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Shuffle Storage in gigabytes (GB). (see [Dataproc Serverless - // pricing] (https://cloud.google.com/dataproc-serverless/pricing)) - int64 shuffle_storage_gb = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Milli (one-thousandth) Dataproc Compute Units (DCUs) charged at - // premium tier (see [Dataproc Serverless pricing] - // (https://cloud.google.com/dataproc-serverless/pricing)). - int64 milli_dcu_premium = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Shuffle Storage in gigabytes (GB) charged at premium tier. (see - // [Dataproc Serverless pricing] - // (https://cloud.google.com/dataproc-serverless/pricing)) - int64 shuffle_storage_gb_premium = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Milli (one-thousandth) accelerator. (see [Dataproc - // Serverless pricing] (https://cloud.google.com/dataproc-serverless/pricing)) - int64 milli_accelerator = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Accelerator type being used, if any - string accelerator_type = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The timestamp of the usage snapshot. - google.protobuf.Timestamp snapshot_time = 3 - [(google.api.field_behavior) = OPTIONAL]; -} - -// The cluster's GKE config. -message GkeClusterConfig { - // Optional. A target GKE cluster to deploy to. It must be in the same project - // and region as the Dataproc cluster (the GKE cluster can be zonal or - // regional). Format: - // 'projects/{project}/locations/{location}/clusters/{cluster_id}' - string gke_cluster_target = 2 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "container.googleapis.com/Cluster" - } - ]; - - // Optional. GKE node pools where workloads will be scheduled. At least one - // node pool must be assigned the `DEFAULT` - // [GkeNodePoolTarget.Role][google.cloud.dataproc.v1.GkeNodePoolTarget.Role]. - // If a `GkeNodePoolTarget` is not specified, Dataproc constructs a `DEFAULT` - // `GkeNodePoolTarget`. Each role can be given to only one - // `GkeNodePoolTarget`. All node pools must have the same location settings. - repeated GkeNodePoolTarget node_pool_target = 3 - [(google.api.field_behavior) = OPTIONAL]; -} - -// The configuration for running the Dataproc cluster on Kubernetes. -message KubernetesClusterConfig { - // Optional. A namespace within the Kubernetes cluster to deploy into. If this - // namespace does not exist, it is created. If it exists, Dataproc verifies - // that another Dataproc VirtualCluster is not installed into it. If not - // specified, the name of the Dataproc Cluster is used. - string kubernetes_namespace = 1 [(google.api.field_behavior) = OPTIONAL]; - - oneof config { - // Required. The configuration for running the Dataproc cluster on GKE. - GkeClusterConfig gke_cluster_config = 2 - [(google.api.field_behavior) = REQUIRED]; - } - - // Optional. The software configuration for this Dataproc cluster running on - // Kubernetes. - KubernetesSoftwareConfig kubernetes_software_config = 3 - [(google.api.field_behavior) = OPTIONAL]; -} - -// The software configuration for this Dataproc cluster running on Kubernetes. -message KubernetesSoftwareConfig { - // The components that should be installed in this Dataproc cluster. The key - // must be a string from the KubernetesComponent enumeration. The value is - // the version of the software to be installed. - // At least one entry must be specified. - map component_version = 1; - - // The properties to set on daemon config files. - // - // Property keys are specified in `prefix:property` format, for example - // `spark:spark.kubernetes.container.image`. The following are supported - // prefixes and their mappings: - // - // * spark: `spark-defaults.conf` - // - // For more information, see [Cluster - // properties](https://cloud.google.com/dataproc/docs/concepts/cluster-properties). - map properties = 2; -} - -// GKE node pools that Dataproc workloads run on. -message GkeNodePoolTarget { - // `Role` specifies the tasks that will run on the node pool. Roles can be - // specific to workloads. Exactly one - // [GkeNodePoolTarget][google.cloud.dataproc.v1.GkeNodePoolTarget] within the - // virtual cluster must have the `DEFAULT` role, which is used to run all - // workloads that are not associated with a node pool. - enum Role { - // Role is unspecified. - ROLE_UNSPECIFIED = 0; - - // At least one node pool must have the `DEFAULT` role. - // Work assigned to a role that is not associated with a node pool - // is assigned to the node pool with the `DEFAULT` role. For example, - // work assigned to the `CONTROLLER` role will be assigned to the node pool - // with the `DEFAULT` role if no node pool has the `CONTROLLER` role. - DEFAULT = 1; - - // Run work associated with the Dataproc control plane (for example, - // controllers and webhooks). Very low resource requirements. - CONTROLLER = 2; - - // Run work associated with a Spark driver of a job. - SPARK_DRIVER = 3; - - // Run work associated with a Spark executor of a job. - SPARK_EXECUTOR = 4; - } - - // Required. The target GKE node pool. - // Format: - // 'projects/{project}/locations/{location}/clusters/{cluster}/nodePools/{node_pool}' - string node_pool = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The roles associated with the GKE node pool. - repeated Role roles = 2 [(google.api.field_behavior) = REQUIRED]; - - // Input only. The configuration for the GKE node pool. - // - // If specified, Dataproc attempts to create a node pool with the - // specified shape. If one with the same name already exists, it is - // verified against all specified fields. If a field differs, the - // virtual cluster creation will fail. - // - // If omitted, any node pool with the specified name is used. If a - // node pool with the specified name does not exist, Dataproc create a - // node pool with default values. - // - // This is an input only field. It will not be returned by the API. - GkeNodePoolConfig node_pool_config = 3 - [(google.api.field_behavior) = INPUT_ONLY]; -} - -// The configuration of a GKE node pool used by a [Dataproc-on-GKE -// cluster](https://cloud.google.com/dataproc/docs/concepts/jobs/dataproc-gke#create-a-dataproc-on-gke-cluster). -message GkeNodePoolConfig { - // Parameters that describe cluster nodes. - message GkeNodeConfig { - // Optional. The name of a Compute Engine [machine - // type](https://cloud.google.com/compute/docs/machine-types). - string machine_type = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The number of local SSD disks to attach to the node, which is - // limited by the maximum number of disks allowable per zone (see [Adding - // Local SSDs](https://cloud.google.com/compute/docs/disks/local-ssd)). - int32 local_ssd_count = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Whether the nodes are created as legacy [preemptible VM - // instances] (https://cloud.google.com/compute/docs/instances/preemptible). - // Also see - // [Spot][google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.spot] - // VMs, preemptible VM instances without a maximum lifetime. Legacy and Spot - // preemptible nodes cannot be used in a node pool with the `CONTROLLER` - // [role] - // (/dataproc/docs/reference/rest/v1/projects.regions.clusters#role) - // or in the DEFAULT node pool if the CONTROLLER role is not assigned (the - // DEFAULT node pool will assume the CONTROLLER role). - bool preemptible = 10 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A list of [hardware - // accelerators](https://cloud.google.com/compute/docs/gpus) to attach to - // each node. - repeated GkeNodePoolAcceleratorConfig accelerators = 11 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. [Minimum CPU - // platform](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform) - // to be used by this instance. The instance may be scheduled on the - // specified or a newer CPU platform. Specify the friendly names of CPU - // platforms, such as "Intel Haswell"` or Intel Sandy Bridge". - string min_cpu_platform = 13 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The [Customer Managed Encryption Key (CMEK)] - // (https://cloud.google.com/kubernetes-engine/docs/how-to/using-cmek) - // used to encrypt the boot disk attached to each node in the node pool. - // Specify the key using the following format: - // projects/KEY_PROJECT_ID/locations/LOCATION/keyRings/RING_NAME/cryptoKeys/KEY_NAME. - string boot_disk_kms_key = 23 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Whether the nodes are created as [Spot VM instances] - // (https://cloud.google.com/compute/docs/instances/spot). - // Spot VMs are the latest update to legacy - // [preemptible - // VMs][google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.preemptible]. - // Spot VMs do not have a maximum lifetime. Legacy and Spot preemptible - // nodes cannot be used in a node pool with the `CONTROLLER` - // [role](/dataproc/docs/reference/rest/v1/projects.regions.clusters#role) - // or in the DEFAULT node pool if the CONTROLLER role is not assigned (the - // DEFAULT node pool will assume the CONTROLLER role). - bool spot = 32 [(google.api.field_behavior) = OPTIONAL]; - } - - // A GkeNodeConfigAcceleratorConfig represents a Hardware Accelerator request - // for a node pool. - message GkeNodePoolAcceleratorConfig { - // The number of accelerator cards exposed to an instance. - int64 accelerator_count = 1; - - // The accelerator type resource namename (see GPUs on Compute Engine). - string accelerator_type = 2; - - // Size of partitions to create on the GPU. Valid values are described in - // the NVIDIA [mig user - // guide](https://docs.nvidia.com/datacenter/tesla/mig-user-guide/#partitioning). - string gpu_partition_size = 3; - } - - // GkeNodePoolAutoscaling contains information the cluster autoscaler needs to - // adjust the size of the node pool to the current cluster usage. - message GkeNodePoolAutoscalingConfig { - // The minimum number of nodes in the node pool. Must be >= 0 and <= - // max_node_count. - int32 min_node_count = 2; - - // The maximum number of nodes in the node pool. Must be >= min_node_count, - // and must be > 0. - // **Note:** Quota must be sufficient to scale up the cluster. - int32 max_node_count = 3; - } - - // Optional. The node pool configuration. - GkeNodeConfig config = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The list of Compute Engine - // [zones](https://cloud.google.com/compute/docs/zones#available) where - // node pool nodes associated with a Dataproc on GKE virtual cluster - // will be located. - // - // **Note:** All node pools associated with a virtual cluster - // must be located in the same region as the virtual cluster, and they must - // be located in the same zone within that region. - // - // If a location is not specified during node pool creation, Dataproc on GKE - // will choose the zone. - repeated string locations = 13 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The autoscaler configuration for this node pool. The autoscaler - // is enabled only when a valid configuration is present. - GkeNodePoolAutoscalingConfig autoscaling = 4 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Authentication configuration for a workload is used to set the default -// identity for the workload execution. -// The config specifies the type of identity (service account or user) that -// will be used by workloads to access resources on the project(s). -message AuthenticationConfig { - // Authentication types for workload execution. - enum AuthenticationType { - // If AuthenticationType is unspecified then END_USER_CREDENTIALS is used - // for 3.0 and newer runtimes, and SERVICE_ACCOUNT is used for older - // runtimes. - AUTHENTICATION_TYPE_UNSPECIFIED = 0; - - // Use service account credentials for authenticating to other services. - SERVICE_ACCOUNT = 1; - - // Use OAuth credentials associated with the workload creator/user for - // authenticating to other services. - END_USER_CREDENTIALS = 2; - } - - // Optional. Authentication type for the user workload running in containers. - AuthenticationType user_workload_authentication_type = 1 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Autotuning configuration of the workload. -message AutotuningConfig { - // Scenario represents a specific goal that autotuning will attempt to achieve - // by modifying workloads. - enum Scenario { - // Default value. - SCENARIO_UNSPECIFIED = 0; - - // Scaling recommendations such as initialExecutors. - SCALING = 2; - - // Adding hints for potential relation broadcasts. - BROADCAST_HASH_JOIN = 3; - - // Memory management for workloads. - MEMORY = 4; - - // No autotuning. - NONE = 5; - - // Automatic selection of scenarios. - AUTO = 6; - } - - // Optional. Scenarios for which tunings are applied. - repeated Scenario scenarios = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Configuration for dependency repositories -message RepositoryConfig { - // Optional. Configuration for PyPi repository. - PyPiRepositoryConfig pypi_repository_config = 1 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Configuration for PyPi repository -message PyPiRepositoryConfig { - // Optional. PyPi repository address - string pypi_repository = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// Cluster components that can be activated. -enum Component { - // Unspecified component. Specifying this will cause Cluster creation to fail. - COMPONENT_UNSPECIFIED = 0; - - // The Anaconda component is no longer supported or applicable to - // [supported Dataproc on Compute Engine image versions] - // (https://cloud.google.com/dataproc/docs/concepts/versioning/dataproc-version-clusters#supported-dataproc-image-versions). - // It cannot be activated on clusters created with supported Dataproc on - // Compute Engine image versions. - ANACONDA = 5; - - // Delta Lake. - DELTA = 20; - - // Docker - DOCKER = 13; - - // The Druid query engine. (alpha) - DRUID = 9; - - // Flink - FLINK = 14; - - // HBase. (beta) - HBASE = 11; - - // The Hive Web HCatalog (the REST service for accessing HCatalog). - HIVE_WEBHCAT = 3; - - // Hudi. - HUDI = 18; - - // Iceberg. - ICEBERG = 19; - - // The Jupyter Notebook. - JUPYTER = 1; - - // The Jupyter Kernel Gateway. - JUPYTER_KERNEL_GATEWAY = 22; - - // The Pig component. - PIG = 21; - - // The Presto query engine. - PRESTO = 6; - - // The Trino query engine. - TRINO = 17; - - // The Ranger service. - RANGER = 12; - - // The Solr service. - SOLR = 10; - - // The Zeppelin notebook. - ZEPPELIN = 4; - - // The Zookeeper service. - ZOOKEEPER = 8; -} - -// Actions in response to failure of a resource associated with a cluster. -enum FailureAction { - // When FailureAction is unspecified, failure action defaults to NO_ACTION. - FAILURE_ACTION_UNSPECIFIED = 0; - - // Take no action on failure to create a cluster resource. NO_ACTION is the - // default. - NO_ACTION = 1; - - // Delete the failed cluster resource. - DELETE = 2; -} diff --git a/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/workflow_templates.proto b/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/workflow_templates.proto deleted file mode 100644 index 4c5774913b11..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/protos/google/cloud/dataproc/v1/workflow_templates.proto +++ /dev/null @@ -1,890 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.dataproc.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/dataproc/v1/clusters.proto"; -import "google/cloud/dataproc/v1/jobs.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpb"; -option java_multiple_files = true; -option java_outer_classname = "WorkflowTemplatesProto"; -option java_package = "com.google.cloud.dataproc.v1"; - -// The API interface for managing Workflow Templates in the -// Dataproc API. -service WorkflowTemplateService { - option (google.api.default_host) = "dataproc.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Creates new workflow template. - rpc CreateWorkflowTemplate(CreateWorkflowTemplateRequest) - returns (WorkflowTemplate) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/workflowTemplates" - body: "template" - additional_bindings { - post: "/v1/{parent=projects/*/regions/*}/workflowTemplates" - body: "template" - } - }; - option (google.api.method_signature) = "parent,template"; - } - - // Retrieves the latest workflow template. - // - // Can retrieve previously instantiated template by specifying optional - // version parameter. - rpc GetWorkflowTemplate(GetWorkflowTemplateRequest) - returns (WorkflowTemplate) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/workflowTemplates/*}" - additional_bindings { - get: "/v1/{name=projects/*/regions/*/workflowTemplates/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Instantiates a template and begins execution. - // - // The returned Operation can be used to track execution of - // workflow by polling - // [operations.get][google.longrunning.Operations.GetOperation]. - // The Operation will complete when entire workflow is finished. - // - // The running workflow can be aborted via - // [operations.cancel][google.longrunning.Operations.CancelOperation]. - // This will cause any inflight jobs to be cancelled and workflow-owned - // clusters to be deleted. - // - // The [Operation.metadata][google.longrunning.Operation.metadata] will be - // [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). - // Also see [Using - // WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). - // - // On successful completion, - // [Operation.response][google.longrunning.Operation.response] will be - // [Empty][google.protobuf.Empty]. - rpc InstantiateWorkflowTemplate(InstantiateWorkflowTemplateRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/workflowTemplates/*}:instantiate" - body: "*" - additional_bindings { - post: "/v1/{name=projects/*/regions/*/workflowTemplates/*}:instantiate" - body: "*" - } - }; - option (google.api.method_signature) = "name"; - option (google.api.method_signature) = "name,parameters"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "WorkflowMetadata" - }; - } - - // Instantiates a template and begins execution. - // - // This method is equivalent to executing the sequence - // [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate], - // [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate], - // [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate]. - // - // The returned Operation can be used to track execution of - // workflow by polling - // [operations.get][google.longrunning.Operations.GetOperation]. - // The Operation will complete when entire workflow is finished. - // - // The running workflow can be aborted via - // [operations.cancel][google.longrunning.Operations.CancelOperation]. - // This will cause any inflight jobs to be cancelled and workflow-owned - // clusters to be deleted. - // - // The [Operation.metadata][google.longrunning.Operation.metadata] will be - // [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). - // Also see [Using - // WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). - // - // On successful completion, - // [Operation.response][google.longrunning.Operation.response] will be - // [Empty][google.protobuf.Empty]. - rpc InstantiateInlineWorkflowTemplate( - InstantiateInlineWorkflowTemplateRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/workflowTemplates:instantiateInline" - body: "template" - additional_bindings { - post: "/v1/{parent=projects/*/regions/*}/workflowTemplates:instantiateInline" - body: "template" - } - }; - option (google.api.method_signature) = "parent,template"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "WorkflowMetadata" - }; - } - - // Updates (replaces) workflow template. The updated template - // must contain version that matches the current server version. - rpc UpdateWorkflowTemplate(UpdateWorkflowTemplateRequest) - returns (WorkflowTemplate) { - option (google.api.http) = { - put: "/v1/{template.name=projects/*/locations/*/workflowTemplates/*}" - body: "template" - additional_bindings { - put: "/v1/{template.name=projects/*/regions/*/workflowTemplates/*}" - body: "template" - } - }; - option (google.api.method_signature) = "template"; - } - - // Lists workflows that match the specified filter in the request. - rpc ListWorkflowTemplates(ListWorkflowTemplatesRequest) - returns (ListWorkflowTemplatesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/workflowTemplates" - additional_bindings { - get: "/v1/{parent=projects/*/regions/*}/workflowTemplates" - } - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a workflow template. It does not cancel in-progress workflows. - rpc DeleteWorkflowTemplate(DeleteWorkflowTemplateRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/workflowTemplates/*}" - additional_bindings { - delete: "/v1/{name=projects/*/regions/*/workflowTemplates/*}" - } - }; - option (google.api.method_signature) = "name"; - } -} - -// A Dataproc workflow template resource. -message WorkflowTemplate { - option (google.api.resource) = { - type: "dataproc.googleapis.com/WorkflowTemplate" - pattern: "projects/{project}/regions/{region}/workflowTemplates/{workflow_template}" - pattern: "projects/{project}/locations/{location}/workflowTemplates/{workflow_template}" - history: ORIGINALLY_SINGLE_PATTERN - }; - - // Encryption settings for encrypting workflow template job arguments. - message EncryptionConfig { - // Optional. The Cloud KMS key name to use for encrypting - // workflow template job arguments. - // - // When this this key is provided, the following workflow template - // [job arguments] - // (https://cloud.google.com/dataproc/docs/concepts/workflows/use-workflows#adding_jobs_to_a_template), - // if present, are - // [CMEK - // encrypted](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/customer-managed-encryption#use_cmek_with_workflow_template_data): - // - // * [FlinkJob - // args](https://cloud.google.com/dataproc/docs/reference/rest/v1/FlinkJob) - // * [HadoopJob - // args](https://cloud.google.com/dataproc/docs/reference/rest/v1/HadoopJob) - // * [SparkJob - // args](https://cloud.google.com/dataproc/docs/reference/rest/v1/SparkJob) - // * [SparkRJob - // args](https://cloud.google.com/dataproc/docs/reference/rest/v1/SparkRJob) - // * [PySparkJob - // args](https://cloud.google.com/dataproc/docs/reference/rest/v1/PySparkJob) - // * [SparkSqlJob](https://cloud.google.com/dataproc/docs/reference/rest/v1/SparkSqlJob) - // scriptVariables and queryList.queries - // * [HiveJob](https://cloud.google.com/dataproc/docs/reference/rest/v1/HiveJob) - // scriptVariables and queryList.queries - // * [PigJob](https://cloud.google.com/dataproc/docs/reference/rest/v1/PigJob) - // scriptVariables and queryList.queries - // * [PrestoJob](https://cloud.google.com/dataproc/docs/reference/rest/v1/PrestoJob) - // scriptVariables and queryList.queries - string kms_key = 1 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - } - ]; - } - - string id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Output only. The resource name of the workflow template, as described - // in https://cloud.google.com/apis/design/resource_names. - // - // * For `projects.regions.workflowTemplates`, the resource name of the - // template has the following format: - // `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` - // - // * For `projects.locations.workflowTemplates`, the resource name of the - // template has the following format: - // `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Used to perform a consistent read-modify-write. - // - // This field should be left blank for a `CreateWorkflowTemplate` request. It - // is required for an `UpdateWorkflowTemplate` request, and must match the - // current server version. A typical update template flow would fetch the - // current template with a `GetWorkflowTemplate` request, which will return - // the current template with the `version` field filled in with the - // current server version. The user updates other fields in the template, - // then returns it as part of the `UpdateWorkflowTemplate` request. - int32 version = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The time template was created. - google.protobuf.Timestamp create_time = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time template was last updated. - google.protobuf.Timestamp update_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The labels to associate with this template. These labels - // will be propagated to all jobs and clusters created by the workflow - // instance. - // - // Label **keys** must contain 1 to 63 characters, and must conform to - // [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). - // - // Label **values** may be empty, but, if present, must contain 1 to 63 - // characters, and must conform to - // [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt). - // - // No more than 32 labels can be associated with a template. - map labels = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Required. WorkflowTemplate scheduling information. - WorkflowTemplatePlacement placement = 7 - [(google.api.field_behavior) = REQUIRED]; - - // Required. The Directed Acyclic Graph of Jobs to submit. - repeated OrderedJob jobs = 8 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Template parameters whose values are substituted into the - // template. Values for parameters must be provided when the template is - // instantiated. - repeated TemplateParameter parameters = 9 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Timeout duration for the DAG of jobs, expressed in seconds (see - // [JSON representation of - // duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). - // The timeout duration must be from 10 minutes ("600s") to 24 hours - // ("86400s"). The timer begins when the first job is submitted. If the - // workflow is running at the end of the timeout period, any remaining jobs - // are cancelled, the workflow is ended, and if the workflow was running on a - // [managed - // cluster](/dataproc/docs/concepts/workflows/using-workflows#configuring_or_selecting_a_cluster), - // the cluster is deleted. - google.protobuf.Duration dag_timeout = 10 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Encryption settings for encrypting workflow template job - // arguments. - EncryptionConfig encryption_config = 11 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Specifies workflow execution target. -// -// Either `managed_cluster` or `cluster_selector` is required. -message WorkflowTemplatePlacement { - // Required. Specifies where workflow executes; either on a managed - // cluster or an existing cluster chosen by labels. - oneof placement { - // A cluster that is managed by the workflow. - ManagedCluster managed_cluster = 1; - - // Optional. A selector that chooses target cluster for jobs based - // on metadata. - // - // The selector is evaluated at the time each job is submitted. - ClusterSelector cluster_selector = 2; - } -} - -// Cluster that is managed by the workflow. -message ManagedCluster { - // Required. The cluster name prefix. A unique cluster name will be formed by - // appending a random suffix. - // - // The name must contain only lower-case letters (a-z), numbers (0-9), - // and hyphens (-). Must begin with a letter. Cannot begin or end with - // hyphen. Must consist of between 2 and 35 characters. - string cluster_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The cluster configuration. - ClusterConfig config = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The labels to associate with this cluster. - // - // Label keys must be between 1 and 63 characters long, and must conform to - // the following PCRE regular expression: - // [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62} - // - // Label values must be between 1 and 63 characters long, and must conform to - // the following PCRE regular expression: [\p{Ll}\p{Lo}\p{N}_-]{0,63} - // - // No more than 32 labels can be associated with a given cluster. - map labels = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// A selector that chooses target cluster for jobs based on metadata. -message ClusterSelector { - // Optional. The zone where workflow process executes. This parameter does not - // affect the selection of the cluster. - // - // If unspecified, the zone of the first cluster matching the selector - // is used. - string zone = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The cluster labels. Cluster must have all labels - // to match. - map cluster_labels = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// A job executed by the workflow. -message OrderedJob { - // Required. The step id. The id must be unique among all jobs - // within the template. - // - // The step id is used as prefix for job id, as job - // `goog-dataproc-workflow-step-id` label, and in - // [prerequisiteStepIds][google.cloud.dataproc.v1.OrderedJob.prerequisite_step_ids] - // field from other steps. - // - // The id must contain only letters (a-z, A-Z), numbers (0-9), - // underscores (_), and hyphens (-). Cannot begin or end with underscore - // or hyphen. Must consist of between 3 and 50 characters. - string step_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The job definition. - oneof job_type { - // Optional. Job is a Hadoop job. - HadoopJob hadoop_job = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Job is a Spark job. - SparkJob spark_job = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Job is a PySpark job. - PySparkJob pyspark_job = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Job is a Hive job. - HiveJob hive_job = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Job is a Pig job. - PigJob pig_job = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Job is a SparkR job. - SparkRJob spark_r_job = 11 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Job is a SparkSql job. - SparkSqlJob spark_sql_job = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Job is a Presto job. - PrestoJob presto_job = 12 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Job is a Trino job. - TrinoJob trino_job = 13 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Job is a Flink job. - FlinkJob flink_job = 14 [(google.api.field_behavior) = OPTIONAL]; - } - - // Optional. The labels to associate with this job. - // - // Label keys must be between 1 and 63 characters long, and must conform to - // the following regular expression: - // [\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62} - // - // Label values must be between 1 and 63 characters long, and must conform to - // the following regular expression: [\p{Ll}\p{Lo}\p{N}_-]{0,63} - // - // No more than 32 labels can be associated with a given job. - map labels = 8 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Job scheduling configuration. - JobScheduling scheduling = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The optional list of prerequisite job step_ids. - // If not specified, the job will start at the beginning of workflow. - repeated string prerequisite_step_ids = 10 - [(google.api.field_behavior) = OPTIONAL]; -} - -// A configurable parameter that replaces one or more fields in the template. -// Parameterizable fields: -// - Labels -// - File uris -// - Job properties -// - Job arguments -// - Script variables -// - Main class (in HadoopJob and SparkJob) -// - Zone (in ClusterSelector) -message TemplateParameter { - // Required. Parameter name. - // The parameter name is used as the key, and paired with the - // parameter value, which are passed to the template when the template - // is instantiated. - // The name must contain only capital letters (A-Z), numbers (0-9), and - // underscores (_), and must not start with a number. The maximum length is - // 40 characters. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Paths to all fields that the parameter replaces. - // A field is allowed to appear in at most one parameter's list of field - // paths. - // - // A field path is similar in syntax to a - // [google.protobuf.FieldMask][google.protobuf.FieldMask]. For example, a - // field path that references the zone field of a workflow template's cluster - // selector would be specified as `placement.clusterSelector.zone`. - // - // Also, field paths can reference fields using the following syntax: - // - // * Values in maps can be referenced by key: - // * labels['key'] - // * placement.clusterSelector.clusterLabels['key'] - // * placement.managedCluster.labels['key'] - // * placement.clusterSelector.clusterLabels['key'] - // * jobs['step-id'].labels['key'] - // - // * Jobs in the jobs list can be referenced by step-id: - // * jobs['step-id'].hadoopJob.mainJarFileUri - // * jobs['step-id'].hiveJob.queryFileUri - // * jobs['step-id'].pySparkJob.mainPythonFileUri - // * jobs['step-id'].hadoopJob.jarFileUris[0] - // * jobs['step-id'].hadoopJob.archiveUris[0] - // * jobs['step-id'].hadoopJob.fileUris[0] - // * jobs['step-id'].pySparkJob.pythonFileUris[0] - // - // * Items in repeated fields can be referenced by a zero-based index: - // * jobs['step-id'].sparkJob.args[0] - // - // * Other examples: - // * jobs['step-id'].hadoopJob.properties['key'] - // * jobs['step-id'].hadoopJob.args[0] - // * jobs['step-id'].hiveJob.scriptVariables['key'] - // * jobs['step-id'].hadoopJob.mainJarFileUri - // * placement.clusterSelector.zone - // - // It may not be possible to parameterize maps and repeated fields in their - // entirety since only individual map values and individual items in repeated - // fields can be referenced. For example, the following field paths are - // invalid: - // - // - placement.clusterSelector.clusterLabels - // - jobs['step-id'].sparkJob.args - repeated string fields = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Brief description of the parameter. - // Must not exceed 1024 characters. - string description = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Validation rules to be applied to this parameter's value. - ParameterValidation validation = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Configuration for parameter validation. -message ParameterValidation { - // Required. The type of validation to be performed. - oneof validation_type { - // Validation based on regular expressions. - RegexValidation regex = 1; - - // Validation based on a list of allowed values. - ValueValidation values = 2; - } -} - -// Validation based on regular expressions. -message RegexValidation { - // Required. RE2 regular expressions used to validate the parameter's value. - // The value must match the regex in its entirety (substring - // matches are not sufficient). - repeated string regexes = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Validation based on a list of allowed values. -message ValueValidation { - // Required. List of allowed values for the parameter. - repeated string values = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// A Dataproc workflow template resource. -message WorkflowMetadata { - // The operation state. - enum State { - // Unused. - UNKNOWN = 0; - - // The operation has been created. - PENDING = 1; - - // The operation is running. - RUNNING = 2; - - // The operation is done; either cancelled or completed. - DONE = 3; - } - - // Output only. The resource name of the workflow template as described - // in https://cloud.google.com/apis/design/resource_names. - // - // * For `projects.regions.workflowTemplates`, the resource name of the - // template has the following format: - // `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` - // - // * For `projects.locations.workflowTemplates`, the resource name of the - // template has the following format: - // `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` - string template = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The version of template at the time of - // workflow instantiation. - int32 version = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The create cluster operation metadata. - ClusterOperation create_cluster = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The workflow graph. - WorkflowGraph graph = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The delete cluster operation metadata. - ClusterOperation delete_cluster = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The workflow state. - State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The name of the target cluster. - string cluster_name = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Map from parameter names to values that were used for those parameters. - map parameters = 8; - - // Output only. Workflow start time. - google.protobuf.Timestamp start_time = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Workflow end time. - google.protobuf.Timestamp end_time = 10 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The UUID of target cluster. - string cluster_uuid = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The timeout duration for the DAG of jobs, expressed in seconds - // (see [JSON representation of - // duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). - google.protobuf.Duration dag_timeout = 12 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. DAG start time, only set for workflows with - // [dag_timeout][google.cloud.dataproc.v1.WorkflowMetadata.dag_timeout] when - // DAG begins. - google.protobuf.Timestamp dag_start_time = 13 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. DAG end time, only set for workflows with - // [dag_timeout][google.cloud.dataproc.v1.WorkflowMetadata.dag_timeout] when - // DAG ends. - google.protobuf.Timestamp dag_end_time = 14 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// The cluster operation triggered by a workflow. -message ClusterOperation { - // Output only. The id of the cluster operation. - string operation_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Error, if operation failed. - string error = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Indicates the operation is done. - bool done = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// The workflow graph. -message WorkflowGraph { - // Output only. The workflow nodes. - repeated WorkflowNode nodes = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// The workflow node. -message WorkflowNode { - // The workflow node state. - enum NodeState { - // State is unspecified. - NODE_STATE_UNSPECIFIED = 0; - - // The node is awaiting prerequisite node to finish. - BLOCKED = 1; - - // The node is runnable but not running. - RUNNABLE = 2; - - // The node is running. - RUNNING = 3; - - // The node completed successfully. - COMPLETED = 4; - - // The node failed. A node can be marked FAILED because - // its ancestor or peer failed. - FAILED = 5; - } - - // Output only. The name of the node. - string step_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Node's prerequisite nodes. - repeated string prerequisite_step_ids = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The job id; populated after the node enters RUNNING state. - string job_id = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The node state. - NodeState state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The error detail. - string error = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// A request to create a workflow template. -message CreateWorkflowTemplateRequest { - // Required. The resource name of the region or location, as described - // in https://cloud.google.com/apis/design/resource_names. - // - // * For `projects.regions.workflowTemplates.create`, the resource name of the - // region has the following format: - // `projects/{project_id}/regions/{region}` - // - // * For `projects.locations.workflowTemplates.create`, the resource name of - // the location has the following format: - // `projects/{project_id}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "dataproc.googleapis.com/WorkflowTemplate" - } - ]; - - // Required. The Dataproc workflow template to create. - WorkflowTemplate template = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// A request to fetch a workflow template. -message GetWorkflowTemplateRequest { - // Required. The resource name of the workflow template, as described - // in https://cloud.google.com/apis/design/resource_names. - // - // * For `projects.regions.workflowTemplates.get`, the resource name of the - // template has the following format: - // `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` - // - // * For `projects.locations.workflowTemplates.get`, the resource name of the - // template has the following format: - // `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataproc.googleapis.com/WorkflowTemplate" - } - ]; - - // Optional. The version of workflow template to retrieve. Only previously - // instantiated versions can be retrieved. - // - // If unspecified, retrieves the current version. - int32 version = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// A request to instantiate a workflow template. -message InstantiateWorkflowTemplateRequest { - // Required. The resource name of the workflow template, as described - // in https://cloud.google.com/apis/design/resource_names. - // - // * For `projects.regions.workflowTemplates.instantiate`, the resource name - // of the template has the following format: - // `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` - // - // * For `projects.locations.workflowTemplates.instantiate`, the resource name - // of the template has the following format: - // `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataproc.googleapis.com/WorkflowTemplate" - } - ]; - - // Optional. The version of workflow template to instantiate. If specified, - // the workflow will be instantiated only if the current version of - // the workflow template has the supplied version. - // - // This option cannot be used to instantiate a previous version of - // workflow template. - int32 version = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A tag that prevents multiple concurrent workflow - // instances with the same tag from running. This mitigates risk of - // concurrent instances started due to retries. - // - // It is recommended to always set this value to a - // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - // - // The tag must contain only letters (a-z, A-Z), numbers (0-9), - // underscores (_), and hyphens (-). The maximum length is 40 characters. - string request_id = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Map from parameter names to values that should be used for those - // parameters. Values may not exceed 1000 characters. - map parameters = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// A request to instantiate an inline workflow template. -message InstantiateInlineWorkflowTemplateRequest { - // Required. The resource name of the region or location, as described - // in https://cloud.google.com/apis/design/resource_names. - // - // * For `projects.regions.workflowTemplates,instantiateinline`, the resource - // name of the region has the following format: - // `projects/{project_id}/regions/{region}` - // - // * For `projects.locations.workflowTemplates.instantiateinline`, the - // resource name of the location has the following format: - // `projects/{project_id}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "dataproc.googleapis.com/WorkflowTemplate" - } - ]; - - // Required. The workflow template to instantiate. - WorkflowTemplate template = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. A tag that prevents multiple concurrent workflow - // instances with the same tag from running. This mitigates risk of - // concurrent instances started due to retries. - // - // It is recommended to always set this value to a - // [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - // - // The tag must contain only letters (a-z, A-Z), numbers (0-9), - // underscores (_), and hyphens (-). The maximum length is 40 characters. - string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// A request to update a workflow template. -message UpdateWorkflowTemplateRequest { - // Required. The updated workflow template. - // - // The `template.version` field must match the current version. - WorkflowTemplate template = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// A request to list workflow templates in a project. -message ListWorkflowTemplatesRequest { - // Required. The resource name of the region or location, as described - // in https://cloud.google.com/apis/design/resource_names. - // - // * For `projects.regions.workflowTemplates,list`, the resource - // name of the region has the following format: - // `projects/{project_id}/regions/{region}` - // - // * For `projects.locations.workflowTemplates.list`, the - // resource name of the location has the following format: - // `projects/{project_id}/locations/{location}` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "dataproc.googleapis.com/WorkflowTemplate" - } - ]; - - // Optional. The maximum number of results to return in each response. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The page token, returned by a previous call, to request the - // next page of results. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// A response to a request to list workflow templates in a project. -message ListWorkflowTemplatesResponse { - // Output only. WorkflowTemplates list. - repeated WorkflowTemplate templates = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. This token is included in the response if there are more - // results to fetch. To fetch additional results, provide this value as the - // page_token in a subsequent ListWorkflowTemplatesRequest. - string next_page_token = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. List of workflow templates that could not be included in the - // response. Attempting to get one of these resources may indicate why it was - // not included in the list response. - repeated string unreachable = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// A request to delete a workflow template. -// -// Currently started workflows will remain running. -message DeleteWorkflowTemplateRequest { - // Required. The resource name of the workflow template, as described - // in https://cloud.google.com/apis/design/resource_names. - // - // * For `projects.regions.workflowTemplates.delete`, the resource name - // of the template has the following format: - // `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` - // - // * For `projects.locations.workflowTemplates.instantiate`, the resource name - // of the template has the following format: - // `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "dataproc.googleapis.com/WorkflowTemplate" - } - ]; - - // Optional. The version of workflow template to delete. If specified, - // will only delete the template if the current server version matches - // specified version. - int32 version = 2 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-dataproc/protos/protos.d.ts b/owl-bot-staging/google-cloud-dataproc/protos/protos.d.ts deleted file mode 100644 index 0f88e851d408..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/protos/protos.d.ts +++ /dev/null @@ -1,29074 +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 dataproc. */ - namespace dataproc { - - /** Namespace v1. */ - namespace v1 { - - /** Represents an AutoscalingPolicyService */ - class AutoscalingPolicyService extends $protobuf.rpc.Service { - - /** - * Constructs a new AutoscalingPolicyService 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 AutoscalingPolicyService 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): AutoscalingPolicyService; - - /** - * Calls CreateAutoscalingPolicy. - * @param request CreateAutoscalingPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and AutoscalingPolicy - */ - public createAutoscalingPolicy(request: google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest, callback: google.cloud.dataproc.v1.AutoscalingPolicyService.CreateAutoscalingPolicyCallback): void; - - /** - * Calls CreateAutoscalingPolicy. - * @param request CreateAutoscalingPolicyRequest message or plain object - * @returns Promise - */ - public createAutoscalingPolicy(request: google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest): Promise; - - /** - * Calls UpdateAutoscalingPolicy. - * @param request UpdateAutoscalingPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and AutoscalingPolicy - */ - public updateAutoscalingPolicy(request: google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest, callback: google.cloud.dataproc.v1.AutoscalingPolicyService.UpdateAutoscalingPolicyCallback): void; - - /** - * Calls UpdateAutoscalingPolicy. - * @param request UpdateAutoscalingPolicyRequest message or plain object - * @returns Promise - */ - public updateAutoscalingPolicy(request: google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest): Promise; - - /** - * Calls GetAutoscalingPolicy. - * @param request GetAutoscalingPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and AutoscalingPolicy - */ - public getAutoscalingPolicy(request: google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest, callback: google.cloud.dataproc.v1.AutoscalingPolicyService.GetAutoscalingPolicyCallback): void; - - /** - * Calls GetAutoscalingPolicy. - * @param request GetAutoscalingPolicyRequest message or plain object - * @returns Promise - */ - public getAutoscalingPolicy(request: google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest): Promise; - - /** - * Calls ListAutoscalingPolicies. - * @param request ListAutoscalingPoliciesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListAutoscalingPoliciesResponse - */ - public listAutoscalingPolicies(request: google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest, callback: google.cloud.dataproc.v1.AutoscalingPolicyService.ListAutoscalingPoliciesCallback): void; - - /** - * Calls ListAutoscalingPolicies. - * @param request ListAutoscalingPoliciesRequest message or plain object - * @returns Promise - */ - public listAutoscalingPolicies(request: google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest): Promise; - - /** - * Calls DeleteAutoscalingPolicy. - * @param request DeleteAutoscalingPolicyRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteAutoscalingPolicy(request: google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest, callback: google.cloud.dataproc.v1.AutoscalingPolicyService.DeleteAutoscalingPolicyCallback): void; - - /** - * Calls DeleteAutoscalingPolicy. - * @param request DeleteAutoscalingPolicyRequest message or plain object - * @returns Promise - */ - public deleteAutoscalingPolicy(request: google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest): Promise; - } - - namespace AutoscalingPolicyService { - - /** - * Callback as used by {@link google.cloud.dataproc.v1.AutoscalingPolicyService|createAutoscalingPolicy}. - * @param error Error, if any - * @param [response] AutoscalingPolicy - */ - type CreateAutoscalingPolicyCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.AutoscalingPolicy) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.AutoscalingPolicyService|updateAutoscalingPolicy}. - * @param error Error, if any - * @param [response] AutoscalingPolicy - */ - type UpdateAutoscalingPolicyCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.AutoscalingPolicy) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.AutoscalingPolicyService|getAutoscalingPolicy}. - * @param error Error, if any - * @param [response] AutoscalingPolicy - */ - type GetAutoscalingPolicyCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.AutoscalingPolicy) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.AutoscalingPolicyService|listAutoscalingPolicies}. - * @param error Error, if any - * @param [response] ListAutoscalingPoliciesResponse - */ - type ListAutoscalingPoliciesCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.AutoscalingPolicyService|deleteAutoscalingPolicy}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteAutoscalingPolicyCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - } - - /** Properties of an AutoscalingPolicy. */ - interface IAutoscalingPolicy { - - /** AutoscalingPolicy id */ - id?: (string|null); - - /** AutoscalingPolicy name */ - name?: (string|null); - - /** AutoscalingPolicy basicAlgorithm */ - basicAlgorithm?: (google.cloud.dataproc.v1.IBasicAutoscalingAlgorithm|null); - - /** AutoscalingPolicy workerConfig */ - workerConfig?: (google.cloud.dataproc.v1.IInstanceGroupAutoscalingPolicyConfig|null); - - /** AutoscalingPolicy secondaryWorkerConfig */ - secondaryWorkerConfig?: (google.cloud.dataproc.v1.IInstanceGroupAutoscalingPolicyConfig|null); - - /** AutoscalingPolicy labels */ - labels?: ({ [k: string]: string }|null); - - /** AutoscalingPolicy clusterType */ - clusterType?: (google.cloud.dataproc.v1.AutoscalingPolicy.ClusterType|keyof typeof google.cloud.dataproc.v1.AutoscalingPolicy.ClusterType|null); - } - - /** Represents an AutoscalingPolicy. */ - class AutoscalingPolicy implements IAutoscalingPolicy { - - /** - * Constructs a new AutoscalingPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IAutoscalingPolicy); - - /** AutoscalingPolicy id. */ - public id: string; - - /** AutoscalingPolicy name. */ - public name: string; - - /** AutoscalingPolicy basicAlgorithm. */ - public basicAlgorithm?: (google.cloud.dataproc.v1.IBasicAutoscalingAlgorithm|null); - - /** AutoscalingPolicy workerConfig. */ - public workerConfig?: (google.cloud.dataproc.v1.IInstanceGroupAutoscalingPolicyConfig|null); - - /** AutoscalingPolicy secondaryWorkerConfig. */ - public secondaryWorkerConfig?: (google.cloud.dataproc.v1.IInstanceGroupAutoscalingPolicyConfig|null); - - /** AutoscalingPolicy labels. */ - public labels: { [k: string]: string }; - - /** AutoscalingPolicy clusterType. */ - public clusterType: (google.cloud.dataproc.v1.AutoscalingPolicy.ClusterType|keyof typeof google.cloud.dataproc.v1.AutoscalingPolicy.ClusterType); - - /** AutoscalingPolicy algorithm. */ - public algorithm?: "basicAlgorithm"; - - /** - * Creates a new AutoscalingPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns AutoscalingPolicy instance - */ - public static create(properties?: google.cloud.dataproc.v1.IAutoscalingPolicy): google.cloud.dataproc.v1.AutoscalingPolicy; - - /** - * Encodes the specified AutoscalingPolicy message. Does not implicitly {@link google.cloud.dataproc.v1.AutoscalingPolicy.verify|verify} messages. - * @param message AutoscalingPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IAutoscalingPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AutoscalingPolicy message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.AutoscalingPolicy.verify|verify} messages. - * @param message AutoscalingPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IAutoscalingPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AutoscalingPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AutoscalingPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.AutoscalingPolicy; - - /** - * Decodes an AutoscalingPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AutoscalingPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.AutoscalingPolicy; - - /** - * Verifies an AutoscalingPolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AutoscalingPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AutoscalingPolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.AutoscalingPolicy; - - /** - * Creates a plain object from an AutoscalingPolicy message. Also converts values to other types if specified. - * @param message AutoscalingPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.AutoscalingPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AutoscalingPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AutoscalingPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AutoscalingPolicy { - - /** ClusterType enum. */ - enum ClusterType { - CLUSTER_TYPE_UNSPECIFIED = 0, - STANDARD = 1, - ZERO_SCALE = 2 - } - } - - /** Properties of a BasicAutoscalingAlgorithm. */ - interface IBasicAutoscalingAlgorithm { - - /** BasicAutoscalingAlgorithm yarnConfig */ - yarnConfig?: (google.cloud.dataproc.v1.IBasicYarnAutoscalingConfig|null); - - /** BasicAutoscalingAlgorithm cooldownPeriod */ - cooldownPeriod?: (google.protobuf.IDuration|null); - } - - /** Represents a BasicAutoscalingAlgorithm. */ - class BasicAutoscalingAlgorithm implements IBasicAutoscalingAlgorithm { - - /** - * Constructs a new BasicAutoscalingAlgorithm. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IBasicAutoscalingAlgorithm); - - /** BasicAutoscalingAlgorithm yarnConfig. */ - public yarnConfig?: (google.cloud.dataproc.v1.IBasicYarnAutoscalingConfig|null); - - /** BasicAutoscalingAlgorithm cooldownPeriod. */ - public cooldownPeriod?: (google.protobuf.IDuration|null); - - /** BasicAutoscalingAlgorithm config. */ - public config?: "yarnConfig"; - - /** - * Creates a new BasicAutoscalingAlgorithm instance using the specified properties. - * @param [properties] Properties to set - * @returns BasicAutoscalingAlgorithm instance - */ - public static create(properties?: google.cloud.dataproc.v1.IBasicAutoscalingAlgorithm): google.cloud.dataproc.v1.BasicAutoscalingAlgorithm; - - /** - * Encodes the specified BasicAutoscalingAlgorithm message. Does not implicitly {@link google.cloud.dataproc.v1.BasicAutoscalingAlgorithm.verify|verify} messages. - * @param message BasicAutoscalingAlgorithm message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IBasicAutoscalingAlgorithm, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BasicAutoscalingAlgorithm message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.BasicAutoscalingAlgorithm.verify|verify} messages. - * @param message BasicAutoscalingAlgorithm message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IBasicAutoscalingAlgorithm, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BasicAutoscalingAlgorithm message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BasicAutoscalingAlgorithm - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.BasicAutoscalingAlgorithm; - - /** - * Decodes a BasicAutoscalingAlgorithm message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BasicAutoscalingAlgorithm - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.BasicAutoscalingAlgorithm; - - /** - * Verifies a BasicAutoscalingAlgorithm message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BasicAutoscalingAlgorithm message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BasicAutoscalingAlgorithm - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.BasicAutoscalingAlgorithm; - - /** - * Creates a plain object from a BasicAutoscalingAlgorithm message. Also converts values to other types if specified. - * @param message BasicAutoscalingAlgorithm - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.BasicAutoscalingAlgorithm, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BasicAutoscalingAlgorithm to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BasicAutoscalingAlgorithm - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BasicYarnAutoscalingConfig. */ - interface IBasicYarnAutoscalingConfig { - - /** BasicYarnAutoscalingConfig gracefulDecommissionTimeout */ - gracefulDecommissionTimeout?: (google.protobuf.IDuration|null); - - /** BasicYarnAutoscalingConfig scaleUpFactor */ - scaleUpFactor?: (number|null); - - /** BasicYarnAutoscalingConfig scaleDownFactor */ - scaleDownFactor?: (number|null); - - /** BasicYarnAutoscalingConfig scaleUpMinWorkerFraction */ - scaleUpMinWorkerFraction?: (number|null); - - /** BasicYarnAutoscalingConfig scaleDownMinWorkerFraction */ - scaleDownMinWorkerFraction?: (number|null); - } - - /** Represents a BasicYarnAutoscalingConfig. */ - class BasicYarnAutoscalingConfig implements IBasicYarnAutoscalingConfig { - - /** - * Constructs a new BasicYarnAutoscalingConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IBasicYarnAutoscalingConfig); - - /** BasicYarnAutoscalingConfig gracefulDecommissionTimeout. */ - public gracefulDecommissionTimeout?: (google.protobuf.IDuration|null); - - /** BasicYarnAutoscalingConfig scaleUpFactor. */ - public scaleUpFactor: number; - - /** BasicYarnAutoscalingConfig scaleDownFactor. */ - public scaleDownFactor: number; - - /** BasicYarnAutoscalingConfig scaleUpMinWorkerFraction. */ - public scaleUpMinWorkerFraction: number; - - /** BasicYarnAutoscalingConfig scaleDownMinWorkerFraction. */ - public scaleDownMinWorkerFraction: number; - - /** - * Creates a new BasicYarnAutoscalingConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns BasicYarnAutoscalingConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.IBasicYarnAutoscalingConfig): google.cloud.dataproc.v1.BasicYarnAutoscalingConfig; - - /** - * Encodes the specified BasicYarnAutoscalingConfig message. Does not implicitly {@link google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.verify|verify} messages. - * @param message BasicYarnAutoscalingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IBasicYarnAutoscalingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BasicYarnAutoscalingConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.verify|verify} messages. - * @param message BasicYarnAutoscalingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IBasicYarnAutoscalingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BasicYarnAutoscalingConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BasicYarnAutoscalingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.BasicYarnAutoscalingConfig; - - /** - * Decodes a BasicYarnAutoscalingConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BasicYarnAutoscalingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.BasicYarnAutoscalingConfig; - - /** - * Verifies a BasicYarnAutoscalingConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BasicYarnAutoscalingConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BasicYarnAutoscalingConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.BasicYarnAutoscalingConfig; - - /** - * Creates a plain object from a BasicYarnAutoscalingConfig message. Also converts values to other types if specified. - * @param message BasicYarnAutoscalingConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.BasicYarnAutoscalingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BasicYarnAutoscalingConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BasicYarnAutoscalingConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InstanceGroupAutoscalingPolicyConfig. */ - interface IInstanceGroupAutoscalingPolicyConfig { - - /** InstanceGroupAutoscalingPolicyConfig minInstances */ - minInstances?: (number|null); - - /** InstanceGroupAutoscalingPolicyConfig maxInstances */ - maxInstances?: (number|null); - - /** InstanceGroupAutoscalingPolicyConfig weight */ - weight?: (number|null); - } - - /** Represents an InstanceGroupAutoscalingPolicyConfig. */ - class InstanceGroupAutoscalingPolicyConfig implements IInstanceGroupAutoscalingPolicyConfig { - - /** - * Constructs a new InstanceGroupAutoscalingPolicyConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IInstanceGroupAutoscalingPolicyConfig); - - /** InstanceGroupAutoscalingPolicyConfig minInstances. */ - public minInstances: number; - - /** InstanceGroupAutoscalingPolicyConfig maxInstances. */ - public maxInstances: number; - - /** InstanceGroupAutoscalingPolicyConfig weight. */ - public weight: number; - - /** - * Creates a new InstanceGroupAutoscalingPolicyConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns InstanceGroupAutoscalingPolicyConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.IInstanceGroupAutoscalingPolicyConfig): google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig; - - /** - * Encodes the specified InstanceGroupAutoscalingPolicyConfig message. Does not implicitly {@link google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig.verify|verify} messages. - * @param message InstanceGroupAutoscalingPolicyConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IInstanceGroupAutoscalingPolicyConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InstanceGroupAutoscalingPolicyConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig.verify|verify} messages. - * @param message InstanceGroupAutoscalingPolicyConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IInstanceGroupAutoscalingPolicyConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InstanceGroupAutoscalingPolicyConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InstanceGroupAutoscalingPolicyConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig; - - /** - * Decodes an InstanceGroupAutoscalingPolicyConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstanceGroupAutoscalingPolicyConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig; - - /** - * Verifies an InstanceGroupAutoscalingPolicyConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InstanceGroupAutoscalingPolicyConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstanceGroupAutoscalingPolicyConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig; - - /** - * Creates a plain object from an InstanceGroupAutoscalingPolicyConfig message. Also converts values to other types if specified. - * @param message InstanceGroupAutoscalingPolicyConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InstanceGroupAutoscalingPolicyConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InstanceGroupAutoscalingPolicyConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateAutoscalingPolicyRequest. */ - interface ICreateAutoscalingPolicyRequest { - - /** CreateAutoscalingPolicyRequest parent */ - parent?: (string|null); - - /** CreateAutoscalingPolicyRequest policy */ - policy?: (google.cloud.dataproc.v1.IAutoscalingPolicy|null); - } - - /** Represents a CreateAutoscalingPolicyRequest. */ - class CreateAutoscalingPolicyRequest implements ICreateAutoscalingPolicyRequest { - - /** - * Constructs a new CreateAutoscalingPolicyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest); - - /** CreateAutoscalingPolicyRequest parent. */ - public parent: string; - - /** CreateAutoscalingPolicyRequest policy. */ - public policy?: (google.cloud.dataproc.v1.IAutoscalingPolicy|null); - - /** - * Creates a new CreateAutoscalingPolicyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateAutoscalingPolicyRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest): google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest; - - /** - * Encodes the specified CreateAutoscalingPolicyRequest message. Does not implicitly {@link google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest.verify|verify} messages. - * @param message CreateAutoscalingPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateAutoscalingPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest.verify|verify} messages. - * @param message CreateAutoscalingPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateAutoscalingPolicyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateAutoscalingPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest; - - /** - * Decodes a CreateAutoscalingPolicyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateAutoscalingPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest; - - /** - * Verifies a CreateAutoscalingPolicyRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateAutoscalingPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateAutoscalingPolicyRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest; - - /** - * Creates a plain object from a CreateAutoscalingPolicyRequest message. Also converts values to other types if specified. - * @param message CreateAutoscalingPolicyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateAutoscalingPolicyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateAutoscalingPolicyRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetAutoscalingPolicyRequest. */ - interface IGetAutoscalingPolicyRequest { - - /** GetAutoscalingPolicyRequest name */ - name?: (string|null); - } - - /** Represents a GetAutoscalingPolicyRequest. */ - class GetAutoscalingPolicyRequest implements IGetAutoscalingPolicyRequest { - - /** - * Constructs a new GetAutoscalingPolicyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest); - - /** GetAutoscalingPolicyRequest name. */ - public name: string; - - /** - * Creates a new GetAutoscalingPolicyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetAutoscalingPolicyRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest): google.cloud.dataproc.v1.GetAutoscalingPolicyRequest; - - /** - * Encodes the specified GetAutoscalingPolicyRequest message. Does not implicitly {@link google.cloud.dataproc.v1.GetAutoscalingPolicyRequest.verify|verify} messages. - * @param message GetAutoscalingPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetAutoscalingPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GetAutoscalingPolicyRequest.verify|verify} messages. - * @param message GetAutoscalingPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetAutoscalingPolicyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetAutoscalingPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.GetAutoscalingPolicyRequest; - - /** - * Decodes a GetAutoscalingPolicyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetAutoscalingPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.GetAutoscalingPolicyRequest; - - /** - * Verifies a GetAutoscalingPolicyRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetAutoscalingPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetAutoscalingPolicyRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.GetAutoscalingPolicyRequest; - - /** - * Creates a plain object from a GetAutoscalingPolicyRequest message. Also converts values to other types if specified. - * @param message GetAutoscalingPolicyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.GetAutoscalingPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetAutoscalingPolicyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetAutoscalingPolicyRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateAutoscalingPolicyRequest. */ - interface IUpdateAutoscalingPolicyRequest { - - /** UpdateAutoscalingPolicyRequest policy */ - policy?: (google.cloud.dataproc.v1.IAutoscalingPolicy|null); - } - - /** Represents an UpdateAutoscalingPolicyRequest. */ - class UpdateAutoscalingPolicyRequest implements IUpdateAutoscalingPolicyRequest { - - /** - * Constructs a new UpdateAutoscalingPolicyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest); - - /** UpdateAutoscalingPolicyRequest policy. */ - public policy?: (google.cloud.dataproc.v1.IAutoscalingPolicy|null); - - /** - * Creates a new UpdateAutoscalingPolicyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateAutoscalingPolicyRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest): google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest; - - /** - * Encodes the specified UpdateAutoscalingPolicyRequest message. Does not implicitly {@link google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest.verify|verify} messages. - * @param message UpdateAutoscalingPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateAutoscalingPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest.verify|verify} messages. - * @param message UpdateAutoscalingPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateAutoscalingPolicyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateAutoscalingPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest; - - /** - * Decodes an UpdateAutoscalingPolicyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateAutoscalingPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest; - - /** - * Verifies an UpdateAutoscalingPolicyRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateAutoscalingPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateAutoscalingPolicyRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest; - - /** - * Creates a plain object from an UpdateAutoscalingPolicyRequest message. Also converts values to other types if specified. - * @param message UpdateAutoscalingPolicyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateAutoscalingPolicyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateAutoscalingPolicyRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteAutoscalingPolicyRequest. */ - interface IDeleteAutoscalingPolicyRequest { - - /** DeleteAutoscalingPolicyRequest name */ - name?: (string|null); - } - - /** Represents a DeleteAutoscalingPolicyRequest. */ - class DeleteAutoscalingPolicyRequest implements IDeleteAutoscalingPolicyRequest { - - /** - * Constructs a new DeleteAutoscalingPolicyRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest); - - /** DeleteAutoscalingPolicyRequest name. */ - public name: string; - - /** - * Creates a new DeleteAutoscalingPolicyRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteAutoscalingPolicyRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest): google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest; - - /** - * Encodes the specified DeleteAutoscalingPolicyRequest message. Does not implicitly {@link google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest.verify|verify} messages. - * @param message DeleteAutoscalingPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteAutoscalingPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest.verify|verify} messages. - * @param message DeleteAutoscalingPolicyRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteAutoscalingPolicyRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteAutoscalingPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest; - - /** - * Decodes a DeleteAutoscalingPolicyRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteAutoscalingPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest; - - /** - * Verifies a DeleteAutoscalingPolicyRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteAutoscalingPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteAutoscalingPolicyRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest; - - /** - * Creates a plain object from a DeleteAutoscalingPolicyRequest message. Also converts values to other types if specified. - * @param message DeleteAutoscalingPolicyRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteAutoscalingPolicyRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteAutoscalingPolicyRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListAutoscalingPoliciesRequest. */ - interface IListAutoscalingPoliciesRequest { - - /** ListAutoscalingPoliciesRequest parent */ - parent?: (string|null); - - /** ListAutoscalingPoliciesRequest pageSize */ - pageSize?: (number|null); - - /** ListAutoscalingPoliciesRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListAutoscalingPoliciesRequest. */ - class ListAutoscalingPoliciesRequest implements IListAutoscalingPoliciesRequest { - - /** - * Constructs a new ListAutoscalingPoliciesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest); - - /** ListAutoscalingPoliciesRequest parent. */ - public parent: string; - - /** ListAutoscalingPoliciesRequest pageSize. */ - public pageSize: number; - - /** ListAutoscalingPoliciesRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListAutoscalingPoliciesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListAutoscalingPoliciesRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest): google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest; - - /** - * Encodes the specified ListAutoscalingPoliciesRequest message. Does not implicitly {@link google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest.verify|verify} messages. - * @param message ListAutoscalingPoliciesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListAutoscalingPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest.verify|verify} messages. - * @param message ListAutoscalingPoliciesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListAutoscalingPoliciesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListAutoscalingPoliciesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest; - - /** - * Decodes a ListAutoscalingPoliciesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListAutoscalingPoliciesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest; - - /** - * Verifies a ListAutoscalingPoliciesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListAutoscalingPoliciesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListAutoscalingPoliciesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest; - - /** - * Creates a plain object from a ListAutoscalingPoliciesRequest message. Also converts values to other types if specified. - * @param message ListAutoscalingPoliciesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListAutoscalingPoliciesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListAutoscalingPoliciesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListAutoscalingPoliciesResponse. */ - interface IListAutoscalingPoliciesResponse { - - /** ListAutoscalingPoliciesResponse policies */ - policies?: (google.cloud.dataproc.v1.IAutoscalingPolicy[]|null); - - /** ListAutoscalingPoliciesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListAutoscalingPoliciesResponse. */ - class ListAutoscalingPoliciesResponse implements IListAutoscalingPoliciesResponse { - - /** - * Constructs a new ListAutoscalingPoliciesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse); - - /** ListAutoscalingPoliciesResponse policies. */ - public policies: google.cloud.dataproc.v1.IAutoscalingPolicy[]; - - /** ListAutoscalingPoliciesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListAutoscalingPoliciesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListAutoscalingPoliciesResponse instance - */ - public static create(properties?: google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse): google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse; - - /** - * Encodes the specified ListAutoscalingPoliciesResponse message. Does not implicitly {@link google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse.verify|verify} messages. - * @param message ListAutoscalingPoliciesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListAutoscalingPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse.verify|verify} messages. - * @param message ListAutoscalingPoliciesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListAutoscalingPoliciesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListAutoscalingPoliciesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse; - - /** - * Decodes a ListAutoscalingPoliciesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListAutoscalingPoliciesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse; - - /** - * Verifies a ListAutoscalingPoliciesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListAutoscalingPoliciesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListAutoscalingPoliciesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse; - - /** - * Creates a plain object from a ListAutoscalingPoliciesResponse message. Also converts values to other types if specified. - * @param message ListAutoscalingPoliciesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListAutoscalingPoliciesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListAutoscalingPoliciesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a BatchController */ - class BatchController extends $protobuf.rpc.Service { - - /** - * Constructs a new BatchController 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 BatchController 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): BatchController; - - /** - * Calls CreateBatch. - * @param request CreateBatchRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createBatch(request: google.cloud.dataproc.v1.ICreateBatchRequest, callback: google.cloud.dataproc.v1.BatchController.CreateBatchCallback): void; - - /** - * Calls CreateBatch. - * @param request CreateBatchRequest message or plain object - * @returns Promise - */ - public createBatch(request: google.cloud.dataproc.v1.ICreateBatchRequest): Promise; - - /** - * Calls GetBatch. - * @param request GetBatchRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Batch - */ - public getBatch(request: google.cloud.dataproc.v1.IGetBatchRequest, callback: google.cloud.dataproc.v1.BatchController.GetBatchCallback): void; - - /** - * Calls GetBatch. - * @param request GetBatchRequest message or plain object - * @returns Promise - */ - public getBatch(request: google.cloud.dataproc.v1.IGetBatchRequest): Promise; - - /** - * Calls ListBatches. - * @param request ListBatchesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListBatchesResponse - */ - public listBatches(request: google.cloud.dataproc.v1.IListBatchesRequest, callback: google.cloud.dataproc.v1.BatchController.ListBatchesCallback): void; - - /** - * Calls ListBatches. - * @param request ListBatchesRequest message or plain object - * @returns Promise - */ - public listBatches(request: google.cloud.dataproc.v1.IListBatchesRequest): Promise; - - /** - * Calls DeleteBatch. - * @param request DeleteBatchRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteBatch(request: google.cloud.dataproc.v1.IDeleteBatchRequest, callback: google.cloud.dataproc.v1.BatchController.DeleteBatchCallback): void; - - /** - * Calls DeleteBatch. - * @param request DeleteBatchRequest message or plain object - * @returns Promise - */ - public deleteBatch(request: google.cloud.dataproc.v1.IDeleteBatchRequest): Promise; - } - - namespace BatchController { - - /** - * Callback as used by {@link google.cloud.dataproc.v1.BatchController|createBatch}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateBatchCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.BatchController|getBatch}. - * @param error Error, if any - * @param [response] Batch - */ - type GetBatchCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.Batch) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.BatchController|listBatches}. - * @param error Error, if any - * @param [response] ListBatchesResponse - */ - type ListBatchesCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.ListBatchesResponse) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.BatchController|deleteBatch}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteBatchCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - } - - /** Properties of a CreateBatchRequest. */ - interface ICreateBatchRequest { - - /** CreateBatchRequest parent */ - parent?: (string|null); - - /** CreateBatchRequest batch */ - batch?: (google.cloud.dataproc.v1.IBatch|null); - - /** CreateBatchRequest batchId */ - batchId?: (string|null); - - /** CreateBatchRequest requestId */ - requestId?: (string|null); - } - - /** Represents a CreateBatchRequest. */ - class CreateBatchRequest implements ICreateBatchRequest { - - /** - * Constructs a new CreateBatchRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.ICreateBatchRequest); - - /** CreateBatchRequest parent. */ - public parent: string; - - /** CreateBatchRequest batch. */ - public batch?: (google.cloud.dataproc.v1.IBatch|null); - - /** CreateBatchRequest batchId. */ - public batchId: string; - - /** CreateBatchRequest requestId. */ - public requestId: string; - - /** - * Creates a new CreateBatchRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateBatchRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.ICreateBatchRequest): google.cloud.dataproc.v1.CreateBatchRequest; - - /** - * Encodes the specified CreateBatchRequest message. Does not implicitly {@link google.cloud.dataproc.v1.CreateBatchRequest.verify|verify} messages. - * @param message CreateBatchRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.ICreateBatchRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateBatchRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.CreateBatchRequest.verify|verify} messages. - * @param message CreateBatchRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.ICreateBatchRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateBatchRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateBatchRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.CreateBatchRequest; - - /** - * Decodes a CreateBatchRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateBatchRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.CreateBatchRequest; - - /** - * Verifies a CreateBatchRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateBatchRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateBatchRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.CreateBatchRequest; - - /** - * Creates a plain object from a CreateBatchRequest message. Also converts values to other types if specified. - * @param message CreateBatchRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.CreateBatchRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateBatchRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateBatchRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetBatchRequest. */ - interface IGetBatchRequest { - - /** GetBatchRequest name */ - name?: (string|null); - } - - /** Represents a GetBatchRequest. */ - class GetBatchRequest implements IGetBatchRequest { - - /** - * Constructs a new GetBatchRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IGetBatchRequest); - - /** GetBatchRequest name. */ - public name: string; - - /** - * Creates a new GetBatchRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetBatchRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.IGetBatchRequest): google.cloud.dataproc.v1.GetBatchRequest; - - /** - * Encodes the specified GetBatchRequest message. Does not implicitly {@link google.cloud.dataproc.v1.GetBatchRequest.verify|verify} messages. - * @param message GetBatchRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IGetBatchRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetBatchRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GetBatchRequest.verify|verify} messages. - * @param message GetBatchRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IGetBatchRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetBatchRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetBatchRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.GetBatchRequest; - - /** - * Decodes a GetBatchRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetBatchRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.GetBatchRequest; - - /** - * Verifies a GetBatchRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetBatchRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetBatchRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.GetBatchRequest; - - /** - * Creates a plain object from a GetBatchRequest message. Also converts values to other types if specified. - * @param message GetBatchRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.GetBatchRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetBatchRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetBatchRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListBatchesRequest. */ - interface IListBatchesRequest { - - /** ListBatchesRequest parent */ - parent?: (string|null); - - /** ListBatchesRequest pageSize */ - pageSize?: (number|null); - - /** ListBatchesRequest pageToken */ - pageToken?: (string|null); - - /** ListBatchesRequest filter */ - filter?: (string|null); - - /** ListBatchesRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListBatchesRequest. */ - class ListBatchesRequest implements IListBatchesRequest { - - /** - * Constructs a new ListBatchesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IListBatchesRequest); - - /** ListBatchesRequest parent. */ - public parent: string; - - /** ListBatchesRequest pageSize. */ - public pageSize: number; - - /** ListBatchesRequest pageToken. */ - public pageToken: string; - - /** ListBatchesRequest filter. */ - public filter: string; - - /** ListBatchesRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListBatchesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListBatchesRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.IListBatchesRequest): google.cloud.dataproc.v1.ListBatchesRequest; - - /** - * Encodes the specified ListBatchesRequest message. Does not implicitly {@link google.cloud.dataproc.v1.ListBatchesRequest.verify|verify} messages. - * @param message ListBatchesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IListBatchesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListBatchesRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListBatchesRequest.verify|verify} messages. - * @param message ListBatchesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IListBatchesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListBatchesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListBatchesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ListBatchesRequest; - - /** - * Decodes a ListBatchesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListBatchesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ListBatchesRequest; - - /** - * Verifies a ListBatchesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListBatchesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListBatchesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ListBatchesRequest; - - /** - * Creates a plain object from a ListBatchesRequest message. Also converts values to other types if specified. - * @param message ListBatchesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.ListBatchesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListBatchesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListBatchesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListBatchesResponse. */ - interface IListBatchesResponse { - - /** ListBatchesResponse batches */ - batches?: (google.cloud.dataproc.v1.IBatch[]|null); - - /** ListBatchesResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListBatchesResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListBatchesResponse. */ - class ListBatchesResponse implements IListBatchesResponse { - - /** - * Constructs a new ListBatchesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IListBatchesResponse); - - /** ListBatchesResponse batches. */ - public batches: google.cloud.dataproc.v1.IBatch[]; - - /** ListBatchesResponse nextPageToken. */ - public nextPageToken: string; - - /** ListBatchesResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListBatchesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListBatchesResponse instance - */ - public static create(properties?: google.cloud.dataproc.v1.IListBatchesResponse): google.cloud.dataproc.v1.ListBatchesResponse; - - /** - * Encodes the specified ListBatchesResponse message. Does not implicitly {@link google.cloud.dataproc.v1.ListBatchesResponse.verify|verify} messages. - * @param message ListBatchesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IListBatchesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListBatchesResponse message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListBatchesResponse.verify|verify} messages. - * @param message ListBatchesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IListBatchesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListBatchesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListBatchesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ListBatchesResponse; - - /** - * Decodes a ListBatchesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListBatchesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ListBatchesResponse; - - /** - * Verifies a ListBatchesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListBatchesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListBatchesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ListBatchesResponse; - - /** - * Creates a plain object from a ListBatchesResponse message. Also converts values to other types if specified. - * @param message ListBatchesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.ListBatchesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListBatchesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListBatchesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteBatchRequest. */ - interface IDeleteBatchRequest { - - /** DeleteBatchRequest name */ - name?: (string|null); - } - - /** Represents a DeleteBatchRequest. */ - class DeleteBatchRequest implements IDeleteBatchRequest { - - /** - * Constructs a new DeleteBatchRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IDeleteBatchRequest); - - /** DeleteBatchRequest name. */ - public name: string; - - /** - * Creates a new DeleteBatchRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteBatchRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.IDeleteBatchRequest): google.cloud.dataproc.v1.DeleteBatchRequest; - - /** - * Encodes the specified DeleteBatchRequest message. Does not implicitly {@link google.cloud.dataproc.v1.DeleteBatchRequest.verify|verify} messages. - * @param message DeleteBatchRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IDeleteBatchRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteBatchRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DeleteBatchRequest.verify|verify} messages. - * @param message DeleteBatchRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IDeleteBatchRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteBatchRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteBatchRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.DeleteBatchRequest; - - /** - * Decodes a DeleteBatchRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteBatchRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.DeleteBatchRequest; - - /** - * Verifies a DeleteBatchRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteBatchRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteBatchRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.DeleteBatchRequest; - - /** - * Creates a plain object from a DeleteBatchRequest message. Also converts values to other types if specified. - * @param message DeleteBatchRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.DeleteBatchRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteBatchRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteBatchRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Batch. */ - interface IBatch { - - /** Batch name */ - name?: (string|null); - - /** Batch uuid */ - uuid?: (string|null); - - /** Batch createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Batch pysparkBatch */ - pysparkBatch?: (google.cloud.dataproc.v1.IPySparkBatch|null); - - /** Batch sparkBatch */ - sparkBatch?: (google.cloud.dataproc.v1.ISparkBatch|null); - - /** Batch sparkRBatch */ - sparkRBatch?: (google.cloud.dataproc.v1.ISparkRBatch|null); - - /** Batch sparkSqlBatch */ - sparkSqlBatch?: (google.cloud.dataproc.v1.ISparkSqlBatch|null); - - /** Batch pysparkNotebookBatch */ - pysparkNotebookBatch?: (google.cloud.dataproc.v1.IPySparkNotebookBatch|null); - - /** Batch runtimeInfo */ - runtimeInfo?: (google.cloud.dataproc.v1.IRuntimeInfo|null); - - /** Batch state */ - state?: (google.cloud.dataproc.v1.Batch.State|keyof typeof google.cloud.dataproc.v1.Batch.State|null); - - /** Batch stateMessage */ - stateMessage?: (string|null); - - /** Batch stateTime */ - stateTime?: (google.protobuf.ITimestamp|null); - - /** Batch creator */ - creator?: (string|null); - - /** Batch labels */ - labels?: ({ [k: string]: string }|null); - - /** Batch runtimeConfig */ - runtimeConfig?: (google.cloud.dataproc.v1.IRuntimeConfig|null); - - /** Batch environmentConfig */ - environmentConfig?: (google.cloud.dataproc.v1.IEnvironmentConfig|null); - - /** Batch operation */ - operation?: (string|null); - - /** Batch stateHistory */ - stateHistory?: (google.cloud.dataproc.v1.Batch.IStateHistory[]|null); - } - - /** Represents a Batch. */ - class Batch implements IBatch { - - /** - * Constructs a new Batch. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IBatch); - - /** Batch name. */ - public name: string; - - /** Batch uuid. */ - public uuid: string; - - /** Batch createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Batch pysparkBatch. */ - public pysparkBatch?: (google.cloud.dataproc.v1.IPySparkBatch|null); - - /** Batch sparkBatch. */ - public sparkBatch?: (google.cloud.dataproc.v1.ISparkBatch|null); - - /** Batch sparkRBatch. */ - public sparkRBatch?: (google.cloud.dataproc.v1.ISparkRBatch|null); - - /** Batch sparkSqlBatch. */ - public sparkSqlBatch?: (google.cloud.dataproc.v1.ISparkSqlBatch|null); - - /** Batch pysparkNotebookBatch. */ - public pysparkNotebookBatch?: (google.cloud.dataproc.v1.IPySparkNotebookBatch|null); - - /** Batch runtimeInfo. */ - public runtimeInfo?: (google.cloud.dataproc.v1.IRuntimeInfo|null); - - /** Batch state. */ - public state: (google.cloud.dataproc.v1.Batch.State|keyof typeof google.cloud.dataproc.v1.Batch.State); - - /** Batch stateMessage. */ - public stateMessage: string; - - /** Batch stateTime. */ - public stateTime?: (google.protobuf.ITimestamp|null); - - /** Batch creator. */ - public creator: string; - - /** Batch labels. */ - public labels: { [k: string]: string }; - - /** Batch runtimeConfig. */ - public runtimeConfig?: (google.cloud.dataproc.v1.IRuntimeConfig|null); - - /** Batch environmentConfig. */ - public environmentConfig?: (google.cloud.dataproc.v1.IEnvironmentConfig|null); - - /** Batch operation. */ - public operation: string; - - /** Batch stateHistory. */ - public stateHistory: google.cloud.dataproc.v1.Batch.IStateHistory[]; - - /** Batch batchConfig. */ - public batchConfig?: ("pysparkBatch"|"sparkBatch"|"sparkRBatch"|"sparkSqlBatch"|"pysparkNotebookBatch"); - - /** - * Creates a new Batch instance using the specified properties. - * @param [properties] Properties to set - * @returns Batch instance - */ - public static create(properties?: google.cloud.dataproc.v1.IBatch): google.cloud.dataproc.v1.Batch; - - /** - * Encodes the specified Batch message. Does not implicitly {@link google.cloud.dataproc.v1.Batch.verify|verify} messages. - * @param message Batch message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IBatch, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Batch message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.Batch.verify|verify} messages. - * @param message Batch message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IBatch, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Batch message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Batch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.Batch; - - /** - * Decodes a Batch message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Batch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.Batch; - - /** - * Verifies a Batch message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Batch message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Batch - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.Batch; - - /** - * Creates a plain object from a Batch message. Also converts values to other types if specified. - * @param message Batch - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.Batch, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Batch to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Batch - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Batch { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - PENDING = 1, - RUNNING = 2, - CANCELLING = 3, - CANCELLED = 4, - SUCCEEDED = 5, - FAILED = 6 - } - - /** Properties of a StateHistory. */ - interface IStateHistory { - - /** StateHistory state */ - state?: (google.cloud.dataproc.v1.Batch.State|keyof typeof google.cloud.dataproc.v1.Batch.State|null); - - /** StateHistory stateMessage */ - stateMessage?: (string|null); - - /** StateHistory stateStartTime */ - stateStartTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a StateHistory. */ - class StateHistory implements IStateHistory { - - /** - * Constructs a new StateHistory. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.Batch.IStateHistory); - - /** StateHistory state. */ - public state: (google.cloud.dataproc.v1.Batch.State|keyof typeof google.cloud.dataproc.v1.Batch.State); - - /** StateHistory stateMessage. */ - public stateMessage: string; - - /** StateHistory stateStartTime. */ - public stateStartTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new StateHistory instance using the specified properties. - * @param [properties] Properties to set - * @returns StateHistory instance - */ - public static create(properties?: google.cloud.dataproc.v1.Batch.IStateHistory): google.cloud.dataproc.v1.Batch.StateHistory; - - /** - * Encodes the specified StateHistory message. Does not implicitly {@link google.cloud.dataproc.v1.Batch.StateHistory.verify|verify} messages. - * @param message StateHistory message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.Batch.IStateHistory, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StateHistory message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.Batch.StateHistory.verify|verify} messages. - * @param message StateHistory message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.Batch.IStateHistory, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StateHistory message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StateHistory - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.Batch.StateHistory; - - /** - * Decodes a StateHistory message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StateHistory - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.Batch.StateHistory; - - /** - * Verifies a StateHistory message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StateHistory message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StateHistory - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.Batch.StateHistory; - - /** - * Creates a plain object from a StateHistory message. Also converts values to other types if specified. - * @param message StateHistory - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.Batch.StateHistory, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StateHistory to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StateHistory - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a PySparkBatch. */ - interface IPySparkBatch { - - /** PySparkBatch mainPythonFileUri */ - mainPythonFileUri?: (string|null); - - /** PySparkBatch args */ - args?: (string[]|null); - - /** PySparkBatch pythonFileUris */ - pythonFileUris?: (string[]|null); - - /** PySparkBatch jarFileUris */ - jarFileUris?: (string[]|null); - - /** PySparkBatch fileUris */ - fileUris?: (string[]|null); - - /** PySparkBatch archiveUris */ - archiveUris?: (string[]|null); - } - - /** Represents a PySparkBatch. */ - class PySparkBatch implements IPySparkBatch { - - /** - * Constructs a new PySparkBatch. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IPySparkBatch); - - /** PySparkBatch mainPythonFileUri. */ - public mainPythonFileUri: string; - - /** PySparkBatch args. */ - public args: string[]; - - /** PySparkBatch pythonFileUris. */ - public pythonFileUris: string[]; - - /** PySparkBatch jarFileUris. */ - public jarFileUris: string[]; - - /** PySparkBatch fileUris. */ - public fileUris: string[]; - - /** PySparkBatch archiveUris. */ - public archiveUris: string[]; - - /** - * Creates a new PySparkBatch instance using the specified properties. - * @param [properties] Properties to set - * @returns PySparkBatch instance - */ - public static create(properties?: google.cloud.dataproc.v1.IPySparkBatch): google.cloud.dataproc.v1.PySparkBatch; - - /** - * Encodes the specified PySparkBatch message. Does not implicitly {@link google.cloud.dataproc.v1.PySparkBatch.verify|verify} messages. - * @param message PySparkBatch message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IPySparkBatch, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PySparkBatch message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.PySparkBatch.verify|verify} messages. - * @param message PySparkBatch message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IPySparkBatch, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PySparkBatch message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PySparkBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.PySparkBatch; - - /** - * Decodes a PySparkBatch message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PySparkBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.PySparkBatch; - - /** - * Verifies a PySparkBatch message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PySparkBatch message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PySparkBatch - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.PySparkBatch; - - /** - * Creates a plain object from a PySparkBatch message. Also converts values to other types if specified. - * @param message PySparkBatch - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.PySparkBatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PySparkBatch to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PySparkBatch - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SparkBatch. */ - interface ISparkBatch { - - /** SparkBatch mainJarFileUri */ - mainJarFileUri?: (string|null); - - /** SparkBatch mainClass */ - mainClass?: (string|null); - - /** SparkBatch args */ - args?: (string[]|null); - - /** SparkBatch jarFileUris */ - jarFileUris?: (string[]|null); - - /** SparkBatch fileUris */ - fileUris?: (string[]|null); - - /** SparkBatch archiveUris */ - archiveUris?: (string[]|null); - } - - /** Represents a SparkBatch. */ - class SparkBatch implements ISparkBatch { - - /** - * Constructs a new SparkBatch. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.ISparkBatch); - - /** SparkBatch mainJarFileUri. */ - public mainJarFileUri?: (string|null); - - /** SparkBatch mainClass. */ - public mainClass?: (string|null); - - /** SparkBatch args. */ - public args: string[]; - - /** SparkBatch jarFileUris. */ - public jarFileUris: string[]; - - /** SparkBatch fileUris. */ - public fileUris: string[]; - - /** SparkBatch archiveUris. */ - public archiveUris: string[]; - - /** SparkBatch driver. */ - public driver?: ("mainJarFileUri"|"mainClass"); - - /** - * Creates a new SparkBatch instance using the specified properties. - * @param [properties] Properties to set - * @returns SparkBatch instance - */ - public static create(properties?: google.cloud.dataproc.v1.ISparkBatch): google.cloud.dataproc.v1.SparkBatch; - - /** - * Encodes the specified SparkBatch message. Does not implicitly {@link google.cloud.dataproc.v1.SparkBatch.verify|verify} messages. - * @param message SparkBatch message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.ISparkBatch, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SparkBatch message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SparkBatch.verify|verify} messages. - * @param message SparkBatch message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.ISparkBatch, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SparkBatch message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SparkBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.SparkBatch; - - /** - * Decodes a SparkBatch message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SparkBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.SparkBatch; - - /** - * Verifies a SparkBatch message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SparkBatch message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SparkBatch - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.SparkBatch; - - /** - * Creates a plain object from a SparkBatch message. Also converts values to other types if specified. - * @param message SparkBatch - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.SparkBatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SparkBatch to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SparkBatch - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SparkRBatch. */ - interface ISparkRBatch { - - /** SparkRBatch mainRFileUri */ - mainRFileUri?: (string|null); - - /** SparkRBatch args */ - args?: (string[]|null); - - /** SparkRBatch fileUris */ - fileUris?: (string[]|null); - - /** SparkRBatch archiveUris */ - archiveUris?: (string[]|null); - } - - /** Represents a SparkRBatch. */ - class SparkRBatch implements ISparkRBatch { - - /** - * Constructs a new SparkRBatch. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.ISparkRBatch); - - /** SparkRBatch mainRFileUri. */ - public mainRFileUri: string; - - /** SparkRBatch args. */ - public args: string[]; - - /** SparkRBatch fileUris. */ - public fileUris: string[]; - - /** SparkRBatch archiveUris. */ - public archiveUris: string[]; - - /** - * Creates a new SparkRBatch instance using the specified properties. - * @param [properties] Properties to set - * @returns SparkRBatch instance - */ - public static create(properties?: google.cloud.dataproc.v1.ISparkRBatch): google.cloud.dataproc.v1.SparkRBatch; - - /** - * Encodes the specified SparkRBatch message. Does not implicitly {@link google.cloud.dataproc.v1.SparkRBatch.verify|verify} messages. - * @param message SparkRBatch message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.ISparkRBatch, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SparkRBatch message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SparkRBatch.verify|verify} messages. - * @param message SparkRBatch message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.ISparkRBatch, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SparkRBatch message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SparkRBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.SparkRBatch; - - /** - * Decodes a SparkRBatch message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SparkRBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.SparkRBatch; - - /** - * Verifies a SparkRBatch message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SparkRBatch message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SparkRBatch - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.SparkRBatch; - - /** - * Creates a plain object from a SparkRBatch message. Also converts values to other types if specified. - * @param message SparkRBatch - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.SparkRBatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SparkRBatch to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SparkRBatch - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SparkSqlBatch. */ - interface ISparkSqlBatch { - - /** SparkSqlBatch queryFileUri */ - queryFileUri?: (string|null); - - /** SparkSqlBatch queryVariables */ - queryVariables?: ({ [k: string]: string }|null); - - /** SparkSqlBatch jarFileUris */ - jarFileUris?: (string[]|null); - } - - /** Represents a SparkSqlBatch. */ - class SparkSqlBatch implements ISparkSqlBatch { - - /** - * Constructs a new SparkSqlBatch. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.ISparkSqlBatch); - - /** SparkSqlBatch queryFileUri. */ - public queryFileUri: string; - - /** SparkSqlBatch queryVariables. */ - public queryVariables: { [k: string]: string }; - - /** SparkSqlBatch jarFileUris. */ - public jarFileUris: string[]; - - /** - * Creates a new SparkSqlBatch instance using the specified properties. - * @param [properties] Properties to set - * @returns SparkSqlBatch instance - */ - public static create(properties?: google.cloud.dataproc.v1.ISparkSqlBatch): google.cloud.dataproc.v1.SparkSqlBatch; - - /** - * Encodes the specified SparkSqlBatch message. Does not implicitly {@link google.cloud.dataproc.v1.SparkSqlBatch.verify|verify} messages. - * @param message SparkSqlBatch message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.ISparkSqlBatch, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SparkSqlBatch message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SparkSqlBatch.verify|verify} messages. - * @param message SparkSqlBatch message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.ISparkSqlBatch, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SparkSqlBatch message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SparkSqlBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.SparkSqlBatch; - - /** - * Decodes a SparkSqlBatch message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SparkSqlBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.SparkSqlBatch; - - /** - * Verifies a SparkSqlBatch message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SparkSqlBatch message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SparkSqlBatch - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.SparkSqlBatch; - - /** - * Creates a plain object from a SparkSqlBatch message. Also converts values to other types if specified. - * @param message SparkSqlBatch - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.SparkSqlBatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SparkSqlBatch to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SparkSqlBatch - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PySparkNotebookBatch. */ - interface IPySparkNotebookBatch { - - /** PySparkNotebookBatch notebookFileUri */ - notebookFileUri?: (string|null); - - /** PySparkNotebookBatch params */ - params?: ({ [k: string]: string }|null); - - /** PySparkNotebookBatch pythonFileUris */ - pythonFileUris?: (string[]|null); - - /** PySparkNotebookBatch jarFileUris */ - jarFileUris?: (string[]|null); - - /** PySparkNotebookBatch fileUris */ - fileUris?: (string[]|null); - - /** PySparkNotebookBatch archiveUris */ - archiveUris?: (string[]|null); - } - - /** Represents a PySparkNotebookBatch. */ - class PySparkNotebookBatch implements IPySparkNotebookBatch { - - /** - * Constructs a new PySparkNotebookBatch. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IPySparkNotebookBatch); - - /** PySparkNotebookBatch notebookFileUri. */ - public notebookFileUri: string; - - /** PySparkNotebookBatch params. */ - public params: { [k: string]: string }; - - /** PySparkNotebookBatch pythonFileUris. */ - public pythonFileUris: string[]; - - /** PySparkNotebookBatch jarFileUris. */ - public jarFileUris: string[]; - - /** PySparkNotebookBatch fileUris. */ - public fileUris: string[]; - - /** PySparkNotebookBatch archiveUris. */ - public archiveUris: string[]; - - /** - * Creates a new PySparkNotebookBatch instance using the specified properties. - * @param [properties] Properties to set - * @returns PySparkNotebookBatch instance - */ - public static create(properties?: google.cloud.dataproc.v1.IPySparkNotebookBatch): google.cloud.dataproc.v1.PySparkNotebookBatch; - - /** - * Encodes the specified PySparkNotebookBatch message. Does not implicitly {@link google.cloud.dataproc.v1.PySparkNotebookBatch.verify|verify} messages. - * @param message PySparkNotebookBatch message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IPySparkNotebookBatch, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PySparkNotebookBatch message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.PySparkNotebookBatch.verify|verify} messages. - * @param message PySparkNotebookBatch message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IPySparkNotebookBatch, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PySparkNotebookBatch message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PySparkNotebookBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.PySparkNotebookBatch; - - /** - * Decodes a PySparkNotebookBatch message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PySparkNotebookBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.PySparkNotebookBatch; - - /** - * Verifies a PySparkNotebookBatch message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PySparkNotebookBatch message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PySparkNotebookBatch - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.PySparkNotebookBatch; - - /** - * Creates a plain object from a PySparkNotebookBatch message. Also converts values to other types if specified. - * @param message PySparkNotebookBatch - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.PySparkNotebookBatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PySparkNotebookBatch to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PySparkNotebookBatch - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RuntimeConfig. */ - interface IRuntimeConfig { - - /** RuntimeConfig version */ - version?: (string|null); - - /** RuntimeConfig containerImage */ - containerImage?: (string|null); - - /** RuntimeConfig properties */ - properties?: ({ [k: string]: string }|null); - - /** RuntimeConfig repositoryConfig */ - repositoryConfig?: (google.cloud.dataproc.v1.IRepositoryConfig|null); - - /** RuntimeConfig autotuningConfig */ - autotuningConfig?: (google.cloud.dataproc.v1.IAutotuningConfig|null); - - /** RuntimeConfig cohort */ - cohort?: (string|null); - } - - /** Represents a RuntimeConfig. */ - class RuntimeConfig implements IRuntimeConfig { - - /** - * Constructs a new RuntimeConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IRuntimeConfig); - - /** RuntimeConfig version. */ - public version: string; - - /** RuntimeConfig containerImage. */ - public containerImage: string; - - /** RuntimeConfig properties. */ - public properties: { [k: string]: string }; - - /** RuntimeConfig repositoryConfig. */ - public repositoryConfig?: (google.cloud.dataproc.v1.IRepositoryConfig|null); - - /** RuntimeConfig autotuningConfig. */ - public autotuningConfig?: (google.cloud.dataproc.v1.IAutotuningConfig|null); - - /** RuntimeConfig cohort. */ - public cohort: string; - - /** - * Creates a new RuntimeConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns RuntimeConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.IRuntimeConfig): google.cloud.dataproc.v1.RuntimeConfig; - - /** - * Encodes the specified RuntimeConfig message. Does not implicitly {@link google.cloud.dataproc.v1.RuntimeConfig.verify|verify} messages. - * @param message RuntimeConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IRuntimeConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RuntimeConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.RuntimeConfig.verify|verify} messages. - * @param message RuntimeConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IRuntimeConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RuntimeConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RuntimeConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.RuntimeConfig; - - /** - * Decodes a RuntimeConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RuntimeConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.RuntimeConfig; - - /** - * Verifies a RuntimeConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RuntimeConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RuntimeConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.RuntimeConfig; - - /** - * Creates a plain object from a RuntimeConfig message. Also converts values to other types if specified. - * @param message RuntimeConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.RuntimeConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RuntimeConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RuntimeConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnvironmentConfig. */ - interface IEnvironmentConfig { - - /** EnvironmentConfig executionConfig */ - executionConfig?: (google.cloud.dataproc.v1.IExecutionConfig|null); - - /** EnvironmentConfig peripheralsConfig */ - peripheralsConfig?: (google.cloud.dataproc.v1.IPeripheralsConfig|null); - } - - /** Represents an EnvironmentConfig. */ - class EnvironmentConfig implements IEnvironmentConfig { - - /** - * Constructs a new EnvironmentConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IEnvironmentConfig); - - /** EnvironmentConfig executionConfig. */ - public executionConfig?: (google.cloud.dataproc.v1.IExecutionConfig|null); - - /** EnvironmentConfig peripheralsConfig. */ - public peripheralsConfig?: (google.cloud.dataproc.v1.IPeripheralsConfig|null); - - /** - * Creates a new EnvironmentConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns EnvironmentConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.IEnvironmentConfig): google.cloud.dataproc.v1.EnvironmentConfig; - - /** - * Encodes the specified EnvironmentConfig message. Does not implicitly {@link google.cloud.dataproc.v1.EnvironmentConfig.verify|verify} messages. - * @param message EnvironmentConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IEnvironmentConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnvironmentConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.EnvironmentConfig.verify|verify} messages. - * @param message EnvironmentConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IEnvironmentConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnvironmentConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnvironmentConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.EnvironmentConfig; - - /** - * Decodes an EnvironmentConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnvironmentConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.EnvironmentConfig; - - /** - * Verifies an EnvironmentConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnvironmentConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnvironmentConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.EnvironmentConfig; - - /** - * Creates a plain object from an EnvironmentConfig message. Also converts values to other types if specified. - * @param message EnvironmentConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.EnvironmentConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnvironmentConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnvironmentConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ExecutionConfig. */ - interface IExecutionConfig { - - /** ExecutionConfig serviceAccount */ - serviceAccount?: (string|null); - - /** ExecutionConfig networkUri */ - networkUri?: (string|null); - - /** ExecutionConfig subnetworkUri */ - subnetworkUri?: (string|null); - - /** ExecutionConfig networkTags */ - networkTags?: (string[]|null); - - /** ExecutionConfig kmsKey */ - kmsKey?: (string|null); - - /** ExecutionConfig idleTtl */ - idleTtl?: (google.protobuf.IDuration|null); - - /** ExecutionConfig ttl */ - ttl?: (google.protobuf.IDuration|null); - - /** ExecutionConfig stagingBucket */ - stagingBucket?: (string|null); - - /** ExecutionConfig authenticationConfig */ - authenticationConfig?: (google.cloud.dataproc.v1.IAuthenticationConfig|null); - } - - /** Represents an ExecutionConfig. */ - class ExecutionConfig implements IExecutionConfig { - - /** - * Constructs a new ExecutionConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IExecutionConfig); - - /** ExecutionConfig serviceAccount. */ - public serviceAccount: string; - - /** ExecutionConfig networkUri. */ - public networkUri?: (string|null); - - /** ExecutionConfig subnetworkUri. */ - public subnetworkUri?: (string|null); - - /** ExecutionConfig networkTags. */ - public networkTags: string[]; - - /** ExecutionConfig kmsKey. */ - public kmsKey: string; - - /** ExecutionConfig idleTtl. */ - public idleTtl?: (google.protobuf.IDuration|null); - - /** ExecutionConfig ttl. */ - public ttl?: (google.protobuf.IDuration|null); - - /** ExecutionConfig stagingBucket. */ - public stagingBucket: string; - - /** ExecutionConfig authenticationConfig. */ - public authenticationConfig?: (google.cloud.dataproc.v1.IAuthenticationConfig|null); - - /** ExecutionConfig network. */ - public network?: ("networkUri"|"subnetworkUri"); - - /** - * Creates a new ExecutionConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ExecutionConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.IExecutionConfig): google.cloud.dataproc.v1.ExecutionConfig; - - /** - * Encodes the specified ExecutionConfig message. Does not implicitly {@link google.cloud.dataproc.v1.ExecutionConfig.verify|verify} messages. - * @param message ExecutionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IExecutionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExecutionConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ExecutionConfig.verify|verify} messages. - * @param message ExecutionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IExecutionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExecutionConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExecutionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ExecutionConfig; - - /** - * Decodes an ExecutionConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExecutionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ExecutionConfig; - - /** - * Verifies an ExecutionConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExecutionConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExecutionConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ExecutionConfig; - - /** - * Creates a plain object from an ExecutionConfig message. Also converts values to other types if specified. - * @param message ExecutionConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.ExecutionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExecutionConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExecutionConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SparkHistoryServerConfig. */ - interface ISparkHistoryServerConfig { - - /** SparkHistoryServerConfig dataprocCluster */ - dataprocCluster?: (string|null); - } - - /** Represents a SparkHistoryServerConfig. */ - class SparkHistoryServerConfig implements ISparkHistoryServerConfig { - - /** - * Constructs a new SparkHistoryServerConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.ISparkHistoryServerConfig); - - /** SparkHistoryServerConfig dataprocCluster. */ - public dataprocCluster: string; - - /** - * Creates a new SparkHistoryServerConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns SparkHistoryServerConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.ISparkHistoryServerConfig): google.cloud.dataproc.v1.SparkHistoryServerConfig; - - /** - * Encodes the specified SparkHistoryServerConfig message. Does not implicitly {@link google.cloud.dataproc.v1.SparkHistoryServerConfig.verify|verify} messages. - * @param message SparkHistoryServerConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.ISparkHistoryServerConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SparkHistoryServerConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SparkHistoryServerConfig.verify|verify} messages. - * @param message SparkHistoryServerConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.ISparkHistoryServerConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SparkHistoryServerConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SparkHistoryServerConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.SparkHistoryServerConfig; - - /** - * Decodes a SparkHistoryServerConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SparkHistoryServerConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.SparkHistoryServerConfig; - - /** - * Verifies a SparkHistoryServerConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SparkHistoryServerConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SparkHistoryServerConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.SparkHistoryServerConfig; - - /** - * Creates a plain object from a SparkHistoryServerConfig message. Also converts values to other types if specified. - * @param message SparkHistoryServerConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.SparkHistoryServerConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SparkHistoryServerConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SparkHistoryServerConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PeripheralsConfig. */ - interface IPeripheralsConfig { - - /** PeripheralsConfig metastoreService */ - metastoreService?: (string|null); - - /** PeripheralsConfig sparkHistoryServerConfig */ - sparkHistoryServerConfig?: (google.cloud.dataproc.v1.ISparkHistoryServerConfig|null); - } - - /** Represents a PeripheralsConfig. */ - class PeripheralsConfig implements IPeripheralsConfig { - - /** - * Constructs a new PeripheralsConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IPeripheralsConfig); - - /** PeripheralsConfig metastoreService. */ - public metastoreService: string; - - /** PeripheralsConfig sparkHistoryServerConfig. */ - public sparkHistoryServerConfig?: (google.cloud.dataproc.v1.ISparkHistoryServerConfig|null); - - /** - * Creates a new PeripheralsConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns PeripheralsConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.IPeripheralsConfig): google.cloud.dataproc.v1.PeripheralsConfig; - - /** - * Encodes the specified PeripheralsConfig message. Does not implicitly {@link google.cloud.dataproc.v1.PeripheralsConfig.verify|verify} messages. - * @param message PeripheralsConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IPeripheralsConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PeripheralsConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.PeripheralsConfig.verify|verify} messages. - * @param message PeripheralsConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IPeripheralsConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PeripheralsConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PeripheralsConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.PeripheralsConfig; - - /** - * Decodes a PeripheralsConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PeripheralsConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.PeripheralsConfig; - - /** - * Verifies a PeripheralsConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PeripheralsConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PeripheralsConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.PeripheralsConfig; - - /** - * Creates a plain object from a PeripheralsConfig message. Also converts values to other types if specified. - * @param message PeripheralsConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.PeripheralsConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PeripheralsConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PeripheralsConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RuntimeInfo. */ - interface IRuntimeInfo { - - /** RuntimeInfo endpoints */ - endpoints?: ({ [k: string]: string }|null); - - /** RuntimeInfo outputUri */ - outputUri?: (string|null); - - /** RuntimeInfo diagnosticOutputUri */ - diagnosticOutputUri?: (string|null); - - /** RuntimeInfo approximateUsage */ - approximateUsage?: (google.cloud.dataproc.v1.IUsageMetrics|null); - - /** RuntimeInfo currentUsage */ - currentUsage?: (google.cloud.dataproc.v1.IUsageSnapshot|null); - } - - /** Represents a RuntimeInfo. */ - class RuntimeInfo implements IRuntimeInfo { - - /** - * Constructs a new RuntimeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IRuntimeInfo); - - /** RuntimeInfo endpoints. */ - public endpoints: { [k: string]: string }; - - /** RuntimeInfo outputUri. */ - public outputUri: string; - - /** RuntimeInfo diagnosticOutputUri. */ - public diagnosticOutputUri: string; - - /** RuntimeInfo approximateUsage. */ - public approximateUsage?: (google.cloud.dataproc.v1.IUsageMetrics|null); - - /** RuntimeInfo currentUsage. */ - public currentUsage?: (google.cloud.dataproc.v1.IUsageSnapshot|null); - - /** - * Creates a new RuntimeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns RuntimeInfo instance - */ - public static create(properties?: google.cloud.dataproc.v1.IRuntimeInfo): google.cloud.dataproc.v1.RuntimeInfo; - - /** - * Encodes the specified RuntimeInfo message. Does not implicitly {@link google.cloud.dataproc.v1.RuntimeInfo.verify|verify} messages. - * @param message RuntimeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IRuntimeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RuntimeInfo message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.RuntimeInfo.verify|verify} messages. - * @param message RuntimeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IRuntimeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RuntimeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RuntimeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.RuntimeInfo; - - /** - * Decodes a RuntimeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RuntimeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.RuntimeInfo; - - /** - * Verifies a RuntimeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RuntimeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RuntimeInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.RuntimeInfo; - - /** - * Creates a plain object from a RuntimeInfo message. Also converts values to other types if specified. - * @param message RuntimeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.RuntimeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RuntimeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RuntimeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a UsageMetrics. */ - interface IUsageMetrics { - - /** UsageMetrics milliDcuSeconds */ - milliDcuSeconds?: (number|Long|string|null); - - /** UsageMetrics shuffleStorageGbSeconds */ - shuffleStorageGbSeconds?: (number|Long|string|null); - - /** UsageMetrics milliAcceleratorSeconds */ - milliAcceleratorSeconds?: (number|Long|string|null); - - /** UsageMetrics acceleratorType */ - acceleratorType?: (string|null); - } - - /** Represents a UsageMetrics. */ - class UsageMetrics implements IUsageMetrics { - - /** - * Constructs a new UsageMetrics. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IUsageMetrics); - - /** UsageMetrics milliDcuSeconds. */ - public milliDcuSeconds: (number|Long|string); - - /** UsageMetrics shuffleStorageGbSeconds. */ - public shuffleStorageGbSeconds: (number|Long|string); - - /** UsageMetrics milliAcceleratorSeconds. */ - public milliAcceleratorSeconds: (number|Long|string); - - /** UsageMetrics acceleratorType. */ - public acceleratorType: string; - - /** - * Creates a new UsageMetrics instance using the specified properties. - * @param [properties] Properties to set - * @returns UsageMetrics instance - */ - public static create(properties?: google.cloud.dataproc.v1.IUsageMetrics): google.cloud.dataproc.v1.UsageMetrics; - - /** - * Encodes the specified UsageMetrics message. Does not implicitly {@link google.cloud.dataproc.v1.UsageMetrics.verify|verify} messages. - * @param message UsageMetrics message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IUsageMetrics, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UsageMetrics message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.UsageMetrics.verify|verify} messages. - * @param message UsageMetrics message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IUsageMetrics, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a UsageMetrics message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UsageMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.UsageMetrics; - - /** - * Decodes a UsageMetrics message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UsageMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.UsageMetrics; - - /** - * Verifies a UsageMetrics message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a UsageMetrics message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UsageMetrics - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.UsageMetrics; - - /** - * Creates a plain object from a UsageMetrics message. Also converts values to other types if specified. - * @param message UsageMetrics - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.UsageMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UsageMetrics to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UsageMetrics - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a UsageSnapshot. */ - interface IUsageSnapshot { - - /** UsageSnapshot milliDcu */ - milliDcu?: (number|Long|string|null); - - /** UsageSnapshot shuffleStorageGb */ - shuffleStorageGb?: (number|Long|string|null); - - /** UsageSnapshot milliDcuPremium */ - milliDcuPremium?: (number|Long|string|null); - - /** UsageSnapshot shuffleStorageGbPremium */ - shuffleStorageGbPremium?: (number|Long|string|null); - - /** UsageSnapshot milliAccelerator */ - milliAccelerator?: (number|Long|string|null); - - /** UsageSnapshot acceleratorType */ - acceleratorType?: (string|null); - - /** UsageSnapshot snapshotTime */ - snapshotTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a UsageSnapshot. */ - class UsageSnapshot implements IUsageSnapshot { - - /** - * Constructs a new UsageSnapshot. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IUsageSnapshot); - - /** UsageSnapshot milliDcu. */ - public milliDcu: (number|Long|string); - - /** UsageSnapshot shuffleStorageGb. */ - public shuffleStorageGb: (number|Long|string); - - /** UsageSnapshot milliDcuPremium. */ - public milliDcuPremium: (number|Long|string); - - /** UsageSnapshot shuffleStorageGbPremium. */ - public shuffleStorageGbPremium: (number|Long|string); - - /** UsageSnapshot milliAccelerator. */ - public milliAccelerator: (number|Long|string); - - /** UsageSnapshot acceleratorType. */ - public acceleratorType: string; - - /** UsageSnapshot snapshotTime. */ - public snapshotTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new UsageSnapshot instance using the specified properties. - * @param [properties] Properties to set - * @returns UsageSnapshot instance - */ - public static create(properties?: google.cloud.dataproc.v1.IUsageSnapshot): google.cloud.dataproc.v1.UsageSnapshot; - - /** - * Encodes the specified UsageSnapshot message. Does not implicitly {@link google.cloud.dataproc.v1.UsageSnapshot.verify|verify} messages. - * @param message UsageSnapshot message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IUsageSnapshot, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UsageSnapshot message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.UsageSnapshot.verify|verify} messages. - * @param message UsageSnapshot message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IUsageSnapshot, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a UsageSnapshot message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UsageSnapshot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.UsageSnapshot; - - /** - * Decodes a UsageSnapshot message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UsageSnapshot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.UsageSnapshot; - - /** - * Verifies a UsageSnapshot message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a UsageSnapshot message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UsageSnapshot - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.UsageSnapshot; - - /** - * Creates a plain object from a UsageSnapshot message. Also converts values to other types if specified. - * @param message UsageSnapshot - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.UsageSnapshot, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UsageSnapshot to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UsageSnapshot - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GkeClusterConfig. */ - interface IGkeClusterConfig { - - /** GkeClusterConfig gkeClusterTarget */ - gkeClusterTarget?: (string|null); - - /** GkeClusterConfig nodePoolTarget */ - nodePoolTarget?: (google.cloud.dataproc.v1.IGkeNodePoolTarget[]|null); - } - - /** Represents a GkeClusterConfig. */ - class GkeClusterConfig implements IGkeClusterConfig { - - /** - * Constructs a new GkeClusterConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IGkeClusterConfig); - - /** GkeClusterConfig gkeClusterTarget. */ - public gkeClusterTarget: string; - - /** GkeClusterConfig nodePoolTarget. */ - public nodePoolTarget: google.cloud.dataproc.v1.IGkeNodePoolTarget[]; - - /** - * Creates a new GkeClusterConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns GkeClusterConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.IGkeClusterConfig): google.cloud.dataproc.v1.GkeClusterConfig; - - /** - * Encodes the specified GkeClusterConfig message. Does not implicitly {@link google.cloud.dataproc.v1.GkeClusterConfig.verify|verify} messages. - * @param message GkeClusterConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IGkeClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GkeClusterConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GkeClusterConfig.verify|verify} messages. - * @param message GkeClusterConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IGkeClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GkeClusterConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GkeClusterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.GkeClusterConfig; - - /** - * Decodes a GkeClusterConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GkeClusterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.GkeClusterConfig; - - /** - * Verifies a GkeClusterConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GkeClusterConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GkeClusterConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.GkeClusterConfig; - - /** - * Creates a plain object from a GkeClusterConfig message. Also converts values to other types if specified. - * @param message GkeClusterConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.GkeClusterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GkeClusterConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GkeClusterConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a KubernetesClusterConfig. */ - interface IKubernetesClusterConfig { - - /** KubernetesClusterConfig kubernetesNamespace */ - kubernetesNamespace?: (string|null); - - /** KubernetesClusterConfig gkeClusterConfig */ - gkeClusterConfig?: (google.cloud.dataproc.v1.IGkeClusterConfig|null); - - /** KubernetesClusterConfig kubernetesSoftwareConfig */ - kubernetesSoftwareConfig?: (google.cloud.dataproc.v1.IKubernetesSoftwareConfig|null); - } - - /** Represents a KubernetesClusterConfig. */ - class KubernetesClusterConfig implements IKubernetesClusterConfig { - - /** - * Constructs a new KubernetesClusterConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IKubernetesClusterConfig); - - /** KubernetesClusterConfig kubernetesNamespace. */ - public kubernetesNamespace: string; - - /** KubernetesClusterConfig gkeClusterConfig. */ - public gkeClusterConfig?: (google.cloud.dataproc.v1.IGkeClusterConfig|null); - - /** KubernetesClusterConfig kubernetesSoftwareConfig. */ - public kubernetesSoftwareConfig?: (google.cloud.dataproc.v1.IKubernetesSoftwareConfig|null); - - /** KubernetesClusterConfig config. */ - public config?: "gkeClusterConfig"; - - /** - * Creates a new KubernetesClusterConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns KubernetesClusterConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.IKubernetesClusterConfig): google.cloud.dataproc.v1.KubernetesClusterConfig; - - /** - * Encodes the specified KubernetesClusterConfig message. Does not implicitly {@link google.cloud.dataproc.v1.KubernetesClusterConfig.verify|verify} messages. - * @param message KubernetesClusterConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IKubernetesClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified KubernetesClusterConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.KubernetesClusterConfig.verify|verify} messages. - * @param message KubernetesClusterConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IKubernetesClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a KubernetesClusterConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns KubernetesClusterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.KubernetesClusterConfig; - - /** - * Decodes a KubernetesClusterConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns KubernetesClusterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.KubernetesClusterConfig; - - /** - * Verifies a KubernetesClusterConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a KubernetesClusterConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns KubernetesClusterConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.KubernetesClusterConfig; - - /** - * Creates a plain object from a KubernetesClusterConfig message. Also converts values to other types if specified. - * @param message KubernetesClusterConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.KubernetesClusterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this KubernetesClusterConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for KubernetesClusterConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a KubernetesSoftwareConfig. */ - interface IKubernetesSoftwareConfig { - - /** KubernetesSoftwareConfig componentVersion */ - componentVersion?: ({ [k: string]: string }|null); - - /** KubernetesSoftwareConfig properties */ - properties?: ({ [k: string]: string }|null); - } - - /** Represents a KubernetesSoftwareConfig. */ - class KubernetesSoftwareConfig implements IKubernetesSoftwareConfig { - - /** - * Constructs a new KubernetesSoftwareConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IKubernetesSoftwareConfig); - - /** KubernetesSoftwareConfig componentVersion. */ - public componentVersion: { [k: string]: string }; - - /** KubernetesSoftwareConfig properties. */ - public properties: { [k: string]: string }; - - /** - * Creates a new KubernetesSoftwareConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns KubernetesSoftwareConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.IKubernetesSoftwareConfig): google.cloud.dataproc.v1.KubernetesSoftwareConfig; - - /** - * Encodes the specified KubernetesSoftwareConfig message. Does not implicitly {@link google.cloud.dataproc.v1.KubernetesSoftwareConfig.verify|verify} messages. - * @param message KubernetesSoftwareConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IKubernetesSoftwareConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified KubernetesSoftwareConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.KubernetesSoftwareConfig.verify|verify} messages. - * @param message KubernetesSoftwareConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IKubernetesSoftwareConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a KubernetesSoftwareConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns KubernetesSoftwareConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.KubernetesSoftwareConfig; - - /** - * Decodes a KubernetesSoftwareConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns KubernetesSoftwareConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.KubernetesSoftwareConfig; - - /** - * Verifies a KubernetesSoftwareConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a KubernetesSoftwareConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns KubernetesSoftwareConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.KubernetesSoftwareConfig; - - /** - * Creates a plain object from a KubernetesSoftwareConfig message. Also converts values to other types if specified. - * @param message KubernetesSoftwareConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.KubernetesSoftwareConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this KubernetesSoftwareConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for KubernetesSoftwareConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GkeNodePoolTarget. */ - interface IGkeNodePoolTarget { - - /** GkeNodePoolTarget nodePool */ - nodePool?: (string|null); - - /** GkeNodePoolTarget roles */ - roles?: (google.cloud.dataproc.v1.GkeNodePoolTarget.Role[]|null); - - /** GkeNodePoolTarget nodePoolConfig */ - nodePoolConfig?: (google.cloud.dataproc.v1.IGkeNodePoolConfig|null); - } - - /** Represents a GkeNodePoolTarget. */ - class GkeNodePoolTarget implements IGkeNodePoolTarget { - - /** - * Constructs a new GkeNodePoolTarget. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IGkeNodePoolTarget); - - /** GkeNodePoolTarget nodePool. */ - public nodePool: string; - - /** GkeNodePoolTarget roles. */ - public roles: google.cloud.dataproc.v1.GkeNodePoolTarget.Role[]; - - /** GkeNodePoolTarget nodePoolConfig. */ - public nodePoolConfig?: (google.cloud.dataproc.v1.IGkeNodePoolConfig|null); - - /** - * Creates a new GkeNodePoolTarget instance using the specified properties. - * @param [properties] Properties to set - * @returns GkeNodePoolTarget instance - */ - public static create(properties?: google.cloud.dataproc.v1.IGkeNodePoolTarget): google.cloud.dataproc.v1.GkeNodePoolTarget; - - /** - * Encodes the specified GkeNodePoolTarget message. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolTarget.verify|verify} messages. - * @param message GkeNodePoolTarget message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IGkeNodePoolTarget, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GkeNodePoolTarget message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolTarget.verify|verify} messages. - * @param message GkeNodePoolTarget message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IGkeNodePoolTarget, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GkeNodePoolTarget message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GkeNodePoolTarget - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.GkeNodePoolTarget; - - /** - * Decodes a GkeNodePoolTarget message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GkeNodePoolTarget - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.GkeNodePoolTarget; - - /** - * Verifies a GkeNodePoolTarget message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GkeNodePoolTarget message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GkeNodePoolTarget - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.GkeNodePoolTarget; - - /** - * Creates a plain object from a GkeNodePoolTarget message. Also converts values to other types if specified. - * @param message GkeNodePoolTarget - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.GkeNodePoolTarget, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GkeNodePoolTarget to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GkeNodePoolTarget - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GkeNodePoolTarget { - - /** Role enum. */ - enum Role { - ROLE_UNSPECIFIED = 0, - DEFAULT = 1, - CONTROLLER = 2, - SPARK_DRIVER = 3, - SPARK_EXECUTOR = 4 - } - } - - /** Properties of a GkeNodePoolConfig. */ - interface IGkeNodePoolConfig { - - /** GkeNodePoolConfig config */ - config?: (google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodeConfig|null); - - /** GkeNodePoolConfig locations */ - locations?: (string[]|null); - - /** GkeNodePoolConfig autoscaling */ - autoscaling?: (google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAutoscalingConfig|null); - } - - /** Represents a GkeNodePoolConfig. */ - class GkeNodePoolConfig implements IGkeNodePoolConfig { - - /** - * Constructs a new GkeNodePoolConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IGkeNodePoolConfig); - - /** GkeNodePoolConfig config. */ - public config?: (google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodeConfig|null); - - /** GkeNodePoolConfig locations. */ - public locations: string[]; - - /** GkeNodePoolConfig autoscaling. */ - public autoscaling?: (google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAutoscalingConfig|null); - - /** - * Creates a new GkeNodePoolConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns GkeNodePoolConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.IGkeNodePoolConfig): google.cloud.dataproc.v1.GkeNodePoolConfig; - - /** - * Encodes the specified GkeNodePoolConfig message. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolConfig.verify|verify} messages. - * @param message GkeNodePoolConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IGkeNodePoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GkeNodePoolConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolConfig.verify|verify} messages. - * @param message GkeNodePoolConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IGkeNodePoolConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GkeNodePoolConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GkeNodePoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.GkeNodePoolConfig; - - /** - * Decodes a GkeNodePoolConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GkeNodePoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.GkeNodePoolConfig; - - /** - * Verifies a GkeNodePoolConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GkeNodePoolConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GkeNodePoolConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.GkeNodePoolConfig; - - /** - * Creates a plain object from a GkeNodePoolConfig message. Also converts values to other types if specified. - * @param message GkeNodePoolConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.GkeNodePoolConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GkeNodePoolConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GkeNodePoolConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GkeNodePoolConfig { - - /** Properties of a GkeNodeConfig. */ - interface IGkeNodeConfig { - - /** GkeNodeConfig machineType */ - machineType?: (string|null); - - /** GkeNodeConfig localSsdCount */ - localSsdCount?: (number|null); - - /** GkeNodeConfig preemptible */ - preemptible?: (boolean|null); - - /** GkeNodeConfig accelerators */ - accelerators?: (google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAcceleratorConfig[]|null); - - /** GkeNodeConfig minCpuPlatform */ - minCpuPlatform?: (string|null); - - /** GkeNodeConfig bootDiskKmsKey */ - bootDiskKmsKey?: (string|null); - - /** GkeNodeConfig spot */ - spot?: (boolean|null); - } - - /** Represents a GkeNodeConfig. */ - class GkeNodeConfig implements IGkeNodeConfig { - - /** - * Constructs a new GkeNodeConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodeConfig); - - /** GkeNodeConfig machineType. */ - public machineType: string; - - /** GkeNodeConfig localSsdCount. */ - public localSsdCount: number; - - /** GkeNodeConfig preemptible. */ - public preemptible: boolean; - - /** GkeNodeConfig accelerators. */ - public accelerators: google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAcceleratorConfig[]; - - /** GkeNodeConfig minCpuPlatform. */ - public minCpuPlatform: string; - - /** GkeNodeConfig bootDiskKmsKey. */ - public bootDiskKmsKey: string; - - /** GkeNodeConfig spot. */ - public spot: boolean; - - /** - * Creates a new GkeNodeConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns GkeNodeConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodeConfig): google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig; - - /** - * Encodes the specified GkeNodeConfig message. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.verify|verify} messages. - * @param message GkeNodeConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GkeNodeConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.verify|verify} messages. - * @param message GkeNodeConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodeConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GkeNodeConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GkeNodeConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig; - - /** - * Decodes a GkeNodeConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GkeNodeConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig; - - /** - * Verifies a GkeNodeConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GkeNodeConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GkeNodeConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig; - - /** - * Creates a plain object from a GkeNodeConfig message. Also converts values to other types if specified. - * @param message GkeNodeConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GkeNodeConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GkeNodeConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GkeNodePoolAcceleratorConfig. */ - interface IGkeNodePoolAcceleratorConfig { - - /** GkeNodePoolAcceleratorConfig acceleratorCount */ - acceleratorCount?: (number|Long|string|null); - - /** GkeNodePoolAcceleratorConfig acceleratorType */ - acceleratorType?: (string|null); - - /** GkeNodePoolAcceleratorConfig gpuPartitionSize */ - gpuPartitionSize?: (string|null); - } - - /** Represents a GkeNodePoolAcceleratorConfig. */ - class GkeNodePoolAcceleratorConfig implements IGkeNodePoolAcceleratorConfig { - - /** - * Constructs a new GkeNodePoolAcceleratorConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAcceleratorConfig); - - /** GkeNodePoolAcceleratorConfig acceleratorCount. */ - public acceleratorCount: (number|Long|string); - - /** GkeNodePoolAcceleratorConfig acceleratorType. */ - public acceleratorType: string; - - /** GkeNodePoolAcceleratorConfig gpuPartitionSize. */ - public gpuPartitionSize: string; - - /** - * Creates a new GkeNodePoolAcceleratorConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns GkeNodePoolAcceleratorConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAcceleratorConfig): google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig; - - /** - * Encodes the specified GkeNodePoolAcceleratorConfig message. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig.verify|verify} messages. - * @param message GkeNodePoolAcceleratorConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAcceleratorConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GkeNodePoolAcceleratorConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig.verify|verify} messages. - * @param message GkeNodePoolAcceleratorConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAcceleratorConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GkeNodePoolAcceleratorConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GkeNodePoolAcceleratorConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig; - - /** - * Decodes a GkeNodePoolAcceleratorConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GkeNodePoolAcceleratorConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig; - - /** - * Verifies a GkeNodePoolAcceleratorConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GkeNodePoolAcceleratorConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GkeNodePoolAcceleratorConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig; - - /** - * Creates a plain object from a GkeNodePoolAcceleratorConfig message. Also converts values to other types if specified. - * @param message GkeNodePoolAcceleratorConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GkeNodePoolAcceleratorConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GkeNodePoolAcceleratorConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GkeNodePoolAutoscalingConfig. */ - interface IGkeNodePoolAutoscalingConfig { - - /** GkeNodePoolAutoscalingConfig minNodeCount */ - minNodeCount?: (number|null); - - /** GkeNodePoolAutoscalingConfig maxNodeCount */ - maxNodeCount?: (number|null); - } - - /** Represents a GkeNodePoolAutoscalingConfig. */ - class GkeNodePoolAutoscalingConfig implements IGkeNodePoolAutoscalingConfig { - - /** - * Constructs a new GkeNodePoolAutoscalingConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAutoscalingConfig); - - /** GkeNodePoolAutoscalingConfig minNodeCount. */ - public minNodeCount: number; - - /** GkeNodePoolAutoscalingConfig maxNodeCount. */ - public maxNodeCount: number; - - /** - * Creates a new GkeNodePoolAutoscalingConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns GkeNodePoolAutoscalingConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAutoscalingConfig): google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig; - - /** - * Encodes the specified GkeNodePoolAutoscalingConfig message. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig.verify|verify} messages. - * @param message GkeNodePoolAutoscalingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAutoscalingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GkeNodePoolAutoscalingConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig.verify|verify} messages. - * @param message GkeNodePoolAutoscalingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAutoscalingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GkeNodePoolAutoscalingConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GkeNodePoolAutoscalingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig; - - /** - * Decodes a GkeNodePoolAutoscalingConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GkeNodePoolAutoscalingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig; - - /** - * Verifies a GkeNodePoolAutoscalingConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GkeNodePoolAutoscalingConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GkeNodePoolAutoscalingConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig; - - /** - * Creates a plain object from a GkeNodePoolAutoscalingConfig message. Also converts values to other types if specified. - * @param message GkeNodePoolAutoscalingConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GkeNodePoolAutoscalingConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GkeNodePoolAutoscalingConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an AuthenticationConfig. */ - interface IAuthenticationConfig { - - /** AuthenticationConfig userWorkloadAuthenticationType */ - userWorkloadAuthenticationType?: (google.cloud.dataproc.v1.AuthenticationConfig.AuthenticationType|keyof typeof google.cloud.dataproc.v1.AuthenticationConfig.AuthenticationType|null); - } - - /** Represents an AuthenticationConfig. */ - class AuthenticationConfig implements IAuthenticationConfig { - - /** - * Constructs a new AuthenticationConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IAuthenticationConfig); - - /** AuthenticationConfig userWorkloadAuthenticationType. */ - public userWorkloadAuthenticationType: (google.cloud.dataproc.v1.AuthenticationConfig.AuthenticationType|keyof typeof google.cloud.dataproc.v1.AuthenticationConfig.AuthenticationType); - - /** - * Creates a new AuthenticationConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns AuthenticationConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.IAuthenticationConfig): google.cloud.dataproc.v1.AuthenticationConfig; - - /** - * Encodes the specified AuthenticationConfig message. Does not implicitly {@link google.cloud.dataproc.v1.AuthenticationConfig.verify|verify} messages. - * @param message AuthenticationConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IAuthenticationConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AuthenticationConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.AuthenticationConfig.verify|verify} messages. - * @param message AuthenticationConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IAuthenticationConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AuthenticationConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AuthenticationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.AuthenticationConfig; - - /** - * Decodes an AuthenticationConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AuthenticationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.AuthenticationConfig; - - /** - * Verifies an AuthenticationConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AuthenticationConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AuthenticationConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.AuthenticationConfig; - - /** - * Creates a plain object from an AuthenticationConfig message. Also converts values to other types if specified. - * @param message AuthenticationConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.AuthenticationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AuthenticationConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AuthenticationConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AuthenticationConfig { - - /** AuthenticationType enum. */ - enum AuthenticationType { - AUTHENTICATION_TYPE_UNSPECIFIED = 0, - SERVICE_ACCOUNT = 1, - END_USER_CREDENTIALS = 2 - } - } - - /** Properties of an AutotuningConfig. */ - interface IAutotuningConfig { - - /** AutotuningConfig scenarios */ - scenarios?: (google.cloud.dataproc.v1.AutotuningConfig.Scenario[]|null); - } - - /** Represents an AutotuningConfig. */ - class AutotuningConfig implements IAutotuningConfig { - - /** - * Constructs a new AutotuningConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IAutotuningConfig); - - /** AutotuningConfig scenarios. */ - public scenarios: google.cloud.dataproc.v1.AutotuningConfig.Scenario[]; - - /** - * Creates a new AutotuningConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns AutotuningConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.IAutotuningConfig): google.cloud.dataproc.v1.AutotuningConfig; - - /** - * Encodes the specified AutotuningConfig message. Does not implicitly {@link google.cloud.dataproc.v1.AutotuningConfig.verify|verify} messages. - * @param message AutotuningConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IAutotuningConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AutotuningConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.AutotuningConfig.verify|verify} messages. - * @param message AutotuningConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IAutotuningConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AutotuningConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AutotuningConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.AutotuningConfig; - - /** - * Decodes an AutotuningConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AutotuningConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.AutotuningConfig; - - /** - * Verifies an AutotuningConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AutotuningConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AutotuningConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.AutotuningConfig; - - /** - * Creates a plain object from an AutotuningConfig message. Also converts values to other types if specified. - * @param message AutotuningConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.AutotuningConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AutotuningConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AutotuningConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AutotuningConfig { - - /** Scenario enum. */ - enum Scenario { - SCENARIO_UNSPECIFIED = 0, - SCALING = 2, - BROADCAST_HASH_JOIN = 3, - MEMORY = 4, - NONE = 5, - AUTO = 6 - } - } - - /** Properties of a RepositoryConfig. */ - interface IRepositoryConfig { - - /** RepositoryConfig pypiRepositoryConfig */ - pypiRepositoryConfig?: (google.cloud.dataproc.v1.IPyPiRepositoryConfig|null); - } - - /** Represents a RepositoryConfig. */ - class RepositoryConfig implements IRepositoryConfig { - - /** - * Constructs a new RepositoryConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IRepositoryConfig); - - /** RepositoryConfig pypiRepositoryConfig. */ - public pypiRepositoryConfig?: (google.cloud.dataproc.v1.IPyPiRepositoryConfig|null); - - /** - * Creates a new RepositoryConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns RepositoryConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.IRepositoryConfig): google.cloud.dataproc.v1.RepositoryConfig; - - /** - * Encodes the specified RepositoryConfig message. Does not implicitly {@link google.cloud.dataproc.v1.RepositoryConfig.verify|verify} messages. - * @param message RepositoryConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IRepositoryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RepositoryConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.RepositoryConfig.verify|verify} messages. - * @param message RepositoryConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IRepositoryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RepositoryConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RepositoryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.RepositoryConfig; - - /** - * Decodes a RepositoryConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RepositoryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.RepositoryConfig; - - /** - * Verifies a RepositoryConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RepositoryConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RepositoryConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.RepositoryConfig; - - /** - * Creates a plain object from a RepositoryConfig message. Also converts values to other types if specified. - * @param message RepositoryConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.RepositoryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RepositoryConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RepositoryConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PyPiRepositoryConfig. */ - interface IPyPiRepositoryConfig { - - /** PyPiRepositoryConfig pypiRepository */ - pypiRepository?: (string|null); - } - - /** Represents a PyPiRepositoryConfig. */ - class PyPiRepositoryConfig implements IPyPiRepositoryConfig { - - /** - * Constructs a new PyPiRepositoryConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IPyPiRepositoryConfig); - - /** PyPiRepositoryConfig pypiRepository. */ - public pypiRepository: string; - - /** - * Creates a new PyPiRepositoryConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns PyPiRepositoryConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.IPyPiRepositoryConfig): google.cloud.dataproc.v1.PyPiRepositoryConfig; - - /** - * Encodes the specified PyPiRepositoryConfig message. Does not implicitly {@link google.cloud.dataproc.v1.PyPiRepositoryConfig.verify|verify} messages. - * @param message PyPiRepositoryConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IPyPiRepositoryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PyPiRepositoryConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.PyPiRepositoryConfig.verify|verify} messages. - * @param message PyPiRepositoryConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IPyPiRepositoryConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PyPiRepositoryConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PyPiRepositoryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.PyPiRepositoryConfig; - - /** - * Decodes a PyPiRepositoryConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PyPiRepositoryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.PyPiRepositoryConfig; - - /** - * Verifies a PyPiRepositoryConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PyPiRepositoryConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PyPiRepositoryConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.PyPiRepositoryConfig; - - /** - * Creates a plain object from a PyPiRepositoryConfig message. Also converts values to other types if specified. - * @param message PyPiRepositoryConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.PyPiRepositoryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PyPiRepositoryConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PyPiRepositoryConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Component enum. */ - enum Component { - COMPONENT_UNSPECIFIED = 0, - ANACONDA = 5, - DELTA = 20, - DOCKER = 13, - DRUID = 9, - FLINK = 14, - HBASE = 11, - HIVE_WEBHCAT = 3, - HUDI = 18, - ICEBERG = 19, - JUPYTER = 1, - JUPYTER_KERNEL_GATEWAY = 22, - PIG = 21, - PRESTO = 6, - TRINO = 17, - RANGER = 12, - SOLR = 10, - ZEPPELIN = 4, - ZOOKEEPER = 8 - } - - /** FailureAction enum. */ - enum FailureAction { - FAILURE_ACTION_UNSPECIFIED = 0, - NO_ACTION = 1, - DELETE = 2 - } - - /** Represents a ClusterController */ - class ClusterController extends $protobuf.rpc.Service { - - /** - * Constructs a new ClusterController 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 ClusterController 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): ClusterController; - - /** - * Calls CreateCluster. - * @param request CreateClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createCluster(request: google.cloud.dataproc.v1.ICreateClusterRequest, callback: google.cloud.dataproc.v1.ClusterController.CreateClusterCallback): void; - - /** - * Calls CreateCluster. - * @param request CreateClusterRequest message or plain object - * @returns Promise - */ - public createCluster(request: google.cloud.dataproc.v1.ICreateClusterRequest): Promise; - - /** - * Calls UpdateCluster. - * @param request UpdateClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateCluster(request: google.cloud.dataproc.v1.IUpdateClusterRequest, callback: google.cloud.dataproc.v1.ClusterController.UpdateClusterCallback): void; - - /** - * Calls UpdateCluster. - * @param request UpdateClusterRequest message or plain object - * @returns Promise - */ - public updateCluster(request: google.cloud.dataproc.v1.IUpdateClusterRequest): Promise; - - /** - * Calls StopCluster. - * @param request StopClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public stopCluster(request: google.cloud.dataproc.v1.IStopClusterRequest, callback: google.cloud.dataproc.v1.ClusterController.StopClusterCallback): void; - - /** - * Calls StopCluster. - * @param request StopClusterRequest message or plain object - * @returns Promise - */ - public stopCluster(request: google.cloud.dataproc.v1.IStopClusterRequest): Promise; - - /** - * Calls StartCluster. - * @param request StartClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public startCluster(request: google.cloud.dataproc.v1.IStartClusterRequest, callback: google.cloud.dataproc.v1.ClusterController.StartClusterCallback): void; - - /** - * Calls StartCluster. - * @param request StartClusterRequest message or plain object - * @returns Promise - */ - public startCluster(request: google.cloud.dataproc.v1.IStartClusterRequest): Promise; - - /** - * Calls DeleteCluster. - * @param request DeleteClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteCluster(request: google.cloud.dataproc.v1.IDeleteClusterRequest, callback: google.cloud.dataproc.v1.ClusterController.DeleteClusterCallback): void; - - /** - * Calls DeleteCluster. - * @param request DeleteClusterRequest message or plain object - * @returns Promise - */ - public deleteCluster(request: google.cloud.dataproc.v1.IDeleteClusterRequest): Promise; - - /** - * Calls GetCluster. - * @param request GetClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Cluster - */ - public getCluster(request: google.cloud.dataproc.v1.IGetClusterRequest, callback: google.cloud.dataproc.v1.ClusterController.GetClusterCallback): void; - - /** - * Calls GetCluster. - * @param request GetClusterRequest message or plain object - * @returns Promise - */ - public getCluster(request: google.cloud.dataproc.v1.IGetClusterRequest): Promise; - - /** - * Calls ListClusters. - * @param request ListClustersRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListClustersResponse - */ - public listClusters(request: google.cloud.dataproc.v1.IListClustersRequest, callback: google.cloud.dataproc.v1.ClusterController.ListClustersCallback): void; - - /** - * Calls ListClusters. - * @param request ListClustersRequest message or plain object - * @returns Promise - */ - public listClusters(request: google.cloud.dataproc.v1.IListClustersRequest): Promise; - - /** - * Calls DiagnoseCluster. - * @param request DiagnoseClusterRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public diagnoseCluster(request: google.cloud.dataproc.v1.IDiagnoseClusterRequest, callback: google.cloud.dataproc.v1.ClusterController.DiagnoseClusterCallback): void; - - /** - * Calls DiagnoseCluster. - * @param request DiagnoseClusterRequest message or plain object - * @returns Promise - */ - public diagnoseCluster(request: google.cloud.dataproc.v1.IDiagnoseClusterRequest): Promise; - } - - namespace ClusterController { - - /** - * Callback as used by {@link google.cloud.dataproc.v1.ClusterController|createCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.ClusterController|updateCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.ClusterController|stopCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type StopClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.ClusterController|startCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type StartClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.ClusterController|deleteCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.ClusterController|getCluster}. - * @param error Error, if any - * @param [response] Cluster - */ - type GetClusterCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.Cluster) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.ClusterController|listClusters}. - * @param error Error, if any - * @param [response] ListClustersResponse - */ - type ListClustersCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.ListClustersResponse) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.ClusterController|diagnoseCluster}. - * @param error Error, if any - * @param [response] Operation - */ - type DiagnoseClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of a Cluster. */ - interface ICluster { - - /** Cluster projectId */ - projectId?: (string|null); - - /** Cluster clusterName */ - clusterName?: (string|null); - - /** Cluster config */ - config?: (google.cloud.dataproc.v1.IClusterConfig|null); - - /** Cluster virtualClusterConfig */ - virtualClusterConfig?: (google.cloud.dataproc.v1.IVirtualClusterConfig|null); - - /** Cluster labels */ - labels?: ({ [k: string]: string }|null); - - /** Cluster status */ - status?: (google.cloud.dataproc.v1.IClusterStatus|null); - - /** Cluster statusHistory */ - statusHistory?: (google.cloud.dataproc.v1.IClusterStatus[]|null); - - /** Cluster clusterUuid */ - clusterUuid?: (string|null); - - /** Cluster metrics */ - metrics?: (google.cloud.dataproc.v1.IClusterMetrics|null); - } - - /** Represents a Cluster. */ - class Cluster implements ICluster { - - /** - * Constructs a new Cluster. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.ICluster); - - /** Cluster projectId. */ - public projectId: string; - - /** Cluster clusterName. */ - public clusterName: string; - - /** Cluster config. */ - public config?: (google.cloud.dataproc.v1.IClusterConfig|null); - - /** Cluster virtualClusterConfig. */ - public virtualClusterConfig?: (google.cloud.dataproc.v1.IVirtualClusterConfig|null); - - /** Cluster labels. */ - public labels: { [k: string]: string }; - - /** Cluster status. */ - public status?: (google.cloud.dataproc.v1.IClusterStatus|null); - - /** Cluster statusHistory. */ - public statusHistory: google.cloud.dataproc.v1.IClusterStatus[]; - - /** Cluster clusterUuid. */ - public clusterUuid: string; - - /** Cluster metrics. */ - public metrics?: (google.cloud.dataproc.v1.IClusterMetrics|null); - - /** - * Creates a new Cluster instance using the specified properties. - * @param [properties] Properties to set - * @returns Cluster instance - */ - public static create(properties?: google.cloud.dataproc.v1.ICluster): google.cloud.dataproc.v1.Cluster; - - /** - * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.dataproc.v1.Cluster.verify|verify} messages. - * @param message Cluster message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.Cluster.verify|verify} messages. - * @param message Cluster message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Cluster message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Cluster - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.Cluster; - - /** - * Decodes a Cluster message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Cluster - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.Cluster; - - /** - * Verifies a Cluster message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Cluster message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Cluster - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.Cluster; - - /** - * Creates a plain object from a Cluster message. Also converts values to other types if specified. - * @param message Cluster - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.Cluster, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Cluster to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Cluster - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ClusterConfig. */ - interface IClusterConfig { - - /** ClusterConfig clusterType */ - clusterType?: (google.cloud.dataproc.v1.ClusterConfig.ClusterType|keyof typeof google.cloud.dataproc.v1.ClusterConfig.ClusterType|null); - - /** ClusterConfig clusterTier */ - clusterTier?: (google.cloud.dataproc.v1.ClusterConfig.ClusterTier|keyof typeof google.cloud.dataproc.v1.ClusterConfig.ClusterTier|null); - - /** ClusterConfig engine */ - engine?: (google.cloud.dataproc.v1.ClusterConfig.Engine|keyof typeof google.cloud.dataproc.v1.ClusterConfig.Engine|null); - - /** ClusterConfig configBucket */ - configBucket?: (string|null); - - /** ClusterConfig tempBucket */ - tempBucket?: (string|null); - - /** ClusterConfig gceClusterConfig */ - gceClusterConfig?: (google.cloud.dataproc.v1.IGceClusterConfig|null); - - /** ClusterConfig masterConfig */ - masterConfig?: (google.cloud.dataproc.v1.IInstanceGroupConfig|null); - - /** ClusterConfig workerConfig */ - workerConfig?: (google.cloud.dataproc.v1.IInstanceGroupConfig|null); - - /** ClusterConfig secondaryWorkerConfig */ - secondaryWorkerConfig?: (google.cloud.dataproc.v1.IInstanceGroupConfig|null); - - /** ClusterConfig softwareConfig */ - softwareConfig?: (google.cloud.dataproc.v1.ISoftwareConfig|null); - - /** ClusterConfig initializationActions */ - initializationActions?: (google.cloud.dataproc.v1.INodeInitializationAction[]|null); - - /** ClusterConfig encryptionConfig */ - encryptionConfig?: (google.cloud.dataproc.v1.IEncryptionConfig|null); - - /** ClusterConfig autoscalingConfig */ - autoscalingConfig?: (google.cloud.dataproc.v1.IAutoscalingConfig|null); - - /** ClusterConfig securityConfig */ - securityConfig?: (google.cloud.dataproc.v1.ISecurityConfig|null); - - /** ClusterConfig lifecycleConfig */ - lifecycleConfig?: (google.cloud.dataproc.v1.ILifecycleConfig|null); - - /** ClusterConfig endpointConfig */ - endpointConfig?: (google.cloud.dataproc.v1.IEndpointConfig|null); - - /** ClusterConfig metastoreConfig */ - metastoreConfig?: (google.cloud.dataproc.v1.IMetastoreConfig|null); - - /** ClusterConfig dataprocMetricConfig */ - dataprocMetricConfig?: (google.cloud.dataproc.v1.IDataprocMetricConfig|null); - - /** ClusterConfig auxiliaryNodeGroups */ - auxiliaryNodeGroups?: (google.cloud.dataproc.v1.IAuxiliaryNodeGroup[]|null); - } - - /** Represents a ClusterConfig. */ - class ClusterConfig implements IClusterConfig { - - /** - * Constructs a new ClusterConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IClusterConfig); - - /** ClusterConfig clusterType. */ - public clusterType: (google.cloud.dataproc.v1.ClusterConfig.ClusterType|keyof typeof google.cloud.dataproc.v1.ClusterConfig.ClusterType); - - /** ClusterConfig clusterTier. */ - public clusterTier: (google.cloud.dataproc.v1.ClusterConfig.ClusterTier|keyof typeof google.cloud.dataproc.v1.ClusterConfig.ClusterTier); - - /** ClusterConfig engine. */ - public engine: (google.cloud.dataproc.v1.ClusterConfig.Engine|keyof typeof google.cloud.dataproc.v1.ClusterConfig.Engine); - - /** ClusterConfig configBucket. */ - public configBucket: string; - - /** ClusterConfig tempBucket. */ - public tempBucket: string; - - /** ClusterConfig gceClusterConfig. */ - public gceClusterConfig?: (google.cloud.dataproc.v1.IGceClusterConfig|null); - - /** ClusterConfig masterConfig. */ - public masterConfig?: (google.cloud.dataproc.v1.IInstanceGroupConfig|null); - - /** ClusterConfig workerConfig. */ - public workerConfig?: (google.cloud.dataproc.v1.IInstanceGroupConfig|null); - - /** ClusterConfig secondaryWorkerConfig. */ - public secondaryWorkerConfig?: (google.cloud.dataproc.v1.IInstanceGroupConfig|null); - - /** ClusterConfig softwareConfig. */ - public softwareConfig?: (google.cloud.dataproc.v1.ISoftwareConfig|null); - - /** ClusterConfig initializationActions. */ - public initializationActions: google.cloud.dataproc.v1.INodeInitializationAction[]; - - /** ClusterConfig encryptionConfig. */ - public encryptionConfig?: (google.cloud.dataproc.v1.IEncryptionConfig|null); - - /** ClusterConfig autoscalingConfig. */ - public autoscalingConfig?: (google.cloud.dataproc.v1.IAutoscalingConfig|null); - - /** ClusterConfig securityConfig. */ - public securityConfig?: (google.cloud.dataproc.v1.ISecurityConfig|null); - - /** ClusterConfig lifecycleConfig. */ - public lifecycleConfig?: (google.cloud.dataproc.v1.ILifecycleConfig|null); - - /** ClusterConfig endpointConfig. */ - public endpointConfig?: (google.cloud.dataproc.v1.IEndpointConfig|null); - - /** ClusterConfig metastoreConfig. */ - public metastoreConfig?: (google.cloud.dataproc.v1.IMetastoreConfig|null); - - /** ClusterConfig dataprocMetricConfig. */ - public dataprocMetricConfig?: (google.cloud.dataproc.v1.IDataprocMetricConfig|null); - - /** ClusterConfig auxiliaryNodeGroups. */ - public auxiliaryNodeGroups: google.cloud.dataproc.v1.IAuxiliaryNodeGroup[]; - - /** - * Creates a new ClusterConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ClusterConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.IClusterConfig): google.cloud.dataproc.v1.ClusterConfig; - - /** - * Encodes the specified ClusterConfig message. Does not implicitly {@link google.cloud.dataproc.v1.ClusterConfig.verify|verify} messages. - * @param message ClusterConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClusterConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ClusterConfig.verify|verify} messages. - * @param message ClusterConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClusterConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClusterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ClusterConfig; - - /** - * Decodes a ClusterConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClusterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ClusterConfig; - - /** - * Verifies a ClusterConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClusterConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClusterConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ClusterConfig; - - /** - * Creates a plain object from a ClusterConfig message. Also converts values to other types if specified. - * @param message ClusterConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.ClusterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClusterConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClusterConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ClusterConfig { - - /** ClusterType enum. */ - enum ClusterType { - CLUSTER_TYPE_UNSPECIFIED = 0, - STANDARD = 1, - SINGLE_NODE = 2, - ZERO_SCALE = 3 - } - - /** ClusterTier enum. */ - enum ClusterTier { - CLUSTER_TIER_UNSPECIFIED = 0, - CLUSTER_TIER_STANDARD = 1, - CLUSTER_TIER_PREMIUM = 2 - } - - /** Engine enum. */ - enum Engine { - ENGINE_UNSPECIFIED = 0, - DEFAULT = 1, - LIGHTNING = 2 - } - } - - /** Properties of a VirtualClusterConfig. */ - interface IVirtualClusterConfig { - - /** VirtualClusterConfig stagingBucket */ - stagingBucket?: (string|null); - - /** VirtualClusterConfig kubernetesClusterConfig */ - kubernetesClusterConfig?: (google.cloud.dataproc.v1.IKubernetesClusterConfig|null); - - /** VirtualClusterConfig auxiliaryServicesConfig */ - auxiliaryServicesConfig?: (google.cloud.dataproc.v1.IAuxiliaryServicesConfig|null); - } - - /** Represents a VirtualClusterConfig. */ - class VirtualClusterConfig implements IVirtualClusterConfig { - - /** - * Constructs a new VirtualClusterConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IVirtualClusterConfig); - - /** VirtualClusterConfig stagingBucket. */ - public stagingBucket: string; - - /** VirtualClusterConfig kubernetesClusterConfig. */ - public kubernetesClusterConfig?: (google.cloud.dataproc.v1.IKubernetesClusterConfig|null); - - /** VirtualClusterConfig auxiliaryServicesConfig. */ - public auxiliaryServicesConfig?: (google.cloud.dataproc.v1.IAuxiliaryServicesConfig|null); - - /** VirtualClusterConfig infrastructureConfig. */ - public infrastructureConfig?: "kubernetesClusterConfig"; - - /** - * Creates a new VirtualClusterConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns VirtualClusterConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.IVirtualClusterConfig): google.cloud.dataproc.v1.VirtualClusterConfig; - - /** - * Encodes the specified VirtualClusterConfig message. Does not implicitly {@link google.cloud.dataproc.v1.VirtualClusterConfig.verify|verify} messages. - * @param message VirtualClusterConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IVirtualClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified VirtualClusterConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.VirtualClusterConfig.verify|verify} messages. - * @param message VirtualClusterConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IVirtualClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a VirtualClusterConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns VirtualClusterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.VirtualClusterConfig; - - /** - * Decodes a VirtualClusterConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns VirtualClusterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.VirtualClusterConfig; - - /** - * Verifies a VirtualClusterConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a VirtualClusterConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns VirtualClusterConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.VirtualClusterConfig; - - /** - * Creates a plain object from a VirtualClusterConfig message. Also converts values to other types if specified. - * @param message VirtualClusterConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.VirtualClusterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this VirtualClusterConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for VirtualClusterConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AuxiliaryServicesConfig. */ - interface IAuxiliaryServicesConfig { - - /** AuxiliaryServicesConfig metastoreConfig */ - metastoreConfig?: (google.cloud.dataproc.v1.IMetastoreConfig|null); - - /** AuxiliaryServicesConfig sparkHistoryServerConfig */ - sparkHistoryServerConfig?: (google.cloud.dataproc.v1.ISparkHistoryServerConfig|null); - } - - /** Represents an AuxiliaryServicesConfig. */ - class AuxiliaryServicesConfig implements IAuxiliaryServicesConfig { - - /** - * Constructs a new AuxiliaryServicesConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IAuxiliaryServicesConfig); - - /** AuxiliaryServicesConfig metastoreConfig. */ - public metastoreConfig?: (google.cloud.dataproc.v1.IMetastoreConfig|null); - - /** AuxiliaryServicesConfig sparkHistoryServerConfig. */ - public sparkHistoryServerConfig?: (google.cloud.dataproc.v1.ISparkHistoryServerConfig|null); - - /** - * Creates a new AuxiliaryServicesConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns AuxiliaryServicesConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.IAuxiliaryServicesConfig): google.cloud.dataproc.v1.AuxiliaryServicesConfig; - - /** - * Encodes the specified AuxiliaryServicesConfig message. Does not implicitly {@link google.cloud.dataproc.v1.AuxiliaryServicesConfig.verify|verify} messages. - * @param message AuxiliaryServicesConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IAuxiliaryServicesConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AuxiliaryServicesConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.AuxiliaryServicesConfig.verify|verify} messages. - * @param message AuxiliaryServicesConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IAuxiliaryServicesConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AuxiliaryServicesConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AuxiliaryServicesConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.AuxiliaryServicesConfig; - - /** - * Decodes an AuxiliaryServicesConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AuxiliaryServicesConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.AuxiliaryServicesConfig; - - /** - * Verifies an AuxiliaryServicesConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AuxiliaryServicesConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AuxiliaryServicesConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.AuxiliaryServicesConfig; - - /** - * Creates a plain object from an AuxiliaryServicesConfig message. Also converts values to other types if specified. - * @param message AuxiliaryServicesConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.AuxiliaryServicesConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AuxiliaryServicesConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AuxiliaryServicesConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EndpointConfig. */ - interface IEndpointConfig { - - /** EndpointConfig httpPorts */ - httpPorts?: ({ [k: string]: string }|null); - - /** EndpointConfig enableHttpPortAccess */ - enableHttpPortAccess?: (boolean|null); - } - - /** Represents an EndpointConfig. */ - class EndpointConfig implements IEndpointConfig { - - /** - * Constructs a new EndpointConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IEndpointConfig); - - /** EndpointConfig httpPorts. */ - public httpPorts: { [k: string]: string }; - - /** EndpointConfig enableHttpPortAccess. */ - public enableHttpPortAccess: boolean; - - /** - * Creates a new EndpointConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns EndpointConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.IEndpointConfig): google.cloud.dataproc.v1.EndpointConfig; - - /** - * Encodes the specified EndpointConfig message. Does not implicitly {@link google.cloud.dataproc.v1.EndpointConfig.verify|verify} messages. - * @param message EndpointConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IEndpointConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EndpointConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.EndpointConfig.verify|verify} messages. - * @param message EndpointConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IEndpointConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EndpointConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EndpointConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.EndpointConfig; - - /** - * Decodes an EndpointConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EndpointConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.EndpointConfig; - - /** - * Verifies an EndpointConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EndpointConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EndpointConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.EndpointConfig; - - /** - * Creates a plain object from an EndpointConfig message. Also converts values to other types if specified. - * @param message EndpointConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.EndpointConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EndpointConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EndpointConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AutoscalingConfig. */ - interface IAutoscalingConfig { - - /** AutoscalingConfig policyUri */ - policyUri?: (string|null); - } - - /** Represents an AutoscalingConfig. */ - class AutoscalingConfig implements IAutoscalingConfig { - - /** - * Constructs a new AutoscalingConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IAutoscalingConfig); - - /** AutoscalingConfig policyUri. */ - public policyUri: string; - - /** - * Creates a new AutoscalingConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns AutoscalingConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.IAutoscalingConfig): google.cloud.dataproc.v1.AutoscalingConfig; - - /** - * Encodes the specified AutoscalingConfig message. Does not implicitly {@link google.cloud.dataproc.v1.AutoscalingConfig.verify|verify} messages. - * @param message AutoscalingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IAutoscalingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AutoscalingConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.AutoscalingConfig.verify|verify} messages. - * @param message AutoscalingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IAutoscalingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AutoscalingConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AutoscalingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.AutoscalingConfig; - - /** - * Decodes an AutoscalingConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AutoscalingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.AutoscalingConfig; - - /** - * Verifies an AutoscalingConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AutoscalingConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AutoscalingConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.AutoscalingConfig; - - /** - * Creates a plain object from an AutoscalingConfig message. Also converts values to other types if specified. - * @param message AutoscalingConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.AutoscalingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AutoscalingConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AutoscalingConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EncryptionConfig. */ - interface IEncryptionConfig { - - /** EncryptionConfig gcePdKmsKeyName */ - gcePdKmsKeyName?: (string|null); - - /** EncryptionConfig kmsKey */ - kmsKey?: (string|null); - } - - /** Represents an EncryptionConfig. */ - class EncryptionConfig implements IEncryptionConfig { - - /** - * Constructs a new EncryptionConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IEncryptionConfig); - - /** EncryptionConfig gcePdKmsKeyName. */ - public gcePdKmsKeyName: string; - - /** EncryptionConfig kmsKey. */ - public kmsKey: string; - - /** - * Creates a new EncryptionConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns EncryptionConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.IEncryptionConfig): google.cloud.dataproc.v1.EncryptionConfig; - - /** - * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.dataproc.v1.EncryptionConfig.verify|verify} messages. - * @param message EncryptionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.EncryptionConfig.verify|verify} messages. - * @param message EncryptionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EncryptionConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.EncryptionConfig; - - /** - * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.EncryptionConfig; - - /** - * Verifies an EncryptionConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EncryptionConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.EncryptionConfig; - - /** - * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. - * @param message EncryptionConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.EncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EncryptionConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EncryptionConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GceClusterConfig. */ - interface IGceClusterConfig { - - /** GceClusterConfig zoneUri */ - zoneUri?: (string|null); - - /** GceClusterConfig networkUri */ - networkUri?: (string|null); - - /** GceClusterConfig subnetworkUri */ - subnetworkUri?: (string|null); - - /** GceClusterConfig internalIpOnly */ - internalIpOnly?: (boolean|null); - - /** GceClusterConfig privateIpv6GoogleAccess */ - privateIpv6GoogleAccess?: (google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccess|keyof typeof google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccess|null); - - /** GceClusterConfig serviceAccount */ - serviceAccount?: (string|null); - - /** GceClusterConfig serviceAccountScopes */ - serviceAccountScopes?: (string[]|null); - - /** GceClusterConfig tags */ - tags?: (string[]|null); - - /** GceClusterConfig metadata */ - metadata?: ({ [k: string]: string }|null); - - /** GceClusterConfig reservationAffinity */ - reservationAffinity?: (google.cloud.dataproc.v1.IReservationAffinity|null); - - /** GceClusterConfig nodeGroupAffinity */ - nodeGroupAffinity?: (google.cloud.dataproc.v1.INodeGroupAffinity|null); - - /** GceClusterConfig shieldedInstanceConfig */ - shieldedInstanceConfig?: (google.cloud.dataproc.v1.IShieldedInstanceConfig|null); - - /** GceClusterConfig confidentialInstanceConfig */ - confidentialInstanceConfig?: (google.cloud.dataproc.v1.IConfidentialInstanceConfig|null); - } - - /** Represents a GceClusterConfig. */ - class GceClusterConfig implements IGceClusterConfig { - - /** - * Constructs a new GceClusterConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IGceClusterConfig); - - /** GceClusterConfig zoneUri. */ - public zoneUri: string; - - /** GceClusterConfig networkUri. */ - public networkUri: string; - - /** GceClusterConfig subnetworkUri. */ - public subnetworkUri: string; - - /** GceClusterConfig internalIpOnly. */ - public internalIpOnly?: (boolean|null); - - /** GceClusterConfig privateIpv6GoogleAccess. */ - public privateIpv6GoogleAccess: (google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccess|keyof typeof google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccess); - - /** GceClusterConfig serviceAccount. */ - public serviceAccount: string; - - /** GceClusterConfig serviceAccountScopes. */ - public serviceAccountScopes: string[]; - - /** GceClusterConfig tags. */ - public tags: string[]; - - /** GceClusterConfig metadata. */ - public metadata: { [k: string]: string }; - - /** GceClusterConfig reservationAffinity. */ - public reservationAffinity?: (google.cloud.dataproc.v1.IReservationAffinity|null); - - /** GceClusterConfig nodeGroupAffinity. */ - public nodeGroupAffinity?: (google.cloud.dataproc.v1.INodeGroupAffinity|null); - - /** GceClusterConfig shieldedInstanceConfig. */ - public shieldedInstanceConfig?: (google.cloud.dataproc.v1.IShieldedInstanceConfig|null); - - /** GceClusterConfig confidentialInstanceConfig. */ - public confidentialInstanceConfig?: (google.cloud.dataproc.v1.IConfidentialInstanceConfig|null); - - /** - * Creates a new GceClusterConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns GceClusterConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.IGceClusterConfig): google.cloud.dataproc.v1.GceClusterConfig; - - /** - * Encodes the specified GceClusterConfig message. Does not implicitly {@link google.cloud.dataproc.v1.GceClusterConfig.verify|verify} messages. - * @param message GceClusterConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IGceClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GceClusterConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GceClusterConfig.verify|verify} messages. - * @param message GceClusterConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IGceClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GceClusterConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GceClusterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.GceClusterConfig; - - /** - * Decodes a GceClusterConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GceClusterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.GceClusterConfig; - - /** - * Verifies a GceClusterConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GceClusterConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GceClusterConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.GceClusterConfig; - - /** - * Creates a plain object from a GceClusterConfig message. Also converts values to other types if specified. - * @param message GceClusterConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.GceClusterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GceClusterConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GceClusterConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GceClusterConfig { - - /** PrivateIpv6GoogleAccess enum. */ - enum PrivateIpv6GoogleAccess { - PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED = 0, - INHERIT_FROM_SUBNETWORK = 1, - OUTBOUND = 2, - BIDIRECTIONAL = 3 - } - } - - /** Properties of a NodeGroupAffinity. */ - interface INodeGroupAffinity { - - /** NodeGroupAffinity nodeGroupUri */ - nodeGroupUri?: (string|null); - } - - /** Represents a NodeGroupAffinity. */ - class NodeGroupAffinity implements INodeGroupAffinity { - - /** - * Constructs a new NodeGroupAffinity. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.INodeGroupAffinity); - - /** NodeGroupAffinity nodeGroupUri. */ - public nodeGroupUri: string; - - /** - * Creates a new NodeGroupAffinity instance using the specified properties. - * @param [properties] Properties to set - * @returns NodeGroupAffinity instance - */ - public static create(properties?: google.cloud.dataproc.v1.INodeGroupAffinity): google.cloud.dataproc.v1.NodeGroupAffinity; - - /** - * Encodes the specified NodeGroupAffinity message. Does not implicitly {@link google.cloud.dataproc.v1.NodeGroupAffinity.verify|verify} messages. - * @param message NodeGroupAffinity message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.INodeGroupAffinity, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NodeGroupAffinity message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.NodeGroupAffinity.verify|verify} messages. - * @param message NodeGroupAffinity message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.INodeGroupAffinity, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NodeGroupAffinity message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NodeGroupAffinity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.NodeGroupAffinity; - - /** - * Decodes a NodeGroupAffinity message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NodeGroupAffinity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.NodeGroupAffinity; - - /** - * Verifies a NodeGroupAffinity message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NodeGroupAffinity message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NodeGroupAffinity - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.NodeGroupAffinity; - - /** - * Creates a plain object from a NodeGroupAffinity message. Also converts values to other types if specified. - * @param message NodeGroupAffinity - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.NodeGroupAffinity, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NodeGroupAffinity to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NodeGroupAffinity - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ShieldedInstanceConfig. */ - interface IShieldedInstanceConfig { - - /** ShieldedInstanceConfig enableSecureBoot */ - enableSecureBoot?: (boolean|null); - - /** ShieldedInstanceConfig enableVtpm */ - enableVtpm?: (boolean|null); - - /** ShieldedInstanceConfig enableIntegrityMonitoring */ - enableIntegrityMonitoring?: (boolean|null); - } - - /** Represents a ShieldedInstanceConfig. */ - class ShieldedInstanceConfig implements IShieldedInstanceConfig { - - /** - * Constructs a new ShieldedInstanceConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IShieldedInstanceConfig); - - /** ShieldedInstanceConfig enableSecureBoot. */ - public enableSecureBoot?: (boolean|null); - - /** ShieldedInstanceConfig enableVtpm. */ - public enableVtpm?: (boolean|null); - - /** ShieldedInstanceConfig enableIntegrityMonitoring. */ - public enableIntegrityMonitoring?: (boolean|null); - - /** - * Creates a new ShieldedInstanceConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ShieldedInstanceConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.IShieldedInstanceConfig): google.cloud.dataproc.v1.ShieldedInstanceConfig; - - /** - * Encodes the specified ShieldedInstanceConfig message. Does not implicitly {@link google.cloud.dataproc.v1.ShieldedInstanceConfig.verify|verify} messages. - * @param message ShieldedInstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IShieldedInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ShieldedInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ShieldedInstanceConfig.verify|verify} messages. - * @param message ShieldedInstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IShieldedInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ShieldedInstanceConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ShieldedInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ShieldedInstanceConfig; - - /** - * Decodes a ShieldedInstanceConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ShieldedInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ShieldedInstanceConfig; - - /** - * Verifies a ShieldedInstanceConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ShieldedInstanceConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ShieldedInstanceConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ShieldedInstanceConfig; - - /** - * Creates a plain object from a ShieldedInstanceConfig message. Also converts values to other types if specified. - * @param message ShieldedInstanceConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.ShieldedInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ShieldedInstanceConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ShieldedInstanceConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ConfidentialInstanceConfig. */ - interface IConfidentialInstanceConfig { - - /** ConfidentialInstanceConfig enableConfidentialCompute */ - enableConfidentialCompute?: (boolean|null); - } - - /** Represents a ConfidentialInstanceConfig. */ - class ConfidentialInstanceConfig implements IConfidentialInstanceConfig { - - /** - * Constructs a new ConfidentialInstanceConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IConfidentialInstanceConfig); - - /** ConfidentialInstanceConfig enableConfidentialCompute. */ - public enableConfidentialCompute: boolean; - - /** - * Creates a new ConfidentialInstanceConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ConfidentialInstanceConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.IConfidentialInstanceConfig): google.cloud.dataproc.v1.ConfidentialInstanceConfig; - - /** - * Encodes the specified ConfidentialInstanceConfig message. Does not implicitly {@link google.cloud.dataproc.v1.ConfidentialInstanceConfig.verify|verify} messages. - * @param message ConfidentialInstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IConfidentialInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConfidentialInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ConfidentialInstanceConfig.verify|verify} messages. - * @param message ConfidentialInstanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IConfidentialInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ConfidentialInstanceConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ConfidentialInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ConfidentialInstanceConfig; - - /** - * Decodes a ConfidentialInstanceConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ConfidentialInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ConfidentialInstanceConfig; - - /** - * Verifies a ConfidentialInstanceConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ConfidentialInstanceConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ConfidentialInstanceConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ConfidentialInstanceConfig; - - /** - * Creates a plain object from a ConfidentialInstanceConfig message. Also converts values to other types if specified. - * @param message ConfidentialInstanceConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.ConfidentialInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ConfidentialInstanceConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ConfidentialInstanceConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InstanceGroupConfig. */ - interface IInstanceGroupConfig { - - /** InstanceGroupConfig numInstances */ - numInstances?: (number|null); - - /** InstanceGroupConfig instanceNames */ - instanceNames?: (string[]|null); - - /** InstanceGroupConfig instanceReferences */ - instanceReferences?: (google.cloud.dataproc.v1.IInstanceReference[]|null); - - /** InstanceGroupConfig imageUri */ - imageUri?: (string|null); - - /** InstanceGroupConfig machineTypeUri */ - machineTypeUri?: (string|null); - - /** InstanceGroupConfig diskConfig */ - diskConfig?: (google.cloud.dataproc.v1.IDiskConfig|null); - - /** InstanceGroupConfig isPreemptible */ - isPreemptible?: (boolean|null); - - /** InstanceGroupConfig preemptibility */ - preemptibility?: (google.cloud.dataproc.v1.InstanceGroupConfig.Preemptibility|keyof typeof google.cloud.dataproc.v1.InstanceGroupConfig.Preemptibility|null); - - /** InstanceGroupConfig managedGroupConfig */ - managedGroupConfig?: (google.cloud.dataproc.v1.IManagedGroupConfig|null); - - /** InstanceGroupConfig accelerators */ - accelerators?: (google.cloud.dataproc.v1.IAcceleratorConfig[]|null); - - /** InstanceGroupConfig minCpuPlatform */ - minCpuPlatform?: (string|null); - - /** InstanceGroupConfig minNumInstances */ - minNumInstances?: (number|null); - - /** InstanceGroupConfig instanceFlexibilityPolicy */ - instanceFlexibilityPolicy?: (google.cloud.dataproc.v1.IInstanceFlexibilityPolicy|null); - - /** InstanceGroupConfig startupConfig */ - startupConfig?: (google.cloud.dataproc.v1.IStartupConfig|null); - } - - /** Represents an InstanceGroupConfig. */ - class InstanceGroupConfig implements IInstanceGroupConfig { - - /** - * Constructs a new InstanceGroupConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IInstanceGroupConfig); - - /** InstanceGroupConfig numInstances. */ - public numInstances: number; - - /** InstanceGroupConfig instanceNames. */ - public instanceNames: string[]; - - /** InstanceGroupConfig instanceReferences. */ - public instanceReferences: google.cloud.dataproc.v1.IInstanceReference[]; - - /** InstanceGroupConfig imageUri. */ - public imageUri: string; - - /** InstanceGroupConfig machineTypeUri. */ - public machineTypeUri: string; - - /** InstanceGroupConfig diskConfig. */ - public diskConfig?: (google.cloud.dataproc.v1.IDiskConfig|null); - - /** InstanceGroupConfig isPreemptible. */ - public isPreemptible: boolean; - - /** InstanceGroupConfig preemptibility. */ - public preemptibility: (google.cloud.dataproc.v1.InstanceGroupConfig.Preemptibility|keyof typeof google.cloud.dataproc.v1.InstanceGroupConfig.Preemptibility); - - /** InstanceGroupConfig managedGroupConfig. */ - public managedGroupConfig?: (google.cloud.dataproc.v1.IManagedGroupConfig|null); - - /** InstanceGroupConfig accelerators. */ - public accelerators: google.cloud.dataproc.v1.IAcceleratorConfig[]; - - /** InstanceGroupConfig minCpuPlatform. */ - public minCpuPlatform: string; - - /** InstanceGroupConfig minNumInstances. */ - public minNumInstances: number; - - /** InstanceGroupConfig instanceFlexibilityPolicy. */ - public instanceFlexibilityPolicy?: (google.cloud.dataproc.v1.IInstanceFlexibilityPolicy|null); - - /** InstanceGroupConfig startupConfig. */ - public startupConfig?: (google.cloud.dataproc.v1.IStartupConfig|null); - - /** - * Creates a new InstanceGroupConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns InstanceGroupConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.IInstanceGroupConfig): google.cloud.dataproc.v1.InstanceGroupConfig; - - /** - * Encodes the specified InstanceGroupConfig message. Does not implicitly {@link google.cloud.dataproc.v1.InstanceGroupConfig.verify|verify} messages. - * @param message InstanceGroupConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IInstanceGroupConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InstanceGroupConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstanceGroupConfig.verify|verify} messages. - * @param message InstanceGroupConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IInstanceGroupConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InstanceGroupConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InstanceGroupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.InstanceGroupConfig; - - /** - * Decodes an InstanceGroupConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstanceGroupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.InstanceGroupConfig; - - /** - * Verifies an InstanceGroupConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InstanceGroupConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstanceGroupConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.InstanceGroupConfig; - - /** - * Creates a plain object from an InstanceGroupConfig message. Also converts values to other types if specified. - * @param message InstanceGroupConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.InstanceGroupConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InstanceGroupConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InstanceGroupConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace InstanceGroupConfig { - - /** Preemptibility enum. */ - enum Preemptibility { - PREEMPTIBILITY_UNSPECIFIED = 0, - NON_PREEMPTIBLE = 1, - PREEMPTIBLE = 2, - SPOT = 3 - } - } - - /** Properties of a StartupConfig. */ - interface IStartupConfig { - - /** StartupConfig requiredRegistrationFraction */ - requiredRegistrationFraction?: (number|null); - } - - /** Represents a StartupConfig. */ - class StartupConfig implements IStartupConfig { - - /** - * Constructs a new StartupConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IStartupConfig); - - /** StartupConfig requiredRegistrationFraction. */ - public requiredRegistrationFraction?: (number|null); - - /** - * Creates a new StartupConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns StartupConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.IStartupConfig): google.cloud.dataproc.v1.StartupConfig; - - /** - * Encodes the specified StartupConfig message. Does not implicitly {@link google.cloud.dataproc.v1.StartupConfig.verify|verify} messages. - * @param message StartupConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IStartupConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StartupConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.StartupConfig.verify|verify} messages. - * @param message StartupConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IStartupConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StartupConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StartupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.StartupConfig; - - /** - * Decodes a StartupConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StartupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.StartupConfig; - - /** - * Verifies a StartupConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StartupConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StartupConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.StartupConfig; - - /** - * Creates a plain object from a StartupConfig message. Also converts values to other types if specified. - * @param message StartupConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.StartupConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StartupConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StartupConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InstanceReference. */ - interface IInstanceReference { - - /** InstanceReference instanceName */ - instanceName?: (string|null); - - /** InstanceReference instanceId */ - instanceId?: (string|null); - - /** InstanceReference publicKey */ - publicKey?: (string|null); - - /** InstanceReference publicEciesKey */ - publicEciesKey?: (string|null); - } - - /** Represents an InstanceReference. */ - class InstanceReference implements IInstanceReference { - - /** - * Constructs a new InstanceReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IInstanceReference); - - /** InstanceReference instanceName. */ - public instanceName: string; - - /** InstanceReference instanceId. */ - public instanceId: string; - - /** InstanceReference publicKey. */ - public publicKey: string; - - /** InstanceReference publicEciesKey. */ - public publicEciesKey: string; - - /** - * Creates a new InstanceReference instance using the specified properties. - * @param [properties] Properties to set - * @returns InstanceReference instance - */ - public static create(properties?: google.cloud.dataproc.v1.IInstanceReference): google.cloud.dataproc.v1.InstanceReference; - - /** - * Encodes the specified InstanceReference message. Does not implicitly {@link google.cloud.dataproc.v1.InstanceReference.verify|verify} messages. - * @param message InstanceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IInstanceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InstanceReference message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstanceReference.verify|verify} messages. - * @param message InstanceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IInstanceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InstanceReference message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InstanceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.InstanceReference; - - /** - * Decodes an InstanceReference message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstanceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.InstanceReference; - - /** - * Verifies an InstanceReference message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InstanceReference message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstanceReference - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.InstanceReference; - - /** - * Creates a plain object from an InstanceReference message. Also converts values to other types if specified. - * @param message InstanceReference - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.InstanceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InstanceReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InstanceReference - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ManagedGroupConfig. */ - interface IManagedGroupConfig { - - /** ManagedGroupConfig instanceTemplateName */ - instanceTemplateName?: (string|null); - - /** ManagedGroupConfig instanceGroupManagerName */ - instanceGroupManagerName?: (string|null); - - /** ManagedGroupConfig instanceGroupManagerUri */ - instanceGroupManagerUri?: (string|null); - } - - /** Represents a ManagedGroupConfig. */ - class ManagedGroupConfig implements IManagedGroupConfig { - - /** - * Constructs a new ManagedGroupConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IManagedGroupConfig); - - /** ManagedGroupConfig instanceTemplateName. */ - public instanceTemplateName: string; - - /** ManagedGroupConfig instanceGroupManagerName. */ - public instanceGroupManagerName: string; - - /** ManagedGroupConfig instanceGroupManagerUri. */ - public instanceGroupManagerUri: string; - - /** - * Creates a new ManagedGroupConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ManagedGroupConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.IManagedGroupConfig): google.cloud.dataproc.v1.ManagedGroupConfig; - - /** - * Encodes the specified ManagedGroupConfig message. Does not implicitly {@link google.cloud.dataproc.v1.ManagedGroupConfig.verify|verify} messages. - * @param message ManagedGroupConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IManagedGroupConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ManagedGroupConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ManagedGroupConfig.verify|verify} messages. - * @param message ManagedGroupConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IManagedGroupConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ManagedGroupConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ManagedGroupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ManagedGroupConfig; - - /** - * Decodes a ManagedGroupConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ManagedGroupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ManagedGroupConfig; - - /** - * Verifies a ManagedGroupConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ManagedGroupConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ManagedGroupConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ManagedGroupConfig; - - /** - * Creates a plain object from a ManagedGroupConfig message. Also converts values to other types if specified. - * @param message ManagedGroupConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.ManagedGroupConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ManagedGroupConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ManagedGroupConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InstanceFlexibilityPolicy. */ - interface IInstanceFlexibilityPolicy { - - /** InstanceFlexibilityPolicy provisioningModelMix */ - provisioningModelMix?: (google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IProvisioningModelMix|null); - - /** InstanceFlexibilityPolicy instanceSelectionList */ - instanceSelectionList?: (google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelection[]|null); - - /** InstanceFlexibilityPolicy instanceSelectionResults */ - instanceSelectionResults?: (google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelectionResult[]|null); - } - - /** Represents an InstanceFlexibilityPolicy. */ - class InstanceFlexibilityPolicy implements IInstanceFlexibilityPolicy { - - /** - * Constructs a new InstanceFlexibilityPolicy. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IInstanceFlexibilityPolicy); - - /** InstanceFlexibilityPolicy provisioningModelMix. */ - public provisioningModelMix?: (google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IProvisioningModelMix|null); - - /** InstanceFlexibilityPolicy instanceSelectionList. */ - public instanceSelectionList: google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelection[]; - - /** InstanceFlexibilityPolicy instanceSelectionResults. */ - public instanceSelectionResults: google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelectionResult[]; - - /** - * Creates a new InstanceFlexibilityPolicy instance using the specified properties. - * @param [properties] Properties to set - * @returns InstanceFlexibilityPolicy instance - */ - public static create(properties?: google.cloud.dataproc.v1.IInstanceFlexibilityPolicy): google.cloud.dataproc.v1.InstanceFlexibilityPolicy; - - /** - * Encodes the specified InstanceFlexibilityPolicy message. Does not implicitly {@link google.cloud.dataproc.v1.InstanceFlexibilityPolicy.verify|verify} messages. - * @param message InstanceFlexibilityPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IInstanceFlexibilityPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InstanceFlexibilityPolicy message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstanceFlexibilityPolicy.verify|verify} messages. - * @param message InstanceFlexibilityPolicy message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IInstanceFlexibilityPolicy, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InstanceFlexibilityPolicy message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InstanceFlexibilityPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.InstanceFlexibilityPolicy; - - /** - * Decodes an InstanceFlexibilityPolicy message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstanceFlexibilityPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.InstanceFlexibilityPolicy; - - /** - * Verifies an InstanceFlexibilityPolicy message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InstanceFlexibilityPolicy message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstanceFlexibilityPolicy - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.InstanceFlexibilityPolicy; - - /** - * Creates a plain object from an InstanceFlexibilityPolicy message. Also converts values to other types if specified. - * @param message InstanceFlexibilityPolicy - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.InstanceFlexibilityPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InstanceFlexibilityPolicy to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InstanceFlexibilityPolicy - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace InstanceFlexibilityPolicy { - - /** Properties of a ProvisioningModelMix. */ - interface IProvisioningModelMix { - - /** ProvisioningModelMix standardCapacityBase */ - standardCapacityBase?: (number|null); - - /** ProvisioningModelMix standardCapacityPercentAboveBase */ - standardCapacityPercentAboveBase?: (number|null); - } - - /** Represents a ProvisioningModelMix. */ - class ProvisioningModelMix implements IProvisioningModelMix { - - /** - * Constructs a new ProvisioningModelMix. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IProvisioningModelMix); - - /** ProvisioningModelMix standardCapacityBase. */ - public standardCapacityBase?: (number|null); - - /** ProvisioningModelMix standardCapacityPercentAboveBase. */ - public standardCapacityPercentAboveBase?: (number|null); - - /** - * Creates a new ProvisioningModelMix instance using the specified properties. - * @param [properties] Properties to set - * @returns ProvisioningModelMix instance - */ - public static create(properties?: google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IProvisioningModelMix): google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix; - - /** - * Encodes the specified ProvisioningModelMix message. Does not implicitly {@link google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix.verify|verify} messages. - * @param message ProvisioningModelMix message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IProvisioningModelMix, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ProvisioningModelMix message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix.verify|verify} messages. - * @param message ProvisioningModelMix message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IProvisioningModelMix, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ProvisioningModelMix message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ProvisioningModelMix - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix; - - /** - * Decodes a ProvisioningModelMix message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ProvisioningModelMix - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix; - - /** - * Verifies a ProvisioningModelMix message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ProvisioningModelMix message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ProvisioningModelMix - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix; - - /** - * Creates a plain object from a ProvisioningModelMix message. Also converts values to other types if specified. - * @param message ProvisioningModelMix - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ProvisioningModelMix to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ProvisioningModelMix - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InstanceSelection. */ - interface IInstanceSelection { - - /** InstanceSelection machineTypes */ - machineTypes?: (string[]|null); - - /** InstanceSelection rank */ - rank?: (number|null); - } - - /** Represents an InstanceSelection. */ - class InstanceSelection implements IInstanceSelection { - - /** - * Constructs a new InstanceSelection. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelection); - - /** InstanceSelection machineTypes. */ - public machineTypes: string[]; - - /** InstanceSelection rank. */ - public rank: number; - - /** - * Creates a new InstanceSelection instance using the specified properties. - * @param [properties] Properties to set - * @returns InstanceSelection instance - */ - public static create(properties?: google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelection): google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection; - - /** - * Encodes the specified InstanceSelection message. Does not implicitly {@link google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection.verify|verify} messages. - * @param message InstanceSelection message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelection, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InstanceSelection message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection.verify|verify} messages. - * @param message InstanceSelection message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelection, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InstanceSelection message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InstanceSelection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection; - - /** - * Decodes an InstanceSelection message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstanceSelection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection; - - /** - * Verifies an InstanceSelection message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InstanceSelection message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstanceSelection - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection; - - /** - * Creates a plain object from an InstanceSelection message. Also converts values to other types if specified. - * @param message InstanceSelection - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InstanceSelection to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InstanceSelection - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InstanceSelectionResult. */ - interface IInstanceSelectionResult { - - /** InstanceSelectionResult machineType */ - machineType?: (string|null); - - /** InstanceSelectionResult vmCount */ - vmCount?: (number|null); - } - - /** Represents an InstanceSelectionResult. */ - class InstanceSelectionResult implements IInstanceSelectionResult { - - /** - * Constructs a new InstanceSelectionResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelectionResult); - - /** InstanceSelectionResult machineType. */ - public machineType?: (string|null); - - /** InstanceSelectionResult vmCount. */ - public vmCount?: (number|null); - - /** - * Creates a new InstanceSelectionResult instance using the specified properties. - * @param [properties] Properties to set - * @returns InstanceSelectionResult instance - */ - public static create(properties?: google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelectionResult): google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult; - - /** - * Encodes the specified InstanceSelectionResult message. Does not implicitly {@link google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult.verify|verify} messages. - * @param message InstanceSelectionResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelectionResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InstanceSelectionResult message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult.verify|verify} messages. - * @param message InstanceSelectionResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelectionResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InstanceSelectionResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InstanceSelectionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult; - - /** - * Decodes an InstanceSelectionResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstanceSelectionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult; - - /** - * Verifies an InstanceSelectionResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InstanceSelectionResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstanceSelectionResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult; - - /** - * Creates a plain object from an InstanceSelectionResult message. Also converts values to other types if specified. - * @param message InstanceSelectionResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InstanceSelectionResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InstanceSelectionResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an AcceleratorConfig. */ - interface IAcceleratorConfig { - - /** AcceleratorConfig acceleratorTypeUri */ - acceleratorTypeUri?: (string|null); - - /** AcceleratorConfig acceleratorCount */ - acceleratorCount?: (number|null); - } - - /** Represents an AcceleratorConfig. */ - class AcceleratorConfig implements IAcceleratorConfig { - - /** - * Constructs a new AcceleratorConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IAcceleratorConfig); - - /** AcceleratorConfig acceleratorTypeUri. */ - public acceleratorTypeUri: string; - - /** AcceleratorConfig acceleratorCount. */ - public acceleratorCount: number; - - /** - * Creates a new AcceleratorConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns AcceleratorConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.IAcceleratorConfig): google.cloud.dataproc.v1.AcceleratorConfig; - - /** - * Encodes the specified AcceleratorConfig message. Does not implicitly {@link google.cloud.dataproc.v1.AcceleratorConfig.verify|verify} messages. - * @param message AcceleratorConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IAcceleratorConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AcceleratorConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.AcceleratorConfig.verify|verify} messages. - * @param message AcceleratorConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IAcceleratorConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AcceleratorConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AcceleratorConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.AcceleratorConfig; - - /** - * Decodes an AcceleratorConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AcceleratorConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.AcceleratorConfig; - - /** - * Verifies an AcceleratorConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AcceleratorConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AcceleratorConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.AcceleratorConfig; - - /** - * Creates a plain object from an AcceleratorConfig message. Also converts values to other types if specified. - * @param message AcceleratorConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.AcceleratorConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AcceleratorConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AcceleratorConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DiskConfig. */ - interface IDiskConfig { - - /** DiskConfig bootDiskType */ - bootDiskType?: (string|null); - - /** DiskConfig bootDiskSizeGb */ - bootDiskSizeGb?: (number|null); - - /** DiskConfig numLocalSsds */ - numLocalSsds?: (number|null); - - /** DiskConfig localSsdInterface */ - localSsdInterface?: (string|null); - - /** DiskConfig bootDiskProvisionedIops */ - bootDiskProvisionedIops?: (number|Long|string|null); - - /** DiskConfig bootDiskProvisionedThroughput */ - bootDiskProvisionedThroughput?: (number|Long|string|null); - } - - /** Represents a DiskConfig. */ - class DiskConfig implements IDiskConfig { - - /** - * Constructs a new DiskConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IDiskConfig); - - /** DiskConfig bootDiskType. */ - public bootDiskType: string; - - /** DiskConfig bootDiskSizeGb. */ - public bootDiskSizeGb: number; - - /** DiskConfig numLocalSsds. */ - public numLocalSsds: number; - - /** DiskConfig localSsdInterface. */ - public localSsdInterface: string; - - /** DiskConfig bootDiskProvisionedIops. */ - public bootDiskProvisionedIops?: (number|Long|string|null); - - /** DiskConfig bootDiskProvisionedThroughput. */ - public bootDiskProvisionedThroughput?: (number|Long|string|null); - - /** - * Creates a new DiskConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns DiskConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.IDiskConfig): google.cloud.dataproc.v1.DiskConfig; - - /** - * Encodes the specified DiskConfig message. Does not implicitly {@link google.cloud.dataproc.v1.DiskConfig.verify|verify} messages. - * @param message DiskConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IDiskConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DiskConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DiskConfig.verify|verify} messages. - * @param message DiskConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IDiskConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DiskConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DiskConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.DiskConfig; - - /** - * Decodes a DiskConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DiskConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.DiskConfig; - - /** - * Verifies a DiskConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DiskConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DiskConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.DiskConfig; - - /** - * Creates a plain object from a DiskConfig message. Also converts values to other types if specified. - * @param message DiskConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.DiskConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DiskConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DiskConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AuxiliaryNodeGroup. */ - interface IAuxiliaryNodeGroup { - - /** AuxiliaryNodeGroup nodeGroup */ - nodeGroup?: (google.cloud.dataproc.v1.INodeGroup|null); - - /** AuxiliaryNodeGroup nodeGroupId */ - nodeGroupId?: (string|null); - } - - /** Represents an AuxiliaryNodeGroup. */ - class AuxiliaryNodeGroup implements IAuxiliaryNodeGroup { - - /** - * Constructs a new AuxiliaryNodeGroup. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IAuxiliaryNodeGroup); - - /** AuxiliaryNodeGroup nodeGroup. */ - public nodeGroup?: (google.cloud.dataproc.v1.INodeGroup|null); - - /** AuxiliaryNodeGroup nodeGroupId. */ - public nodeGroupId: string; - - /** - * Creates a new AuxiliaryNodeGroup instance using the specified properties. - * @param [properties] Properties to set - * @returns AuxiliaryNodeGroup instance - */ - public static create(properties?: google.cloud.dataproc.v1.IAuxiliaryNodeGroup): google.cloud.dataproc.v1.AuxiliaryNodeGroup; - - /** - * Encodes the specified AuxiliaryNodeGroup message. Does not implicitly {@link google.cloud.dataproc.v1.AuxiliaryNodeGroup.verify|verify} messages. - * @param message AuxiliaryNodeGroup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IAuxiliaryNodeGroup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AuxiliaryNodeGroup message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.AuxiliaryNodeGroup.verify|verify} messages. - * @param message AuxiliaryNodeGroup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IAuxiliaryNodeGroup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AuxiliaryNodeGroup message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AuxiliaryNodeGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.AuxiliaryNodeGroup; - - /** - * Decodes an AuxiliaryNodeGroup message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AuxiliaryNodeGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.AuxiliaryNodeGroup; - - /** - * Verifies an AuxiliaryNodeGroup message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AuxiliaryNodeGroup message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AuxiliaryNodeGroup - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.AuxiliaryNodeGroup; - - /** - * Creates a plain object from an AuxiliaryNodeGroup message. Also converts values to other types if specified. - * @param message AuxiliaryNodeGroup - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.AuxiliaryNodeGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AuxiliaryNodeGroup to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AuxiliaryNodeGroup - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NodeGroup. */ - interface INodeGroup { - - /** NodeGroup name */ - name?: (string|null); - - /** NodeGroup roles */ - roles?: (google.cloud.dataproc.v1.NodeGroup.Role[]|null); - - /** NodeGroup nodeGroupConfig */ - nodeGroupConfig?: (google.cloud.dataproc.v1.IInstanceGroupConfig|null); - - /** NodeGroup labels */ - labels?: ({ [k: string]: string }|null); - } - - /** Represents a NodeGroup. */ - class NodeGroup implements INodeGroup { - - /** - * Constructs a new NodeGroup. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.INodeGroup); - - /** NodeGroup name. */ - public name: string; - - /** NodeGroup roles. */ - public roles: google.cloud.dataproc.v1.NodeGroup.Role[]; - - /** NodeGroup nodeGroupConfig. */ - public nodeGroupConfig?: (google.cloud.dataproc.v1.IInstanceGroupConfig|null); - - /** NodeGroup labels. */ - public labels: { [k: string]: string }; - - /** - * Creates a new NodeGroup instance using the specified properties. - * @param [properties] Properties to set - * @returns NodeGroup instance - */ - public static create(properties?: google.cloud.dataproc.v1.INodeGroup): google.cloud.dataproc.v1.NodeGroup; - - /** - * Encodes the specified NodeGroup message. Does not implicitly {@link google.cloud.dataproc.v1.NodeGroup.verify|verify} messages. - * @param message NodeGroup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.INodeGroup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NodeGroup message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.NodeGroup.verify|verify} messages. - * @param message NodeGroup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.INodeGroup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NodeGroup message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NodeGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.NodeGroup; - - /** - * Decodes a NodeGroup message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NodeGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.NodeGroup; - - /** - * Verifies a NodeGroup message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NodeGroup message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NodeGroup - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.NodeGroup; - - /** - * Creates a plain object from a NodeGroup message. Also converts values to other types if specified. - * @param message NodeGroup - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.NodeGroup, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NodeGroup to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NodeGroup - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace NodeGroup { - - /** Role enum. */ - enum Role { - ROLE_UNSPECIFIED = 0, - DRIVER = 1 - } - } - - /** Properties of a NodeInitializationAction. */ - interface INodeInitializationAction { - - /** NodeInitializationAction executableFile */ - executableFile?: (string|null); - - /** NodeInitializationAction executionTimeout */ - executionTimeout?: (google.protobuf.IDuration|null); - } - - /** Represents a NodeInitializationAction. */ - class NodeInitializationAction implements INodeInitializationAction { - - /** - * Constructs a new NodeInitializationAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.INodeInitializationAction); - - /** NodeInitializationAction executableFile. */ - public executableFile: string; - - /** NodeInitializationAction executionTimeout. */ - public executionTimeout?: (google.protobuf.IDuration|null); - - /** - * Creates a new NodeInitializationAction instance using the specified properties. - * @param [properties] Properties to set - * @returns NodeInitializationAction instance - */ - public static create(properties?: google.cloud.dataproc.v1.INodeInitializationAction): google.cloud.dataproc.v1.NodeInitializationAction; - - /** - * Encodes the specified NodeInitializationAction message. Does not implicitly {@link google.cloud.dataproc.v1.NodeInitializationAction.verify|verify} messages. - * @param message NodeInitializationAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.INodeInitializationAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NodeInitializationAction message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.NodeInitializationAction.verify|verify} messages. - * @param message NodeInitializationAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.INodeInitializationAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NodeInitializationAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NodeInitializationAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.NodeInitializationAction; - - /** - * Decodes a NodeInitializationAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NodeInitializationAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.NodeInitializationAction; - - /** - * Verifies a NodeInitializationAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NodeInitializationAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NodeInitializationAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.NodeInitializationAction; - - /** - * Creates a plain object from a NodeInitializationAction message. Also converts values to other types if specified. - * @param message NodeInitializationAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.NodeInitializationAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NodeInitializationAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NodeInitializationAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ClusterStatus. */ - interface IClusterStatus { - - /** ClusterStatus state */ - state?: (google.cloud.dataproc.v1.ClusterStatus.State|keyof typeof google.cloud.dataproc.v1.ClusterStatus.State|null); - - /** ClusterStatus detail */ - detail?: (string|null); - - /** ClusterStatus stateStartTime */ - stateStartTime?: (google.protobuf.ITimestamp|null); - - /** ClusterStatus substate */ - substate?: (google.cloud.dataproc.v1.ClusterStatus.Substate|keyof typeof google.cloud.dataproc.v1.ClusterStatus.Substate|null); - } - - /** Represents a ClusterStatus. */ - class ClusterStatus implements IClusterStatus { - - /** - * Constructs a new ClusterStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IClusterStatus); - - /** ClusterStatus state. */ - public state: (google.cloud.dataproc.v1.ClusterStatus.State|keyof typeof google.cloud.dataproc.v1.ClusterStatus.State); - - /** ClusterStatus detail. */ - public detail: string; - - /** ClusterStatus stateStartTime. */ - public stateStartTime?: (google.protobuf.ITimestamp|null); - - /** ClusterStatus substate. */ - public substate: (google.cloud.dataproc.v1.ClusterStatus.Substate|keyof typeof google.cloud.dataproc.v1.ClusterStatus.Substate); - - /** - * Creates a new ClusterStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns ClusterStatus instance - */ - public static create(properties?: google.cloud.dataproc.v1.IClusterStatus): google.cloud.dataproc.v1.ClusterStatus; - - /** - * Encodes the specified ClusterStatus message. Does not implicitly {@link google.cloud.dataproc.v1.ClusterStatus.verify|verify} messages. - * @param message ClusterStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IClusterStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClusterStatus message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ClusterStatus.verify|verify} messages. - * @param message ClusterStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IClusterStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClusterStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClusterStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ClusterStatus; - - /** - * Decodes a ClusterStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClusterStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ClusterStatus; - - /** - * Verifies a ClusterStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClusterStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClusterStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ClusterStatus; - - /** - * Creates a plain object from a ClusterStatus message. Also converts values to other types if specified. - * @param message ClusterStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.ClusterStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClusterStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClusterStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ClusterStatus { - - /** State enum. */ - enum State { - UNKNOWN = 0, - CREATING = 1, - RUNNING = 2, - ERROR = 3, - ERROR_DUE_TO_UPDATE = 9, - DELETING = 4, - UPDATING = 5, - STOPPING = 6, - STOPPED = 7, - STARTING = 8, - REPAIRING = 10 - } - - /** Substate enum. */ - enum Substate { - UNSPECIFIED = 0, - UNHEALTHY = 1, - STALE_STATUS = 2 - } - } - - /** Properties of a SecurityConfig. */ - interface ISecurityConfig { - - /** SecurityConfig kerberosConfig */ - kerberosConfig?: (google.cloud.dataproc.v1.IKerberosConfig|null); - - /** SecurityConfig identityConfig */ - identityConfig?: (google.cloud.dataproc.v1.IIdentityConfig|null); - } - - /** Represents a SecurityConfig. */ - class SecurityConfig implements ISecurityConfig { - - /** - * Constructs a new SecurityConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.ISecurityConfig); - - /** SecurityConfig kerberosConfig. */ - public kerberosConfig?: (google.cloud.dataproc.v1.IKerberosConfig|null); - - /** SecurityConfig identityConfig. */ - public identityConfig?: (google.cloud.dataproc.v1.IIdentityConfig|null); - - /** - * Creates a new SecurityConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns SecurityConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.ISecurityConfig): google.cloud.dataproc.v1.SecurityConfig; - - /** - * Encodes the specified SecurityConfig message. Does not implicitly {@link google.cloud.dataproc.v1.SecurityConfig.verify|verify} messages. - * @param message SecurityConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.ISecurityConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SecurityConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SecurityConfig.verify|verify} messages. - * @param message SecurityConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.ISecurityConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SecurityConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SecurityConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.SecurityConfig; - - /** - * Decodes a SecurityConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SecurityConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.SecurityConfig; - - /** - * Verifies a SecurityConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SecurityConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SecurityConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.SecurityConfig; - - /** - * Creates a plain object from a SecurityConfig message. Also converts values to other types if specified. - * @param message SecurityConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.SecurityConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SecurityConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SecurityConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a KerberosConfig. */ - interface IKerberosConfig { - - /** KerberosConfig enableKerberos */ - enableKerberos?: (boolean|null); - - /** KerberosConfig rootPrincipalPasswordUri */ - rootPrincipalPasswordUri?: (string|null); - - /** KerberosConfig kmsKeyUri */ - kmsKeyUri?: (string|null); - - /** KerberosConfig keystoreUri */ - keystoreUri?: (string|null); - - /** KerberosConfig truststoreUri */ - truststoreUri?: (string|null); - - /** KerberosConfig keystorePasswordUri */ - keystorePasswordUri?: (string|null); - - /** KerberosConfig keyPasswordUri */ - keyPasswordUri?: (string|null); - - /** KerberosConfig truststorePasswordUri */ - truststorePasswordUri?: (string|null); - - /** KerberosConfig crossRealmTrustRealm */ - crossRealmTrustRealm?: (string|null); - - /** KerberosConfig crossRealmTrustKdc */ - crossRealmTrustKdc?: (string|null); - - /** KerberosConfig crossRealmTrustAdminServer */ - crossRealmTrustAdminServer?: (string|null); - - /** KerberosConfig crossRealmTrustSharedPasswordUri */ - crossRealmTrustSharedPasswordUri?: (string|null); - - /** KerberosConfig kdcDbKeyUri */ - kdcDbKeyUri?: (string|null); - - /** KerberosConfig tgtLifetimeHours */ - tgtLifetimeHours?: (number|null); - - /** KerberosConfig realm */ - realm?: (string|null); - } - - /** Represents a KerberosConfig. */ - class KerberosConfig implements IKerberosConfig { - - /** - * Constructs a new KerberosConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IKerberosConfig); - - /** KerberosConfig enableKerberos. */ - public enableKerberos: boolean; - - /** KerberosConfig rootPrincipalPasswordUri. */ - public rootPrincipalPasswordUri: string; - - /** KerberosConfig kmsKeyUri. */ - public kmsKeyUri: string; - - /** KerberosConfig keystoreUri. */ - public keystoreUri: string; - - /** KerberosConfig truststoreUri. */ - public truststoreUri: string; - - /** KerberosConfig keystorePasswordUri. */ - public keystorePasswordUri: string; - - /** KerberosConfig keyPasswordUri. */ - public keyPasswordUri: string; - - /** KerberosConfig truststorePasswordUri. */ - public truststorePasswordUri: string; - - /** KerberosConfig crossRealmTrustRealm. */ - public crossRealmTrustRealm: string; - - /** KerberosConfig crossRealmTrustKdc. */ - public crossRealmTrustKdc: string; - - /** KerberosConfig crossRealmTrustAdminServer. */ - public crossRealmTrustAdminServer: string; - - /** KerberosConfig crossRealmTrustSharedPasswordUri. */ - public crossRealmTrustSharedPasswordUri: string; - - /** KerberosConfig kdcDbKeyUri. */ - public kdcDbKeyUri: string; - - /** KerberosConfig tgtLifetimeHours. */ - public tgtLifetimeHours: number; - - /** KerberosConfig realm. */ - public realm: string; - - /** - * Creates a new KerberosConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns KerberosConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.IKerberosConfig): google.cloud.dataproc.v1.KerberosConfig; - - /** - * Encodes the specified KerberosConfig message. Does not implicitly {@link google.cloud.dataproc.v1.KerberosConfig.verify|verify} messages. - * @param message KerberosConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IKerberosConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified KerberosConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.KerberosConfig.verify|verify} messages. - * @param message KerberosConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IKerberosConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a KerberosConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns KerberosConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.KerberosConfig; - - /** - * Decodes a KerberosConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns KerberosConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.KerberosConfig; - - /** - * Verifies a KerberosConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a KerberosConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns KerberosConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.KerberosConfig; - - /** - * Creates a plain object from a KerberosConfig message. Also converts values to other types if specified. - * @param message KerberosConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.KerberosConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this KerberosConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for KerberosConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an IdentityConfig. */ - interface IIdentityConfig { - - /** IdentityConfig userServiceAccountMapping */ - userServiceAccountMapping?: ({ [k: string]: string }|null); - } - - /** Represents an IdentityConfig. */ - class IdentityConfig implements IIdentityConfig { - - /** - * Constructs a new IdentityConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IIdentityConfig); - - /** IdentityConfig userServiceAccountMapping. */ - public userServiceAccountMapping: { [k: string]: string }; - - /** - * Creates a new IdentityConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns IdentityConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.IIdentityConfig): google.cloud.dataproc.v1.IdentityConfig; - - /** - * Encodes the specified IdentityConfig message. Does not implicitly {@link google.cloud.dataproc.v1.IdentityConfig.verify|verify} messages. - * @param message IdentityConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IIdentityConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IdentityConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.IdentityConfig.verify|verify} messages. - * @param message IdentityConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IIdentityConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IdentityConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IdentityConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.IdentityConfig; - - /** - * Decodes an IdentityConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IdentityConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.IdentityConfig; - - /** - * Verifies an IdentityConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an IdentityConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IdentityConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.IdentityConfig; - - /** - * Creates a plain object from an IdentityConfig message. Also converts values to other types if specified. - * @param message IdentityConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.IdentityConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IdentityConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for IdentityConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SoftwareConfig. */ - interface ISoftwareConfig { - - /** SoftwareConfig imageVersion */ - imageVersion?: (string|null); - - /** SoftwareConfig properties */ - properties?: ({ [k: string]: string }|null); - - /** SoftwareConfig optionalComponents */ - optionalComponents?: (google.cloud.dataproc.v1.Component[]|null); - } - - /** Represents a SoftwareConfig. */ - class SoftwareConfig implements ISoftwareConfig { - - /** - * Constructs a new SoftwareConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.ISoftwareConfig); - - /** SoftwareConfig imageVersion. */ - public imageVersion: string; - - /** SoftwareConfig properties. */ - public properties: { [k: string]: string }; - - /** SoftwareConfig optionalComponents. */ - public optionalComponents: google.cloud.dataproc.v1.Component[]; - - /** - * Creates a new SoftwareConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns SoftwareConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.ISoftwareConfig): google.cloud.dataproc.v1.SoftwareConfig; - - /** - * Encodes the specified SoftwareConfig message. Does not implicitly {@link google.cloud.dataproc.v1.SoftwareConfig.verify|verify} messages. - * @param message SoftwareConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.ISoftwareConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SoftwareConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SoftwareConfig.verify|verify} messages. - * @param message SoftwareConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.ISoftwareConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SoftwareConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SoftwareConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.SoftwareConfig; - - /** - * Decodes a SoftwareConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SoftwareConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.SoftwareConfig; - - /** - * Verifies a SoftwareConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SoftwareConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SoftwareConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.SoftwareConfig; - - /** - * Creates a plain object from a SoftwareConfig message. Also converts values to other types if specified. - * @param message SoftwareConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.SoftwareConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SoftwareConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SoftwareConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a LifecycleConfig. */ - interface ILifecycleConfig { - - /** LifecycleConfig idleDeleteTtl */ - idleDeleteTtl?: (google.protobuf.IDuration|null); - - /** LifecycleConfig autoDeleteTime */ - autoDeleteTime?: (google.protobuf.ITimestamp|null); - - /** LifecycleConfig autoDeleteTtl */ - autoDeleteTtl?: (google.protobuf.IDuration|null); - - /** LifecycleConfig idleStopTtl */ - idleStopTtl?: (google.protobuf.IDuration|null); - - /** LifecycleConfig autoStopTime */ - autoStopTime?: (google.protobuf.ITimestamp|null); - - /** LifecycleConfig autoStopTtl */ - autoStopTtl?: (google.protobuf.IDuration|null); - - /** LifecycleConfig idleStartTime */ - idleStartTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a LifecycleConfig. */ - class LifecycleConfig implements ILifecycleConfig { - - /** - * Constructs a new LifecycleConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.ILifecycleConfig); - - /** LifecycleConfig idleDeleteTtl. */ - public idleDeleteTtl?: (google.protobuf.IDuration|null); - - /** LifecycleConfig autoDeleteTime. */ - public autoDeleteTime?: (google.protobuf.ITimestamp|null); - - /** LifecycleConfig autoDeleteTtl. */ - public autoDeleteTtl?: (google.protobuf.IDuration|null); - - /** LifecycleConfig idleStopTtl. */ - public idleStopTtl?: (google.protobuf.IDuration|null); - - /** LifecycleConfig autoStopTime. */ - public autoStopTime?: (google.protobuf.ITimestamp|null); - - /** LifecycleConfig autoStopTtl. */ - public autoStopTtl?: (google.protobuf.IDuration|null); - - /** LifecycleConfig idleStartTime. */ - public idleStartTime?: (google.protobuf.ITimestamp|null); - - /** LifecycleConfig ttl. */ - public ttl?: ("autoDeleteTime"|"autoDeleteTtl"); - - /** LifecycleConfig stopTtl. */ - public stopTtl?: ("autoStopTime"|"autoStopTtl"); - - /** - * Creates a new LifecycleConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns LifecycleConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.ILifecycleConfig): google.cloud.dataproc.v1.LifecycleConfig; - - /** - * Encodes the specified LifecycleConfig message. Does not implicitly {@link google.cloud.dataproc.v1.LifecycleConfig.verify|verify} messages. - * @param message LifecycleConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.ILifecycleConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LifecycleConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.LifecycleConfig.verify|verify} messages. - * @param message LifecycleConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.ILifecycleConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LifecycleConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LifecycleConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.LifecycleConfig; - - /** - * Decodes a LifecycleConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LifecycleConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.LifecycleConfig; - - /** - * Verifies a LifecycleConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LifecycleConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LifecycleConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.LifecycleConfig; - - /** - * Creates a plain object from a LifecycleConfig message. Also converts values to other types if specified. - * @param message LifecycleConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.LifecycleConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LifecycleConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LifecycleConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MetastoreConfig. */ - interface IMetastoreConfig { - - /** MetastoreConfig dataprocMetastoreService */ - dataprocMetastoreService?: (string|null); - } - - /** Represents a MetastoreConfig. */ - class MetastoreConfig implements IMetastoreConfig { - - /** - * Constructs a new MetastoreConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IMetastoreConfig); - - /** MetastoreConfig dataprocMetastoreService. */ - public dataprocMetastoreService: string; - - /** - * Creates a new MetastoreConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns MetastoreConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.IMetastoreConfig): google.cloud.dataproc.v1.MetastoreConfig; - - /** - * Encodes the specified MetastoreConfig message. Does not implicitly {@link google.cloud.dataproc.v1.MetastoreConfig.verify|verify} messages. - * @param message MetastoreConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IMetastoreConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MetastoreConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.MetastoreConfig.verify|verify} messages. - * @param message MetastoreConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IMetastoreConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MetastoreConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MetastoreConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.MetastoreConfig; - - /** - * Decodes a MetastoreConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MetastoreConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.MetastoreConfig; - - /** - * Verifies a MetastoreConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MetastoreConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MetastoreConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.MetastoreConfig; - - /** - * Creates a plain object from a MetastoreConfig message. Also converts values to other types if specified. - * @param message MetastoreConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.MetastoreConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MetastoreConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MetastoreConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ClusterMetrics. */ - interface IClusterMetrics { - - /** ClusterMetrics hdfsMetrics */ - hdfsMetrics?: ({ [k: string]: (number|Long|string) }|null); - - /** ClusterMetrics yarnMetrics */ - yarnMetrics?: ({ [k: string]: (number|Long|string) }|null); - } - - /** Represents a ClusterMetrics. */ - class ClusterMetrics implements IClusterMetrics { - - /** - * Constructs a new ClusterMetrics. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IClusterMetrics); - - /** ClusterMetrics hdfsMetrics. */ - public hdfsMetrics: { [k: string]: (number|Long|string) }; - - /** ClusterMetrics yarnMetrics. */ - public yarnMetrics: { [k: string]: (number|Long|string) }; - - /** - * Creates a new ClusterMetrics instance using the specified properties. - * @param [properties] Properties to set - * @returns ClusterMetrics instance - */ - public static create(properties?: google.cloud.dataproc.v1.IClusterMetrics): google.cloud.dataproc.v1.ClusterMetrics; - - /** - * Encodes the specified ClusterMetrics message. Does not implicitly {@link google.cloud.dataproc.v1.ClusterMetrics.verify|verify} messages. - * @param message ClusterMetrics message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IClusterMetrics, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClusterMetrics message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ClusterMetrics.verify|verify} messages. - * @param message ClusterMetrics message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IClusterMetrics, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClusterMetrics message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClusterMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ClusterMetrics; - - /** - * Decodes a ClusterMetrics message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClusterMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ClusterMetrics; - - /** - * Verifies a ClusterMetrics message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClusterMetrics message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClusterMetrics - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ClusterMetrics; - - /** - * Creates a plain object from a ClusterMetrics message. Also converts values to other types if specified. - * @param message ClusterMetrics - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.ClusterMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClusterMetrics to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClusterMetrics - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DataprocMetricConfig. */ - interface IDataprocMetricConfig { - - /** DataprocMetricConfig metrics */ - metrics?: (google.cloud.dataproc.v1.DataprocMetricConfig.IMetric[]|null); - } - - /** Represents a DataprocMetricConfig. */ - class DataprocMetricConfig implements IDataprocMetricConfig { - - /** - * Constructs a new DataprocMetricConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IDataprocMetricConfig); - - /** DataprocMetricConfig metrics. */ - public metrics: google.cloud.dataproc.v1.DataprocMetricConfig.IMetric[]; - - /** - * Creates a new DataprocMetricConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns DataprocMetricConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.IDataprocMetricConfig): google.cloud.dataproc.v1.DataprocMetricConfig; - - /** - * Encodes the specified DataprocMetricConfig message. Does not implicitly {@link google.cloud.dataproc.v1.DataprocMetricConfig.verify|verify} messages. - * @param message DataprocMetricConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IDataprocMetricConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DataprocMetricConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DataprocMetricConfig.verify|verify} messages. - * @param message DataprocMetricConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IDataprocMetricConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DataprocMetricConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DataprocMetricConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.DataprocMetricConfig; - - /** - * Decodes a DataprocMetricConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DataprocMetricConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.DataprocMetricConfig; - - /** - * Verifies a DataprocMetricConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DataprocMetricConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DataprocMetricConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.DataprocMetricConfig; - - /** - * Creates a plain object from a DataprocMetricConfig message. Also converts values to other types if specified. - * @param message DataprocMetricConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.DataprocMetricConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DataprocMetricConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DataprocMetricConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DataprocMetricConfig { - - /** MetricSource enum. */ - enum MetricSource { - METRIC_SOURCE_UNSPECIFIED = 0, - MONITORING_AGENT_DEFAULTS = 1, - HDFS = 2, - SPARK = 3, - YARN = 4, - SPARK_HISTORY_SERVER = 5, - HIVESERVER2 = 6, - HIVEMETASTORE = 7, - FLINK = 8 - } - - /** Properties of a Metric. */ - interface IMetric { - - /** Metric metricSource */ - metricSource?: (google.cloud.dataproc.v1.DataprocMetricConfig.MetricSource|keyof typeof google.cloud.dataproc.v1.DataprocMetricConfig.MetricSource|null); - - /** Metric metricOverrides */ - metricOverrides?: (string[]|null); - } - - /** Represents a Metric. */ - class Metric implements IMetric { - - /** - * Constructs a new Metric. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.DataprocMetricConfig.IMetric); - - /** Metric metricSource. */ - public metricSource: (google.cloud.dataproc.v1.DataprocMetricConfig.MetricSource|keyof typeof google.cloud.dataproc.v1.DataprocMetricConfig.MetricSource); - - /** Metric metricOverrides. */ - public metricOverrides: string[]; - - /** - * Creates a new Metric instance using the specified properties. - * @param [properties] Properties to set - * @returns Metric instance - */ - public static create(properties?: google.cloud.dataproc.v1.DataprocMetricConfig.IMetric): google.cloud.dataproc.v1.DataprocMetricConfig.Metric; - - /** - * Encodes the specified Metric message. Does not implicitly {@link google.cloud.dataproc.v1.DataprocMetricConfig.Metric.verify|verify} messages. - * @param message Metric message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.DataprocMetricConfig.IMetric, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Metric message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DataprocMetricConfig.Metric.verify|verify} messages. - * @param message Metric message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.DataprocMetricConfig.IMetric, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Metric message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Metric - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.DataprocMetricConfig.Metric; - - /** - * Decodes a Metric message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Metric - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.DataprocMetricConfig.Metric; - - /** - * Verifies a Metric message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Metric message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Metric - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.DataprocMetricConfig.Metric; - - /** - * Creates a plain object from a Metric message. Also converts values to other types if specified. - * @param message Metric - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.DataprocMetricConfig.Metric, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Metric to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Metric - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a CreateClusterRequest. */ - interface ICreateClusterRequest { - - /** CreateClusterRequest projectId */ - projectId?: (string|null); - - /** CreateClusterRequest region */ - region?: (string|null); - - /** CreateClusterRequest cluster */ - cluster?: (google.cloud.dataproc.v1.ICluster|null); - - /** CreateClusterRequest requestId */ - requestId?: (string|null); - - /** CreateClusterRequest actionOnFailedPrimaryWorkers */ - actionOnFailedPrimaryWorkers?: (google.cloud.dataproc.v1.FailureAction|keyof typeof google.cloud.dataproc.v1.FailureAction|null); - } - - /** Represents a CreateClusterRequest. */ - class CreateClusterRequest implements ICreateClusterRequest { - - /** - * Constructs a new CreateClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.ICreateClusterRequest); - - /** CreateClusterRequest projectId. */ - public projectId: string; - - /** CreateClusterRequest region. */ - public region: string; - - /** CreateClusterRequest cluster. */ - public cluster?: (google.cloud.dataproc.v1.ICluster|null); - - /** CreateClusterRequest requestId. */ - public requestId: string; - - /** CreateClusterRequest actionOnFailedPrimaryWorkers. */ - public actionOnFailedPrimaryWorkers: (google.cloud.dataproc.v1.FailureAction|keyof typeof google.cloud.dataproc.v1.FailureAction); - - /** - * Creates a new CreateClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateClusterRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.ICreateClusterRequest): google.cloud.dataproc.v1.CreateClusterRequest; - - /** - * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.cloud.dataproc.v1.CreateClusterRequest.verify|verify} messages. - * @param message CreateClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.CreateClusterRequest.verify|verify} messages. - * @param message CreateClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.CreateClusterRequest; - - /** - * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.CreateClusterRequest; - - /** - * Verifies a CreateClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.CreateClusterRequest; - - /** - * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. - * @param message CreateClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.CreateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateClusterRequest. */ - interface IUpdateClusterRequest { - - /** UpdateClusterRequest projectId */ - projectId?: (string|null); - - /** UpdateClusterRequest region */ - region?: (string|null); - - /** UpdateClusterRequest clusterName */ - clusterName?: (string|null); - - /** UpdateClusterRequest cluster */ - cluster?: (google.cloud.dataproc.v1.ICluster|null); - - /** UpdateClusterRequest gracefulDecommissionTimeout */ - gracefulDecommissionTimeout?: (google.protobuf.IDuration|null); - - /** UpdateClusterRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateClusterRequest requestId */ - requestId?: (string|null); - } - - /** Represents an UpdateClusterRequest. */ - class UpdateClusterRequest implements IUpdateClusterRequest { - - /** - * Constructs a new UpdateClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IUpdateClusterRequest); - - /** UpdateClusterRequest projectId. */ - public projectId: string; - - /** UpdateClusterRequest region. */ - public region: string; - - /** UpdateClusterRequest clusterName. */ - public clusterName: string; - - /** UpdateClusterRequest cluster. */ - public cluster?: (google.cloud.dataproc.v1.ICluster|null); - - /** UpdateClusterRequest gracefulDecommissionTimeout. */ - public gracefulDecommissionTimeout?: (google.protobuf.IDuration|null); - - /** UpdateClusterRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateClusterRequest requestId. */ - public requestId: string; - - /** - * Creates a new UpdateClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateClusterRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.IUpdateClusterRequest): google.cloud.dataproc.v1.UpdateClusterRequest; - - /** - * Encodes the specified UpdateClusterRequest message. Does not implicitly {@link google.cloud.dataproc.v1.UpdateClusterRequest.verify|verify} messages. - * @param message UpdateClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IUpdateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.UpdateClusterRequest.verify|verify} messages. - * @param message UpdateClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IUpdateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.UpdateClusterRequest; - - /** - * Decodes an UpdateClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.UpdateClusterRequest; - - /** - * Verifies an UpdateClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.UpdateClusterRequest; - - /** - * Creates a plain object from an UpdateClusterRequest message. Also converts values to other types if specified. - * @param message UpdateClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.UpdateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a StopClusterRequest. */ - interface IStopClusterRequest { - - /** StopClusterRequest projectId */ - projectId?: (string|null); - - /** StopClusterRequest region */ - region?: (string|null); - - /** StopClusterRequest clusterName */ - clusterName?: (string|null); - - /** StopClusterRequest clusterUuid */ - clusterUuid?: (string|null); - - /** StopClusterRequest requestId */ - requestId?: (string|null); - } - - /** Represents a StopClusterRequest. */ - class StopClusterRequest implements IStopClusterRequest { - - /** - * Constructs a new StopClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IStopClusterRequest); - - /** StopClusterRequest projectId. */ - public projectId: string; - - /** StopClusterRequest region. */ - public region: string; - - /** StopClusterRequest clusterName. */ - public clusterName: string; - - /** StopClusterRequest clusterUuid. */ - public clusterUuid: string; - - /** StopClusterRequest requestId. */ - public requestId: string; - - /** - * Creates a new StopClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns StopClusterRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.IStopClusterRequest): google.cloud.dataproc.v1.StopClusterRequest; - - /** - * Encodes the specified StopClusterRequest message. Does not implicitly {@link google.cloud.dataproc.v1.StopClusterRequest.verify|verify} messages. - * @param message StopClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IStopClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StopClusterRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.StopClusterRequest.verify|verify} messages. - * @param message StopClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IStopClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StopClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StopClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.StopClusterRequest; - - /** - * Decodes a StopClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StopClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.StopClusterRequest; - - /** - * Verifies a StopClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StopClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StopClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.StopClusterRequest; - - /** - * Creates a plain object from a StopClusterRequest message. Also converts values to other types if specified. - * @param message StopClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.StopClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StopClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StopClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a StartClusterRequest. */ - interface IStartClusterRequest { - - /** StartClusterRequest projectId */ - projectId?: (string|null); - - /** StartClusterRequest region */ - region?: (string|null); - - /** StartClusterRequest clusterName */ - clusterName?: (string|null); - - /** StartClusterRequest clusterUuid */ - clusterUuid?: (string|null); - - /** StartClusterRequest requestId */ - requestId?: (string|null); - } - - /** Represents a StartClusterRequest. */ - class StartClusterRequest implements IStartClusterRequest { - - /** - * Constructs a new StartClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IStartClusterRequest); - - /** StartClusterRequest projectId. */ - public projectId: string; - - /** StartClusterRequest region. */ - public region: string; - - /** StartClusterRequest clusterName. */ - public clusterName: string; - - /** StartClusterRequest clusterUuid. */ - public clusterUuid: string; - - /** StartClusterRequest requestId. */ - public requestId: string; - - /** - * Creates a new StartClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns StartClusterRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.IStartClusterRequest): google.cloud.dataproc.v1.StartClusterRequest; - - /** - * Encodes the specified StartClusterRequest message. Does not implicitly {@link google.cloud.dataproc.v1.StartClusterRequest.verify|verify} messages. - * @param message StartClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IStartClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StartClusterRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.StartClusterRequest.verify|verify} messages. - * @param message StartClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IStartClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StartClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StartClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.StartClusterRequest; - - /** - * Decodes a StartClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StartClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.StartClusterRequest; - - /** - * Verifies a StartClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StartClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StartClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.StartClusterRequest; - - /** - * Creates a plain object from a StartClusterRequest message. Also converts values to other types if specified. - * @param message StartClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.StartClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StartClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StartClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteClusterRequest. */ - interface IDeleteClusterRequest { - - /** DeleteClusterRequest projectId */ - projectId?: (string|null); - - /** DeleteClusterRequest region */ - region?: (string|null); - - /** DeleteClusterRequest clusterName */ - clusterName?: (string|null); - - /** DeleteClusterRequest clusterUuid */ - clusterUuid?: (string|null); - - /** DeleteClusterRequest requestId */ - requestId?: (string|null); - } - - /** Represents a DeleteClusterRequest. */ - class DeleteClusterRequest implements IDeleteClusterRequest { - - /** - * Constructs a new DeleteClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IDeleteClusterRequest); - - /** DeleteClusterRequest projectId. */ - public projectId: string; - - /** DeleteClusterRequest region. */ - public region: string; - - /** DeleteClusterRequest clusterName. */ - public clusterName: string; - - /** DeleteClusterRequest clusterUuid. */ - public clusterUuid: string; - - /** DeleteClusterRequest requestId. */ - public requestId: string; - - /** - * Creates a new DeleteClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteClusterRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.IDeleteClusterRequest): google.cloud.dataproc.v1.DeleteClusterRequest; - - /** - * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.cloud.dataproc.v1.DeleteClusterRequest.verify|verify} messages. - * @param message DeleteClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DeleteClusterRequest.verify|verify} messages. - * @param message DeleteClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.DeleteClusterRequest; - - /** - * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.DeleteClusterRequest; - - /** - * Verifies a DeleteClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.DeleteClusterRequest; - - /** - * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. - * @param message DeleteClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.DeleteClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetClusterRequest. */ - interface IGetClusterRequest { - - /** GetClusterRequest projectId */ - projectId?: (string|null); - - /** GetClusterRequest region */ - region?: (string|null); - - /** GetClusterRequest clusterName */ - clusterName?: (string|null); - } - - /** Represents a GetClusterRequest. */ - class GetClusterRequest implements IGetClusterRequest { - - /** - * Constructs a new GetClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IGetClusterRequest); - - /** GetClusterRequest projectId. */ - public projectId: string; - - /** GetClusterRequest region. */ - public region: string; - - /** GetClusterRequest clusterName. */ - public clusterName: string; - - /** - * Creates a new GetClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetClusterRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.IGetClusterRequest): google.cloud.dataproc.v1.GetClusterRequest; - - /** - * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.cloud.dataproc.v1.GetClusterRequest.verify|verify} messages. - * @param message GetClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetClusterRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GetClusterRequest.verify|verify} messages. - * @param message GetClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.GetClusterRequest; - - /** - * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.GetClusterRequest; - - /** - * Verifies a GetClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.GetClusterRequest; - - /** - * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. - * @param message GetClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.GetClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListClustersRequest. */ - interface IListClustersRequest { - - /** ListClustersRequest projectId */ - projectId?: (string|null); - - /** ListClustersRequest region */ - region?: (string|null); - - /** ListClustersRequest filter */ - filter?: (string|null); - - /** ListClustersRequest pageSize */ - pageSize?: (number|null); - - /** ListClustersRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListClustersRequest. */ - class ListClustersRequest implements IListClustersRequest { - - /** - * Constructs a new ListClustersRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IListClustersRequest); - - /** ListClustersRequest projectId. */ - public projectId: string; - - /** ListClustersRequest region. */ - public region: string; - - /** ListClustersRequest filter. */ - public filter: string; - - /** ListClustersRequest pageSize. */ - public pageSize: number; - - /** ListClustersRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListClustersRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListClustersRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.IListClustersRequest): google.cloud.dataproc.v1.ListClustersRequest; - - /** - * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.cloud.dataproc.v1.ListClustersRequest.verify|verify} messages. - * @param message ListClustersRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListClustersRequest.verify|verify} messages. - * @param message ListClustersRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListClustersRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListClustersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ListClustersRequest; - - /** - * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListClustersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ListClustersRequest; - - /** - * Verifies a ListClustersRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListClustersRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ListClustersRequest; - - /** - * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. - * @param message ListClustersRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.ListClustersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListClustersRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListClustersRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListClustersResponse. */ - interface IListClustersResponse { - - /** ListClustersResponse clusters */ - clusters?: (google.cloud.dataproc.v1.ICluster[]|null); - - /** ListClustersResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListClustersResponse. */ - class ListClustersResponse implements IListClustersResponse { - - /** - * Constructs a new ListClustersResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IListClustersResponse); - - /** ListClustersResponse clusters. */ - public clusters: google.cloud.dataproc.v1.ICluster[]; - - /** ListClustersResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListClustersResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListClustersResponse instance - */ - public static create(properties?: google.cloud.dataproc.v1.IListClustersResponse): google.cloud.dataproc.v1.ListClustersResponse; - - /** - * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.cloud.dataproc.v1.ListClustersResponse.verify|verify} messages. - * @param message ListClustersResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListClustersResponse message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListClustersResponse.verify|verify} messages. - * @param message ListClustersResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListClustersResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListClustersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ListClustersResponse; - - /** - * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListClustersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ListClustersResponse; - - /** - * Verifies a ListClustersResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListClustersResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ListClustersResponse; - - /** - * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. - * @param message ListClustersResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.ListClustersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListClustersResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListClustersResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DiagnoseClusterRequest. */ - interface IDiagnoseClusterRequest { - - /** DiagnoseClusterRequest projectId */ - projectId?: (string|null); - - /** DiagnoseClusterRequest region */ - region?: (string|null); - - /** DiagnoseClusterRequest clusterName */ - clusterName?: (string|null); - - /** DiagnoseClusterRequest tarballGcsDir */ - tarballGcsDir?: (string|null); - - /** DiagnoseClusterRequest tarballAccess */ - tarballAccess?: (google.cloud.dataproc.v1.DiagnoseClusterRequest.TarballAccess|keyof typeof google.cloud.dataproc.v1.DiagnoseClusterRequest.TarballAccess|null); - - /** DiagnoseClusterRequest diagnosisInterval */ - diagnosisInterval?: (google.type.IInterval|null); - - /** DiagnoseClusterRequest jobs */ - jobs?: (string[]|null); - - /** DiagnoseClusterRequest yarnApplicationIds */ - yarnApplicationIds?: (string[]|null); - } - - /** Represents a DiagnoseClusterRequest. */ - class DiagnoseClusterRequest implements IDiagnoseClusterRequest { - - /** - * Constructs a new DiagnoseClusterRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IDiagnoseClusterRequest); - - /** DiagnoseClusterRequest projectId. */ - public projectId: string; - - /** DiagnoseClusterRequest region. */ - public region: string; - - /** DiagnoseClusterRequest clusterName. */ - public clusterName: string; - - /** DiagnoseClusterRequest tarballGcsDir. */ - public tarballGcsDir: string; - - /** DiagnoseClusterRequest tarballAccess. */ - public tarballAccess: (google.cloud.dataproc.v1.DiagnoseClusterRequest.TarballAccess|keyof typeof google.cloud.dataproc.v1.DiagnoseClusterRequest.TarballAccess); - - /** DiagnoseClusterRequest diagnosisInterval. */ - public diagnosisInterval?: (google.type.IInterval|null); - - /** DiagnoseClusterRequest jobs. */ - public jobs: string[]; - - /** DiagnoseClusterRequest yarnApplicationIds. */ - public yarnApplicationIds: string[]; - - /** - * Creates a new DiagnoseClusterRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DiagnoseClusterRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.IDiagnoseClusterRequest): google.cloud.dataproc.v1.DiagnoseClusterRequest; - - /** - * Encodes the specified DiagnoseClusterRequest message. Does not implicitly {@link google.cloud.dataproc.v1.DiagnoseClusterRequest.verify|verify} messages. - * @param message DiagnoseClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IDiagnoseClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DiagnoseClusterRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DiagnoseClusterRequest.verify|verify} messages. - * @param message DiagnoseClusterRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IDiagnoseClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DiagnoseClusterRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DiagnoseClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.DiagnoseClusterRequest; - - /** - * Decodes a DiagnoseClusterRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DiagnoseClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.DiagnoseClusterRequest; - - /** - * Verifies a DiagnoseClusterRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DiagnoseClusterRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DiagnoseClusterRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.DiagnoseClusterRequest; - - /** - * Creates a plain object from a DiagnoseClusterRequest message. Also converts values to other types if specified. - * @param message DiagnoseClusterRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.DiagnoseClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DiagnoseClusterRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DiagnoseClusterRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DiagnoseClusterRequest { - - /** TarballAccess enum. */ - enum TarballAccess { - TARBALL_ACCESS_UNSPECIFIED = 0, - GOOGLE_CLOUD_SUPPORT = 1, - GOOGLE_DATAPROC_DIAGNOSE = 2 - } - } - - /** Properties of a DiagnoseClusterResults. */ - interface IDiagnoseClusterResults { - - /** DiagnoseClusterResults outputUri */ - outputUri?: (string|null); - } - - /** Represents a DiagnoseClusterResults. */ - class DiagnoseClusterResults implements IDiagnoseClusterResults { - - /** - * Constructs a new DiagnoseClusterResults. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IDiagnoseClusterResults); - - /** DiagnoseClusterResults outputUri. */ - public outputUri: string; - - /** - * Creates a new DiagnoseClusterResults instance using the specified properties. - * @param [properties] Properties to set - * @returns DiagnoseClusterResults instance - */ - public static create(properties?: google.cloud.dataproc.v1.IDiagnoseClusterResults): google.cloud.dataproc.v1.DiagnoseClusterResults; - - /** - * Encodes the specified DiagnoseClusterResults message. Does not implicitly {@link google.cloud.dataproc.v1.DiagnoseClusterResults.verify|verify} messages. - * @param message DiagnoseClusterResults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IDiagnoseClusterResults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DiagnoseClusterResults message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DiagnoseClusterResults.verify|verify} messages. - * @param message DiagnoseClusterResults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IDiagnoseClusterResults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DiagnoseClusterResults message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DiagnoseClusterResults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.DiagnoseClusterResults; - - /** - * Decodes a DiagnoseClusterResults message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DiagnoseClusterResults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.DiagnoseClusterResults; - - /** - * Verifies a DiagnoseClusterResults message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DiagnoseClusterResults message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DiagnoseClusterResults - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.DiagnoseClusterResults; - - /** - * Creates a plain object from a DiagnoseClusterResults message. Also converts values to other types if specified. - * @param message DiagnoseClusterResults - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.DiagnoseClusterResults, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DiagnoseClusterResults to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DiagnoseClusterResults - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ReservationAffinity. */ - interface IReservationAffinity { - - /** ReservationAffinity consumeReservationType */ - consumeReservationType?: (google.cloud.dataproc.v1.ReservationAffinity.Type|keyof typeof google.cloud.dataproc.v1.ReservationAffinity.Type|null); - - /** ReservationAffinity key */ - key?: (string|null); - - /** ReservationAffinity values */ - values?: (string[]|null); - } - - /** Represents a ReservationAffinity. */ - class ReservationAffinity implements IReservationAffinity { - - /** - * Constructs a new ReservationAffinity. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IReservationAffinity); - - /** ReservationAffinity consumeReservationType. */ - public consumeReservationType: (google.cloud.dataproc.v1.ReservationAffinity.Type|keyof typeof google.cloud.dataproc.v1.ReservationAffinity.Type); - - /** ReservationAffinity key. */ - public key: string; - - /** ReservationAffinity values. */ - public values: string[]; - - /** - * Creates a new ReservationAffinity instance using the specified properties. - * @param [properties] Properties to set - * @returns ReservationAffinity instance - */ - public static create(properties?: google.cloud.dataproc.v1.IReservationAffinity): google.cloud.dataproc.v1.ReservationAffinity; - - /** - * Encodes the specified ReservationAffinity message. Does not implicitly {@link google.cloud.dataproc.v1.ReservationAffinity.verify|verify} messages. - * @param message ReservationAffinity message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IReservationAffinity, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReservationAffinity message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ReservationAffinity.verify|verify} messages. - * @param message ReservationAffinity message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IReservationAffinity, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReservationAffinity message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReservationAffinity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ReservationAffinity; - - /** - * Decodes a ReservationAffinity message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReservationAffinity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ReservationAffinity; - - /** - * Verifies a ReservationAffinity message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReservationAffinity message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReservationAffinity - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ReservationAffinity; - - /** - * Creates a plain object from a ReservationAffinity message. Also converts values to other types if specified. - * @param message ReservationAffinity - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.ReservationAffinity, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReservationAffinity to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReservationAffinity - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ReservationAffinity { - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - NO_RESERVATION = 1, - ANY_RESERVATION = 2, - SPECIFIC_RESERVATION = 3 - } - } - - /** Properties of a BatchOperationMetadata. */ - interface IBatchOperationMetadata { - - /** BatchOperationMetadata batch */ - batch?: (string|null); - - /** BatchOperationMetadata batchUuid */ - batchUuid?: (string|null); - - /** BatchOperationMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** BatchOperationMetadata doneTime */ - doneTime?: (google.protobuf.ITimestamp|null); - - /** BatchOperationMetadata operationType */ - operationType?: (google.cloud.dataproc.v1.BatchOperationMetadata.BatchOperationType|keyof typeof google.cloud.dataproc.v1.BatchOperationMetadata.BatchOperationType|null); - - /** BatchOperationMetadata description */ - description?: (string|null); - - /** BatchOperationMetadata labels */ - labels?: ({ [k: string]: string }|null); - - /** BatchOperationMetadata warnings */ - warnings?: (string[]|null); - } - - /** Represents a BatchOperationMetadata. */ - class BatchOperationMetadata implements IBatchOperationMetadata { - - /** - * Constructs a new BatchOperationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IBatchOperationMetadata); - - /** BatchOperationMetadata batch. */ - public batch: string; - - /** BatchOperationMetadata batchUuid. */ - public batchUuid: string; - - /** BatchOperationMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** BatchOperationMetadata doneTime. */ - public doneTime?: (google.protobuf.ITimestamp|null); - - /** BatchOperationMetadata operationType. */ - public operationType: (google.cloud.dataproc.v1.BatchOperationMetadata.BatchOperationType|keyof typeof google.cloud.dataproc.v1.BatchOperationMetadata.BatchOperationType); - - /** BatchOperationMetadata description. */ - public description: string; - - /** BatchOperationMetadata labels. */ - public labels: { [k: string]: string }; - - /** BatchOperationMetadata warnings. */ - public warnings: string[]; - - /** - * Creates a new BatchOperationMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchOperationMetadata instance - */ - public static create(properties?: google.cloud.dataproc.v1.IBatchOperationMetadata): google.cloud.dataproc.v1.BatchOperationMetadata; - - /** - * Encodes the specified BatchOperationMetadata message. Does not implicitly {@link google.cloud.dataproc.v1.BatchOperationMetadata.verify|verify} messages. - * @param message BatchOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IBatchOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BatchOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.BatchOperationMetadata.verify|verify} messages. - * @param message BatchOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IBatchOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchOperationMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.BatchOperationMetadata; - - /** - * Decodes a BatchOperationMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.BatchOperationMetadata; - - /** - * Verifies a BatchOperationMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BatchOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchOperationMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.BatchOperationMetadata; - - /** - * Creates a plain object from a BatchOperationMetadata message. Also converts values to other types if specified. - * @param message BatchOperationMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.BatchOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BatchOperationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BatchOperationMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace BatchOperationMetadata { - - /** BatchOperationType enum. */ - enum BatchOperationType { - BATCH_OPERATION_TYPE_UNSPECIFIED = 0, - BATCH = 1 - } - } - - /** Properties of a SessionOperationMetadata. */ - interface ISessionOperationMetadata { - - /** SessionOperationMetadata session */ - session?: (string|null); - - /** SessionOperationMetadata sessionUuid */ - sessionUuid?: (string|null); - - /** SessionOperationMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** SessionOperationMetadata doneTime */ - doneTime?: (google.protobuf.ITimestamp|null); - - /** SessionOperationMetadata operationType */ - operationType?: (google.cloud.dataproc.v1.SessionOperationMetadata.SessionOperationType|keyof typeof google.cloud.dataproc.v1.SessionOperationMetadata.SessionOperationType|null); - - /** SessionOperationMetadata description */ - description?: (string|null); - - /** SessionOperationMetadata labels */ - labels?: ({ [k: string]: string }|null); - - /** SessionOperationMetadata warnings */ - warnings?: (string[]|null); - } - - /** Represents a SessionOperationMetadata. */ - class SessionOperationMetadata implements ISessionOperationMetadata { - - /** - * Constructs a new SessionOperationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.ISessionOperationMetadata); - - /** SessionOperationMetadata session. */ - public session: string; - - /** SessionOperationMetadata sessionUuid. */ - public sessionUuid: string; - - /** SessionOperationMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** SessionOperationMetadata doneTime. */ - public doneTime?: (google.protobuf.ITimestamp|null); - - /** SessionOperationMetadata operationType. */ - public operationType: (google.cloud.dataproc.v1.SessionOperationMetadata.SessionOperationType|keyof typeof google.cloud.dataproc.v1.SessionOperationMetadata.SessionOperationType); - - /** SessionOperationMetadata description. */ - public description: string; - - /** SessionOperationMetadata labels. */ - public labels: { [k: string]: string }; - - /** SessionOperationMetadata warnings. */ - public warnings: string[]; - - /** - * Creates a new SessionOperationMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns SessionOperationMetadata instance - */ - public static create(properties?: google.cloud.dataproc.v1.ISessionOperationMetadata): google.cloud.dataproc.v1.SessionOperationMetadata; - - /** - * Encodes the specified SessionOperationMetadata message. Does not implicitly {@link google.cloud.dataproc.v1.SessionOperationMetadata.verify|verify} messages. - * @param message SessionOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.ISessionOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SessionOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SessionOperationMetadata.verify|verify} messages. - * @param message SessionOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.ISessionOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SessionOperationMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SessionOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.SessionOperationMetadata; - - /** - * Decodes a SessionOperationMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SessionOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.SessionOperationMetadata; - - /** - * Verifies a SessionOperationMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SessionOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SessionOperationMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.SessionOperationMetadata; - - /** - * Creates a plain object from a SessionOperationMetadata message. Also converts values to other types if specified. - * @param message SessionOperationMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.SessionOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SessionOperationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SessionOperationMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SessionOperationMetadata { - - /** SessionOperationType enum. */ - enum SessionOperationType { - SESSION_OPERATION_TYPE_UNSPECIFIED = 0, - CREATE = 1, - TERMINATE = 2, - DELETE = 3 - } - } - - /** Properties of a ClusterOperationStatus. */ - interface IClusterOperationStatus { - - /** ClusterOperationStatus state */ - state?: (google.cloud.dataproc.v1.ClusterOperationStatus.State|keyof typeof google.cloud.dataproc.v1.ClusterOperationStatus.State|null); - - /** ClusterOperationStatus innerState */ - innerState?: (string|null); - - /** ClusterOperationStatus details */ - details?: (string|null); - - /** ClusterOperationStatus stateStartTime */ - stateStartTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a ClusterOperationStatus. */ - class ClusterOperationStatus implements IClusterOperationStatus { - - /** - * Constructs a new ClusterOperationStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IClusterOperationStatus); - - /** ClusterOperationStatus state. */ - public state: (google.cloud.dataproc.v1.ClusterOperationStatus.State|keyof typeof google.cloud.dataproc.v1.ClusterOperationStatus.State); - - /** ClusterOperationStatus innerState. */ - public innerState: string; - - /** ClusterOperationStatus details. */ - public details: string; - - /** ClusterOperationStatus stateStartTime. */ - public stateStartTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new ClusterOperationStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns ClusterOperationStatus instance - */ - public static create(properties?: google.cloud.dataproc.v1.IClusterOperationStatus): google.cloud.dataproc.v1.ClusterOperationStatus; - - /** - * Encodes the specified ClusterOperationStatus message. Does not implicitly {@link google.cloud.dataproc.v1.ClusterOperationStatus.verify|verify} messages. - * @param message ClusterOperationStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IClusterOperationStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClusterOperationStatus message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ClusterOperationStatus.verify|verify} messages. - * @param message ClusterOperationStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IClusterOperationStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClusterOperationStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClusterOperationStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ClusterOperationStatus; - - /** - * Decodes a ClusterOperationStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClusterOperationStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ClusterOperationStatus; - - /** - * Verifies a ClusterOperationStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClusterOperationStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClusterOperationStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ClusterOperationStatus; - - /** - * Creates a plain object from a ClusterOperationStatus message. Also converts values to other types if specified. - * @param message ClusterOperationStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.ClusterOperationStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClusterOperationStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClusterOperationStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ClusterOperationStatus { - - /** State enum. */ - enum State { - UNKNOWN = 0, - PENDING = 1, - RUNNING = 2, - DONE = 3 - } - } - - /** Properties of a ClusterOperationMetadata. */ - interface IClusterOperationMetadata { - - /** ClusterOperationMetadata clusterName */ - clusterName?: (string|null); - - /** ClusterOperationMetadata clusterUuid */ - clusterUuid?: (string|null); - - /** ClusterOperationMetadata status */ - status?: (google.cloud.dataproc.v1.IClusterOperationStatus|null); - - /** ClusterOperationMetadata statusHistory */ - statusHistory?: (google.cloud.dataproc.v1.IClusterOperationStatus[]|null); - - /** ClusterOperationMetadata operationType */ - operationType?: (string|null); - - /** ClusterOperationMetadata description */ - description?: (string|null); - - /** ClusterOperationMetadata labels */ - labels?: ({ [k: string]: string }|null); - - /** ClusterOperationMetadata warnings */ - warnings?: (string[]|null); - - /** ClusterOperationMetadata childOperationIds */ - childOperationIds?: (string[]|null); - } - - /** Represents a ClusterOperationMetadata. */ - class ClusterOperationMetadata implements IClusterOperationMetadata { - - /** - * Constructs a new ClusterOperationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IClusterOperationMetadata); - - /** ClusterOperationMetadata clusterName. */ - public clusterName: string; - - /** ClusterOperationMetadata clusterUuid. */ - public clusterUuid: string; - - /** ClusterOperationMetadata status. */ - public status?: (google.cloud.dataproc.v1.IClusterOperationStatus|null); - - /** ClusterOperationMetadata statusHistory. */ - public statusHistory: google.cloud.dataproc.v1.IClusterOperationStatus[]; - - /** ClusterOperationMetadata operationType. */ - public operationType: string; - - /** ClusterOperationMetadata description. */ - public description: string; - - /** ClusterOperationMetadata labels. */ - public labels: { [k: string]: string }; - - /** ClusterOperationMetadata warnings. */ - public warnings: string[]; - - /** ClusterOperationMetadata childOperationIds. */ - public childOperationIds: string[]; - - /** - * Creates a new ClusterOperationMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns ClusterOperationMetadata instance - */ - public static create(properties?: google.cloud.dataproc.v1.IClusterOperationMetadata): google.cloud.dataproc.v1.ClusterOperationMetadata; - - /** - * Encodes the specified ClusterOperationMetadata message. Does not implicitly {@link google.cloud.dataproc.v1.ClusterOperationMetadata.verify|verify} messages. - * @param message ClusterOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IClusterOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClusterOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ClusterOperationMetadata.verify|verify} messages. - * @param message ClusterOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IClusterOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClusterOperationMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClusterOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ClusterOperationMetadata; - - /** - * Decodes a ClusterOperationMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClusterOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ClusterOperationMetadata; - - /** - * Verifies a ClusterOperationMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClusterOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClusterOperationMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ClusterOperationMetadata; - - /** - * Creates a plain object from a ClusterOperationMetadata message. Also converts values to other types if specified. - * @param message ClusterOperationMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.ClusterOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClusterOperationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClusterOperationMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NodeGroupOperationMetadata. */ - interface INodeGroupOperationMetadata { - - /** NodeGroupOperationMetadata nodeGroupId */ - nodeGroupId?: (string|null); - - /** NodeGroupOperationMetadata clusterUuid */ - clusterUuid?: (string|null); - - /** NodeGroupOperationMetadata status */ - status?: (google.cloud.dataproc.v1.IClusterOperationStatus|null); - - /** NodeGroupOperationMetadata statusHistory */ - statusHistory?: (google.cloud.dataproc.v1.IClusterOperationStatus[]|null); - - /** NodeGroupOperationMetadata operationType */ - operationType?: (google.cloud.dataproc.v1.NodeGroupOperationMetadata.NodeGroupOperationType|keyof typeof google.cloud.dataproc.v1.NodeGroupOperationMetadata.NodeGroupOperationType|null); - - /** NodeGroupOperationMetadata description */ - description?: (string|null); - - /** NodeGroupOperationMetadata labels */ - labels?: ({ [k: string]: string }|null); - - /** NodeGroupOperationMetadata warnings */ - warnings?: (string[]|null); - } - - /** Represents a NodeGroupOperationMetadata. */ - class NodeGroupOperationMetadata implements INodeGroupOperationMetadata { - - /** - * Constructs a new NodeGroupOperationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.INodeGroupOperationMetadata); - - /** NodeGroupOperationMetadata nodeGroupId. */ - public nodeGroupId: string; - - /** NodeGroupOperationMetadata clusterUuid. */ - public clusterUuid: string; - - /** NodeGroupOperationMetadata status. */ - public status?: (google.cloud.dataproc.v1.IClusterOperationStatus|null); - - /** NodeGroupOperationMetadata statusHistory. */ - public statusHistory: google.cloud.dataproc.v1.IClusterOperationStatus[]; - - /** NodeGroupOperationMetadata operationType. */ - public operationType: (google.cloud.dataproc.v1.NodeGroupOperationMetadata.NodeGroupOperationType|keyof typeof google.cloud.dataproc.v1.NodeGroupOperationMetadata.NodeGroupOperationType); - - /** NodeGroupOperationMetadata description. */ - public description: string; - - /** NodeGroupOperationMetadata labels. */ - public labels: { [k: string]: string }; - - /** NodeGroupOperationMetadata warnings. */ - public warnings: string[]; - - /** - * Creates a new NodeGroupOperationMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns NodeGroupOperationMetadata instance - */ - public static create(properties?: google.cloud.dataproc.v1.INodeGroupOperationMetadata): google.cloud.dataproc.v1.NodeGroupOperationMetadata; - - /** - * Encodes the specified NodeGroupOperationMetadata message. Does not implicitly {@link google.cloud.dataproc.v1.NodeGroupOperationMetadata.verify|verify} messages. - * @param message NodeGroupOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.INodeGroupOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NodeGroupOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.NodeGroupOperationMetadata.verify|verify} messages. - * @param message NodeGroupOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.INodeGroupOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NodeGroupOperationMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NodeGroupOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.NodeGroupOperationMetadata; - - /** - * Decodes a NodeGroupOperationMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NodeGroupOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.NodeGroupOperationMetadata; - - /** - * Verifies a NodeGroupOperationMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NodeGroupOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NodeGroupOperationMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.NodeGroupOperationMetadata; - - /** - * Creates a plain object from a NodeGroupOperationMetadata message. Also converts values to other types if specified. - * @param message NodeGroupOperationMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.NodeGroupOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NodeGroupOperationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NodeGroupOperationMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace NodeGroupOperationMetadata { - - /** NodeGroupOperationType enum. */ - enum NodeGroupOperationType { - NODE_GROUP_OPERATION_TYPE_UNSPECIFIED = 0, - CREATE = 1, - UPDATE = 2, - DELETE = 3, - RESIZE = 4 - } - } - - /** Represents a JobController */ - class JobController extends $protobuf.rpc.Service { - - /** - * Constructs a new JobController 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 JobController 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): JobController; - - /** - * Calls SubmitJob. - * @param request SubmitJobRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Job - */ - public submitJob(request: google.cloud.dataproc.v1.ISubmitJobRequest, callback: google.cloud.dataproc.v1.JobController.SubmitJobCallback): void; - - /** - * Calls SubmitJob. - * @param request SubmitJobRequest message or plain object - * @returns Promise - */ - public submitJob(request: google.cloud.dataproc.v1.ISubmitJobRequest): Promise; - - /** - * Calls SubmitJobAsOperation. - * @param request SubmitJobRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public submitJobAsOperation(request: google.cloud.dataproc.v1.ISubmitJobRequest, callback: google.cloud.dataproc.v1.JobController.SubmitJobAsOperationCallback): void; - - /** - * Calls SubmitJobAsOperation. - * @param request SubmitJobRequest message or plain object - * @returns Promise - */ - public submitJobAsOperation(request: google.cloud.dataproc.v1.ISubmitJobRequest): 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.dataproc.v1.IGetJobRequest, callback: google.cloud.dataproc.v1.JobController.GetJobCallback): void; - - /** - * Calls GetJob. - * @param request GetJobRequest message or plain object - * @returns Promise - */ - public getJob(request: google.cloud.dataproc.v1.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.dataproc.v1.IListJobsRequest, callback: google.cloud.dataproc.v1.JobController.ListJobsCallback): void; - - /** - * Calls ListJobs. - * @param request ListJobsRequest message or plain object - * @returns Promise - */ - public listJobs(request: google.cloud.dataproc.v1.IListJobsRequest): Promise; - - /** - * Calls UpdateJob. - * @param request UpdateJobRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Job - */ - public updateJob(request: google.cloud.dataproc.v1.IUpdateJobRequest, callback: google.cloud.dataproc.v1.JobController.UpdateJobCallback): void; - - /** - * Calls UpdateJob. - * @param request UpdateJobRequest message or plain object - * @returns Promise - */ - public updateJob(request: google.cloud.dataproc.v1.IUpdateJobRequest): Promise; - - /** - * Calls CancelJob. - * @param request CancelJobRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Job - */ - public cancelJob(request: google.cloud.dataproc.v1.ICancelJobRequest, callback: google.cloud.dataproc.v1.JobController.CancelJobCallback): void; - - /** - * Calls CancelJob. - * @param request CancelJobRequest message or plain object - * @returns Promise - */ - public cancelJob(request: google.cloud.dataproc.v1.ICancelJobRequest): Promise; - - /** - * Calls DeleteJob. - * @param request DeleteJobRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteJob(request: google.cloud.dataproc.v1.IDeleteJobRequest, callback: google.cloud.dataproc.v1.JobController.DeleteJobCallback): void; - - /** - * Calls DeleteJob. - * @param request DeleteJobRequest message or plain object - * @returns Promise - */ - public deleteJob(request: google.cloud.dataproc.v1.IDeleteJobRequest): Promise; - } - - namespace JobController { - - /** - * Callback as used by {@link google.cloud.dataproc.v1.JobController|submitJob}. - * @param error Error, if any - * @param [response] Job - */ - type SubmitJobCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.Job) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.JobController|submitJobAsOperation}. - * @param error Error, if any - * @param [response] Operation - */ - type SubmitJobAsOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.JobController|getJob}. - * @param error Error, if any - * @param [response] Job - */ - type GetJobCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.Job) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.JobController|listJobs}. - * @param error Error, if any - * @param [response] ListJobsResponse - */ - type ListJobsCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.ListJobsResponse) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.JobController|updateJob}. - * @param error Error, if any - * @param [response] Job - */ - type UpdateJobCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.Job) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.JobController|cancelJob}. - * @param error Error, if any - * @param [response] Job - */ - type CancelJobCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.Job) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.JobController|deleteJob}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteJobCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - } - - /** Properties of a LoggingConfig. */ - interface ILoggingConfig { - - /** LoggingConfig driverLogLevels */ - driverLogLevels?: ({ [k: string]: google.cloud.dataproc.v1.LoggingConfig.Level }|null); - } - - /** Represents a LoggingConfig. */ - class LoggingConfig implements ILoggingConfig { - - /** - * Constructs a new LoggingConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.ILoggingConfig); - - /** LoggingConfig driverLogLevels. */ - public driverLogLevels: { [k: string]: google.cloud.dataproc.v1.LoggingConfig.Level }; - - /** - * Creates a new LoggingConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns LoggingConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.ILoggingConfig): google.cloud.dataproc.v1.LoggingConfig; - - /** - * Encodes the specified LoggingConfig message. Does not implicitly {@link google.cloud.dataproc.v1.LoggingConfig.verify|verify} messages. - * @param message LoggingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.ILoggingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LoggingConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.LoggingConfig.verify|verify} messages. - * @param message LoggingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.ILoggingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LoggingConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LoggingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.LoggingConfig; - - /** - * Decodes a LoggingConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LoggingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.LoggingConfig; - - /** - * Verifies a LoggingConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LoggingConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LoggingConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.LoggingConfig; - - /** - * Creates a plain object from a LoggingConfig message. Also converts values to other types if specified. - * @param message LoggingConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.LoggingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LoggingConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LoggingConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace LoggingConfig { - - /** Level enum. */ - enum Level { - LEVEL_UNSPECIFIED = 0, - ALL = 1, - TRACE = 2, - DEBUG = 3, - INFO = 4, - WARN = 5, - ERROR = 6, - FATAL = 7, - OFF = 8 - } - } - - /** Properties of a HadoopJob. */ - interface IHadoopJob { - - /** HadoopJob mainJarFileUri */ - mainJarFileUri?: (string|null); - - /** HadoopJob mainClass */ - mainClass?: (string|null); - - /** HadoopJob args */ - args?: (string[]|null); - - /** HadoopJob jarFileUris */ - jarFileUris?: (string[]|null); - - /** HadoopJob fileUris */ - fileUris?: (string[]|null); - - /** HadoopJob archiveUris */ - archiveUris?: (string[]|null); - - /** HadoopJob properties */ - properties?: ({ [k: string]: string }|null); - - /** HadoopJob loggingConfig */ - loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); - } - - /** Represents a HadoopJob. */ - class HadoopJob implements IHadoopJob { - - /** - * Constructs a new HadoopJob. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IHadoopJob); - - /** HadoopJob mainJarFileUri. */ - public mainJarFileUri?: (string|null); - - /** HadoopJob mainClass. */ - public mainClass?: (string|null); - - /** HadoopJob args. */ - public args: string[]; - - /** HadoopJob jarFileUris. */ - public jarFileUris: string[]; - - /** HadoopJob fileUris. */ - public fileUris: string[]; - - /** HadoopJob archiveUris. */ - public archiveUris: string[]; - - /** HadoopJob properties. */ - public properties: { [k: string]: string }; - - /** HadoopJob loggingConfig. */ - public loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); - - /** HadoopJob driver. */ - public driver?: ("mainJarFileUri"|"mainClass"); - - /** - * Creates a new HadoopJob instance using the specified properties. - * @param [properties] Properties to set - * @returns HadoopJob instance - */ - public static create(properties?: google.cloud.dataproc.v1.IHadoopJob): google.cloud.dataproc.v1.HadoopJob; - - /** - * Encodes the specified HadoopJob message. Does not implicitly {@link google.cloud.dataproc.v1.HadoopJob.verify|verify} messages. - * @param message HadoopJob message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IHadoopJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HadoopJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.HadoopJob.verify|verify} messages. - * @param message HadoopJob message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IHadoopJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HadoopJob message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HadoopJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.HadoopJob; - - /** - * Decodes a HadoopJob message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HadoopJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.HadoopJob; - - /** - * Verifies a HadoopJob message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a HadoopJob message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HadoopJob - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.HadoopJob; - - /** - * Creates a plain object from a HadoopJob message. Also converts values to other types if specified. - * @param message HadoopJob - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.HadoopJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HadoopJob to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for HadoopJob - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SparkJob. */ - interface ISparkJob { - - /** SparkJob mainJarFileUri */ - mainJarFileUri?: (string|null); - - /** SparkJob mainClass */ - mainClass?: (string|null); - - /** SparkJob args */ - args?: (string[]|null); - - /** SparkJob jarFileUris */ - jarFileUris?: (string[]|null); - - /** SparkJob fileUris */ - fileUris?: (string[]|null); - - /** SparkJob archiveUris */ - archiveUris?: (string[]|null); - - /** SparkJob properties */ - properties?: ({ [k: string]: string }|null); - - /** SparkJob loggingConfig */ - loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); - } - - /** Represents a SparkJob. */ - class SparkJob implements ISparkJob { - - /** - * Constructs a new SparkJob. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.ISparkJob); - - /** SparkJob mainJarFileUri. */ - public mainJarFileUri?: (string|null); - - /** SparkJob mainClass. */ - public mainClass?: (string|null); - - /** SparkJob args. */ - public args: string[]; - - /** SparkJob jarFileUris. */ - public jarFileUris: string[]; - - /** SparkJob fileUris. */ - public fileUris: string[]; - - /** SparkJob archiveUris. */ - public archiveUris: string[]; - - /** SparkJob properties. */ - public properties: { [k: string]: string }; - - /** SparkJob loggingConfig. */ - public loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); - - /** SparkJob driver. */ - public driver?: ("mainJarFileUri"|"mainClass"); - - /** - * Creates a new SparkJob instance using the specified properties. - * @param [properties] Properties to set - * @returns SparkJob instance - */ - public static create(properties?: google.cloud.dataproc.v1.ISparkJob): google.cloud.dataproc.v1.SparkJob; - - /** - * Encodes the specified SparkJob message. Does not implicitly {@link google.cloud.dataproc.v1.SparkJob.verify|verify} messages. - * @param message SparkJob message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.ISparkJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SparkJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SparkJob.verify|verify} messages. - * @param message SparkJob message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.ISparkJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SparkJob message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SparkJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.SparkJob; - - /** - * Decodes a SparkJob message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SparkJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.SparkJob; - - /** - * Verifies a SparkJob message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SparkJob message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SparkJob - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.SparkJob; - - /** - * Creates a plain object from a SparkJob message. Also converts values to other types if specified. - * @param message SparkJob - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.SparkJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SparkJob to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SparkJob - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PySparkJob. */ - interface IPySparkJob { - - /** PySparkJob mainPythonFileUri */ - mainPythonFileUri?: (string|null); - - /** PySparkJob args */ - args?: (string[]|null); - - /** PySparkJob pythonFileUris */ - pythonFileUris?: (string[]|null); - - /** PySparkJob jarFileUris */ - jarFileUris?: (string[]|null); - - /** PySparkJob fileUris */ - fileUris?: (string[]|null); - - /** PySparkJob archiveUris */ - archiveUris?: (string[]|null); - - /** PySparkJob properties */ - properties?: ({ [k: string]: string }|null); - - /** PySparkJob loggingConfig */ - loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); - } - - /** Represents a PySparkJob. */ - class PySparkJob implements IPySparkJob { - - /** - * Constructs a new PySparkJob. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IPySparkJob); - - /** PySparkJob mainPythonFileUri. */ - public mainPythonFileUri: string; - - /** PySparkJob args. */ - public args: string[]; - - /** PySparkJob pythonFileUris. */ - public pythonFileUris: string[]; - - /** PySparkJob jarFileUris. */ - public jarFileUris: string[]; - - /** PySparkJob fileUris. */ - public fileUris: string[]; - - /** PySparkJob archiveUris. */ - public archiveUris: string[]; - - /** PySparkJob properties. */ - public properties: { [k: string]: string }; - - /** PySparkJob loggingConfig. */ - public loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); - - /** - * Creates a new PySparkJob instance using the specified properties. - * @param [properties] Properties to set - * @returns PySparkJob instance - */ - public static create(properties?: google.cloud.dataproc.v1.IPySparkJob): google.cloud.dataproc.v1.PySparkJob; - - /** - * Encodes the specified PySparkJob message. Does not implicitly {@link google.cloud.dataproc.v1.PySparkJob.verify|verify} messages. - * @param message PySparkJob message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IPySparkJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PySparkJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.PySparkJob.verify|verify} messages. - * @param message PySparkJob message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IPySparkJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PySparkJob message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PySparkJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.PySparkJob; - - /** - * Decodes a PySparkJob message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PySparkJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.PySparkJob; - - /** - * Verifies a PySparkJob message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PySparkJob message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PySparkJob - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.PySparkJob; - - /** - * Creates a plain object from a PySparkJob message. Also converts values to other types if specified. - * @param message PySparkJob - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.PySparkJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PySparkJob to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PySparkJob - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a QueryList. */ - interface IQueryList { - - /** QueryList queries */ - queries?: (string[]|null); - } - - /** Represents a QueryList. */ - class QueryList implements IQueryList { - - /** - * Constructs a new QueryList. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IQueryList); - - /** QueryList queries. */ - public queries: string[]; - - /** - * Creates a new QueryList instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryList instance - */ - public static create(properties?: google.cloud.dataproc.v1.IQueryList): google.cloud.dataproc.v1.QueryList; - - /** - * Encodes the specified QueryList message. Does not implicitly {@link google.cloud.dataproc.v1.QueryList.verify|verify} messages. - * @param message QueryList message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IQueryList, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QueryList message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.QueryList.verify|verify} messages. - * @param message QueryList message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IQueryList, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QueryList message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.QueryList; - - /** - * Decodes a QueryList message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.QueryList; - - /** - * Verifies a QueryList message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QueryList message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryList - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.QueryList; - - /** - * Creates a plain object from a QueryList message. Also converts values to other types if specified. - * @param message QueryList - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.QueryList, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryList to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for QueryList - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a HiveJob. */ - interface IHiveJob { - - /** HiveJob queryFileUri */ - queryFileUri?: (string|null); - - /** HiveJob queryList */ - queryList?: (google.cloud.dataproc.v1.IQueryList|null); - - /** HiveJob continueOnFailure */ - continueOnFailure?: (boolean|null); - - /** HiveJob scriptVariables */ - scriptVariables?: ({ [k: string]: string }|null); - - /** HiveJob properties */ - properties?: ({ [k: string]: string }|null); - - /** HiveJob jarFileUris */ - jarFileUris?: (string[]|null); - } - - /** Represents a HiveJob. */ - class HiveJob implements IHiveJob { - - /** - * Constructs a new HiveJob. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IHiveJob); - - /** HiveJob queryFileUri. */ - public queryFileUri?: (string|null); - - /** HiveJob queryList. */ - public queryList?: (google.cloud.dataproc.v1.IQueryList|null); - - /** HiveJob continueOnFailure. */ - public continueOnFailure: boolean; - - /** HiveJob scriptVariables. */ - public scriptVariables: { [k: string]: string }; - - /** HiveJob properties. */ - public properties: { [k: string]: string }; - - /** HiveJob jarFileUris. */ - public jarFileUris: string[]; - - /** HiveJob queries. */ - public queries?: ("queryFileUri"|"queryList"); - - /** - * Creates a new HiveJob instance using the specified properties. - * @param [properties] Properties to set - * @returns HiveJob instance - */ - public static create(properties?: google.cloud.dataproc.v1.IHiveJob): google.cloud.dataproc.v1.HiveJob; - - /** - * Encodes the specified HiveJob message. Does not implicitly {@link google.cloud.dataproc.v1.HiveJob.verify|verify} messages. - * @param message HiveJob message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IHiveJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HiveJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.HiveJob.verify|verify} messages. - * @param message HiveJob message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IHiveJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HiveJob message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HiveJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.HiveJob; - - /** - * Decodes a HiveJob message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HiveJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.HiveJob; - - /** - * Verifies a HiveJob message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a HiveJob message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HiveJob - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.HiveJob; - - /** - * Creates a plain object from a HiveJob message. Also converts values to other types if specified. - * @param message HiveJob - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.HiveJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HiveJob to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for HiveJob - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SparkSqlJob. */ - interface ISparkSqlJob { - - /** SparkSqlJob queryFileUri */ - queryFileUri?: (string|null); - - /** SparkSqlJob queryList */ - queryList?: (google.cloud.dataproc.v1.IQueryList|null); - - /** SparkSqlJob scriptVariables */ - scriptVariables?: ({ [k: string]: string }|null); - - /** SparkSqlJob properties */ - properties?: ({ [k: string]: string }|null); - - /** SparkSqlJob jarFileUris */ - jarFileUris?: (string[]|null); - - /** SparkSqlJob loggingConfig */ - loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); - } - - /** Represents a SparkSqlJob. */ - class SparkSqlJob implements ISparkSqlJob { - - /** - * Constructs a new SparkSqlJob. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.ISparkSqlJob); - - /** SparkSqlJob queryFileUri. */ - public queryFileUri?: (string|null); - - /** SparkSqlJob queryList. */ - public queryList?: (google.cloud.dataproc.v1.IQueryList|null); - - /** SparkSqlJob scriptVariables. */ - public scriptVariables: { [k: string]: string }; - - /** SparkSqlJob properties. */ - public properties: { [k: string]: string }; - - /** SparkSqlJob jarFileUris. */ - public jarFileUris: string[]; - - /** SparkSqlJob loggingConfig. */ - public loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); - - /** SparkSqlJob queries. */ - public queries?: ("queryFileUri"|"queryList"); - - /** - * Creates a new SparkSqlJob instance using the specified properties. - * @param [properties] Properties to set - * @returns SparkSqlJob instance - */ - public static create(properties?: google.cloud.dataproc.v1.ISparkSqlJob): google.cloud.dataproc.v1.SparkSqlJob; - - /** - * Encodes the specified SparkSqlJob message. Does not implicitly {@link google.cloud.dataproc.v1.SparkSqlJob.verify|verify} messages. - * @param message SparkSqlJob message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.ISparkSqlJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SparkSqlJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SparkSqlJob.verify|verify} messages. - * @param message SparkSqlJob message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.ISparkSqlJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SparkSqlJob message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SparkSqlJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.SparkSqlJob; - - /** - * Decodes a SparkSqlJob message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SparkSqlJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.SparkSqlJob; - - /** - * Verifies a SparkSqlJob message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SparkSqlJob message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SparkSqlJob - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.SparkSqlJob; - - /** - * Creates a plain object from a SparkSqlJob message. Also converts values to other types if specified. - * @param message SparkSqlJob - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.SparkSqlJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SparkSqlJob to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SparkSqlJob - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PigJob. */ - interface IPigJob { - - /** PigJob queryFileUri */ - queryFileUri?: (string|null); - - /** PigJob queryList */ - queryList?: (google.cloud.dataproc.v1.IQueryList|null); - - /** PigJob continueOnFailure */ - continueOnFailure?: (boolean|null); - - /** PigJob scriptVariables */ - scriptVariables?: ({ [k: string]: string }|null); - - /** PigJob properties */ - properties?: ({ [k: string]: string }|null); - - /** PigJob jarFileUris */ - jarFileUris?: (string[]|null); - - /** PigJob loggingConfig */ - loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); - } - - /** Represents a PigJob. */ - class PigJob implements IPigJob { - - /** - * Constructs a new PigJob. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IPigJob); - - /** PigJob queryFileUri. */ - public queryFileUri?: (string|null); - - /** PigJob queryList. */ - public queryList?: (google.cloud.dataproc.v1.IQueryList|null); - - /** PigJob continueOnFailure. */ - public continueOnFailure: boolean; - - /** PigJob scriptVariables. */ - public scriptVariables: { [k: string]: string }; - - /** PigJob properties. */ - public properties: { [k: string]: string }; - - /** PigJob jarFileUris. */ - public jarFileUris: string[]; - - /** PigJob loggingConfig. */ - public loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); - - /** PigJob queries. */ - public queries?: ("queryFileUri"|"queryList"); - - /** - * Creates a new PigJob instance using the specified properties. - * @param [properties] Properties to set - * @returns PigJob instance - */ - public static create(properties?: google.cloud.dataproc.v1.IPigJob): google.cloud.dataproc.v1.PigJob; - - /** - * Encodes the specified PigJob message. Does not implicitly {@link google.cloud.dataproc.v1.PigJob.verify|verify} messages. - * @param message PigJob message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IPigJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PigJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.PigJob.verify|verify} messages. - * @param message PigJob message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IPigJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PigJob message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PigJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.PigJob; - - /** - * Decodes a PigJob message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PigJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.PigJob; - - /** - * Verifies a PigJob message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PigJob message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PigJob - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.PigJob; - - /** - * Creates a plain object from a PigJob message. Also converts values to other types if specified. - * @param message PigJob - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.PigJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PigJob to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PigJob - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SparkRJob. */ - interface ISparkRJob { - - /** SparkRJob mainRFileUri */ - mainRFileUri?: (string|null); - - /** SparkRJob args */ - args?: (string[]|null); - - /** SparkRJob fileUris */ - fileUris?: (string[]|null); - - /** SparkRJob archiveUris */ - archiveUris?: (string[]|null); - - /** SparkRJob properties */ - properties?: ({ [k: string]: string }|null); - - /** SparkRJob loggingConfig */ - loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); - } - - /** Represents a SparkRJob. */ - class SparkRJob implements ISparkRJob { - - /** - * Constructs a new SparkRJob. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.ISparkRJob); - - /** SparkRJob mainRFileUri. */ - public mainRFileUri: string; - - /** SparkRJob args. */ - public args: string[]; - - /** SparkRJob fileUris. */ - public fileUris: string[]; - - /** SparkRJob archiveUris. */ - public archiveUris: string[]; - - /** SparkRJob properties. */ - public properties: { [k: string]: string }; - - /** SparkRJob loggingConfig. */ - public loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); - - /** - * Creates a new SparkRJob instance using the specified properties. - * @param [properties] Properties to set - * @returns SparkRJob instance - */ - public static create(properties?: google.cloud.dataproc.v1.ISparkRJob): google.cloud.dataproc.v1.SparkRJob; - - /** - * Encodes the specified SparkRJob message. Does not implicitly {@link google.cloud.dataproc.v1.SparkRJob.verify|verify} messages. - * @param message SparkRJob message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.ISparkRJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SparkRJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SparkRJob.verify|verify} messages. - * @param message SparkRJob message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.ISparkRJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SparkRJob message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SparkRJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.SparkRJob; - - /** - * Decodes a SparkRJob message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SparkRJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.SparkRJob; - - /** - * Verifies a SparkRJob message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SparkRJob message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SparkRJob - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.SparkRJob; - - /** - * Creates a plain object from a SparkRJob message. Also converts values to other types if specified. - * @param message SparkRJob - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.SparkRJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SparkRJob to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SparkRJob - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PrestoJob. */ - interface IPrestoJob { - - /** PrestoJob queryFileUri */ - queryFileUri?: (string|null); - - /** PrestoJob queryList */ - queryList?: (google.cloud.dataproc.v1.IQueryList|null); - - /** PrestoJob continueOnFailure */ - continueOnFailure?: (boolean|null); - - /** PrestoJob outputFormat */ - outputFormat?: (string|null); - - /** PrestoJob clientTags */ - clientTags?: (string[]|null); - - /** PrestoJob properties */ - properties?: ({ [k: string]: string }|null); - - /** PrestoJob loggingConfig */ - loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); - } - - /** Represents a PrestoJob. */ - class PrestoJob implements IPrestoJob { - - /** - * Constructs a new PrestoJob. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IPrestoJob); - - /** PrestoJob queryFileUri. */ - public queryFileUri?: (string|null); - - /** PrestoJob queryList. */ - public queryList?: (google.cloud.dataproc.v1.IQueryList|null); - - /** PrestoJob continueOnFailure. */ - public continueOnFailure: boolean; - - /** PrestoJob outputFormat. */ - public outputFormat: string; - - /** PrestoJob clientTags. */ - public clientTags: string[]; - - /** PrestoJob properties. */ - public properties: { [k: string]: string }; - - /** PrestoJob loggingConfig. */ - public loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); - - /** PrestoJob queries. */ - public queries?: ("queryFileUri"|"queryList"); - - /** - * Creates a new PrestoJob instance using the specified properties. - * @param [properties] Properties to set - * @returns PrestoJob instance - */ - public static create(properties?: google.cloud.dataproc.v1.IPrestoJob): google.cloud.dataproc.v1.PrestoJob; - - /** - * Encodes the specified PrestoJob message. Does not implicitly {@link google.cloud.dataproc.v1.PrestoJob.verify|verify} messages. - * @param message PrestoJob message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IPrestoJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PrestoJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.PrestoJob.verify|verify} messages. - * @param message PrestoJob message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IPrestoJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PrestoJob message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PrestoJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.PrestoJob; - - /** - * Decodes a PrestoJob message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PrestoJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.PrestoJob; - - /** - * Verifies a PrestoJob message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PrestoJob message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PrestoJob - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.PrestoJob; - - /** - * Creates a plain object from a PrestoJob message. Also converts values to other types if specified. - * @param message PrestoJob - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.PrestoJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PrestoJob to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PrestoJob - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TrinoJob. */ - interface ITrinoJob { - - /** TrinoJob queryFileUri */ - queryFileUri?: (string|null); - - /** TrinoJob queryList */ - queryList?: (google.cloud.dataproc.v1.IQueryList|null); - - /** TrinoJob continueOnFailure */ - continueOnFailure?: (boolean|null); - - /** TrinoJob outputFormat */ - outputFormat?: (string|null); - - /** TrinoJob clientTags */ - clientTags?: (string[]|null); - - /** TrinoJob properties */ - properties?: ({ [k: string]: string }|null); - - /** TrinoJob loggingConfig */ - loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); - } - - /** Represents a TrinoJob. */ - class TrinoJob implements ITrinoJob { - - /** - * Constructs a new TrinoJob. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.ITrinoJob); - - /** TrinoJob queryFileUri. */ - public queryFileUri?: (string|null); - - /** TrinoJob queryList. */ - public queryList?: (google.cloud.dataproc.v1.IQueryList|null); - - /** TrinoJob continueOnFailure. */ - public continueOnFailure: boolean; - - /** TrinoJob outputFormat. */ - public outputFormat: string; - - /** TrinoJob clientTags. */ - public clientTags: string[]; - - /** TrinoJob properties. */ - public properties: { [k: string]: string }; - - /** TrinoJob loggingConfig. */ - public loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); - - /** TrinoJob queries. */ - public queries?: ("queryFileUri"|"queryList"); - - /** - * Creates a new TrinoJob instance using the specified properties. - * @param [properties] Properties to set - * @returns TrinoJob instance - */ - public static create(properties?: google.cloud.dataproc.v1.ITrinoJob): google.cloud.dataproc.v1.TrinoJob; - - /** - * Encodes the specified TrinoJob message. Does not implicitly {@link google.cloud.dataproc.v1.TrinoJob.verify|verify} messages. - * @param message TrinoJob message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.ITrinoJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TrinoJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.TrinoJob.verify|verify} messages. - * @param message TrinoJob message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.ITrinoJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TrinoJob message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TrinoJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.TrinoJob; - - /** - * Decodes a TrinoJob message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TrinoJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.TrinoJob; - - /** - * Verifies a TrinoJob message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TrinoJob message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TrinoJob - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.TrinoJob; - - /** - * Creates a plain object from a TrinoJob message. Also converts values to other types if specified. - * @param message TrinoJob - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.TrinoJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TrinoJob to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TrinoJob - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FlinkJob. */ - interface IFlinkJob { - - /** FlinkJob mainJarFileUri */ - mainJarFileUri?: (string|null); - - /** FlinkJob mainClass */ - mainClass?: (string|null); - - /** FlinkJob args */ - args?: (string[]|null); - - /** FlinkJob jarFileUris */ - jarFileUris?: (string[]|null); - - /** FlinkJob savepointUri */ - savepointUri?: (string|null); - - /** FlinkJob properties */ - properties?: ({ [k: string]: string }|null); - - /** FlinkJob loggingConfig */ - loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); - } - - /** Represents a FlinkJob. */ - class FlinkJob implements IFlinkJob { - - /** - * Constructs a new FlinkJob. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IFlinkJob); - - /** FlinkJob mainJarFileUri. */ - public mainJarFileUri?: (string|null); - - /** FlinkJob mainClass. */ - public mainClass?: (string|null); - - /** FlinkJob args. */ - public args: string[]; - - /** FlinkJob jarFileUris. */ - public jarFileUris: string[]; - - /** FlinkJob savepointUri. */ - public savepointUri: string; - - /** FlinkJob properties. */ - public properties: { [k: string]: string }; - - /** FlinkJob loggingConfig. */ - public loggingConfig?: (google.cloud.dataproc.v1.ILoggingConfig|null); - - /** FlinkJob driver. */ - public driver?: ("mainJarFileUri"|"mainClass"); - - /** - * Creates a new FlinkJob instance using the specified properties. - * @param [properties] Properties to set - * @returns FlinkJob instance - */ - public static create(properties?: google.cloud.dataproc.v1.IFlinkJob): google.cloud.dataproc.v1.FlinkJob; - - /** - * Encodes the specified FlinkJob message. Does not implicitly {@link google.cloud.dataproc.v1.FlinkJob.verify|verify} messages. - * @param message FlinkJob message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IFlinkJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FlinkJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.FlinkJob.verify|verify} messages. - * @param message FlinkJob message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IFlinkJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FlinkJob message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FlinkJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.FlinkJob; - - /** - * Decodes a FlinkJob message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FlinkJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.FlinkJob; - - /** - * Verifies a FlinkJob message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FlinkJob message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FlinkJob - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.FlinkJob; - - /** - * Creates a plain object from a FlinkJob message. Also converts values to other types if specified. - * @param message FlinkJob - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.FlinkJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FlinkJob to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FlinkJob - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a JobPlacement. */ - interface IJobPlacement { - - /** JobPlacement clusterName */ - clusterName?: (string|null); - - /** JobPlacement clusterUuid */ - clusterUuid?: (string|null); - - /** JobPlacement clusterLabels */ - clusterLabels?: ({ [k: string]: string }|null); - } - - /** Represents a JobPlacement. */ - class JobPlacement implements IJobPlacement { - - /** - * Constructs a new JobPlacement. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IJobPlacement); - - /** JobPlacement clusterName. */ - public clusterName: string; - - /** JobPlacement clusterUuid. */ - public clusterUuid: string; - - /** JobPlacement clusterLabels. */ - public clusterLabels: { [k: string]: string }; - - /** - * Creates a new JobPlacement instance using the specified properties. - * @param [properties] Properties to set - * @returns JobPlacement instance - */ - public static create(properties?: google.cloud.dataproc.v1.IJobPlacement): google.cloud.dataproc.v1.JobPlacement; - - /** - * Encodes the specified JobPlacement message. Does not implicitly {@link google.cloud.dataproc.v1.JobPlacement.verify|verify} messages. - * @param message JobPlacement message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IJobPlacement, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified JobPlacement message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.JobPlacement.verify|verify} messages. - * @param message JobPlacement message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IJobPlacement, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a JobPlacement message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns JobPlacement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.JobPlacement; - - /** - * Decodes a JobPlacement message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns JobPlacement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.JobPlacement; - - /** - * Verifies a JobPlacement message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a JobPlacement message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns JobPlacement - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.JobPlacement; - - /** - * Creates a plain object from a JobPlacement message. Also converts values to other types if specified. - * @param message JobPlacement - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.JobPlacement, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this JobPlacement to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for JobPlacement - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a JobStatus. */ - interface IJobStatus { - - /** JobStatus state */ - state?: (google.cloud.dataproc.v1.JobStatus.State|keyof typeof google.cloud.dataproc.v1.JobStatus.State|null); - - /** JobStatus details */ - details?: (string|null); - - /** JobStatus stateStartTime */ - stateStartTime?: (google.protobuf.ITimestamp|null); - - /** JobStatus substate */ - substate?: (google.cloud.dataproc.v1.JobStatus.Substate|keyof typeof google.cloud.dataproc.v1.JobStatus.Substate|null); - } - - /** Represents a JobStatus. */ - class JobStatus implements IJobStatus { - - /** - * Constructs a new JobStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IJobStatus); - - /** JobStatus state. */ - public state: (google.cloud.dataproc.v1.JobStatus.State|keyof typeof google.cloud.dataproc.v1.JobStatus.State); - - /** JobStatus details. */ - public details: string; - - /** JobStatus stateStartTime. */ - public stateStartTime?: (google.protobuf.ITimestamp|null); - - /** JobStatus substate. */ - public substate: (google.cloud.dataproc.v1.JobStatus.Substate|keyof typeof google.cloud.dataproc.v1.JobStatus.Substate); - - /** - * Creates a new JobStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns JobStatus instance - */ - public static create(properties?: google.cloud.dataproc.v1.IJobStatus): google.cloud.dataproc.v1.JobStatus; - - /** - * Encodes the specified JobStatus message. Does not implicitly {@link google.cloud.dataproc.v1.JobStatus.verify|verify} messages. - * @param message JobStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IJobStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified JobStatus message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.JobStatus.verify|verify} messages. - * @param message JobStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IJobStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a JobStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns JobStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.JobStatus; - - /** - * Decodes a JobStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns JobStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.JobStatus; - - /** - * Verifies a JobStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a JobStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns JobStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.JobStatus; - - /** - * Creates a plain object from a JobStatus message. Also converts values to other types if specified. - * @param message JobStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.JobStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this JobStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for JobStatus - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace JobStatus { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - PENDING = 1, - SETUP_DONE = 8, - RUNNING = 2, - CANCEL_PENDING = 3, - CANCEL_STARTED = 7, - CANCELLED = 4, - DONE = 5, - ERROR = 6, - ATTEMPT_FAILURE = 9 - } - - /** Substate enum. */ - enum Substate { - UNSPECIFIED = 0, - SUBMITTED = 1, - QUEUED = 2, - STALE_STATUS = 3 - } - } - - /** Properties of a JobReference. */ - interface IJobReference { - - /** JobReference projectId */ - projectId?: (string|null); - - /** JobReference jobId */ - jobId?: (string|null); - } - - /** Represents a JobReference. */ - class JobReference implements IJobReference { - - /** - * Constructs a new JobReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IJobReference); - - /** JobReference projectId. */ - public projectId: string; - - /** JobReference jobId. */ - public jobId: string; - - /** - * Creates a new JobReference instance using the specified properties. - * @param [properties] Properties to set - * @returns JobReference instance - */ - public static create(properties?: google.cloud.dataproc.v1.IJobReference): google.cloud.dataproc.v1.JobReference; - - /** - * Encodes the specified JobReference message. Does not implicitly {@link google.cloud.dataproc.v1.JobReference.verify|verify} messages. - * @param message JobReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IJobReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified JobReference message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.JobReference.verify|verify} messages. - * @param message JobReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IJobReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a JobReference message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns JobReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.JobReference; - - /** - * Decodes a JobReference message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns JobReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.JobReference; - - /** - * Verifies a JobReference message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a JobReference message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns JobReference - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.JobReference; - - /** - * Creates a plain object from a JobReference message. Also converts values to other types if specified. - * @param message JobReference - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.JobReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this JobReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for JobReference - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a YarnApplication. */ - interface IYarnApplication { - - /** YarnApplication name */ - name?: (string|null); - - /** YarnApplication state */ - state?: (google.cloud.dataproc.v1.YarnApplication.State|keyof typeof google.cloud.dataproc.v1.YarnApplication.State|null); - - /** YarnApplication progress */ - progress?: (number|null); - - /** YarnApplication trackingUrl */ - trackingUrl?: (string|null); - } - - /** Represents a YarnApplication. */ - class YarnApplication implements IYarnApplication { - - /** - * Constructs a new YarnApplication. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IYarnApplication); - - /** YarnApplication name. */ - public name: string; - - /** YarnApplication state. */ - public state: (google.cloud.dataproc.v1.YarnApplication.State|keyof typeof google.cloud.dataproc.v1.YarnApplication.State); - - /** YarnApplication progress. */ - public progress: number; - - /** YarnApplication trackingUrl. */ - public trackingUrl: string; - - /** - * Creates a new YarnApplication instance using the specified properties. - * @param [properties] Properties to set - * @returns YarnApplication instance - */ - public static create(properties?: google.cloud.dataproc.v1.IYarnApplication): google.cloud.dataproc.v1.YarnApplication; - - /** - * Encodes the specified YarnApplication message. Does not implicitly {@link google.cloud.dataproc.v1.YarnApplication.verify|verify} messages. - * @param message YarnApplication message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IYarnApplication, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified YarnApplication message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.YarnApplication.verify|verify} messages. - * @param message YarnApplication message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IYarnApplication, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a YarnApplication message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns YarnApplication - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.YarnApplication; - - /** - * Decodes a YarnApplication message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns YarnApplication - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.YarnApplication; - - /** - * Verifies a YarnApplication message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a YarnApplication message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns YarnApplication - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.YarnApplication; - - /** - * Creates a plain object from a YarnApplication message. Also converts values to other types if specified. - * @param message YarnApplication - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.YarnApplication, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this YarnApplication to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for YarnApplication - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace YarnApplication { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - NEW = 1, - NEW_SAVING = 2, - SUBMITTED = 3, - ACCEPTED = 4, - RUNNING = 5, - FINISHED = 6, - FAILED = 7, - KILLED = 8 - } - } - - /** Properties of a Job. */ - interface IJob { - - /** Job reference */ - reference?: (google.cloud.dataproc.v1.IJobReference|null); - - /** Job placement */ - placement?: (google.cloud.dataproc.v1.IJobPlacement|null); - - /** Job hadoopJob */ - hadoopJob?: (google.cloud.dataproc.v1.IHadoopJob|null); - - /** Job sparkJob */ - sparkJob?: (google.cloud.dataproc.v1.ISparkJob|null); - - /** Job pysparkJob */ - pysparkJob?: (google.cloud.dataproc.v1.IPySparkJob|null); - - /** Job hiveJob */ - hiveJob?: (google.cloud.dataproc.v1.IHiveJob|null); - - /** Job pigJob */ - pigJob?: (google.cloud.dataproc.v1.IPigJob|null); - - /** Job sparkRJob */ - sparkRJob?: (google.cloud.dataproc.v1.ISparkRJob|null); - - /** Job sparkSqlJob */ - sparkSqlJob?: (google.cloud.dataproc.v1.ISparkSqlJob|null); - - /** Job prestoJob */ - prestoJob?: (google.cloud.dataproc.v1.IPrestoJob|null); - - /** Job trinoJob */ - trinoJob?: (google.cloud.dataproc.v1.ITrinoJob|null); - - /** Job flinkJob */ - flinkJob?: (google.cloud.dataproc.v1.IFlinkJob|null); - - /** Job status */ - status?: (google.cloud.dataproc.v1.IJobStatus|null); - - /** Job statusHistory */ - statusHistory?: (google.cloud.dataproc.v1.IJobStatus[]|null); - - /** Job yarnApplications */ - yarnApplications?: (google.cloud.dataproc.v1.IYarnApplication[]|null); - - /** Job driverOutputResourceUri */ - driverOutputResourceUri?: (string|null); - - /** Job driverControlFilesUri */ - driverControlFilesUri?: (string|null); - - /** Job labels */ - labels?: ({ [k: string]: string }|null); - - /** Job scheduling */ - scheduling?: (google.cloud.dataproc.v1.IJobScheduling|null); - - /** Job jobUuid */ - jobUuid?: (string|null); - - /** Job done */ - done?: (boolean|null); - - /** Job driverSchedulingConfig */ - driverSchedulingConfig?: (google.cloud.dataproc.v1.IDriverSchedulingConfig|null); - } - - /** Represents a Job. */ - class Job implements IJob { - - /** - * Constructs a new Job. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IJob); - - /** Job reference. */ - public reference?: (google.cloud.dataproc.v1.IJobReference|null); - - /** Job placement. */ - public placement?: (google.cloud.dataproc.v1.IJobPlacement|null); - - /** Job hadoopJob. */ - public hadoopJob?: (google.cloud.dataproc.v1.IHadoopJob|null); - - /** Job sparkJob. */ - public sparkJob?: (google.cloud.dataproc.v1.ISparkJob|null); - - /** Job pysparkJob. */ - public pysparkJob?: (google.cloud.dataproc.v1.IPySparkJob|null); - - /** Job hiveJob. */ - public hiveJob?: (google.cloud.dataproc.v1.IHiveJob|null); - - /** Job pigJob. */ - public pigJob?: (google.cloud.dataproc.v1.IPigJob|null); - - /** Job sparkRJob. */ - public sparkRJob?: (google.cloud.dataproc.v1.ISparkRJob|null); - - /** Job sparkSqlJob. */ - public sparkSqlJob?: (google.cloud.dataproc.v1.ISparkSqlJob|null); - - /** Job prestoJob. */ - public prestoJob?: (google.cloud.dataproc.v1.IPrestoJob|null); - - /** Job trinoJob. */ - public trinoJob?: (google.cloud.dataproc.v1.ITrinoJob|null); - - /** Job flinkJob. */ - public flinkJob?: (google.cloud.dataproc.v1.IFlinkJob|null); - - /** Job status. */ - public status?: (google.cloud.dataproc.v1.IJobStatus|null); - - /** Job statusHistory. */ - public statusHistory: google.cloud.dataproc.v1.IJobStatus[]; - - /** Job yarnApplications. */ - public yarnApplications: google.cloud.dataproc.v1.IYarnApplication[]; - - /** Job driverOutputResourceUri. */ - public driverOutputResourceUri: string; - - /** Job driverControlFilesUri. */ - public driverControlFilesUri: string; - - /** Job labels. */ - public labels: { [k: string]: string }; - - /** Job scheduling. */ - public scheduling?: (google.cloud.dataproc.v1.IJobScheduling|null); - - /** Job jobUuid. */ - public jobUuid: string; - - /** Job done. */ - public done: boolean; - - /** Job driverSchedulingConfig. */ - public driverSchedulingConfig?: (google.cloud.dataproc.v1.IDriverSchedulingConfig|null); - - /** Job typeJob. */ - public typeJob?: ("hadoopJob"|"sparkJob"|"pysparkJob"|"hiveJob"|"pigJob"|"sparkRJob"|"sparkSqlJob"|"prestoJob"|"trinoJob"|"flinkJob"); - - /** - * Creates a new Job instance using the specified properties. - * @param [properties] Properties to set - * @returns Job instance - */ - public static create(properties?: google.cloud.dataproc.v1.IJob): google.cloud.dataproc.v1.Job; - - /** - * Encodes the specified Job message. Does not implicitly {@link google.cloud.dataproc.v1.Job.verify|verify} messages. - * @param message Job message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.Job.verify|verify} messages. - * @param message Job message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Job message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Job - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.Job; - - /** - * Decodes a Job message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Job - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.Job; - - /** - * Verifies a Job message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Job message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Job - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.Job; - - /** - * Creates a plain object from a Job message. Also converts values to other types if specified. - * @param message Job - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.Job, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Job to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Job - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DriverSchedulingConfig. */ - interface IDriverSchedulingConfig { - - /** DriverSchedulingConfig memoryMb */ - memoryMb?: (number|null); - - /** DriverSchedulingConfig vcores */ - vcores?: (number|null); - } - - /** Represents a DriverSchedulingConfig. */ - class DriverSchedulingConfig implements IDriverSchedulingConfig { - - /** - * Constructs a new DriverSchedulingConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IDriverSchedulingConfig); - - /** DriverSchedulingConfig memoryMb. */ - public memoryMb: number; - - /** DriverSchedulingConfig vcores. */ - public vcores: number; - - /** - * Creates a new DriverSchedulingConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns DriverSchedulingConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.IDriverSchedulingConfig): google.cloud.dataproc.v1.DriverSchedulingConfig; - - /** - * Encodes the specified DriverSchedulingConfig message. Does not implicitly {@link google.cloud.dataproc.v1.DriverSchedulingConfig.verify|verify} messages. - * @param message DriverSchedulingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IDriverSchedulingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DriverSchedulingConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DriverSchedulingConfig.verify|verify} messages. - * @param message DriverSchedulingConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IDriverSchedulingConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DriverSchedulingConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DriverSchedulingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.DriverSchedulingConfig; - - /** - * Decodes a DriverSchedulingConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DriverSchedulingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.DriverSchedulingConfig; - - /** - * Verifies a DriverSchedulingConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DriverSchedulingConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DriverSchedulingConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.DriverSchedulingConfig; - - /** - * Creates a plain object from a DriverSchedulingConfig message. Also converts values to other types if specified. - * @param message DriverSchedulingConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.DriverSchedulingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DriverSchedulingConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DriverSchedulingConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a JobScheduling. */ - interface IJobScheduling { - - /** JobScheduling maxFailuresPerHour */ - maxFailuresPerHour?: (number|null); - - /** JobScheduling maxFailuresTotal */ - maxFailuresTotal?: (number|null); - } - - /** Represents a JobScheduling. */ - class JobScheduling implements IJobScheduling { - - /** - * Constructs a new JobScheduling. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IJobScheduling); - - /** JobScheduling maxFailuresPerHour. */ - public maxFailuresPerHour: number; - - /** JobScheduling maxFailuresTotal. */ - public maxFailuresTotal: number; - - /** - * Creates a new JobScheduling instance using the specified properties. - * @param [properties] Properties to set - * @returns JobScheduling instance - */ - public static create(properties?: google.cloud.dataproc.v1.IJobScheduling): google.cloud.dataproc.v1.JobScheduling; - - /** - * Encodes the specified JobScheduling message. Does not implicitly {@link google.cloud.dataproc.v1.JobScheduling.verify|verify} messages. - * @param message JobScheduling message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IJobScheduling, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified JobScheduling message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.JobScheduling.verify|verify} messages. - * @param message JobScheduling message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IJobScheduling, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a JobScheduling message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns JobScheduling - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.JobScheduling; - - /** - * Decodes a JobScheduling message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns JobScheduling - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.JobScheduling; - - /** - * Verifies a JobScheduling message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a JobScheduling message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns JobScheduling - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.JobScheduling; - - /** - * Creates a plain object from a JobScheduling message. Also converts values to other types if specified. - * @param message JobScheduling - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.JobScheduling, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this JobScheduling to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for JobScheduling - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SubmitJobRequest. */ - interface ISubmitJobRequest { - - /** SubmitJobRequest projectId */ - projectId?: (string|null); - - /** SubmitJobRequest region */ - region?: (string|null); - - /** SubmitJobRequest job */ - job?: (google.cloud.dataproc.v1.IJob|null); - - /** SubmitJobRequest requestId */ - requestId?: (string|null); - } - - /** Represents a SubmitJobRequest. */ - class SubmitJobRequest implements ISubmitJobRequest { - - /** - * Constructs a new SubmitJobRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.ISubmitJobRequest); - - /** SubmitJobRequest projectId. */ - public projectId: string; - - /** SubmitJobRequest region. */ - public region: string; - - /** SubmitJobRequest job. */ - public job?: (google.cloud.dataproc.v1.IJob|null); - - /** SubmitJobRequest requestId. */ - public requestId: string; - - /** - * Creates a new SubmitJobRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns SubmitJobRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.ISubmitJobRequest): google.cloud.dataproc.v1.SubmitJobRequest; - - /** - * Encodes the specified SubmitJobRequest message. Does not implicitly {@link google.cloud.dataproc.v1.SubmitJobRequest.verify|verify} messages. - * @param message SubmitJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.ISubmitJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SubmitJobRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SubmitJobRequest.verify|verify} messages. - * @param message SubmitJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.ISubmitJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SubmitJobRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SubmitJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.SubmitJobRequest; - - /** - * Decodes a SubmitJobRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SubmitJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.SubmitJobRequest; - - /** - * Verifies a SubmitJobRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SubmitJobRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SubmitJobRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.SubmitJobRequest; - - /** - * Creates a plain object from a SubmitJobRequest message. Also converts values to other types if specified. - * @param message SubmitJobRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.SubmitJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SubmitJobRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SubmitJobRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a JobMetadata. */ - interface IJobMetadata { - - /** JobMetadata jobId */ - jobId?: (string|null); - - /** JobMetadata status */ - status?: (google.cloud.dataproc.v1.IJobStatus|null); - - /** JobMetadata operationType */ - operationType?: (string|null); - - /** JobMetadata startTime */ - startTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a JobMetadata. */ - class JobMetadata implements IJobMetadata { - - /** - * Constructs a new JobMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IJobMetadata); - - /** JobMetadata jobId. */ - public jobId: string; - - /** JobMetadata status. */ - public status?: (google.cloud.dataproc.v1.IJobStatus|null); - - /** JobMetadata operationType. */ - public operationType: string; - - /** JobMetadata startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new JobMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns JobMetadata instance - */ - public static create(properties?: google.cloud.dataproc.v1.IJobMetadata): google.cloud.dataproc.v1.JobMetadata; - - /** - * Encodes the specified JobMetadata message. Does not implicitly {@link google.cloud.dataproc.v1.JobMetadata.verify|verify} messages. - * @param message JobMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IJobMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified JobMetadata message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.JobMetadata.verify|verify} messages. - * @param message JobMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IJobMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a JobMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns JobMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.JobMetadata; - - /** - * Decodes a JobMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns JobMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.JobMetadata; - - /** - * Verifies a JobMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a JobMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns JobMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.JobMetadata; - - /** - * Creates a plain object from a JobMetadata message. Also converts values to other types if specified. - * @param message JobMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.JobMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this JobMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for JobMetadata - * @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 projectId */ - projectId?: (string|null); - - /** GetJobRequest region */ - region?: (string|null); - - /** GetJobRequest jobId */ - jobId?: (string|null); - } - - /** Represents a GetJobRequest. */ - class GetJobRequest implements IGetJobRequest { - - /** - * Constructs a new GetJobRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IGetJobRequest); - - /** GetJobRequest projectId. */ - public projectId: string; - - /** GetJobRequest region. */ - public region: string; - - /** GetJobRequest jobId. */ - public jobId: string; - - /** - * Creates a new GetJobRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetJobRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.IGetJobRequest): google.cloud.dataproc.v1.GetJobRequest; - - /** - * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.dataproc.v1.GetJobRequest.verify|verify} messages. - * @param message GetJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IGetJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetJobRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GetJobRequest.verify|verify} messages. - * @param message GetJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IGetJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetJobRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.GetJobRequest; - - /** - * Decodes a GetJobRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.GetJobRequest; - - /** - * Verifies a GetJobRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetJobRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetJobRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.GetJobRequest; - - /** - * Creates a plain object from a GetJobRequest message. Also converts values to other types if specified. - * @param message GetJobRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.GetJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetJobRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetJobRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListJobsRequest. */ - interface IListJobsRequest { - - /** ListJobsRequest projectId */ - projectId?: (string|null); - - /** ListJobsRequest region */ - region?: (string|null); - - /** ListJobsRequest pageSize */ - pageSize?: (number|null); - - /** ListJobsRequest pageToken */ - pageToken?: (string|null); - - /** ListJobsRequest clusterName */ - clusterName?: (string|null); - - /** ListJobsRequest jobStateMatcher */ - jobStateMatcher?: (google.cloud.dataproc.v1.ListJobsRequest.JobStateMatcher|keyof typeof google.cloud.dataproc.v1.ListJobsRequest.JobStateMatcher|null); - - /** ListJobsRequest filter */ - filter?: (string|null); - } - - /** Represents a ListJobsRequest. */ - class ListJobsRequest implements IListJobsRequest { - - /** - * Constructs a new ListJobsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IListJobsRequest); - - /** ListJobsRequest projectId. */ - public projectId: string; - - /** ListJobsRequest region. */ - public region: string; - - /** ListJobsRequest pageSize. */ - public pageSize: number; - - /** ListJobsRequest pageToken. */ - public pageToken: string; - - /** ListJobsRequest clusterName. */ - public clusterName: string; - - /** ListJobsRequest jobStateMatcher. */ - public jobStateMatcher: (google.cloud.dataproc.v1.ListJobsRequest.JobStateMatcher|keyof typeof google.cloud.dataproc.v1.ListJobsRequest.JobStateMatcher); - - /** ListJobsRequest filter. */ - public filter: string; - - /** - * Creates a new ListJobsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListJobsRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.IListJobsRequest): google.cloud.dataproc.v1.ListJobsRequest; - - /** - * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.dataproc.v1.ListJobsRequest.verify|verify} messages. - * @param message ListJobsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IListJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListJobsRequest.verify|verify} messages. - * @param message ListJobsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IListJobsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListJobsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListJobsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ListJobsRequest; - - /** - * Decodes a ListJobsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListJobsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ListJobsRequest; - - /** - * Verifies a ListJobsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListJobsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListJobsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ListJobsRequest; - - /** - * Creates a plain object from a ListJobsRequest message. Also converts values to other types if specified. - * @param message ListJobsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.ListJobsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListJobsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListJobsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ListJobsRequest { - - /** JobStateMatcher enum. */ - enum JobStateMatcher { - ALL = 0, - ACTIVE = 1, - NON_ACTIVE = 2 - } - } - - /** Properties of an UpdateJobRequest. */ - interface IUpdateJobRequest { - - /** UpdateJobRequest projectId */ - projectId?: (string|null); - - /** UpdateJobRequest region */ - region?: (string|null); - - /** UpdateJobRequest jobId */ - jobId?: (string|null); - - /** UpdateJobRequest job */ - job?: (google.cloud.dataproc.v1.IJob|null); - - /** UpdateJobRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents an UpdateJobRequest. */ - class UpdateJobRequest implements IUpdateJobRequest { - - /** - * Constructs a new UpdateJobRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IUpdateJobRequest); - - /** UpdateJobRequest projectId. */ - public projectId: string; - - /** UpdateJobRequest region. */ - public region: string; - - /** UpdateJobRequest jobId. */ - public jobId: string; - - /** UpdateJobRequest job. */ - public job?: (google.cloud.dataproc.v1.IJob|null); - - /** UpdateJobRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** - * Creates a new UpdateJobRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateJobRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.IUpdateJobRequest): google.cloud.dataproc.v1.UpdateJobRequest; - - /** - * Encodes the specified UpdateJobRequest message. Does not implicitly {@link google.cloud.dataproc.v1.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.dataproc.v1.IUpdateJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateJobRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.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.dataproc.v1.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.dataproc.v1.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.dataproc.v1.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.dataproc.v1.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.dataproc.v1.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 ListJobsResponse. */ - interface IListJobsResponse { - - /** ListJobsResponse jobs */ - jobs?: (google.cloud.dataproc.v1.IJob[]|null); - - /** ListJobsResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListJobsResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListJobsResponse. */ - class ListJobsResponse implements IListJobsResponse { - - /** - * Constructs a new ListJobsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IListJobsResponse); - - /** ListJobsResponse jobs. */ - public jobs: google.cloud.dataproc.v1.IJob[]; - - /** ListJobsResponse nextPageToken. */ - public nextPageToken: string; - - /** ListJobsResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListJobsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListJobsResponse instance - */ - public static create(properties?: google.cloud.dataproc.v1.IListJobsResponse): google.cloud.dataproc.v1.ListJobsResponse; - - /** - * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.cloud.dataproc.v1.ListJobsResponse.verify|verify} messages. - * @param message ListJobsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IListJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListJobsResponse message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListJobsResponse.verify|verify} messages. - * @param message ListJobsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IListJobsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListJobsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListJobsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ListJobsResponse; - - /** - * Decodes a ListJobsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListJobsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ListJobsResponse; - - /** - * Verifies a ListJobsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListJobsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListJobsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ListJobsResponse; - - /** - * Creates a plain object from a ListJobsResponse message. Also converts values to other types if specified. - * @param message ListJobsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.ListJobsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListJobsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListJobsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CancelJobRequest. */ - interface ICancelJobRequest { - - /** CancelJobRequest projectId */ - projectId?: (string|null); - - /** CancelJobRequest region */ - region?: (string|null); - - /** CancelJobRequest jobId */ - jobId?: (string|null); - } - - /** Represents a CancelJobRequest. */ - class CancelJobRequest implements ICancelJobRequest { - - /** - * Constructs a new CancelJobRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.ICancelJobRequest); - - /** CancelJobRequest projectId. */ - public projectId: string; - - /** CancelJobRequest region. */ - public region: string; - - /** CancelJobRequest jobId. */ - public jobId: string; - - /** - * Creates a new CancelJobRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CancelJobRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.ICancelJobRequest): google.cloud.dataproc.v1.CancelJobRequest; - - /** - * Encodes the specified CancelJobRequest message. Does not implicitly {@link google.cloud.dataproc.v1.CancelJobRequest.verify|verify} messages. - * @param message CancelJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.ICancelJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CancelJobRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.CancelJobRequest.verify|verify} messages. - * @param message CancelJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.ICancelJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CancelJobRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CancelJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.CancelJobRequest; - - /** - * Decodes a CancelJobRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CancelJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.CancelJobRequest; - - /** - * Verifies a CancelJobRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CancelJobRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CancelJobRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.CancelJobRequest; - - /** - * Creates a plain object from a CancelJobRequest message. Also converts values to other types if specified. - * @param message CancelJobRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.CancelJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CancelJobRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CancelJobRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteJobRequest. */ - interface IDeleteJobRequest { - - /** DeleteJobRequest projectId */ - projectId?: (string|null); - - /** DeleteJobRequest region */ - region?: (string|null); - - /** DeleteJobRequest jobId */ - jobId?: (string|null); - } - - /** Represents a DeleteJobRequest. */ - class DeleteJobRequest implements IDeleteJobRequest { - - /** - * Constructs a new DeleteJobRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IDeleteJobRequest); - - /** DeleteJobRequest projectId. */ - public projectId: string; - - /** DeleteJobRequest region. */ - public region: string; - - /** DeleteJobRequest jobId. */ - public jobId: string; - - /** - * Creates a new DeleteJobRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteJobRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.IDeleteJobRequest): google.cloud.dataproc.v1.DeleteJobRequest; - - /** - * Encodes the specified DeleteJobRequest message. Does not implicitly {@link google.cloud.dataproc.v1.DeleteJobRequest.verify|verify} messages. - * @param message DeleteJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IDeleteJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteJobRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DeleteJobRequest.verify|verify} messages. - * @param message DeleteJobRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IDeleteJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteJobRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.DeleteJobRequest; - - /** - * Decodes a DeleteJobRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.DeleteJobRequest; - - /** - * Verifies a DeleteJobRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteJobRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteJobRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.DeleteJobRequest; - - /** - * Creates a plain object from a DeleteJobRequest message. Also converts values to other types if specified. - * @param message DeleteJobRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.DeleteJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteJobRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteJobRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a NodeGroupController */ - class NodeGroupController extends $protobuf.rpc.Service { - - /** - * Constructs a new NodeGroupController 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 NodeGroupController 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): NodeGroupController; - - /** - * Calls CreateNodeGroup. - * @param request CreateNodeGroupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createNodeGroup(request: google.cloud.dataproc.v1.ICreateNodeGroupRequest, callback: google.cloud.dataproc.v1.NodeGroupController.CreateNodeGroupCallback): void; - - /** - * Calls CreateNodeGroup. - * @param request CreateNodeGroupRequest message or plain object - * @returns Promise - */ - public createNodeGroup(request: google.cloud.dataproc.v1.ICreateNodeGroupRequest): Promise; - - /** - * Calls ResizeNodeGroup. - * @param request ResizeNodeGroupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public resizeNodeGroup(request: google.cloud.dataproc.v1.IResizeNodeGroupRequest, callback: google.cloud.dataproc.v1.NodeGroupController.ResizeNodeGroupCallback): void; - - /** - * Calls ResizeNodeGroup. - * @param request ResizeNodeGroupRequest message or plain object - * @returns Promise - */ - public resizeNodeGroup(request: google.cloud.dataproc.v1.IResizeNodeGroupRequest): Promise; - - /** - * Calls GetNodeGroup. - * @param request GetNodeGroupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and NodeGroup - */ - public getNodeGroup(request: google.cloud.dataproc.v1.IGetNodeGroupRequest, callback: google.cloud.dataproc.v1.NodeGroupController.GetNodeGroupCallback): void; - - /** - * Calls GetNodeGroup. - * @param request GetNodeGroupRequest message or plain object - * @returns Promise - */ - public getNodeGroup(request: google.cloud.dataproc.v1.IGetNodeGroupRequest): Promise; - } - - namespace NodeGroupController { - - /** - * Callback as used by {@link google.cloud.dataproc.v1.NodeGroupController|createNodeGroup}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateNodeGroupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.NodeGroupController|resizeNodeGroup}. - * @param error Error, if any - * @param [response] Operation - */ - type ResizeNodeGroupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.NodeGroupController|getNodeGroup}. - * @param error Error, if any - * @param [response] NodeGroup - */ - type GetNodeGroupCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.NodeGroup) => void; - } - - /** Properties of a CreateNodeGroupRequest. */ - interface ICreateNodeGroupRequest { - - /** CreateNodeGroupRequest parent */ - parent?: (string|null); - - /** CreateNodeGroupRequest nodeGroup */ - nodeGroup?: (google.cloud.dataproc.v1.INodeGroup|null); - - /** CreateNodeGroupRequest nodeGroupId */ - nodeGroupId?: (string|null); - - /** CreateNodeGroupRequest requestId */ - requestId?: (string|null); - } - - /** Represents a CreateNodeGroupRequest. */ - class CreateNodeGroupRequest implements ICreateNodeGroupRequest { - - /** - * Constructs a new CreateNodeGroupRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.ICreateNodeGroupRequest); - - /** CreateNodeGroupRequest parent. */ - public parent: string; - - /** CreateNodeGroupRequest nodeGroup. */ - public nodeGroup?: (google.cloud.dataproc.v1.INodeGroup|null); - - /** CreateNodeGroupRequest nodeGroupId. */ - public nodeGroupId: string; - - /** CreateNodeGroupRequest requestId. */ - public requestId: string; - - /** - * Creates a new CreateNodeGroupRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateNodeGroupRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.ICreateNodeGroupRequest): google.cloud.dataproc.v1.CreateNodeGroupRequest; - - /** - * Encodes the specified CreateNodeGroupRequest message. Does not implicitly {@link google.cloud.dataproc.v1.CreateNodeGroupRequest.verify|verify} messages. - * @param message CreateNodeGroupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.ICreateNodeGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateNodeGroupRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.CreateNodeGroupRequest.verify|verify} messages. - * @param message CreateNodeGroupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.ICreateNodeGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateNodeGroupRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateNodeGroupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.CreateNodeGroupRequest; - - /** - * Decodes a CreateNodeGroupRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateNodeGroupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.CreateNodeGroupRequest; - - /** - * Verifies a CreateNodeGroupRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateNodeGroupRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateNodeGroupRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.CreateNodeGroupRequest; - - /** - * Creates a plain object from a CreateNodeGroupRequest message. Also converts values to other types if specified. - * @param message CreateNodeGroupRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.CreateNodeGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateNodeGroupRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateNodeGroupRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ResizeNodeGroupRequest. */ - interface IResizeNodeGroupRequest { - - /** ResizeNodeGroupRequest name */ - name?: (string|null); - - /** ResizeNodeGroupRequest size */ - size?: (number|null); - - /** ResizeNodeGroupRequest requestId */ - requestId?: (string|null); - - /** ResizeNodeGroupRequest gracefulDecommissionTimeout */ - gracefulDecommissionTimeout?: (google.protobuf.IDuration|null); - } - - /** Represents a ResizeNodeGroupRequest. */ - class ResizeNodeGroupRequest implements IResizeNodeGroupRequest { - - /** - * Constructs a new ResizeNodeGroupRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IResizeNodeGroupRequest); - - /** ResizeNodeGroupRequest name. */ - public name: string; - - /** ResizeNodeGroupRequest size. */ - public size: number; - - /** ResizeNodeGroupRequest requestId. */ - public requestId: string; - - /** ResizeNodeGroupRequest gracefulDecommissionTimeout. */ - public gracefulDecommissionTimeout?: (google.protobuf.IDuration|null); - - /** - * Creates a new ResizeNodeGroupRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ResizeNodeGroupRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.IResizeNodeGroupRequest): google.cloud.dataproc.v1.ResizeNodeGroupRequest; - - /** - * Encodes the specified ResizeNodeGroupRequest message. Does not implicitly {@link google.cloud.dataproc.v1.ResizeNodeGroupRequest.verify|verify} messages. - * @param message ResizeNodeGroupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IResizeNodeGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResizeNodeGroupRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ResizeNodeGroupRequest.verify|verify} messages. - * @param message ResizeNodeGroupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IResizeNodeGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResizeNodeGroupRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResizeNodeGroupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ResizeNodeGroupRequest; - - /** - * Decodes a ResizeNodeGroupRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResizeNodeGroupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ResizeNodeGroupRequest; - - /** - * Verifies a ResizeNodeGroupRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResizeNodeGroupRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResizeNodeGroupRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ResizeNodeGroupRequest; - - /** - * Creates a plain object from a ResizeNodeGroupRequest message. Also converts values to other types if specified. - * @param message ResizeNodeGroupRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.ResizeNodeGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResizeNodeGroupRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResizeNodeGroupRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetNodeGroupRequest. */ - interface IGetNodeGroupRequest { - - /** GetNodeGroupRequest name */ - name?: (string|null); - } - - /** Represents a GetNodeGroupRequest. */ - class GetNodeGroupRequest implements IGetNodeGroupRequest { - - /** - * Constructs a new GetNodeGroupRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IGetNodeGroupRequest); - - /** GetNodeGroupRequest name. */ - public name: string; - - /** - * Creates a new GetNodeGroupRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetNodeGroupRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.IGetNodeGroupRequest): google.cloud.dataproc.v1.GetNodeGroupRequest; - - /** - * Encodes the specified GetNodeGroupRequest message. Does not implicitly {@link google.cloud.dataproc.v1.GetNodeGroupRequest.verify|verify} messages. - * @param message GetNodeGroupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IGetNodeGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetNodeGroupRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GetNodeGroupRequest.verify|verify} messages. - * @param message GetNodeGroupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IGetNodeGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetNodeGroupRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetNodeGroupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.GetNodeGroupRequest; - - /** - * Decodes a GetNodeGroupRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetNodeGroupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.GetNodeGroupRequest; - - /** - * Verifies a GetNodeGroupRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetNodeGroupRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetNodeGroupRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.GetNodeGroupRequest; - - /** - * Creates a plain object from a GetNodeGroupRequest message. Also converts values to other types if specified. - * @param message GetNodeGroupRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.GetNodeGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetNodeGroupRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetNodeGroupRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a SessionTemplateController */ - class SessionTemplateController extends $protobuf.rpc.Service { - - /** - * Constructs a new SessionTemplateController 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 SessionTemplateController 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): SessionTemplateController; - - /** - * Calls CreateSessionTemplate. - * @param request CreateSessionTemplateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SessionTemplate - */ - public createSessionTemplate(request: google.cloud.dataproc.v1.ICreateSessionTemplateRequest, callback: google.cloud.dataproc.v1.SessionTemplateController.CreateSessionTemplateCallback): void; - - /** - * Calls CreateSessionTemplate. - * @param request CreateSessionTemplateRequest message or plain object - * @returns Promise - */ - public createSessionTemplate(request: google.cloud.dataproc.v1.ICreateSessionTemplateRequest): Promise; - - /** - * Calls UpdateSessionTemplate. - * @param request UpdateSessionTemplateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SessionTemplate - */ - public updateSessionTemplate(request: google.cloud.dataproc.v1.IUpdateSessionTemplateRequest, callback: google.cloud.dataproc.v1.SessionTemplateController.UpdateSessionTemplateCallback): void; - - /** - * Calls UpdateSessionTemplate. - * @param request UpdateSessionTemplateRequest message or plain object - * @returns Promise - */ - public updateSessionTemplate(request: google.cloud.dataproc.v1.IUpdateSessionTemplateRequest): Promise; - - /** - * Calls GetSessionTemplate. - * @param request GetSessionTemplateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SessionTemplate - */ - public getSessionTemplate(request: google.cloud.dataproc.v1.IGetSessionTemplateRequest, callback: google.cloud.dataproc.v1.SessionTemplateController.GetSessionTemplateCallback): void; - - /** - * Calls GetSessionTemplate. - * @param request GetSessionTemplateRequest message or plain object - * @returns Promise - */ - public getSessionTemplate(request: google.cloud.dataproc.v1.IGetSessionTemplateRequest): Promise; - - /** - * Calls ListSessionTemplates. - * @param request ListSessionTemplatesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListSessionTemplatesResponse - */ - public listSessionTemplates(request: google.cloud.dataproc.v1.IListSessionTemplatesRequest, callback: google.cloud.dataproc.v1.SessionTemplateController.ListSessionTemplatesCallback): void; - - /** - * Calls ListSessionTemplates. - * @param request ListSessionTemplatesRequest message or plain object - * @returns Promise - */ - public listSessionTemplates(request: google.cloud.dataproc.v1.IListSessionTemplatesRequest): Promise; - - /** - * Calls DeleteSessionTemplate. - * @param request DeleteSessionTemplateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteSessionTemplate(request: google.cloud.dataproc.v1.IDeleteSessionTemplateRequest, callback: google.cloud.dataproc.v1.SessionTemplateController.DeleteSessionTemplateCallback): void; - - /** - * Calls DeleteSessionTemplate. - * @param request DeleteSessionTemplateRequest message or plain object - * @returns Promise - */ - public deleteSessionTemplate(request: google.cloud.dataproc.v1.IDeleteSessionTemplateRequest): Promise; - } - - namespace SessionTemplateController { - - /** - * Callback as used by {@link google.cloud.dataproc.v1.SessionTemplateController|createSessionTemplate}. - * @param error Error, if any - * @param [response] SessionTemplate - */ - type CreateSessionTemplateCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.SessionTemplate) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.SessionTemplateController|updateSessionTemplate}. - * @param error Error, if any - * @param [response] SessionTemplate - */ - type UpdateSessionTemplateCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.SessionTemplate) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.SessionTemplateController|getSessionTemplate}. - * @param error Error, if any - * @param [response] SessionTemplate - */ - type GetSessionTemplateCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.SessionTemplate) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.SessionTemplateController|listSessionTemplates}. - * @param error Error, if any - * @param [response] ListSessionTemplatesResponse - */ - type ListSessionTemplatesCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.ListSessionTemplatesResponse) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.SessionTemplateController|deleteSessionTemplate}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteSessionTemplateCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - } - - /** Properties of a CreateSessionTemplateRequest. */ - interface ICreateSessionTemplateRequest { - - /** CreateSessionTemplateRequest parent */ - parent?: (string|null); - - /** CreateSessionTemplateRequest sessionTemplate */ - sessionTemplate?: (google.cloud.dataproc.v1.ISessionTemplate|null); - } - - /** Represents a CreateSessionTemplateRequest. */ - class CreateSessionTemplateRequest implements ICreateSessionTemplateRequest { - - /** - * Constructs a new CreateSessionTemplateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.ICreateSessionTemplateRequest); - - /** CreateSessionTemplateRequest parent. */ - public parent: string; - - /** CreateSessionTemplateRequest sessionTemplate. */ - public sessionTemplate?: (google.cloud.dataproc.v1.ISessionTemplate|null); - - /** - * Creates a new CreateSessionTemplateRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateSessionTemplateRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.ICreateSessionTemplateRequest): google.cloud.dataproc.v1.CreateSessionTemplateRequest; - - /** - * Encodes the specified CreateSessionTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.CreateSessionTemplateRequest.verify|verify} messages. - * @param message CreateSessionTemplateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.ICreateSessionTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateSessionTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.CreateSessionTemplateRequest.verify|verify} messages. - * @param message CreateSessionTemplateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.ICreateSessionTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateSessionTemplateRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateSessionTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.CreateSessionTemplateRequest; - - /** - * Decodes a CreateSessionTemplateRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateSessionTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.CreateSessionTemplateRequest; - - /** - * Verifies a CreateSessionTemplateRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateSessionTemplateRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateSessionTemplateRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.CreateSessionTemplateRequest; - - /** - * Creates a plain object from a CreateSessionTemplateRequest message. Also converts values to other types if specified. - * @param message CreateSessionTemplateRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.CreateSessionTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateSessionTemplateRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateSessionTemplateRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateSessionTemplateRequest. */ - interface IUpdateSessionTemplateRequest { - - /** UpdateSessionTemplateRequest sessionTemplate */ - sessionTemplate?: (google.cloud.dataproc.v1.ISessionTemplate|null); - } - - /** Represents an UpdateSessionTemplateRequest. */ - class UpdateSessionTemplateRequest implements IUpdateSessionTemplateRequest { - - /** - * Constructs a new UpdateSessionTemplateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IUpdateSessionTemplateRequest); - - /** UpdateSessionTemplateRequest sessionTemplate. */ - public sessionTemplate?: (google.cloud.dataproc.v1.ISessionTemplate|null); - - /** - * Creates a new UpdateSessionTemplateRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateSessionTemplateRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.IUpdateSessionTemplateRequest): google.cloud.dataproc.v1.UpdateSessionTemplateRequest; - - /** - * Encodes the specified UpdateSessionTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.UpdateSessionTemplateRequest.verify|verify} messages. - * @param message UpdateSessionTemplateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IUpdateSessionTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateSessionTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.UpdateSessionTemplateRequest.verify|verify} messages. - * @param message UpdateSessionTemplateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IUpdateSessionTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateSessionTemplateRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateSessionTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.UpdateSessionTemplateRequest; - - /** - * Decodes an UpdateSessionTemplateRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateSessionTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.UpdateSessionTemplateRequest; - - /** - * Verifies an UpdateSessionTemplateRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateSessionTemplateRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateSessionTemplateRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.UpdateSessionTemplateRequest; - - /** - * Creates a plain object from an UpdateSessionTemplateRequest message. Also converts values to other types if specified. - * @param message UpdateSessionTemplateRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.UpdateSessionTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateSessionTemplateRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateSessionTemplateRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetSessionTemplateRequest. */ - interface IGetSessionTemplateRequest { - - /** GetSessionTemplateRequest name */ - name?: (string|null); - } - - /** Represents a GetSessionTemplateRequest. */ - class GetSessionTemplateRequest implements IGetSessionTemplateRequest { - - /** - * Constructs a new GetSessionTemplateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IGetSessionTemplateRequest); - - /** GetSessionTemplateRequest name. */ - public name: string; - - /** - * Creates a new GetSessionTemplateRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetSessionTemplateRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.IGetSessionTemplateRequest): google.cloud.dataproc.v1.GetSessionTemplateRequest; - - /** - * Encodes the specified GetSessionTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.GetSessionTemplateRequest.verify|verify} messages. - * @param message GetSessionTemplateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IGetSessionTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetSessionTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GetSessionTemplateRequest.verify|verify} messages. - * @param message GetSessionTemplateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IGetSessionTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetSessionTemplateRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetSessionTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.GetSessionTemplateRequest; - - /** - * Decodes a GetSessionTemplateRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetSessionTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.GetSessionTemplateRequest; - - /** - * Verifies a GetSessionTemplateRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetSessionTemplateRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetSessionTemplateRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.GetSessionTemplateRequest; - - /** - * Creates a plain object from a GetSessionTemplateRequest message. Also converts values to other types if specified. - * @param message GetSessionTemplateRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.GetSessionTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetSessionTemplateRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetSessionTemplateRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListSessionTemplatesRequest. */ - interface IListSessionTemplatesRequest { - - /** ListSessionTemplatesRequest parent */ - parent?: (string|null); - - /** ListSessionTemplatesRequest pageSize */ - pageSize?: (number|null); - - /** ListSessionTemplatesRequest pageToken */ - pageToken?: (string|null); - - /** ListSessionTemplatesRequest filter */ - filter?: (string|null); - } - - /** Represents a ListSessionTemplatesRequest. */ - class ListSessionTemplatesRequest implements IListSessionTemplatesRequest { - - /** - * Constructs a new ListSessionTemplatesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IListSessionTemplatesRequest); - - /** ListSessionTemplatesRequest parent. */ - public parent: string; - - /** ListSessionTemplatesRequest pageSize. */ - public pageSize: number; - - /** ListSessionTemplatesRequest pageToken. */ - public pageToken: string; - - /** ListSessionTemplatesRequest filter. */ - public filter: string; - - /** - * Creates a new ListSessionTemplatesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSessionTemplatesRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.IListSessionTemplatesRequest): google.cloud.dataproc.v1.ListSessionTemplatesRequest; - - /** - * Encodes the specified ListSessionTemplatesRequest message. Does not implicitly {@link google.cloud.dataproc.v1.ListSessionTemplatesRequest.verify|verify} messages. - * @param message ListSessionTemplatesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IListSessionTemplatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSessionTemplatesRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListSessionTemplatesRequest.verify|verify} messages. - * @param message ListSessionTemplatesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IListSessionTemplatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListSessionTemplatesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSessionTemplatesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ListSessionTemplatesRequest; - - /** - * Decodes a ListSessionTemplatesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSessionTemplatesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ListSessionTemplatesRequest; - - /** - * Verifies a ListSessionTemplatesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListSessionTemplatesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSessionTemplatesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ListSessionTemplatesRequest; - - /** - * Creates a plain object from a ListSessionTemplatesRequest message. Also converts values to other types if specified. - * @param message ListSessionTemplatesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.ListSessionTemplatesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSessionTemplatesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListSessionTemplatesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListSessionTemplatesResponse. */ - interface IListSessionTemplatesResponse { - - /** ListSessionTemplatesResponse sessionTemplates */ - sessionTemplates?: (google.cloud.dataproc.v1.ISessionTemplate[]|null); - - /** ListSessionTemplatesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListSessionTemplatesResponse. */ - class ListSessionTemplatesResponse implements IListSessionTemplatesResponse { - - /** - * Constructs a new ListSessionTemplatesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IListSessionTemplatesResponse); - - /** ListSessionTemplatesResponse sessionTemplates. */ - public sessionTemplates: google.cloud.dataproc.v1.ISessionTemplate[]; - - /** ListSessionTemplatesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListSessionTemplatesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSessionTemplatesResponse instance - */ - public static create(properties?: google.cloud.dataproc.v1.IListSessionTemplatesResponse): google.cloud.dataproc.v1.ListSessionTemplatesResponse; - - /** - * Encodes the specified ListSessionTemplatesResponse message. Does not implicitly {@link google.cloud.dataproc.v1.ListSessionTemplatesResponse.verify|verify} messages. - * @param message ListSessionTemplatesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IListSessionTemplatesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSessionTemplatesResponse message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListSessionTemplatesResponse.verify|verify} messages. - * @param message ListSessionTemplatesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IListSessionTemplatesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListSessionTemplatesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSessionTemplatesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ListSessionTemplatesResponse; - - /** - * Decodes a ListSessionTemplatesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSessionTemplatesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ListSessionTemplatesResponse; - - /** - * Verifies a ListSessionTemplatesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListSessionTemplatesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSessionTemplatesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ListSessionTemplatesResponse; - - /** - * Creates a plain object from a ListSessionTemplatesResponse message. Also converts values to other types if specified. - * @param message ListSessionTemplatesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.ListSessionTemplatesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSessionTemplatesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListSessionTemplatesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteSessionTemplateRequest. */ - interface IDeleteSessionTemplateRequest { - - /** DeleteSessionTemplateRequest name */ - name?: (string|null); - } - - /** Represents a DeleteSessionTemplateRequest. */ - class DeleteSessionTemplateRequest implements IDeleteSessionTemplateRequest { - - /** - * Constructs a new DeleteSessionTemplateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IDeleteSessionTemplateRequest); - - /** DeleteSessionTemplateRequest name. */ - public name: string; - - /** - * Creates a new DeleteSessionTemplateRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteSessionTemplateRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.IDeleteSessionTemplateRequest): google.cloud.dataproc.v1.DeleteSessionTemplateRequest; - - /** - * Encodes the specified DeleteSessionTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.DeleteSessionTemplateRequest.verify|verify} messages. - * @param message DeleteSessionTemplateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IDeleteSessionTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteSessionTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DeleteSessionTemplateRequest.verify|verify} messages. - * @param message DeleteSessionTemplateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IDeleteSessionTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteSessionTemplateRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteSessionTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.DeleteSessionTemplateRequest; - - /** - * Decodes a DeleteSessionTemplateRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteSessionTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.DeleteSessionTemplateRequest; - - /** - * Verifies a DeleteSessionTemplateRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteSessionTemplateRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteSessionTemplateRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.DeleteSessionTemplateRequest; - - /** - * Creates a plain object from a DeleteSessionTemplateRequest message. Also converts values to other types if specified. - * @param message DeleteSessionTemplateRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.DeleteSessionTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteSessionTemplateRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteSessionTemplateRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a SessionTemplate. */ - interface ISessionTemplate { - - /** SessionTemplate name */ - name?: (string|null); - - /** SessionTemplate description */ - description?: (string|null); - - /** SessionTemplate createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** SessionTemplate jupyterSession */ - jupyterSession?: (google.cloud.dataproc.v1.IJupyterConfig|null); - - /** SessionTemplate sparkConnectSession */ - sparkConnectSession?: (google.cloud.dataproc.v1.ISparkConnectConfig|null); - - /** SessionTemplate creator */ - creator?: (string|null); - - /** SessionTemplate labels */ - labels?: ({ [k: string]: string }|null); - - /** SessionTemplate runtimeConfig */ - runtimeConfig?: (google.cloud.dataproc.v1.IRuntimeConfig|null); - - /** SessionTemplate environmentConfig */ - environmentConfig?: (google.cloud.dataproc.v1.IEnvironmentConfig|null); - - /** SessionTemplate updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** SessionTemplate uuid */ - uuid?: (string|null); - } - - /** Represents a SessionTemplate. */ - class SessionTemplate implements ISessionTemplate { - - /** - * Constructs a new SessionTemplate. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.ISessionTemplate); - - /** SessionTemplate name. */ - public name: string; - - /** SessionTemplate description. */ - public description: string; - - /** SessionTemplate createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** SessionTemplate jupyterSession. */ - public jupyterSession?: (google.cloud.dataproc.v1.IJupyterConfig|null); - - /** SessionTemplate sparkConnectSession. */ - public sparkConnectSession?: (google.cloud.dataproc.v1.ISparkConnectConfig|null); - - /** SessionTemplate creator. */ - public creator: string; - - /** SessionTemplate labels. */ - public labels: { [k: string]: string }; - - /** SessionTemplate runtimeConfig. */ - public runtimeConfig?: (google.cloud.dataproc.v1.IRuntimeConfig|null); - - /** SessionTemplate environmentConfig. */ - public environmentConfig?: (google.cloud.dataproc.v1.IEnvironmentConfig|null); - - /** SessionTemplate updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** SessionTemplate uuid. */ - public uuid: string; - - /** SessionTemplate sessionConfig. */ - public sessionConfig?: ("jupyterSession"|"sparkConnectSession"); - - /** - * Creates a new SessionTemplate instance using the specified properties. - * @param [properties] Properties to set - * @returns SessionTemplate instance - */ - public static create(properties?: google.cloud.dataproc.v1.ISessionTemplate): google.cloud.dataproc.v1.SessionTemplate; - - /** - * Encodes the specified SessionTemplate message. Does not implicitly {@link google.cloud.dataproc.v1.SessionTemplate.verify|verify} messages. - * @param message SessionTemplate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.ISessionTemplate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SessionTemplate message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SessionTemplate.verify|verify} messages. - * @param message SessionTemplate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.ISessionTemplate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SessionTemplate message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SessionTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.SessionTemplate; - - /** - * Decodes a SessionTemplate message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SessionTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.SessionTemplate; - - /** - * Verifies a SessionTemplate message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SessionTemplate message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SessionTemplate - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.SessionTemplate; - - /** - * Creates a plain object from a SessionTemplate message. Also converts values to other types if specified. - * @param message SessionTemplate - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.SessionTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SessionTemplate to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SessionTemplate - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a SessionController */ - class SessionController extends $protobuf.rpc.Service { - - /** - * Constructs a new SessionController 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 SessionController 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): SessionController; - - /** - * Calls CreateSession. - * @param request CreateSessionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createSession(request: google.cloud.dataproc.v1.ICreateSessionRequest, callback: google.cloud.dataproc.v1.SessionController.CreateSessionCallback): void; - - /** - * Calls CreateSession. - * @param request CreateSessionRequest message or plain object - * @returns Promise - */ - public createSession(request: google.cloud.dataproc.v1.ICreateSessionRequest): Promise; - - /** - * Calls GetSession. - * @param request GetSessionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Session - */ - public getSession(request: google.cloud.dataproc.v1.IGetSessionRequest, callback: google.cloud.dataproc.v1.SessionController.GetSessionCallback): void; - - /** - * Calls GetSession. - * @param request GetSessionRequest message or plain object - * @returns Promise - */ - public getSession(request: google.cloud.dataproc.v1.IGetSessionRequest): Promise; - - /** - * Calls ListSessions. - * @param request ListSessionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListSessionsResponse - */ - public listSessions(request: google.cloud.dataproc.v1.IListSessionsRequest, callback: google.cloud.dataproc.v1.SessionController.ListSessionsCallback): void; - - /** - * Calls ListSessions. - * @param request ListSessionsRequest message or plain object - * @returns Promise - */ - public listSessions(request: google.cloud.dataproc.v1.IListSessionsRequest): Promise; - - /** - * Calls TerminateSession. - * @param request TerminateSessionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public terminateSession(request: google.cloud.dataproc.v1.ITerminateSessionRequest, callback: google.cloud.dataproc.v1.SessionController.TerminateSessionCallback): void; - - /** - * Calls TerminateSession. - * @param request TerminateSessionRequest message or plain object - * @returns Promise - */ - public terminateSession(request: google.cloud.dataproc.v1.ITerminateSessionRequest): Promise; - - /** - * Calls DeleteSession. - * @param request DeleteSessionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteSession(request: google.cloud.dataproc.v1.IDeleteSessionRequest, callback: google.cloud.dataproc.v1.SessionController.DeleteSessionCallback): void; - - /** - * Calls DeleteSession. - * @param request DeleteSessionRequest message or plain object - * @returns Promise - */ - public deleteSession(request: google.cloud.dataproc.v1.IDeleteSessionRequest): Promise; - } - - namespace SessionController { - - /** - * Callback as used by {@link google.cloud.dataproc.v1.SessionController|createSession}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateSessionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.SessionController|getSession}. - * @param error Error, if any - * @param [response] Session - */ - type GetSessionCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.Session) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.SessionController|listSessions}. - * @param error Error, if any - * @param [response] ListSessionsResponse - */ - type ListSessionsCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.ListSessionsResponse) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.SessionController|terminateSession}. - * @param error Error, if any - * @param [response] Operation - */ - type TerminateSessionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.SessionController|deleteSession}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteSessionCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of a CreateSessionRequest. */ - interface ICreateSessionRequest { - - /** CreateSessionRequest parent */ - parent?: (string|null); - - /** CreateSessionRequest session */ - session?: (google.cloud.dataproc.v1.ISession|null); - - /** CreateSessionRequest sessionId */ - sessionId?: (string|null); - - /** CreateSessionRequest requestId */ - requestId?: (string|null); - } - - /** Represents a CreateSessionRequest. */ - class CreateSessionRequest implements ICreateSessionRequest { - - /** - * Constructs a new CreateSessionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.ICreateSessionRequest); - - /** CreateSessionRequest parent. */ - public parent: string; - - /** CreateSessionRequest session. */ - public session?: (google.cloud.dataproc.v1.ISession|null); - - /** CreateSessionRequest sessionId. */ - public sessionId: string; - - /** CreateSessionRequest requestId. */ - public requestId: string; - - /** - * Creates a new CreateSessionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateSessionRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.ICreateSessionRequest): google.cloud.dataproc.v1.CreateSessionRequest; - - /** - * Encodes the specified CreateSessionRequest message. Does not implicitly {@link google.cloud.dataproc.v1.CreateSessionRequest.verify|verify} messages. - * @param message CreateSessionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.ICreateSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateSessionRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.CreateSessionRequest.verify|verify} messages. - * @param message CreateSessionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.ICreateSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateSessionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.CreateSessionRequest; - - /** - * Decodes a CreateSessionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.CreateSessionRequest; - - /** - * Verifies a CreateSessionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateSessionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateSessionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.CreateSessionRequest; - - /** - * Creates a plain object from a CreateSessionRequest message. Also converts values to other types if specified. - * @param message CreateSessionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.CreateSessionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateSessionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateSessionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetSessionRequest. */ - interface IGetSessionRequest { - - /** GetSessionRequest name */ - name?: (string|null); - } - - /** Represents a GetSessionRequest. */ - class GetSessionRequest implements IGetSessionRequest { - - /** - * Constructs a new GetSessionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IGetSessionRequest); - - /** GetSessionRequest name. */ - public name: string; - - /** - * Creates a new GetSessionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetSessionRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.IGetSessionRequest): google.cloud.dataproc.v1.GetSessionRequest; - - /** - * Encodes the specified GetSessionRequest message. Does not implicitly {@link google.cloud.dataproc.v1.GetSessionRequest.verify|verify} messages. - * @param message GetSessionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IGetSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetSessionRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GetSessionRequest.verify|verify} messages. - * @param message GetSessionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IGetSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetSessionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.GetSessionRequest; - - /** - * Decodes a GetSessionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.GetSessionRequest; - - /** - * Verifies a GetSessionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetSessionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetSessionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.GetSessionRequest; - - /** - * Creates a plain object from a GetSessionRequest message. Also converts values to other types if specified. - * @param message GetSessionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.GetSessionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetSessionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetSessionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListSessionsRequest. */ - interface IListSessionsRequest { - - /** ListSessionsRequest parent */ - parent?: (string|null); - - /** ListSessionsRequest pageSize */ - pageSize?: (number|null); - - /** ListSessionsRequest pageToken */ - pageToken?: (string|null); - - /** ListSessionsRequest filter */ - filter?: (string|null); - } - - /** Represents a ListSessionsRequest. */ - class ListSessionsRequest implements IListSessionsRequest { - - /** - * Constructs a new ListSessionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IListSessionsRequest); - - /** ListSessionsRequest parent. */ - public parent: string; - - /** ListSessionsRequest pageSize. */ - public pageSize: number; - - /** ListSessionsRequest pageToken. */ - public pageToken: string; - - /** ListSessionsRequest filter. */ - public filter: string; - - /** - * Creates a new ListSessionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSessionsRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.IListSessionsRequest): google.cloud.dataproc.v1.ListSessionsRequest; - - /** - * Encodes the specified ListSessionsRequest message. Does not implicitly {@link google.cloud.dataproc.v1.ListSessionsRequest.verify|verify} messages. - * @param message ListSessionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IListSessionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSessionsRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListSessionsRequest.verify|verify} messages. - * @param message ListSessionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IListSessionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListSessionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSessionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ListSessionsRequest; - - /** - * Decodes a ListSessionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSessionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ListSessionsRequest; - - /** - * Verifies a ListSessionsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListSessionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSessionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ListSessionsRequest; - - /** - * Creates a plain object from a ListSessionsRequest message. Also converts values to other types if specified. - * @param message ListSessionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.ListSessionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSessionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListSessionsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListSessionsResponse. */ - interface IListSessionsResponse { - - /** ListSessionsResponse sessions */ - sessions?: (google.cloud.dataproc.v1.ISession[]|null); - - /** ListSessionsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListSessionsResponse. */ - class ListSessionsResponse implements IListSessionsResponse { - - /** - * Constructs a new ListSessionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IListSessionsResponse); - - /** ListSessionsResponse sessions. */ - public sessions: google.cloud.dataproc.v1.ISession[]; - - /** ListSessionsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListSessionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSessionsResponse instance - */ - public static create(properties?: google.cloud.dataproc.v1.IListSessionsResponse): google.cloud.dataproc.v1.ListSessionsResponse; - - /** - * Encodes the specified ListSessionsResponse message. Does not implicitly {@link google.cloud.dataproc.v1.ListSessionsResponse.verify|verify} messages. - * @param message ListSessionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IListSessionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListSessionsResponse message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListSessionsResponse.verify|verify} messages. - * @param message ListSessionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IListSessionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListSessionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSessionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ListSessionsResponse; - - /** - * Decodes a ListSessionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSessionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ListSessionsResponse; - - /** - * Verifies a ListSessionsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListSessionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSessionsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ListSessionsResponse; - - /** - * Creates a plain object from a ListSessionsResponse message. Also converts values to other types if specified. - * @param message ListSessionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.ListSessionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListSessionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListSessionsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TerminateSessionRequest. */ - interface ITerminateSessionRequest { - - /** TerminateSessionRequest name */ - name?: (string|null); - - /** TerminateSessionRequest requestId */ - requestId?: (string|null); - } - - /** Represents a TerminateSessionRequest. */ - class TerminateSessionRequest implements ITerminateSessionRequest { - - /** - * Constructs a new TerminateSessionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.ITerminateSessionRequest); - - /** TerminateSessionRequest name. */ - public name: string; - - /** TerminateSessionRequest requestId. */ - public requestId: string; - - /** - * Creates a new TerminateSessionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns TerminateSessionRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.ITerminateSessionRequest): google.cloud.dataproc.v1.TerminateSessionRequest; - - /** - * Encodes the specified TerminateSessionRequest message. Does not implicitly {@link google.cloud.dataproc.v1.TerminateSessionRequest.verify|verify} messages. - * @param message TerminateSessionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.ITerminateSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TerminateSessionRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.TerminateSessionRequest.verify|verify} messages. - * @param message TerminateSessionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.ITerminateSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TerminateSessionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TerminateSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.TerminateSessionRequest; - - /** - * Decodes a TerminateSessionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TerminateSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.TerminateSessionRequest; - - /** - * Verifies a TerminateSessionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TerminateSessionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TerminateSessionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.TerminateSessionRequest; - - /** - * Creates a plain object from a TerminateSessionRequest message. Also converts values to other types if specified. - * @param message TerminateSessionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.TerminateSessionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TerminateSessionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TerminateSessionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteSessionRequest. */ - interface IDeleteSessionRequest { - - /** DeleteSessionRequest name */ - name?: (string|null); - - /** DeleteSessionRequest requestId */ - requestId?: (string|null); - } - - /** Represents a DeleteSessionRequest. */ - class DeleteSessionRequest implements IDeleteSessionRequest { - - /** - * Constructs a new DeleteSessionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IDeleteSessionRequest); - - /** DeleteSessionRequest name. */ - public name: string; - - /** DeleteSessionRequest requestId. */ - public requestId: string; - - /** - * Creates a new DeleteSessionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteSessionRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.IDeleteSessionRequest): google.cloud.dataproc.v1.DeleteSessionRequest; - - /** - * Encodes the specified DeleteSessionRequest message. Does not implicitly {@link google.cloud.dataproc.v1.DeleteSessionRequest.verify|verify} messages. - * @param message DeleteSessionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IDeleteSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteSessionRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DeleteSessionRequest.verify|verify} messages. - * @param message DeleteSessionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IDeleteSessionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteSessionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.DeleteSessionRequest; - - /** - * Decodes a DeleteSessionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.DeleteSessionRequest; - - /** - * Verifies a DeleteSessionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteSessionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteSessionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.DeleteSessionRequest; - - /** - * Creates a plain object from a DeleteSessionRequest message. Also converts values to other types if specified. - * @param message DeleteSessionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.DeleteSessionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteSessionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteSessionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Session. */ - interface ISession { - - /** Session name */ - name?: (string|null); - - /** Session uuid */ - uuid?: (string|null); - - /** Session createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Session jupyterSession */ - jupyterSession?: (google.cloud.dataproc.v1.IJupyterConfig|null); - - /** Session sparkConnectSession */ - sparkConnectSession?: (google.cloud.dataproc.v1.ISparkConnectConfig|null); - - /** Session runtimeInfo */ - runtimeInfo?: (google.cloud.dataproc.v1.IRuntimeInfo|null); - - /** Session state */ - state?: (google.cloud.dataproc.v1.Session.State|keyof typeof google.cloud.dataproc.v1.Session.State|null); - - /** Session stateMessage */ - stateMessage?: (string|null); - - /** Session stateTime */ - stateTime?: (google.protobuf.ITimestamp|null); - - /** Session creator */ - creator?: (string|null); - - /** Session labels */ - labels?: ({ [k: string]: string }|null); - - /** Session runtimeConfig */ - runtimeConfig?: (google.cloud.dataproc.v1.IRuntimeConfig|null); - - /** Session environmentConfig */ - environmentConfig?: (google.cloud.dataproc.v1.IEnvironmentConfig|null); - - /** Session user */ - user?: (string|null); - - /** Session stateHistory */ - stateHistory?: (google.cloud.dataproc.v1.Session.ISessionStateHistory[]|null); - - /** Session sessionTemplate */ - sessionTemplate?: (string|null); - } - - /** Represents a Session. */ - class Session implements ISession { - - /** - * Constructs a new Session. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.ISession); - - /** Session name. */ - public name: string; - - /** Session uuid. */ - public uuid: string; - - /** Session createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Session jupyterSession. */ - public jupyterSession?: (google.cloud.dataproc.v1.IJupyterConfig|null); - - /** Session sparkConnectSession. */ - public sparkConnectSession?: (google.cloud.dataproc.v1.ISparkConnectConfig|null); - - /** Session runtimeInfo. */ - public runtimeInfo?: (google.cloud.dataproc.v1.IRuntimeInfo|null); - - /** Session state. */ - public state: (google.cloud.dataproc.v1.Session.State|keyof typeof google.cloud.dataproc.v1.Session.State); - - /** Session stateMessage. */ - public stateMessage: string; - - /** Session stateTime. */ - public stateTime?: (google.protobuf.ITimestamp|null); - - /** Session creator. */ - public creator: string; - - /** Session labels. */ - public labels: { [k: string]: string }; - - /** Session runtimeConfig. */ - public runtimeConfig?: (google.cloud.dataproc.v1.IRuntimeConfig|null); - - /** Session environmentConfig. */ - public environmentConfig?: (google.cloud.dataproc.v1.IEnvironmentConfig|null); - - /** Session user. */ - public user: string; - - /** Session stateHistory. */ - public stateHistory: google.cloud.dataproc.v1.Session.ISessionStateHistory[]; - - /** Session sessionTemplate. */ - public sessionTemplate: string; - - /** Session sessionConfig. */ - public sessionConfig?: ("jupyterSession"|"sparkConnectSession"); - - /** - * Creates a new Session instance using the specified properties. - * @param [properties] Properties to set - * @returns Session instance - */ - public static create(properties?: google.cloud.dataproc.v1.ISession): google.cloud.dataproc.v1.Session; - - /** - * Encodes the specified Session message. Does not implicitly {@link google.cloud.dataproc.v1.Session.verify|verify} messages. - * @param message Session message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.ISession, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Session message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.Session.verify|verify} messages. - * @param message Session message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.ISession, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Session message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Session - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.Session; - - /** - * Decodes a Session message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Session - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.Session; - - /** - * Verifies a Session message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Session message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Session - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.Session; - - /** - * Creates a plain object from a Session message. Also converts values to other types if specified. - * @param message Session - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.Session, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Session to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Session - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Session { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - CREATING = 1, - ACTIVE = 2, - TERMINATING = 3, - TERMINATED = 4, - FAILED = 5 - } - - /** Properties of a SessionStateHistory. */ - interface ISessionStateHistory { - - /** SessionStateHistory state */ - state?: (google.cloud.dataproc.v1.Session.State|keyof typeof google.cloud.dataproc.v1.Session.State|null); - - /** SessionStateHistory stateMessage */ - stateMessage?: (string|null); - - /** SessionStateHistory stateStartTime */ - stateStartTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a SessionStateHistory. */ - class SessionStateHistory implements ISessionStateHistory { - - /** - * Constructs a new SessionStateHistory. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.Session.ISessionStateHistory); - - /** SessionStateHistory state. */ - public state: (google.cloud.dataproc.v1.Session.State|keyof typeof google.cloud.dataproc.v1.Session.State); - - /** SessionStateHistory stateMessage. */ - public stateMessage: string; - - /** SessionStateHistory stateStartTime. */ - public stateStartTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new SessionStateHistory instance using the specified properties. - * @param [properties] Properties to set - * @returns SessionStateHistory instance - */ - public static create(properties?: google.cloud.dataproc.v1.Session.ISessionStateHistory): google.cloud.dataproc.v1.Session.SessionStateHistory; - - /** - * Encodes the specified SessionStateHistory message. Does not implicitly {@link google.cloud.dataproc.v1.Session.SessionStateHistory.verify|verify} messages. - * @param message SessionStateHistory message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.Session.ISessionStateHistory, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SessionStateHistory message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.Session.SessionStateHistory.verify|verify} messages. - * @param message SessionStateHistory message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.Session.ISessionStateHistory, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SessionStateHistory message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SessionStateHistory - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.Session.SessionStateHistory; - - /** - * Decodes a SessionStateHistory message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SessionStateHistory - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.Session.SessionStateHistory; - - /** - * Verifies a SessionStateHistory message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SessionStateHistory message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SessionStateHistory - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.Session.SessionStateHistory; - - /** - * Creates a plain object from a SessionStateHistory message. Also converts values to other types if specified. - * @param message SessionStateHistory - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.Session.SessionStateHistory, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SessionStateHistory to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SessionStateHistory - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a JupyterConfig. */ - interface IJupyterConfig { - - /** JupyterConfig kernel */ - kernel?: (google.cloud.dataproc.v1.JupyterConfig.Kernel|keyof typeof google.cloud.dataproc.v1.JupyterConfig.Kernel|null); - - /** JupyterConfig displayName */ - displayName?: (string|null); - } - - /** Represents a JupyterConfig. */ - class JupyterConfig implements IJupyterConfig { - - /** - * Constructs a new JupyterConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IJupyterConfig); - - /** JupyterConfig kernel. */ - public kernel: (google.cloud.dataproc.v1.JupyterConfig.Kernel|keyof typeof google.cloud.dataproc.v1.JupyterConfig.Kernel); - - /** JupyterConfig displayName. */ - public displayName: string; - - /** - * Creates a new JupyterConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns JupyterConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.IJupyterConfig): google.cloud.dataproc.v1.JupyterConfig; - - /** - * Encodes the specified JupyterConfig message. Does not implicitly {@link google.cloud.dataproc.v1.JupyterConfig.verify|verify} messages. - * @param message JupyterConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IJupyterConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified JupyterConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.JupyterConfig.verify|verify} messages. - * @param message JupyterConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IJupyterConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a JupyterConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns JupyterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.JupyterConfig; - - /** - * Decodes a JupyterConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns JupyterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.JupyterConfig; - - /** - * Verifies a JupyterConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a JupyterConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns JupyterConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.JupyterConfig; - - /** - * Creates a plain object from a JupyterConfig message. Also converts values to other types if specified. - * @param message JupyterConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.JupyterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this JupyterConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for JupyterConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace JupyterConfig { - - /** Kernel enum. */ - enum Kernel { - KERNEL_UNSPECIFIED = 0, - PYTHON = 1, - SCALA = 2 - } - } - - /** Properties of a SparkConnectConfig. */ - interface ISparkConnectConfig { - } - - /** Represents a SparkConnectConfig. */ - class SparkConnectConfig implements ISparkConnectConfig { - - /** - * Constructs a new SparkConnectConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.ISparkConnectConfig); - - /** - * Creates a new SparkConnectConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns SparkConnectConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.ISparkConnectConfig): google.cloud.dataproc.v1.SparkConnectConfig; - - /** - * Encodes the specified SparkConnectConfig message. Does not implicitly {@link google.cloud.dataproc.v1.SparkConnectConfig.verify|verify} messages. - * @param message SparkConnectConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.ISparkConnectConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SparkConnectConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SparkConnectConfig.verify|verify} messages. - * @param message SparkConnectConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.ISparkConnectConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SparkConnectConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SparkConnectConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.SparkConnectConfig; - - /** - * Decodes a SparkConnectConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SparkConnectConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.SparkConnectConfig; - - /** - * Verifies a SparkConnectConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SparkConnectConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SparkConnectConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.SparkConnectConfig; - - /** - * Creates a plain object from a SparkConnectConfig message. Also converts values to other types if specified. - * @param message SparkConnectConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.SparkConnectConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SparkConnectConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SparkConnectConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a WorkflowTemplateService */ - class WorkflowTemplateService extends $protobuf.rpc.Service { - - /** - * Constructs a new WorkflowTemplateService 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 WorkflowTemplateService 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): WorkflowTemplateService; - - /** - * Calls CreateWorkflowTemplate. - * @param request CreateWorkflowTemplateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and WorkflowTemplate - */ - public createWorkflowTemplate(request: google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest, callback: google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplateCallback): void; - - /** - * Calls CreateWorkflowTemplate. - * @param request CreateWorkflowTemplateRequest message or plain object - * @returns Promise - */ - public createWorkflowTemplate(request: google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest): Promise; - - /** - * Calls GetWorkflowTemplate. - * @param request GetWorkflowTemplateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and WorkflowTemplate - */ - public getWorkflowTemplate(request: google.cloud.dataproc.v1.IGetWorkflowTemplateRequest, callback: google.cloud.dataproc.v1.WorkflowTemplateService.GetWorkflowTemplateCallback): void; - - /** - * Calls GetWorkflowTemplate. - * @param request GetWorkflowTemplateRequest message or plain object - * @returns Promise - */ - public getWorkflowTemplate(request: google.cloud.dataproc.v1.IGetWorkflowTemplateRequest): Promise; - - /** - * Calls InstantiateWorkflowTemplate. - * @param request InstantiateWorkflowTemplateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public instantiateWorkflowTemplate(request: google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest, callback: google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplateCallback): void; - - /** - * Calls InstantiateWorkflowTemplate. - * @param request InstantiateWorkflowTemplateRequest message or plain object - * @returns Promise - */ - public instantiateWorkflowTemplate(request: google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest): Promise; - - /** - * Calls InstantiateInlineWorkflowTemplate. - * @param request InstantiateInlineWorkflowTemplateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public instantiateInlineWorkflowTemplate(request: google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest, callback: google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateInlineWorkflowTemplateCallback): void; - - /** - * Calls InstantiateInlineWorkflowTemplate. - * @param request InstantiateInlineWorkflowTemplateRequest message or plain object - * @returns Promise - */ - public instantiateInlineWorkflowTemplate(request: google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest): Promise; - - /** - * Calls UpdateWorkflowTemplate. - * @param request UpdateWorkflowTemplateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and WorkflowTemplate - */ - public updateWorkflowTemplate(request: google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest, callback: google.cloud.dataproc.v1.WorkflowTemplateService.UpdateWorkflowTemplateCallback): void; - - /** - * Calls UpdateWorkflowTemplate. - * @param request UpdateWorkflowTemplateRequest message or plain object - * @returns Promise - */ - public updateWorkflowTemplate(request: google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest): Promise; - - /** - * Calls ListWorkflowTemplates. - * @param request ListWorkflowTemplatesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListWorkflowTemplatesResponse - */ - public listWorkflowTemplates(request: google.cloud.dataproc.v1.IListWorkflowTemplatesRequest, callback: google.cloud.dataproc.v1.WorkflowTemplateService.ListWorkflowTemplatesCallback): void; - - /** - * Calls ListWorkflowTemplates. - * @param request ListWorkflowTemplatesRequest message or plain object - * @returns Promise - */ - public listWorkflowTemplates(request: google.cloud.dataproc.v1.IListWorkflowTemplatesRequest): Promise; - - /** - * Calls DeleteWorkflowTemplate. - * @param request DeleteWorkflowTemplateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteWorkflowTemplate(request: google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest, callback: google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplateCallback): void; - - /** - * Calls DeleteWorkflowTemplate. - * @param request DeleteWorkflowTemplateRequest message or plain object - * @returns Promise - */ - public deleteWorkflowTemplate(request: google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest): Promise; - } - - namespace WorkflowTemplateService { - - /** - * Callback as used by {@link google.cloud.dataproc.v1.WorkflowTemplateService|createWorkflowTemplate}. - * @param error Error, if any - * @param [response] WorkflowTemplate - */ - type CreateWorkflowTemplateCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.WorkflowTemplate) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.WorkflowTemplateService|getWorkflowTemplate}. - * @param error Error, if any - * @param [response] WorkflowTemplate - */ - type GetWorkflowTemplateCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.WorkflowTemplate) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.WorkflowTemplateService|instantiateWorkflowTemplate}. - * @param error Error, if any - * @param [response] Operation - */ - type InstantiateWorkflowTemplateCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.WorkflowTemplateService|instantiateInlineWorkflowTemplate}. - * @param error Error, if any - * @param [response] Operation - */ - type InstantiateInlineWorkflowTemplateCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.WorkflowTemplateService|updateWorkflowTemplate}. - * @param error Error, if any - * @param [response] WorkflowTemplate - */ - type UpdateWorkflowTemplateCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.WorkflowTemplate) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.WorkflowTemplateService|listWorkflowTemplates}. - * @param error Error, if any - * @param [response] ListWorkflowTemplatesResponse - */ - type ListWorkflowTemplatesCallback = (error: (Error|null), response?: google.cloud.dataproc.v1.ListWorkflowTemplatesResponse) => void; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.WorkflowTemplateService|deleteWorkflowTemplate}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteWorkflowTemplateCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - } - - /** Properties of a WorkflowTemplate. */ - interface IWorkflowTemplate { - - /** WorkflowTemplate id */ - id?: (string|null); - - /** WorkflowTemplate name */ - name?: (string|null); - - /** WorkflowTemplate version */ - version?: (number|null); - - /** WorkflowTemplate createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** WorkflowTemplate updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** WorkflowTemplate labels */ - labels?: ({ [k: string]: string }|null); - - /** WorkflowTemplate placement */ - placement?: (google.cloud.dataproc.v1.IWorkflowTemplatePlacement|null); - - /** WorkflowTemplate jobs */ - jobs?: (google.cloud.dataproc.v1.IOrderedJob[]|null); - - /** WorkflowTemplate parameters */ - parameters?: (google.cloud.dataproc.v1.ITemplateParameter[]|null); - - /** WorkflowTemplate dagTimeout */ - dagTimeout?: (google.protobuf.IDuration|null); - - /** WorkflowTemplate encryptionConfig */ - encryptionConfig?: (google.cloud.dataproc.v1.WorkflowTemplate.IEncryptionConfig|null); - } - - /** Represents a WorkflowTemplate. */ - class WorkflowTemplate implements IWorkflowTemplate { - - /** - * Constructs a new WorkflowTemplate. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IWorkflowTemplate); - - /** WorkflowTemplate id. */ - public id: string; - - /** WorkflowTemplate name. */ - public name: string; - - /** WorkflowTemplate version. */ - public version: number; - - /** WorkflowTemplate createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** WorkflowTemplate updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** WorkflowTemplate labels. */ - public labels: { [k: string]: string }; - - /** WorkflowTemplate placement. */ - public placement?: (google.cloud.dataproc.v1.IWorkflowTemplatePlacement|null); - - /** WorkflowTemplate jobs. */ - public jobs: google.cloud.dataproc.v1.IOrderedJob[]; - - /** WorkflowTemplate parameters. */ - public parameters: google.cloud.dataproc.v1.ITemplateParameter[]; - - /** WorkflowTemplate dagTimeout. */ - public dagTimeout?: (google.protobuf.IDuration|null); - - /** WorkflowTemplate encryptionConfig. */ - public encryptionConfig?: (google.cloud.dataproc.v1.WorkflowTemplate.IEncryptionConfig|null); - - /** - * Creates a new WorkflowTemplate instance using the specified properties. - * @param [properties] Properties to set - * @returns WorkflowTemplate instance - */ - public static create(properties?: google.cloud.dataproc.v1.IWorkflowTemplate): google.cloud.dataproc.v1.WorkflowTemplate; - - /** - * Encodes the specified WorkflowTemplate message. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowTemplate.verify|verify} messages. - * @param message WorkflowTemplate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IWorkflowTemplate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WorkflowTemplate message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowTemplate.verify|verify} messages. - * @param message WorkflowTemplate message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IWorkflowTemplate, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WorkflowTemplate message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WorkflowTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.WorkflowTemplate; - - /** - * Decodes a WorkflowTemplate message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WorkflowTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.WorkflowTemplate; - - /** - * Verifies a WorkflowTemplate message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WorkflowTemplate message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WorkflowTemplate - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.WorkflowTemplate; - - /** - * Creates a plain object from a WorkflowTemplate message. Also converts values to other types if specified. - * @param message WorkflowTemplate - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.WorkflowTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WorkflowTemplate to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WorkflowTemplate - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace WorkflowTemplate { - - /** Properties of an EncryptionConfig. */ - interface IEncryptionConfig { - - /** EncryptionConfig kmsKey */ - kmsKey?: (string|null); - } - - /** Represents an EncryptionConfig. */ - class EncryptionConfig implements IEncryptionConfig { - - /** - * Constructs a new EncryptionConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.WorkflowTemplate.IEncryptionConfig); - - /** EncryptionConfig kmsKey. */ - public kmsKey: string; - - /** - * Creates a new EncryptionConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns EncryptionConfig instance - */ - public static create(properties?: google.cloud.dataproc.v1.WorkflowTemplate.IEncryptionConfig): google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig; - - /** - * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig.verify|verify} messages. - * @param message EncryptionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.WorkflowTemplate.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig.verify|verify} messages. - * @param message EncryptionConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.WorkflowTemplate.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EncryptionConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig; - - /** - * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig; - - /** - * Verifies an EncryptionConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EncryptionConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig; - - /** - * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. - * @param message EncryptionConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EncryptionConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EncryptionConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a WorkflowTemplatePlacement. */ - interface IWorkflowTemplatePlacement { - - /** WorkflowTemplatePlacement managedCluster */ - managedCluster?: (google.cloud.dataproc.v1.IManagedCluster|null); - - /** WorkflowTemplatePlacement clusterSelector */ - clusterSelector?: (google.cloud.dataproc.v1.IClusterSelector|null); - } - - /** Represents a WorkflowTemplatePlacement. */ - class WorkflowTemplatePlacement implements IWorkflowTemplatePlacement { - - /** - * Constructs a new WorkflowTemplatePlacement. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IWorkflowTemplatePlacement); - - /** WorkflowTemplatePlacement managedCluster. */ - public managedCluster?: (google.cloud.dataproc.v1.IManagedCluster|null); - - /** WorkflowTemplatePlacement clusterSelector. */ - public clusterSelector?: (google.cloud.dataproc.v1.IClusterSelector|null); - - /** WorkflowTemplatePlacement placement. */ - public placement?: ("managedCluster"|"clusterSelector"); - - /** - * Creates a new WorkflowTemplatePlacement instance using the specified properties. - * @param [properties] Properties to set - * @returns WorkflowTemplatePlacement instance - */ - public static create(properties?: google.cloud.dataproc.v1.IWorkflowTemplatePlacement): google.cloud.dataproc.v1.WorkflowTemplatePlacement; - - /** - * Encodes the specified WorkflowTemplatePlacement message. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowTemplatePlacement.verify|verify} messages. - * @param message WorkflowTemplatePlacement message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IWorkflowTemplatePlacement, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WorkflowTemplatePlacement message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowTemplatePlacement.verify|verify} messages. - * @param message WorkflowTemplatePlacement message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IWorkflowTemplatePlacement, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WorkflowTemplatePlacement message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WorkflowTemplatePlacement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.WorkflowTemplatePlacement; - - /** - * Decodes a WorkflowTemplatePlacement message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WorkflowTemplatePlacement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.WorkflowTemplatePlacement; - - /** - * Verifies a WorkflowTemplatePlacement message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WorkflowTemplatePlacement message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WorkflowTemplatePlacement - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.WorkflowTemplatePlacement; - - /** - * Creates a plain object from a WorkflowTemplatePlacement message. Also converts values to other types if specified. - * @param message WorkflowTemplatePlacement - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.WorkflowTemplatePlacement, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WorkflowTemplatePlacement to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WorkflowTemplatePlacement - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ManagedCluster. */ - interface IManagedCluster { - - /** ManagedCluster clusterName */ - clusterName?: (string|null); - - /** ManagedCluster config */ - config?: (google.cloud.dataproc.v1.IClusterConfig|null); - - /** ManagedCluster labels */ - labels?: ({ [k: string]: string }|null); - } - - /** Represents a ManagedCluster. */ - class ManagedCluster implements IManagedCluster { - - /** - * Constructs a new ManagedCluster. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IManagedCluster); - - /** ManagedCluster clusterName. */ - public clusterName: string; - - /** ManagedCluster config. */ - public config?: (google.cloud.dataproc.v1.IClusterConfig|null); - - /** ManagedCluster labels. */ - public labels: { [k: string]: string }; - - /** - * Creates a new ManagedCluster instance using the specified properties. - * @param [properties] Properties to set - * @returns ManagedCluster instance - */ - public static create(properties?: google.cloud.dataproc.v1.IManagedCluster): google.cloud.dataproc.v1.ManagedCluster; - - /** - * Encodes the specified ManagedCluster message. Does not implicitly {@link google.cloud.dataproc.v1.ManagedCluster.verify|verify} messages. - * @param message ManagedCluster message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IManagedCluster, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ManagedCluster message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ManagedCluster.verify|verify} messages. - * @param message ManagedCluster message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IManagedCluster, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ManagedCluster message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ManagedCluster - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ManagedCluster; - - /** - * Decodes a ManagedCluster message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ManagedCluster - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ManagedCluster; - - /** - * Verifies a ManagedCluster message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ManagedCluster message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ManagedCluster - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ManagedCluster; - - /** - * Creates a plain object from a ManagedCluster message. Also converts values to other types if specified. - * @param message ManagedCluster - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.ManagedCluster, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ManagedCluster to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ManagedCluster - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ClusterSelector. */ - interface IClusterSelector { - - /** ClusterSelector zone */ - zone?: (string|null); - - /** ClusterSelector clusterLabels */ - clusterLabels?: ({ [k: string]: string }|null); - } - - /** Represents a ClusterSelector. */ - class ClusterSelector implements IClusterSelector { - - /** - * Constructs a new ClusterSelector. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IClusterSelector); - - /** ClusterSelector zone. */ - public zone: string; - - /** ClusterSelector clusterLabels. */ - public clusterLabels: { [k: string]: string }; - - /** - * Creates a new ClusterSelector instance using the specified properties. - * @param [properties] Properties to set - * @returns ClusterSelector instance - */ - public static create(properties?: google.cloud.dataproc.v1.IClusterSelector): google.cloud.dataproc.v1.ClusterSelector; - - /** - * Encodes the specified ClusterSelector message. Does not implicitly {@link google.cloud.dataproc.v1.ClusterSelector.verify|verify} messages. - * @param message ClusterSelector message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IClusterSelector, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClusterSelector message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ClusterSelector.verify|verify} messages. - * @param message ClusterSelector message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IClusterSelector, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClusterSelector message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClusterSelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ClusterSelector; - - /** - * Decodes a ClusterSelector message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClusterSelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ClusterSelector; - - /** - * Verifies a ClusterSelector message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClusterSelector message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClusterSelector - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ClusterSelector; - - /** - * Creates a plain object from a ClusterSelector message. Also converts values to other types if specified. - * @param message ClusterSelector - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.ClusterSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClusterSelector to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClusterSelector - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OrderedJob. */ - interface IOrderedJob { - - /** OrderedJob stepId */ - stepId?: (string|null); - - /** OrderedJob hadoopJob */ - hadoopJob?: (google.cloud.dataproc.v1.IHadoopJob|null); - - /** OrderedJob sparkJob */ - sparkJob?: (google.cloud.dataproc.v1.ISparkJob|null); - - /** OrderedJob pysparkJob */ - pysparkJob?: (google.cloud.dataproc.v1.IPySparkJob|null); - - /** OrderedJob hiveJob */ - hiveJob?: (google.cloud.dataproc.v1.IHiveJob|null); - - /** OrderedJob pigJob */ - pigJob?: (google.cloud.dataproc.v1.IPigJob|null); - - /** OrderedJob sparkRJob */ - sparkRJob?: (google.cloud.dataproc.v1.ISparkRJob|null); - - /** OrderedJob sparkSqlJob */ - sparkSqlJob?: (google.cloud.dataproc.v1.ISparkSqlJob|null); - - /** OrderedJob prestoJob */ - prestoJob?: (google.cloud.dataproc.v1.IPrestoJob|null); - - /** OrderedJob trinoJob */ - trinoJob?: (google.cloud.dataproc.v1.ITrinoJob|null); - - /** OrderedJob flinkJob */ - flinkJob?: (google.cloud.dataproc.v1.IFlinkJob|null); - - /** OrderedJob labels */ - labels?: ({ [k: string]: string }|null); - - /** OrderedJob scheduling */ - scheduling?: (google.cloud.dataproc.v1.IJobScheduling|null); - - /** OrderedJob prerequisiteStepIds */ - prerequisiteStepIds?: (string[]|null); - } - - /** Represents an OrderedJob. */ - class OrderedJob implements IOrderedJob { - - /** - * Constructs a new OrderedJob. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IOrderedJob); - - /** OrderedJob stepId. */ - public stepId: string; - - /** OrderedJob hadoopJob. */ - public hadoopJob?: (google.cloud.dataproc.v1.IHadoopJob|null); - - /** OrderedJob sparkJob. */ - public sparkJob?: (google.cloud.dataproc.v1.ISparkJob|null); - - /** OrderedJob pysparkJob. */ - public pysparkJob?: (google.cloud.dataproc.v1.IPySparkJob|null); - - /** OrderedJob hiveJob. */ - public hiveJob?: (google.cloud.dataproc.v1.IHiveJob|null); - - /** OrderedJob pigJob. */ - public pigJob?: (google.cloud.dataproc.v1.IPigJob|null); - - /** OrderedJob sparkRJob. */ - public sparkRJob?: (google.cloud.dataproc.v1.ISparkRJob|null); - - /** OrderedJob sparkSqlJob. */ - public sparkSqlJob?: (google.cloud.dataproc.v1.ISparkSqlJob|null); - - /** OrderedJob prestoJob. */ - public prestoJob?: (google.cloud.dataproc.v1.IPrestoJob|null); - - /** OrderedJob trinoJob. */ - public trinoJob?: (google.cloud.dataproc.v1.ITrinoJob|null); - - /** OrderedJob flinkJob. */ - public flinkJob?: (google.cloud.dataproc.v1.IFlinkJob|null); - - /** OrderedJob labels. */ - public labels: { [k: string]: string }; - - /** OrderedJob scheduling. */ - public scheduling?: (google.cloud.dataproc.v1.IJobScheduling|null); - - /** OrderedJob prerequisiteStepIds. */ - public prerequisiteStepIds: string[]; - - /** OrderedJob jobType. */ - public jobType?: ("hadoopJob"|"sparkJob"|"pysparkJob"|"hiveJob"|"pigJob"|"sparkRJob"|"sparkSqlJob"|"prestoJob"|"trinoJob"|"flinkJob"); - - /** - * Creates a new OrderedJob instance using the specified properties. - * @param [properties] Properties to set - * @returns OrderedJob instance - */ - public static create(properties?: google.cloud.dataproc.v1.IOrderedJob): google.cloud.dataproc.v1.OrderedJob; - - /** - * Encodes the specified OrderedJob message. Does not implicitly {@link google.cloud.dataproc.v1.OrderedJob.verify|verify} messages. - * @param message OrderedJob message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IOrderedJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OrderedJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.OrderedJob.verify|verify} messages. - * @param message OrderedJob message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IOrderedJob, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OrderedJob message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OrderedJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.OrderedJob; - - /** - * Decodes an OrderedJob message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OrderedJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.OrderedJob; - - /** - * Verifies an OrderedJob message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OrderedJob message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OrderedJob - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.OrderedJob; - - /** - * Creates a plain object from an OrderedJob message. Also converts values to other types if specified. - * @param message OrderedJob - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.OrderedJob, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OrderedJob to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OrderedJob - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TemplateParameter. */ - interface ITemplateParameter { - - /** TemplateParameter name */ - name?: (string|null); - - /** TemplateParameter fields */ - fields?: (string[]|null); - - /** TemplateParameter description */ - description?: (string|null); - - /** TemplateParameter validation */ - validation?: (google.cloud.dataproc.v1.IParameterValidation|null); - } - - /** Represents a TemplateParameter. */ - class TemplateParameter implements ITemplateParameter { - - /** - * Constructs a new TemplateParameter. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.ITemplateParameter); - - /** TemplateParameter name. */ - public name: string; - - /** TemplateParameter fields. */ - public fields: string[]; - - /** TemplateParameter description. */ - public description: string; - - /** TemplateParameter validation. */ - public validation?: (google.cloud.dataproc.v1.IParameterValidation|null); - - /** - * Creates a new TemplateParameter instance using the specified properties. - * @param [properties] Properties to set - * @returns TemplateParameter instance - */ - public static create(properties?: google.cloud.dataproc.v1.ITemplateParameter): google.cloud.dataproc.v1.TemplateParameter; - - /** - * Encodes the specified TemplateParameter message. Does not implicitly {@link google.cloud.dataproc.v1.TemplateParameter.verify|verify} messages. - * @param message TemplateParameter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.ITemplateParameter, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TemplateParameter message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.TemplateParameter.verify|verify} messages. - * @param message TemplateParameter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.ITemplateParameter, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TemplateParameter message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TemplateParameter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.TemplateParameter; - - /** - * Decodes a TemplateParameter message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TemplateParameter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.TemplateParameter; - - /** - * Verifies a TemplateParameter message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TemplateParameter message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TemplateParameter - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.TemplateParameter; - - /** - * Creates a plain object from a TemplateParameter message. Also converts values to other types if specified. - * @param message TemplateParameter - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.TemplateParameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TemplateParameter to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TemplateParameter - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ParameterValidation. */ - interface IParameterValidation { - - /** ParameterValidation regex */ - regex?: (google.cloud.dataproc.v1.IRegexValidation|null); - - /** ParameterValidation values */ - values?: (google.cloud.dataproc.v1.IValueValidation|null); - } - - /** Represents a ParameterValidation. */ - class ParameterValidation implements IParameterValidation { - - /** - * Constructs a new ParameterValidation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IParameterValidation); - - /** ParameterValidation regex. */ - public regex?: (google.cloud.dataproc.v1.IRegexValidation|null); - - /** ParameterValidation values. */ - public values?: (google.cloud.dataproc.v1.IValueValidation|null); - - /** ParameterValidation validationType. */ - public validationType?: ("regex"|"values"); - - /** - * Creates a new ParameterValidation instance using the specified properties. - * @param [properties] Properties to set - * @returns ParameterValidation instance - */ - public static create(properties?: google.cloud.dataproc.v1.IParameterValidation): google.cloud.dataproc.v1.ParameterValidation; - - /** - * Encodes the specified ParameterValidation message. Does not implicitly {@link google.cloud.dataproc.v1.ParameterValidation.verify|verify} messages. - * @param message ParameterValidation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IParameterValidation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ParameterValidation message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ParameterValidation.verify|verify} messages. - * @param message ParameterValidation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IParameterValidation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ParameterValidation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ParameterValidation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ParameterValidation; - - /** - * Decodes a ParameterValidation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ParameterValidation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ParameterValidation; - - /** - * Verifies a ParameterValidation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ParameterValidation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ParameterValidation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ParameterValidation; - - /** - * Creates a plain object from a ParameterValidation message. Also converts values to other types if specified. - * @param message ParameterValidation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.ParameterValidation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ParameterValidation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ParameterValidation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RegexValidation. */ - interface IRegexValidation { - - /** RegexValidation regexes */ - regexes?: (string[]|null); - } - - /** Represents a RegexValidation. */ - class RegexValidation implements IRegexValidation { - - /** - * Constructs a new RegexValidation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IRegexValidation); - - /** RegexValidation regexes. */ - public regexes: string[]; - - /** - * Creates a new RegexValidation instance using the specified properties. - * @param [properties] Properties to set - * @returns RegexValidation instance - */ - public static create(properties?: google.cloud.dataproc.v1.IRegexValidation): google.cloud.dataproc.v1.RegexValidation; - - /** - * Encodes the specified RegexValidation message. Does not implicitly {@link google.cloud.dataproc.v1.RegexValidation.verify|verify} messages. - * @param message RegexValidation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IRegexValidation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RegexValidation message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.RegexValidation.verify|verify} messages. - * @param message RegexValidation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IRegexValidation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RegexValidation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RegexValidation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.RegexValidation; - - /** - * Decodes a RegexValidation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RegexValidation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.RegexValidation; - - /** - * Verifies a RegexValidation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RegexValidation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RegexValidation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.RegexValidation; - - /** - * Creates a plain object from a RegexValidation message. Also converts values to other types if specified. - * @param message RegexValidation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.RegexValidation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RegexValidation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RegexValidation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ValueValidation. */ - interface IValueValidation { - - /** ValueValidation values */ - values?: (string[]|null); - } - - /** Represents a ValueValidation. */ - class ValueValidation implements IValueValidation { - - /** - * Constructs a new ValueValidation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IValueValidation); - - /** ValueValidation values. */ - public values: string[]; - - /** - * Creates a new ValueValidation instance using the specified properties. - * @param [properties] Properties to set - * @returns ValueValidation instance - */ - public static create(properties?: google.cloud.dataproc.v1.IValueValidation): google.cloud.dataproc.v1.ValueValidation; - - /** - * Encodes the specified ValueValidation message. Does not implicitly {@link google.cloud.dataproc.v1.ValueValidation.verify|verify} messages. - * @param message ValueValidation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IValueValidation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ValueValidation message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ValueValidation.verify|verify} messages. - * @param message ValueValidation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IValueValidation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ValueValidation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ValueValidation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ValueValidation; - - /** - * Decodes a ValueValidation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ValueValidation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ValueValidation; - - /** - * Verifies a ValueValidation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ValueValidation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ValueValidation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ValueValidation; - - /** - * Creates a plain object from a ValueValidation message. Also converts values to other types if specified. - * @param message ValueValidation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.ValueValidation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ValueValidation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ValueValidation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a WorkflowMetadata. */ - interface IWorkflowMetadata { - - /** WorkflowMetadata template */ - template?: (string|null); - - /** WorkflowMetadata version */ - version?: (number|null); - - /** WorkflowMetadata createCluster */ - createCluster?: (google.cloud.dataproc.v1.IClusterOperation|null); - - /** WorkflowMetadata graph */ - graph?: (google.cloud.dataproc.v1.IWorkflowGraph|null); - - /** WorkflowMetadata deleteCluster */ - deleteCluster?: (google.cloud.dataproc.v1.IClusterOperation|null); - - /** WorkflowMetadata state */ - state?: (google.cloud.dataproc.v1.WorkflowMetadata.State|keyof typeof google.cloud.dataproc.v1.WorkflowMetadata.State|null); - - /** WorkflowMetadata clusterName */ - clusterName?: (string|null); - - /** WorkflowMetadata parameters */ - parameters?: ({ [k: string]: string }|null); - - /** WorkflowMetadata startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** WorkflowMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** WorkflowMetadata clusterUuid */ - clusterUuid?: (string|null); - - /** WorkflowMetadata dagTimeout */ - dagTimeout?: (google.protobuf.IDuration|null); - - /** WorkflowMetadata dagStartTime */ - dagStartTime?: (google.protobuf.ITimestamp|null); - - /** WorkflowMetadata dagEndTime */ - dagEndTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a WorkflowMetadata. */ - class WorkflowMetadata implements IWorkflowMetadata { - - /** - * Constructs a new WorkflowMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IWorkflowMetadata); - - /** WorkflowMetadata template. */ - public template: string; - - /** WorkflowMetadata version. */ - public version: number; - - /** WorkflowMetadata createCluster. */ - public createCluster?: (google.cloud.dataproc.v1.IClusterOperation|null); - - /** WorkflowMetadata graph. */ - public graph?: (google.cloud.dataproc.v1.IWorkflowGraph|null); - - /** WorkflowMetadata deleteCluster. */ - public deleteCluster?: (google.cloud.dataproc.v1.IClusterOperation|null); - - /** WorkflowMetadata state. */ - public state: (google.cloud.dataproc.v1.WorkflowMetadata.State|keyof typeof google.cloud.dataproc.v1.WorkflowMetadata.State); - - /** WorkflowMetadata clusterName. */ - public clusterName: string; - - /** WorkflowMetadata parameters. */ - public parameters: { [k: string]: string }; - - /** WorkflowMetadata startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** WorkflowMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** WorkflowMetadata clusterUuid. */ - public clusterUuid: string; - - /** WorkflowMetadata dagTimeout. */ - public dagTimeout?: (google.protobuf.IDuration|null); - - /** WorkflowMetadata dagStartTime. */ - public dagStartTime?: (google.protobuf.ITimestamp|null); - - /** WorkflowMetadata dagEndTime. */ - public dagEndTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new WorkflowMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns WorkflowMetadata instance - */ - public static create(properties?: google.cloud.dataproc.v1.IWorkflowMetadata): google.cloud.dataproc.v1.WorkflowMetadata; - - /** - * Encodes the specified WorkflowMetadata message. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowMetadata.verify|verify} messages. - * @param message WorkflowMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IWorkflowMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WorkflowMetadata message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowMetadata.verify|verify} messages. - * @param message WorkflowMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IWorkflowMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WorkflowMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WorkflowMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.WorkflowMetadata; - - /** - * Decodes a WorkflowMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WorkflowMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.WorkflowMetadata; - - /** - * Verifies a WorkflowMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WorkflowMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WorkflowMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.WorkflowMetadata; - - /** - * Creates a plain object from a WorkflowMetadata message. Also converts values to other types if specified. - * @param message WorkflowMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.WorkflowMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WorkflowMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WorkflowMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace WorkflowMetadata { - - /** State enum. */ - enum State { - UNKNOWN = 0, - PENDING = 1, - RUNNING = 2, - DONE = 3 - } - } - - /** Properties of a ClusterOperation. */ - interface IClusterOperation { - - /** ClusterOperation operationId */ - operationId?: (string|null); - - /** ClusterOperation error */ - error?: (string|null); - - /** ClusterOperation done */ - done?: (boolean|null); - } - - /** Represents a ClusterOperation. */ - class ClusterOperation implements IClusterOperation { - - /** - * Constructs a new ClusterOperation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IClusterOperation); - - /** ClusterOperation operationId. */ - public operationId: string; - - /** ClusterOperation error. */ - public error: string; - - /** ClusterOperation done. */ - public done: boolean; - - /** - * Creates a new ClusterOperation instance using the specified properties. - * @param [properties] Properties to set - * @returns ClusterOperation instance - */ - public static create(properties?: google.cloud.dataproc.v1.IClusterOperation): google.cloud.dataproc.v1.ClusterOperation; - - /** - * Encodes the specified ClusterOperation message. Does not implicitly {@link google.cloud.dataproc.v1.ClusterOperation.verify|verify} messages. - * @param message ClusterOperation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IClusterOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClusterOperation message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ClusterOperation.verify|verify} messages. - * @param message ClusterOperation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IClusterOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClusterOperation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClusterOperation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ClusterOperation; - - /** - * Decodes a ClusterOperation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClusterOperation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ClusterOperation; - - /** - * Verifies a ClusterOperation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClusterOperation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClusterOperation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ClusterOperation; - - /** - * Creates a plain object from a ClusterOperation message. Also converts values to other types if specified. - * @param message ClusterOperation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.ClusterOperation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClusterOperation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClusterOperation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a WorkflowGraph. */ - interface IWorkflowGraph { - - /** WorkflowGraph nodes */ - nodes?: (google.cloud.dataproc.v1.IWorkflowNode[]|null); - } - - /** Represents a WorkflowGraph. */ - class WorkflowGraph implements IWorkflowGraph { - - /** - * Constructs a new WorkflowGraph. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IWorkflowGraph); - - /** WorkflowGraph nodes. */ - public nodes: google.cloud.dataproc.v1.IWorkflowNode[]; - - /** - * Creates a new WorkflowGraph instance using the specified properties. - * @param [properties] Properties to set - * @returns WorkflowGraph instance - */ - public static create(properties?: google.cloud.dataproc.v1.IWorkflowGraph): google.cloud.dataproc.v1.WorkflowGraph; - - /** - * Encodes the specified WorkflowGraph message. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowGraph.verify|verify} messages. - * @param message WorkflowGraph message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IWorkflowGraph, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WorkflowGraph message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowGraph.verify|verify} messages. - * @param message WorkflowGraph message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IWorkflowGraph, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WorkflowGraph message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WorkflowGraph - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.WorkflowGraph; - - /** - * Decodes a WorkflowGraph message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WorkflowGraph - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.WorkflowGraph; - - /** - * Verifies a WorkflowGraph message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WorkflowGraph message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WorkflowGraph - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.WorkflowGraph; - - /** - * Creates a plain object from a WorkflowGraph message. Also converts values to other types if specified. - * @param message WorkflowGraph - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.WorkflowGraph, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WorkflowGraph to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WorkflowGraph - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a WorkflowNode. */ - interface IWorkflowNode { - - /** WorkflowNode stepId */ - stepId?: (string|null); - - /** WorkflowNode prerequisiteStepIds */ - prerequisiteStepIds?: (string[]|null); - - /** WorkflowNode jobId */ - jobId?: (string|null); - - /** WorkflowNode state */ - state?: (google.cloud.dataproc.v1.WorkflowNode.NodeState|keyof typeof google.cloud.dataproc.v1.WorkflowNode.NodeState|null); - - /** WorkflowNode error */ - error?: (string|null); - } - - /** Represents a WorkflowNode. */ - class WorkflowNode implements IWorkflowNode { - - /** - * Constructs a new WorkflowNode. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IWorkflowNode); - - /** WorkflowNode stepId. */ - public stepId: string; - - /** WorkflowNode prerequisiteStepIds. */ - public prerequisiteStepIds: string[]; - - /** WorkflowNode jobId. */ - public jobId: string; - - /** WorkflowNode state. */ - public state: (google.cloud.dataproc.v1.WorkflowNode.NodeState|keyof typeof google.cloud.dataproc.v1.WorkflowNode.NodeState); - - /** WorkflowNode error. */ - public error: string; - - /** - * Creates a new WorkflowNode instance using the specified properties. - * @param [properties] Properties to set - * @returns WorkflowNode instance - */ - public static create(properties?: google.cloud.dataproc.v1.IWorkflowNode): google.cloud.dataproc.v1.WorkflowNode; - - /** - * Encodes the specified WorkflowNode message. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowNode.verify|verify} messages. - * @param message WorkflowNode message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IWorkflowNode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WorkflowNode message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowNode.verify|verify} messages. - * @param message WorkflowNode message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IWorkflowNode, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WorkflowNode message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WorkflowNode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.WorkflowNode; - - /** - * Decodes a WorkflowNode message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WorkflowNode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.WorkflowNode; - - /** - * Verifies a WorkflowNode message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WorkflowNode message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WorkflowNode - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.WorkflowNode; - - /** - * Creates a plain object from a WorkflowNode message. Also converts values to other types if specified. - * @param message WorkflowNode - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.WorkflowNode, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WorkflowNode to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WorkflowNode - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace WorkflowNode { - - /** NodeState enum. */ - enum NodeState { - NODE_STATE_UNSPECIFIED = 0, - BLOCKED = 1, - RUNNABLE = 2, - RUNNING = 3, - COMPLETED = 4, - FAILED = 5 - } - } - - /** Properties of a CreateWorkflowTemplateRequest. */ - interface ICreateWorkflowTemplateRequest { - - /** CreateWorkflowTemplateRequest parent */ - parent?: (string|null); - - /** CreateWorkflowTemplateRequest template */ - template?: (google.cloud.dataproc.v1.IWorkflowTemplate|null); - } - - /** Represents a CreateWorkflowTemplateRequest. */ - class CreateWorkflowTemplateRequest implements ICreateWorkflowTemplateRequest { - - /** - * Constructs a new CreateWorkflowTemplateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest); - - /** CreateWorkflowTemplateRequest parent. */ - public parent: string; - - /** CreateWorkflowTemplateRequest template. */ - public template?: (google.cloud.dataproc.v1.IWorkflowTemplate|null); - - /** - * Creates a new CreateWorkflowTemplateRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateWorkflowTemplateRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest): google.cloud.dataproc.v1.CreateWorkflowTemplateRequest; - - /** - * Encodes the specified CreateWorkflowTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.CreateWorkflowTemplateRequest.verify|verify} messages. - * @param message CreateWorkflowTemplateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateWorkflowTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.CreateWorkflowTemplateRequest.verify|verify} messages. - * @param message CreateWorkflowTemplateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateWorkflowTemplateRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateWorkflowTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.CreateWorkflowTemplateRequest; - - /** - * Decodes a CreateWorkflowTemplateRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateWorkflowTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.CreateWorkflowTemplateRequest; - - /** - * Verifies a CreateWorkflowTemplateRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateWorkflowTemplateRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateWorkflowTemplateRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.CreateWorkflowTemplateRequest; - - /** - * Creates a plain object from a CreateWorkflowTemplateRequest message. Also converts values to other types if specified. - * @param message CreateWorkflowTemplateRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.CreateWorkflowTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateWorkflowTemplateRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateWorkflowTemplateRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetWorkflowTemplateRequest. */ - interface IGetWorkflowTemplateRequest { - - /** GetWorkflowTemplateRequest name */ - name?: (string|null); - - /** GetWorkflowTemplateRequest version */ - version?: (number|null); - } - - /** Represents a GetWorkflowTemplateRequest. */ - class GetWorkflowTemplateRequest implements IGetWorkflowTemplateRequest { - - /** - * Constructs a new GetWorkflowTemplateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IGetWorkflowTemplateRequest); - - /** GetWorkflowTemplateRequest name. */ - public name: string; - - /** GetWorkflowTemplateRequest version. */ - public version: number; - - /** - * Creates a new GetWorkflowTemplateRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetWorkflowTemplateRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.IGetWorkflowTemplateRequest): google.cloud.dataproc.v1.GetWorkflowTemplateRequest; - - /** - * Encodes the specified GetWorkflowTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.GetWorkflowTemplateRequest.verify|verify} messages. - * @param message GetWorkflowTemplateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IGetWorkflowTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetWorkflowTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GetWorkflowTemplateRequest.verify|verify} messages. - * @param message GetWorkflowTemplateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IGetWorkflowTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetWorkflowTemplateRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetWorkflowTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.GetWorkflowTemplateRequest; - - /** - * Decodes a GetWorkflowTemplateRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetWorkflowTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.GetWorkflowTemplateRequest; - - /** - * Verifies a GetWorkflowTemplateRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetWorkflowTemplateRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetWorkflowTemplateRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.GetWorkflowTemplateRequest; - - /** - * Creates a plain object from a GetWorkflowTemplateRequest message. Also converts values to other types if specified. - * @param message GetWorkflowTemplateRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.GetWorkflowTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetWorkflowTemplateRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetWorkflowTemplateRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InstantiateWorkflowTemplateRequest. */ - interface IInstantiateWorkflowTemplateRequest { - - /** InstantiateWorkflowTemplateRequest name */ - name?: (string|null); - - /** InstantiateWorkflowTemplateRequest version */ - version?: (number|null); - - /** InstantiateWorkflowTemplateRequest requestId */ - requestId?: (string|null); - - /** InstantiateWorkflowTemplateRequest parameters */ - parameters?: ({ [k: string]: string }|null); - } - - /** Represents an InstantiateWorkflowTemplateRequest. */ - class InstantiateWorkflowTemplateRequest implements IInstantiateWorkflowTemplateRequest { - - /** - * Constructs a new InstantiateWorkflowTemplateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest); - - /** InstantiateWorkflowTemplateRequest name. */ - public name: string; - - /** InstantiateWorkflowTemplateRequest version. */ - public version: number; - - /** InstantiateWorkflowTemplateRequest requestId. */ - public requestId: string; - - /** InstantiateWorkflowTemplateRequest parameters. */ - public parameters: { [k: string]: string }; - - /** - * Creates a new InstantiateWorkflowTemplateRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns InstantiateWorkflowTemplateRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest): google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest; - - /** - * Encodes the specified InstantiateWorkflowTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest.verify|verify} messages. - * @param message InstantiateWorkflowTemplateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InstantiateWorkflowTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest.verify|verify} messages. - * @param message InstantiateWorkflowTemplateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InstantiateWorkflowTemplateRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InstantiateWorkflowTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest; - - /** - * Decodes an InstantiateWorkflowTemplateRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstantiateWorkflowTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest; - - /** - * Verifies an InstantiateWorkflowTemplateRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InstantiateWorkflowTemplateRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstantiateWorkflowTemplateRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest; - - /** - * Creates a plain object from an InstantiateWorkflowTemplateRequest message. Also converts values to other types if specified. - * @param message InstantiateWorkflowTemplateRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InstantiateWorkflowTemplateRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InstantiateWorkflowTemplateRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InstantiateInlineWorkflowTemplateRequest. */ - interface IInstantiateInlineWorkflowTemplateRequest { - - /** InstantiateInlineWorkflowTemplateRequest parent */ - parent?: (string|null); - - /** InstantiateInlineWorkflowTemplateRequest template */ - template?: (google.cloud.dataproc.v1.IWorkflowTemplate|null); - - /** InstantiateInlineWorkflowTemplateRequest requestId */ - requestId?: (string|null); - } - - /** Represents an InstantiateInlineWorkflowTemplateRequest. */ - class InstantiateInlineWorkflowTemplateRequest implements IInstantiateInlineWorkflowTemplateRequest { - - /** - * Constructs a new InstantiateInlineWorkflowTemplateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest); - - /** InstantiateInlineWorkflowTemplateRequest parent. */ - public parent: string; - - /** InstantiateInlineWorkflowTemplateRequest template. */ - public template?: (google.cloud.dataproc.v1.IWorkflowTemplate|null); - - /** InstantiateInlineWorkflowTemplateRequest requestId. */ - public requestId: string; - - /** - * Creates a new InstantiateInlineWorkflowTemplateRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns InstantiateInlineWorkflowTemplateRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest): google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest; - - /** - * Encodes the specified InstantiateInlineWorkflowTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest.verify|verify} messages. - * @param message InstantiateInlineWorkflowTemplateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InstantiateInlineWorkflowTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest.verify|verify} messages. - * @param message InstantiateInlineWorkflowTemplateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InstantiateInlineWorkflowTemplateRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InstantiateInlineWorkflowTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest; - - /** - * Decodes an InstantiateInlineWorkflowTemplateRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstantiateInlineWorkflowTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest; - - /** - * Verifies an InstantiateInlineWorkflowTemplateRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InstantiateInlineWorkflowTemplateRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstantiateInlineWorkflowTemplateRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest; - - /** - * Creates a plain object from an InstantiateInlineWorkflowTemplateRequest message. Also converts values to other types if specified. - * @param message InstantiateInlineWorkflowTemplateRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InstantiateInlineWorkflowTemplateRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InstantiateInlineWorkflowTemplateRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateWorkflowTemplateRequest. */ - interface IUpdateWorkflowTemplateRequest { - - /** UpdateWorkflowTemplateRequest template */ - template?: (google.cloud.dataproc.v1.IWorkflowTemplate|null); - } - - /** Represents an UpdateWorkflowTemplateRequest. */ - class UpdateWorkflowTemplateRequest implements IUpdateWorkflowTemplateRequest { - - /** - * Constructs a new UpdateWorkflowTemplateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest); - - /** UpdateWorkflowTemplateRequest template. */ - public template?: (google.cloud.dataproc.v1.IWorkflowTemplate|null); - - /** - * Creates a new UpdateWorkflowTemplateRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateWorkflowTemplateRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest): google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest; - - /** - * Encodes the specified UpdateWorkflowTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest.verify|verify} messages. - * @param message UpdateWorkflowTemplateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateWorkflowTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest.verify|verify} messages. - * @param message UpdateWorkflowTemplateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateWorkflowTemplateRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateWorkflowTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest; - - /** - * Decodes an UpdateWorkflowTemplateRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateWorkflowTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest; - - /** - * Verifies an UpdateWorkflowTemplateRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateWorkflowTemplateRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateWorkflowTemplateRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest; - - /** - * Creates a plain object from an UpdateWorkflowTemplateRequest message. Also converts values to other types if specified. - * @param message UpdateWorkflowTemplateRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateWorkflowTemplateRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateWorkflowTemplateRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListWorkflowTemplatesRequest. */ - interface IListWorkflowTemplatesRequest { - - /** ListWorkflowTemplatesRequest parent */ - parent?: (string|null); - - /** ListWorkflowTemplatesRequest pageSize */ - pageSize?: (number|null); - - /** ListWorkflowTemplatesRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListWorkflowTemplatesRequest. */ - class ListWorkflowTemplatesRequest implements IListWorkflowTemplatesRequest { - - /** - * Constructs a new ListWorkflowTemplatesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IListWorkflowTemplatesRequest); - - /** ListWorkflowTemplatesRequest parent. */ - public parent: string; - - /** ListWorkflowTemplatesRequest pageSize. */ - public pageSize: number; - - /** ListWorkflowTemplatesRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListWorkflowTemplatesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListWorkflowTemplatesRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.IListWorkflowTemplatesRequest): google.cloud.dataproc.v1.ListWorkflowTemplatesRequest; - - /** - * Encodes the specified ListWorkflowTemplatesRequest message. Does not implicitly {@link google.cloud.dataproc.v1.ListWorkflowTemplatesRequest.verify|verify} messages. - * @param message ListWorkflowTemplatesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IListWorkflowTemplatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListWorkflowTemplatesRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListWorkflowTemplatesRequest.verify|verify} messages. - * @param message ListWorkflowTemplatesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IListWorkflowTemplatesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListWorkflowTemplatesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListWorkflowTemplatesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ListWorkflowTemplatesRequest; - - /** - * Decodes a ListWorkflowTemplatesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListWorkflowTemplatesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ListWorkflowTemplatesRequest; - - /** - * Verifies a ListWorkflowTemplatesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListWorkflowTemplatesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListWorkflowTemplatesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ListWorkflowTemplatesRequest; - - /** - * Creates a plain object from a ListWorkflowTemplatesRequest message. Also converts values to other types if specified. - * @param message ListWorkflowTemplatesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.ListWorkflowTemplatesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListWorkflowTemplatesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListWorkflowTemplatesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListWorkflowTemplatesResponse. */ - interface IListWorkflowTemplatesResponse { - - /** ListWorkflowTemplatesResponse templates */ - templates?: (google.cloud.dataproc.v1.IWorkflowTemplate[]|null); - - /** ListWorkflowTemplatesResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListWorkflowTemplatesResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListWorkflowTemplatesResponse. */ - class ListWorkflowTemplatesResponse implements IListWorkflowTemplatesResponse { - - /** - * Constructs a new ListWorkflowTemplatesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IListWorkflowTemplatesResponse); - - /** ListWorkflowTemplatesResponse templates. */ - public templates: google.cloud.dataproc.v1.IWorkflowTemplate[]; - - /** ListWorkflowTemplatesResponse nextPageToken. */ - public nextPageToken: string; - - /** ListWorkflowTemplatesResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListWorkflowTemplatesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListWorkflowTemplatesResponse instance - */ - public static create(properties?: google.cloud.dataproc.v1.IListWorkflowTemplatesResponse): google.cloud.dataproc.v1.ListWorkflowTemplatesResponse; - - /** - * Encodes the specified ListWorkflowTemplatesResponse message. Does not implicitly {@link google.cloud.dataproc.v1.ListWorkflowTemplatesResponse.verify|verify} messages. - * @param message ListWorkflowTemplatesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IListWorkflowTemplatesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListWorkflowTemplatesResponse message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListWorkflowTemplatesResponse.verify|verify} messages. - * @param message ListWorkflowTemplatesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IListWorkflowTemplatesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListWorkflowTemplatesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListWorkflowTemplatesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.ListWorkflowTemplatesResponse; - - /** - * Decodes a ListWorkflowTemplatesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListWorkflowTemplatesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.ListWorkflowTemplatesResponse; - - /** - * Verifies a ListWorkflowTemplatesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListWorkflowTemplatesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListWorkflowTemplatesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.ListWorkflowTemplatesResponse; - - /** - * Creates a plain object from a ListWorkflowTemplatesResponse message. Also converts values to other types if specified. - * @param message ListWorkflowTemplatesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.ListWorkflowTemplatesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListWorkflowTemplatesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListWorkflowTemplatesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteWorkflowTemplateRequest. */ - interface IDeleteWorkflowTemplateRequest { - - /** DeleteWorkflowTemplateRequest name */ - name?: (string|null); - - /** DeleteWorkflowTemplateRequest version */ - version?: (number|null); - } - - /** Represents a DeleteWorkflowTemplateRequest. */ - class DeleteWorkflowTemplateRequest implements IDeleteWorkflowTemplateRequest { - - /** - * Constructs a new DeleteWorkflowTemplateRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest); - - /** DeleteWorkflowTemplateRequest name. */ - public name: string; - - /** DeleteWorkflowTemplateRequest version. */ - public version: number; - - /** - * Creates a new DeleteWorkflowTemplateRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteWorkflowTemplateRequest instance - */ - public static create(properties?: google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest): google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest; - - /** - * Encodes the specified DeleteWorkflowTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest.verify|verify} messages. - * @param message DeleteWorkflowTemplateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteWorkflowTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest.verify|verify} messages. - * @param message DeleteWorkflowTemplateRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteWorkflowTemplateRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteWorkflowTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest; - - /** - * Decodes a DeleteWorkflowTemplateRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteWorkflowTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest; - - /** - * Verifies a DeleteWorkflowTemplateRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteWorkflowTemplateRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteWorkflowTemplateRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest; - - /** - * Creates a plain object from a DeleteWorkflowTemplateRequest message. Also converts values to other types if specified. - * @param message DeleteWorkflowTemplateRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteWorkflowTemplateRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteWorkflowTemplateRequest - * @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; - } - } - - /** Namespace protobuf. */ - namespace protobuf { - - /** Properties of a FileDescriptorSet. */ - interface IFileDescriptorSet { - - /** FileDescriptorSet file */ - file?: (google.protobuf.IFileDescriptorProto[]|null); - } - - /** Represents a FileDescriptorSet. */ - class FileDescriptorSet implements IFileDescriptorSet { - - /** - * Constructs a new FileDescriptorSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorSet); - - /** FileDescriptorSet file. */ - public file: google.protobuf.IFileDescriptorProto[]; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorSet instance - */ - public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; - - /** - * Verifies a FileDescriptorSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @param message FileDescriptorSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Edition enum. */ - enum Edition { - EDITION_UNKNOWN = 0, - EDITION_PROTO2 = 998, - EDITION_PROTO3 = 999, - EDITION_2023 = 1000, - EDITION_2024 = 1001, - EDITION_1_TEST_ONLY = 1, - EDITION_2_TEST_ONLY = 2, - EDITION_99997_TEST_ONLY = 99997, - EDITION_99998_TEST_ONLY = 99998, - EDITION_99999_TEST_ONLY = 99999, - EDITION_MAX = 2147483647 - } - - /** Properties of a FileDescriptorProto. */ - interface IFileDescriptorProto { - - /** FileDescriptorProto name */ - name?: (string|null); - - /** FileDescriptorProto package */ - "package"?: (string|null); - - /** FileDescriptorProto dependency */ - dependency?: (string[]|null); - - /** FileDescriptorProto publicDependency */ - publicDependency?: (number[]|null); - - /** FileDescriptorProto weakDependency */ - weakDependency?: (number[]|null); - - /** FileDescriptorProto messageType */ - messageType?: (google.protobuf.IDescriptorProto[]|null); - - /** FileDescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** FileDescriptorProto service */ - service?: (google.protobuf.IServiceDescriptorProto[]|null); - - /** FileDescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** FileDescriptorProto options */ - options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo */ - sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax */ - syntax?: (string|null); - - /** FileDescriptorProto edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FileDescriptorProto. */ - class FileDescriptorProto implements IFileDescriptorProto { - - /** - * Constructs a new FileDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorProto); - - /** FileDescriptorProto name. */ - public name: string; - - /** FileDescriptorProto package. */ - public package: string; - - /** FileDescriptorProto dependency. */ - public dependency: string[]; - - /** FileDescriptorProto publicDependency. */ - public publicDependency: number[]; - - /** FileDescriptorProto weakDependency. */ - public weakDependency: number[]; - - /** FileDescriptorProto messageType. */ - public messageType: google.protobuf.IDescriptorProto[]; - - /** FileDescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** FileDescriptorProto service. */ - public service: google.protobuf.IServiceDescriptorProto[]; - - /** FileDescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** FileDescriptorProto options. */ - public options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo. */ - public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax. */ - public syntax: string; - - /** FileDescriptorProto edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; - - /** - * Verifies a FileDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @param message FileDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DescriptorProto. */ - interface IDescriptorProto { - - /** DescriptorProto name */ - name?: (string|null); - - /** DescriptorProto field */ - field?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto nestedType */ - nestedType?: (google.protobuf.IDescriptorProto[]|null); - - /** DescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** DescriptorProto extensionRange */ - extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); - - /** DescriptorProto oneofDecl */ - oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); - - /** DescriptorProto options */ - options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange */ - reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); - - /** DescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents a DescriptorProto. */ - class DescriptorProto implements IDescriptorProto { - - /** - * Constructs a new DescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDescriptorProto); - - /** DescriptorProto name. */ - public name: string; - - /** DescriptorProto field. */ - public field: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto nestedType. */ - public nestedType: google.protobuf.IDescriptorProto[]; - - /** DescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** DescriptorProto extensionRange. */ - public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; - - /** DescriptorProto oneofDecl. */ - public oneofDecl: google.protobuf.IOneofDescriptorProto[]; - - /** DescriptorProto options. */ - public options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange. */ - public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; - - /** DescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns DescriptorProto instance - */ - public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; - - /** - * Verifies a DescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @param message DescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DescriptorProto { - - /** Properties of an ExtensionRange. */ - interface IExtensionRange { - - /** ExtensionRange start */ - start?: (number|null); - - /** ExtensionRange end */ - end?: (number|null); - - /** ExtensionRange options */ - options?: (google.protobuf.IExtensionRangeOptions|null); - } - - /** Represents an ExtensionRange. */ - class ExtensionRange implements IExtensionRange { - - /** - * Constructs a new ExtensionRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); - - /** ExtensionRange start. */ - public start: number; - - /** ExtensionRange end. */ - public end: number; - - /** ExtensionRange options. */ - public options?: (google.protobuf.IExtensionRangeOptions|null); - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Verifies an ExtensionRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @param message ExtensionRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ReservedRange. */ - interface IReservedRange { - - /** ReservedRange start */ - start?: (number|null); - - /** ReservedRange end */ - end?: (number|null); - } - - /** Represents a ReservedRange. */ - class ReservedRange implements IReservedRange { - - /** - * Constructs a new ReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); - - /** ReservedRange start. */ - public start: number; - - /** ReservedRange end. */ - public end: number; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ReservedRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Verifies a ReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @param message ReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ExtensionRangeOptions. */ - interface IExtensionRangeOptions { - - /** ExtensionRangeOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ExtensionRangeOptions declaration */ - declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); - - /** ExtensionRangeOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification */ - verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); - } - - /** Represents an ExtensionRangeOptions. */ - class ExtensionRangeOptions implements IExtensionRangeOptions { - - /** - * Constructs a new ExtensionRangeOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IExtensionRangeOptions); - - /** ExtensionRangeOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** ExtensionRangeOptions declaration. */ - public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; - - /** ExtensionRangeOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification. */ - public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRangeOptions instance - */ - public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; - - /** - * Verifies an ExtensionRangeOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRangeOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @param message ExtensionRangeOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ExtensionRangeOptions { - - /** Properties of a Declaration. */ - interface IDeclaration { - - /** Declaration number */ - number?: (number|null); - - /** Declaration fullName */ - fullName?: (string|null); - - /** Declaration type */ - type?: (string|null); - - /** Declaration reserved */ - reserved?: (boolean|null); - - /** Declaration repeated */ - repeated?: (boolean|null); - } - - /** Represents a Declaration. */ - class Declaration implements IDeclaration { - - /** - * Constructs a new Declaration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); - - /** Declaration number. */ - public number: number; - - /** Declaration fullName. */ - public fullName: string; - - /** Declaration type. */ - public type: string; - - /** Declaration reserved. */ - public reserved: boolean; - - /** Declaration repeated. */ - public repeated: boolean; - - /** - * Creates a new Declaration instance using the specified properties. - * @param [properties] Properties to set - * @returns Declaration instance - */ - public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Verifies a Declaration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Declaration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @param message Declaration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Declaration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Declaration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** VerificationState enum. */ - enum VerificationState { - DECLARATION = 0, - UNVERIFIED = 1 - } - } - - /** Properties of a FieldDescriptorProto. */ - interface IFieldDescriptorProto { - - /** FieldDescriptorProto name */ - name?: (string|null); - - /** FieldDescriptorProto number */ - number?: (number|null); - - /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); - - /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); - - /** FieldDescriptorProto typeName */ - typeName?: (string|null); - - /** FieldDescriptorProto extendee */ - extendee?: (string|null); - - /** FieldDescriptorProto defaultValue */ - defaultValue?: (string|null); - - /** FieldDescriptorProto oneofIndex */ - oneofIndex?: (number|null); - - /** FieldDescriptorProto jsonName */ - jsonName?: (string|null); - - /** FieldDescriptorProto options */ - options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional */ - proto3Optional?: (boolean|null); - } - - /** Represents a FieldDescriptorProto. */ - class FieldDescriptorProto implements IFieldDescriptorProto { - - /** - * Constructs a new FieldDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldDescriptorProto); - - /** FieldDescriptorProto name. */ - public name: string; - - /** FieldDescriptorProto number. */ - public number: number; - - /** FieldDescriptorProto label. */ - public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); - - /** FieldDescriptorProto type. */ - public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); - - /** FieldDescriptorProto typeName. */ - public typeName: string; - - /** FieldDescriptorProto extendee. */ - public extendee: string; - - /** FieldDescriptorProto defaultValue. */ - public defaultValue: string; - - /** FieldDescriptorProto oneofIndex. */ - public oneofIndex: number; - - /** FieldDescriptorProto jsonName. */ - public jsonName: string; - - /** FieldDescriptorProto options. */ - public options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional. */ - public proto3Optional: boolean; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; - - /** - * Verifies a FieldDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @param message FieldDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldDescriptorProto { - - /** Type enum. */ - enum Type { - TYPE_DOUBLE = 1, - TYPE_FLOAT = 2, - TYPE_INT64 = 3, - TYPE_UINT64 = 4, - TYPE_INT32 = 5, - TYPE_FIXED64 = 6, - TYPE_FIXED32 = 7, - TYPE_BOOL = 8, - TYPE_STRING = 9, - TYPE_GROUP = 10, - TYPE_MESSAGE = 11, - TYPE_BYTES = 12, - TYPE_UINT32 = 13, - TYPE_ENUM = 14, - TYPE_SFIXED32 = 15, - TYPE_SFIXED64 = 16, - TYPE_SINT32 = 17, - TYPE_SINT64 = 18 - } - - /** Label enum. */ - enum Label { - LABEL_OPTIONAL = 1, - LABEL_REPEATED = 3, - LABEL_REQUIRED = 2 - } - } - - /** Properties of an OneofDescriptorProto. */ - interface IOneofDescriptorProto { - - /** OneofDescriptorProto name */ - name?: (string|null); - - /** OneofDescriptorProto options */ - options?: (google.protobuf.IOneofOptions|null); - } - - /** Represents an OneofDescriptorProto. */ - class OneofDescriptorProto implements IOneofDescriptorProto { - - /** - * Constructs a new OneofDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofDescriptorProto); - - /** OneofDescriptorProto name. */ - public name: string; - - /** OneofDescriptorProto options. */ - public options?: (google.protobuf.IOneofOptions|null); - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofDescriptorProto instance - */ - public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; - - /** - * Verifies an OneofDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @param message OneofDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumDescriptorProto. */ - interface IEnumDescriptorProto { - - /** EnumDescriptorProto name */ - name?: (string|null); - - /** EnumDescriptorProto value */ - value?: (google.protobuf.IEnumValueDescriptorProto[]|null); - - /** EnumDescriptorProto options */ - options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange */ - reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); - - /** EnumDescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents an EnumDescriptorProto. */ - class EnumDescriptorProto implements IEnumDescriptorProto { - - /** - * Constructs a new EnumDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumDescriptorProto); - - /** EnumDescriptorProto name. */ - public name: string; - - /** EnumDescriptorProto value. */ - public value: google.protobuf.IEnumValueDescriptorProto[]; - - /** EnumDescriptorProto options. */ - public options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange. */ - public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; - - /** EnumDescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; - - /** - * Verifies an EnumDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @param message EnumDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EnumDescriptorProto { - - /** Properties of an EnumReservedRange. */ - interface IEnumReservedRange { - - /** EnumReservedRange start */ - start?: (number|null); - - /** EnumReservedRange end */ - end?: (number|null); - } - - /** Represents an EnumReservedRange. */ - class EnumReservedRange implements IEnumReservedRange { - - /** - * Constructs a new EnumReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); - - /** EnumReservedRange start. */ - public start: number; - - /** EnumReservedRange end. */ - public end: number; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumReservedRange instance - */ - public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Verifies an EnumReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @param message EnumReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an EnumValueDescriptorProto. */ - interface IEnumValueDescriptorProto { - - /** EnumValueDescriptorProto name */ - name?: (string|null); - - /** EnumValueDescriptorProto number */ - number?: (number|null); - - /** EnumValueDescriptorProto options */ - options?: (google.protobuf.IEnumValueOptions|null); - } - - /** Represents an EnumValueDescriptorProto. */ - class EnumValueDescriptorProto implements IEnumValueDescriptorProto { - - /** - * Constructs a new EnumValueDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueDescriptorProto); - - /** EnumValueDescriptorProto name. */ - public name: string; - - /** EnumValueDescriptorProto number. */ - public number: number; - - /** EnumValueDescriptorProto options. */ - public options?: (google.protobuf.IEnumValueOptions|null); - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; - - /** - * Verifies an EnumValueDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @param message EnumValueDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceDescriptorProto. */ - interface IServiceDescriptorProto { - - /** ServiceDescriptorProto name */ - name?: (string|null); - - /** ServiceDescriptorProto method */ - method?: (google.protobuf.IMethodDescriptorProto[]|null); - - /** ServiceDescriptorProto options */ - options?: (google.protobuf.IServiceOptions|null); - } - - /** Represents a ServiceDescriptorProto. */ - class ServiceDescriptorProto implements IServiceDescriptorProto { - - /** - * Constructs a new ServiceDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceDescriptorProto); - - /** ServiceDescriptorProto name. */ - public name: string; - - /** ServiceDescriptorProto method. */ - public method: google.protobuf.IMethodDescriptorProto[]; - - /** ServiceDescriptorProto options. */ - public options?: (google.protobuf.IServiceOptions|null); - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceDescriptorProto instance - */ - public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; - - /** - * Verifies a ServiceDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @param message ServiceDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodDescriptorProto. */ - interface IMethodDescriptorProto { - - /** MethodDescriptorProto name */ - name?: (string|null); - - /** MethodDescriptorProto inputType */ - inputType?: (string|null); - - /** MethodDescriptorProto outputType */ - outputType?: (string|null); - - /** MethodDescriptorProto options */ - options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming */ - clientStreaming?: (boolean|null); - - /** MethodDescriptorProto serverStreaming */ - serverStreaming?: (boolean|null); - } - - /** Represents a MethodDescriptorProto. */ - class MethodDescriptorProto implements IMethodDescriptorProto { - - /** - * Constructs a new MethodDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodDescriptorProto); - - /** MethodDescriptorProto name. */ - public name: string; - - /** MethodDescriptorProto inputType. */ - public inputType: string; - - /** MethodDescriptorProto outputType. */ - public outputType: string; - - /** MethodDescriptorProto options. */ - public options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming. */ - public clientStreaming: boolean; - - /** MethodDescriptorProto serverStreaming. */ - public serverStreaming: boolean; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodDescriptorProto instance - */ - public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; - - /** - * Verifies a MethodDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @param message MethodDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FileOptions. */ - interface IFileOptions { - - /** FileOptions javaPackage */ - javaPackage?: (string|null); - - /** FileOptions javaOuterClassname */ - javaOuterClassname?: (string|null); - - /** FileOptions javaMultipleFiles */ - javaMultipleFiles?: (boolean|null); - - /** FileOptions javaGenerateEqualsAndHash */ - javaGenerateEqualsAndHash?: (boolean|null); - - /** FileOptions javaStringCheckUtf8 */ - javaStringCheckUtf8?: (boolean|null); - - /** FileOptions optimizeFor */ - optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); - - /** FileOptions goPackage */ - goPackage?: (string|null); - - /** FileOptions ccGenericServices */ - ccGenericServices?: (boolean|null); - - /** FileOptions javaGenericServices */ - javaGenericServices?: (boolean|null); - - /** FileOptions pyGenericServices */ - pyGenericServices?: (boolean|null); - - /** FileOptions deprecated */ - deprecated?: (boolean|null); - - /** FileOptions ccEnableArenas */ - ccEnableArenas?: (boolean|null); - - /** FileOptions objcClassPrefix */ - objcClassPrefix?: (string|null); - - /** FileOptions csharpNamespace */ - csharpNamespace?: (string|null); - - /** FileOptions swiftPrefix */ - swiftPrefix?: (string|null); - - /** FileOptions phpClassPrefix */ - phpClassPrefix?: (string|null); - - /** FileOptions phpNamespace */ - phpNamespace?: (string|null); - - /** FileOptions phpMetadataNamespace */ - phpMetadataNamespace?: (string|null); - - /** FileOptions rubyPackage */ - rubyPackage?: (string|null); - - /** FileOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** FileOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FileOptions .google.api.resourceDefinition */ - ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); - } - - /** Represents a FileOptions. */ - class FileOptions implements IFileOptions { - - /** - * Constructs a new FileOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileOptions); - - /** FileOptions javaPackage. */ - public javaPackage: string; - - /** FileOptions javaOuterClassname. */ - public javaOuterClassname: string; - - /** FileOptions javaMultipleFiles. */ - public javaMultipleFiles: boolean; - - /** FileOptions javaGenerateEqualsAndHash. */ - public javaGenerateEqualsAndHash: boolean; - - /** FileOptions javaStringCheckUtf8. */ - public javaStringCheckUtf8: boolean; - - /** FileOptions optimizeFor. */ - public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); - - /** FileOptions goPackage. */ - public goPackage: string; - - /** FileOptions ccGenericServices. */ - public ccGenericServices: boolean; - - /** FileOptions javaGenericServices. */ - public javaGenericServices: boolean; - - /** FileOptions pyGenericServices. */ - public pyGenericServices: boolean; - - /** FileOptions deprecated. */ - public deprecated: boolean; - - /** FileOptions ccEnableArenas. */ - public ccEnableArenas: boolean; - - /** FileOptions objcClassPrefix. */ - public objcClassPrefix: string; - - /** FileOptions csharpNamespace. */ - public csharpNamespace: string; - - /** FileOptions swiftPrefix. */ - public swiftPrefix: string; - - /** FileOptions phpClassPrefix. */ - public phpClassPrefix: string; - - /** FileOptions phpNamespace. */ - public phpNamespace: string; - - /** FileOptions phpMetadataNamespace. */ - public phpMetadataNamespace: string; - - /** FileOptions rubyPackage. */ - public rubyPackage: string; - - /** FileOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** FileOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FileOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FileOptions instance - */ - public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; - - /** - * Verifies a FileOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @param message FileOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FileOptions { - - /** OptimizeMode enum. */ - enum OptimizeMode { - SPEED = 1, - CODE_SIZE = 2, - LITE_RUNTIME = 3 - } - } - - /** Properties of a MessageOptions. */ - interface IMessageOptions { - - /** MessageOptions messageSetWireFormat */ - messageSetWireFormat?: (boolean|null); - - /** MessageOptions noStandardDescriptorAccessor */ - noStandardDescriptorAccessor?: (boolean|null); - - /** MessageOptions deprecated */ - deprecated?: (boolean|null); - - /** MessageOptions mapEntry */ - mapEntry?: (boolean|null); - - /** MessageOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** MessageOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** MessageOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MessageOptions .google.api.resource */ - ".google.api.resource"?: (google.api.IResourceDescriptor|null); - } - - /** Represents a MessageOptions. */ - class MessageOptions implements IMessageOptions { - - /** - * Constructs a new MessageOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMessageOptions); - - /** MessageOptions messageSetWireFormat. */ - public messageSetWireFormat: boolean; - - /** MessageOptions noStandardDescriptorAccessor. */ - public noStandardDescriptorAccessor: boolean; - - /** MessageOptions deprecated. */ - public deprecated: boolean; - - /** MessageOptions mapEntry. */ - public mapEntry: boolean; - - /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** MessageOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** MessageOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MessageOptions instance - */ - public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; - - /** - * Verifies a MessageOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MessageOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @param message MessageOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MessageOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MessageOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FieldOptions. */ - interface IFieldOptions { - - /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); - - /** FieldOptions packed */ - packed?: (boolean|null); - - /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); - - /** FieldOptions lazy */ - lazy?: (boolean|null); - - /** FieldOptions unverifiedLazy */ - unverifiedLazy?: (boolean|null); - - /** FieldOptions deprecated */ - deprecated?: (boolean|null); - - /** FieldOptions weak */ - weak?: (boolean|null); - - /** FieldOptions debugRedact */ - debugRedact?: (boolean|null); - - /** FieldOptions retention */ - retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); - - /** FieldOptions targets */ - targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); - - /** FieldOptions editionDefaults */ - editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); - - /** FieldOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** FieldOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FieldOptions .google.api.fieldBehavior */ - ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); - - /** FieldOptions .google.api.resourceReference */ - ".google.api.resourceReference"?: (google.api.IResourceReference|null); - } - - /** Represents a FieldOptions. */ - class FieldOptions implements IFieldOptions { - - /** - * Constructs a new FieldOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldOptions); - - /** FieldOptions ctype. */ - public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); - - /** FieldOptions packed. */ - public packed: boolean; - - /** FieldOptions jstype. */ - public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); - - /** FieldOptions lazy. */ - public lazy: boolean; - - /** FieldOptions unverifiedLazy. */ - public unverifiedLazy: boolean; - - /** FieldOptions deprecated. */ - public deprecated: boolean; - - /** FieldOptions weak. */ - public weak: boolean; - - /** FieldOptions debugRedact. */ - public debugRedact: boolean; - - /** FieldOptions retention. */ - public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); - - /** FieldOptions targets. */ - public targets: google.protobuf.FieldOptions.OptionTargetType[]; - - /** FieldOptions editionDefaults. */ - public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; - - /** FieldOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** FieldOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldOptions instance - */ - public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; - - /** - * Verifies a FieldOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @param message FieldOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldOptions { - - /** CType enum. */ - enum CType { - STRING = 0, - CORD = 1, - STRING_PIECE = 2 - } - - /** JSType enum. */ - enum JSType { - JS_NORMAL = 0, - JS_STRING = 1, - JS_NUMBER = 2 - } - - /** OptionRetention enum. */ - enum OptionRetention { - RETENTION_UNKNOWN = 0, - RETENTION_RUNTIME = 1, - RETENTION_SOURCE = 2 - } - - /** OptionTargetType enum. */ - enum OptionTargetType { - TARGET_TYPE_UNKNOWN = 0, - TARGET_TYPE_FILE = 1, - TARGET_TYPE_EXTENSION_RANGE = 2, - TARGET_TYPE_MESSAGE = 3, - TARGET_TYPE_FIELD = 4, - TARGET_TYPE_ONEOF = 5, - TARGET_TYPE_ENUM = 6, - TARGET_TYPE_ENUM_ENTRY = 7, - TARGET_TYPE_SERVICE = 8, - TARGET_TYPE_METHOD = 9 - } - - /** Properties of an EditionDefault. */ - interface IEditionDefault { - - /** EditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** EditionDefault value */ - value?: (string|null); - } - - /** Represents an EditionDefault. */ - class EditionDefault implements IEditionDefault { - - /** - * Constructs a new EditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); - - /** EditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** EditionDefault value. */ - public value: string; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns EditionDefault instance - */ - public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; - - /** - * Verifies an EditionDefault message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @param message EditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an OneofOptions. */ - interface IOneofOptions { - - /** OneofOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** OneofOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an OneofOptions. */ - class OneofOptions implements IOneofOptions { - - /** - * Constructs a new OneofOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofOptions); - - /** OneofOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** OneofOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofOptions instance - */ - public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; - - /** - * Verifies an OneofOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @param message OneofOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumOptions. */ - interface IEnumOptions { - - /** EnumOptions allowAlias */ - allowAlias?: (boolean|null); - - /** EnumOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** EnumOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumOptions. */ - class EnumOptions implements IEnumOptions { - - /** - * Constructs a new EnumOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumOptions); - - /** EnumOptions allowAlias. */ - public allowAlias: boolean; - - /** EnumOptions deprecated. */ - public deprecated: boolean; - - /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** EnumOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumOptions instance - */ - public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; - - /** - * Verifies an EnumOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @param message EnumOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { - - /** EnumValueOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumValueOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact */ - debugRedact?: (boolean|null); - - /** EnumValueOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumValueOptions. */ - class EnumValueOptions implements IEnumValueOptions { - - /** - * Constructs a new EnumValueOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueOptions); - - /** EnumValueOptions deprecated. */ - public deprecated: boolean; - - /** EnumValueOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact. */ - public debugRedact: boolean; - - /** EnumValueOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueOptions instance - */ - public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; - - /** - * Verifies an EnumValueOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @param message EnumValueOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceOptions. */ - interface IServiceOptions { - - /** ServiceOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ServiceOptions deprecated */ - deprecated?: (boolean|null); - - /** ServiceOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ServiceOptions .google.api.defaultHost */ - ".google.api.defaultHost"?: (string|null); - - /** ServiceOptions .google.api.oauthScopes */ - ".google.api.oauthScopes"?: (string|null); - - /** ServiceOptions .google.api.apiVersion */ - ".google.api.apiVersion"?: (string|null); - } - - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { - - /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceOptions); - - /** ServiceOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ServiceOptions deprecated. */ - public deprecated: boolean; - - /** ServiceOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceOptions instance - */ - public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; - - /** - * Verifies a ServiceOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @param message ServiceOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodOptions. */ - interface IMethodOptions { - - /** MethodOptions deprecated */ - deprecated?: (boolean|null); - - /** MethodOptions idempotencyLevel */ - idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); - - /** MethodOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); - - /** MethodOptions .google.api.methodSignature */ - ".google.api.methodSignature"?: (string[]|null); - - /** MethodOptions .google.longrunning.operationInfo */ - ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); - } - - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { - - /** - * Constructs a new MethodOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodOptions); - - /** MethodOptions deprecated. */ - public deprecated: boolean; - - /** MethodOptions idempotencyLevel. */ - public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); - - /** MethodOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MethodOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodOptions instance - */ - public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; - - /** - * Verifies a MethodOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @param message MethodOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MethodOptions { - - /** IdempotencyLevel enum. */ - enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0, - NO_SIDE_EFFECTS = 1, - IDEMPOTENT = 2 - } - } - - /** Properties of an UninterpretedOption. */ - interface IUninterpretedOption { - - /** UninterpretedOption name */ - name?: (google.protobuf.UninterpretedOption.INamePart[]|null); - - /** UninterpretedOption identifierValue */ - identifierValue?: (string|null); - - /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|Long|string|null); - - /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|string|null); - - /** UninterpretedOption doubleValue */ - doubleValue?: (number|null); - - /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|Buffer|string|null); - - /** UninterpretedOption aggregateValue */ - aggregateValue?: (string|null); - } - - /** Represents an UninterpretedOption. */ - class UninterpretedOption implements IUninterpretedOption { - - /** - * Constructs a new UninterpretedOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUninterpretedOption); - - /** UninterpretedOption name. */ - public name: google.protobuf.UninterpretedOption.INamePart[]; - - /** UninterpretedOption identifierValue. */ - public identifierValue: string; - - /** UninterpretedOption positiveIntValue. */ - public positiveIntValue: (number|Long|string); - - /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|Long|string); - - /** UninterpretedOption doubleValue. */ - public doubleValue: number; - - /** UninterpretedOption stringValue. */ - public stringValue: (Uint8Array|Buffer|string); - - /** UninterpretedOption aggregateValue. */ - public aggregateValue: string; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @param [properties] Properties to set - * @returns UninterpretedOption instance - */ - public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; - - /** - * Verifies an UninterpretedOption message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UninterpretedOption - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @param message UninterpretedOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UninterpretedOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UninterpretedOption - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace UninterpretedOption { - - /** Properties of a NamePart. */ - interface INamePart { - - /** NamePart namePart */ - namePart: string; - - /** NamePart isExtension */ - isExtension: boolean; - } - - /** Represents a NamePart. */ - class NamePart implements INamePart { - - /** - * Constructs a new NamePart. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.UninterpretedOption.INamePart); - - /** NamePart namePart. */ - public namePart: string; - - /** NamePart isExtension. */ - public isExtension: boolean; - - /** - * Creates a new NamePart instance using the specified properties. - * @param [properties] Properties to set - * @returns NamePart instance - */ - public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; - - /** - * Verifies a NamePart message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NamePart - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @param message NamePart - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NamePart to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NamePart - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a FeatureSet. */ - interface IFeatureSet { - - /** FeatureSet fieldPresence */ - fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); - - /** FeatureSet enumType */ - enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); - - /** FeatureSet repeatedFieldEncoding */ - repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); - - /** FeatureSet utf8Validation */ - utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); - - /** FeatureSet messageEncoding */ - messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); - - /** FeatureSet jsonFormat */ - jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); - } - - /** Represents a FeatureSet. */ - class FeatureSet implements IFeatureSet { - - /** - * Constructs a new FeatureSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSet); - - /** FeatureSet fieldPresence. */ - public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); - - /** FeatureSet enumType. */ - public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); - - /** FeatureSet repeatedFieldEncoding. */ - public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); - - /** FeatureSet utf8Validation. */ - public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); - - /** FeatureSet messageEncoding. */ - public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); - - /** FeatureSet jsonFormat. */ - public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); - - /** - * Creates a new FeatureSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSet instance - */ - public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; - - /** - * Verifies a FeatureSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @param message FeatureSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSet { - - /** FieldPresence enum. */ - enum FieldPresence { - FIELD_PRESENCE_UNKNOWN = 0, - EXPLICIT = 1, - IMPLICIT = 2, - LEGACY_REQUIRED = 3 - } - - /** EnumType enum. */ - enum EnumType { - ENUM_TYPE_UNKNOWN = 0, - OPEN = 1, - CLOSED = 2 - } - - /** RepeatedFieldEncoding enum. */ - enum RepeatedFieldEncoding { - REPEATED_FIELD_ENCODING_UNKNOWN = 0, - PACKED = 1, - EXPANDED = 2 - } - - /** Utf8Validation enum. */ - enum Utf8Validation { - UTF8_VALIDATION_UNKNOWN = 0, - VERIFY = 2, - NONE = 3 - } - - /** MessageEncoding enum. */ - enum MessageEncoding { - MESSAGE_ENCODING_UNKNOWN = 0, - LENGTH_PREFIXED = 1, - DELIMITED = 2 - } - - /** JsonFormat enum. */ - enum JsonFormat { - JSON_FORMAT_UNKNOWN = 0, - ALLOW = 1, - LEGACY_BEST_EFFORT = 2 - } - } - - /** Properties of a FeatureSetDefaults. */ - interface IFeatureSetDefaults { - - /** FeatureSetDefaults defaults */ - defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); - - /** FeatureSetDefaults minimumEdition */ - minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetDefaults maximumEdition */ - maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FeatureSetDefaults. */ - class FeatureSetDefaults implements IFeatureSetDefaults { - - /** - * Constructs a new FeatureSetDefaults. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSetDefaults); - - /** FeatureSetDefaults defaults. */ - public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; - - /** FeatureSetDefaults minimumEdition. */ - public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetDefaults maximumEdition. */ - public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetDefaults instance - */ - public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; - - /** - * Verifies a FeatureSetDefaults message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetDefaults - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @param message FeatureSetDefaults - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetDefaults - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSetDefaults { - - /** Properties of a FeatureSetEditionDefault. */ - interface IFeatureSetEditionDefault { - - /** FeatureSetEditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetEditionDefault features */ - features?: (google.protobuf.IFeatureSet|null); - } - - /** Represents a FeatureSetEditionDefault. */ - class FeatureSetEditionDefault implements IFeatureSetEditionDefault { - - /** - * Constructs a new FeatureSetEditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); - - /** FeatureSetEditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetEditionDefault features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetEditionDefault instance - */ - public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Verifies a FeatureSetEditionDefault message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetEditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @param message FeatureSetEditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { - - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); - } - - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { - - /** - * Constructs a new SourceCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ISourceCodeInfo); - - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns SourceCodeInfo instance - */ - public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; - - /** - * Verifies a SourceCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SourceCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @param message SourceCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SourceCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SourceCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SourceCodeInfo { - - /** Properties of a Location. */ - interface ILocation { - - /** Location path */ - path?: (number[]|null); - - /** Location span */ - span?: (number[]|null); - - /** Location leadingComments */ - leadingComments?: (string|null); - - /** Location trailingComments */ - trailingComments?: (string|null); - - /** Location leadingDetachedComments */ - leadingDetachedComments?: (string[]|null); - } - - /** Represents a Location. */ - class Location implements ILocation { - - /** - * Constructs a new Location. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - - /** Location path. */ - public path: number[]; - - /** Location span. */ - public span: number[]; - - /** Location leadingComments. */ - public leadingComments: string; - - /** Location trailingComments. */ - public trailingComments: string; - - /** Location leadingDetachedComments. */ - public leadingDetachedComments: string[]; - - /** - * Creates a new Location instance using the specified properties. - * @param [properties] Properties to set - * @returns Location instance - */ - public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Location message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; - - /** - * Verifies a Location message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Location - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @param message Location - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Location to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Location - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { - - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); - } - - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { - - /** - * Constructs a new GeneratedCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); - - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns GeneratedCodeInfo instance - */ - public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; - - /** - * Verifies a GeneratedCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GeneratedCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @param message GeneratedCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GeneratedCodeInfo { - - /** Properties of an Annotation. */ - interface IAnnotation { - - /** Annotation path */ - path?: (number[]|null); - - /** Annotation sourceFile */ - sourceFile?: (string|null); - - /** Annotation begin */ - begin?: (number|null); - - /** Annotation end */ - end?: (number|null); - - /** Annotation semantic */ - semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); - } - - /** Represents an Annotation. */ - class Annotation implements IAnnotation { - - /** - * Constructs a new Annotation. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); - - /** Annotation path. */ - public path: number[]; - - /** Annotation sourceFile. */ - public sourceFile: string; - - /** Annotation begin. */ - public begin: number; - - /** Annotation end. */ - public end: number; - - /** Annotation semantic. */ - public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); - - /** - * Creates a new Annotation instance using the specified properties. - * @param [properties] Properties to set - * @returns Annotation instance - */ - public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Verifies an Annotation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Annotation - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @param message Annotation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Annotation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Annotation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Annotation { - - /** Semantic enum. */ - enum Semantic { - NONE = 0, - SET = 1, - ALIAS = 2 - } - } - } - - /** Properties of a Duration. */ - interface IDuration { - - /** Duration seconds */ - seconds?: (number|Long|string|null); - - /** Duration nanos */ - nanos?: (number|null); - } - - /** Represents a Duration. */ - class Duration implements IDuration { - - /** - * Constructs a new Duration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDuration); - - /** Duration seconds. */ - public seconds: (number|Long|string); - - /** Duration nanos. */ - public nanos: number; - - /** - * Creates a new Duration instance using the specified properties. - * @param [properties] Properties to set - * @returns Duration instance - */ - public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; - - /** - * Verifies a Duration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Duration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @param message Duration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Duration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Duration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an 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 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 a FieldMask. */ - interface IFieldMask { - - /** FieldMask paths */ - paths?: (string[]|null); - } - - /** Represents a FieldMask. */ - class FieldMask implements IFieldMask { - - /** - * Constructs a new FieldMask. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldMask); - - /** FieldMask paths. */ - public paths: string[]; - - /** - * Creates a new FieldMask instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldMask instance - */ - public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; - - /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @param message FieldMask message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @param message FieldMask message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldMask message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; - - /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; - - /** - * Verifies a FieldMask message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldMask - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; - - /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @param message FieldMask - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldMask to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldMask - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DoubleValue. */ - interface IDoubleValue { - - /** DoubleValue value */ - value?: (number|null); - } - - /** Represents a DoubleValue. */ - class DoubleValue implements IDoubleValue { - - /** - * Constructs a new DoubleValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDoubleValue); - - /** DoubleValue value. */ - public value: number; - - /** - * Creates a new DoubleValue instance using the specified properties. - * @param [properties] Properties to set - * @returns DoubleValue instance - */ - public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; - - /** - * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @param message DoubleValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @param message DoubleValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DoubleValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DoubleValue; - - /** - * Decodes a DoubleValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DoubleValue; - - /** - * Verifies a DoubleValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DoubleValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; - - /** - * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. - * @param message DoubleValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DoubleValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DoubleValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FloatValue. */ - interface IFloatValue { - - /** FloatValue value */ - value?: (number|null); - } - - /** Represents a FloatValue. */ - class FloatValue implements IFloatValue { - - /** - * Constructs a new FloatValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFloatValue); - - /** FloatValue value. */ - public value: number; - - /** - * Creates a new FloatValue instance using the specified properties. - * @param [properties] Properties to set - * @returns FloatValue instance - */ - public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; - - /** - * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @param message FloatValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @param message FloatValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FloatValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FloatValue; - - /** - * Decodes a FloatValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FloatValue; - - /** - * Verifies a FloatValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FloatValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; - - /** - * Creates a plain object from a FloatValue message. Also converts values to other types if specified. - * @param message FloatValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FloatValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FloatValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Int64Value. */ - interface IInt64Value { - - /** Int64Value value */ - value?: (number|Long|string|null); - } - - /** Represents an Int64Value. */ - class Int64Value implements IInt64Value { - - /** - * Constructs a new Int64Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IInt64Value); - - /** Int64Value value. */ - public value: (number|Long|string); - - /** - * Creates a new Int64Value instance using the specified properties. - * @param [properties] Properties to set - * @returns Int64Value instance - */ - public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; - - /** - * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @param message Int64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @param message Int64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Int64Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int64Value; - - /** - * Decodes an Int64Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int64Value; - - /** - * Verifies an Int64Value message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Int64Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; - - /** - * Creates a plain object from an Int64Value message. Also converts values to other types if specified. - * @param message Int64Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Int64Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Int64Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a UInt64Value. */ - interface IUInt64Value { - - /** UInt64Value value */ - value?: (number|Long|string|null); - } - - /** Represents a UInt64Value. */ - class UInt64Value implements IUInt64Value { - - /** - * Constructs a new UInt64Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUInt64Value); - - /** UInt64Value value. */ - public value: (number|Long|string); - - /** - * Creates a new UInt64Value instance using the specified properties. - * @param [properties] Properties to set - * @returns UInt64Value instance - */ - public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; - - /** - * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @param message UInt64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @param message UInt64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a UInt64Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt64Value; - - /** - * Decodes a UInt64Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt64Value; - - /** - * Verifies a UInt64Value message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UInt64Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; - - /** - * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. - * @param message UInt64Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UInt64Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UInt64Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Int32Value. */ - interface IInt32Value { - - /** Int32Value value */ - value?: (number|null); - } - - /** Represents an Int32Value. */ - class Int32Value implements IInt32Value { - - /** - * Constructs a new Int32Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IInt32Value); - - /** Int32Value value. */ - public value: number; - - /** - * Creates a new Int32Value instance using the specified properties. - * @param [properties] Properties to set - * @returns Int32Value instance - */ - public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; - - /** - * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @param message Int32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @param message Int32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Int32Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int32Value; - - /** - * Decodes an Int32Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int32Value; - - /** - * Verifies an Int32Value message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Int32Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; - - /** - * Creates a plain object from an Int32Value message. Also converts values to other types if specified. - * @param message Int32Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Int32Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Int32Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a UInt32Value. */ - interface IUInt32Value { - - /** UInt32Value value */ - value?: (number|null); - } - - /** Represents a UInt32Value. */ - class UInt32Value implements IUInt32Value { - - /** - * Constructs a new UInt32Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUInt32Value); - - /** UInt32Value value. */ - public value: number; - - /** - * Creates a new UInt32Value instance using the specified properties. - * @param [properties] Properties to set - * @returns UInt32Value instance - */ - public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; - - /** - * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @param message UInt32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @param message UInt32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a UInt32Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt32Value; - - /** - * Decodes a UInt32Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt32Value; - - /** - * Verifies a UInt32Value message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UInt32Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; - - /** - * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. - * @param message UInt32Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UInt32Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UInt32Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BoolValue. */ - interface IBoolValue { - - /** BoolValue value */ - value?: (boolean|null); - } - - /** Represents a BoolValue. */ - class BoolValue implements IBoolValue { - - /** - * Constructs a new BoolValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IBoolValue); - - /** BoolValue value. */ - public value: boolean; - - /** - * Creates a new BoolValue instance using the specified properties. - * @param [properties] Properties to set - * @returns BoolValue instance - */ - public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; - - /** - * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @param message BoolValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @param message BoolValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BoolValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BoolValue; - - /** - * Decodes a BoolValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BoolValue; - - /** - * Verifies a BoolValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BoolValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; - - /** - * Creates a plain object from a BoolValue message. Also converts values to other types if specified. - * @param message BoolValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BoolValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BoolValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a StringValue. */ - interface IStringValue { - - /** StringValue value */ - value?: (string|null); - } - - /** Represents a StringValue. */ - class StringValue implements IStringValue { - - /** - * Constructs a new StringValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IStringValue); - - /** StringValue value. */ - public value: string; - - /** - * Creates a new StringValue instance using the specified properties. - * @param [properties] Properties to set - * @returns StringValue instance - */ - public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; - - /** - * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @param message StringValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @param message StringValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StringValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.StringValue; - - /** - * Decodes a StringValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.StringValue; - - /** - * Verifies a StringValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StringValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StringValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; - - /** - * Creates a plain object from a StringValue message. Also converts values to other types if specified. - * @param message StringValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StringValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StringValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BytesValue. */ - interface IBytesValue { - - /** BytesValue value */ - value?: (Uint8Array|Buffer|string|null); - } - - /** Represents a BytesValue. */ - class BytesValue implements IBytesValue { - - /** - * Constructs a new BytesValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IBytesValue); - - /** BytesValue value. */ - public value: (Uint8Array|Buffer|string); - - /** - * Creates a new BytesValue instance using the specified properties. - * @param [properties] Properties to set - * @returns BytesValue instance - */ - public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; - - /** - * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @param message BytesValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @param message BytesValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BytesValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BytesValue; - - /** - * Decodes a BytesValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BytesValue; - - /** - * Verifies a BytesValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BytesValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; - - /** - * Creates a plain object from a BytesValue message. Also converts values to other types if specified. - * @param message BytesValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BytesValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BytesValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace longrunning. */ - namespace longrunning { - - /** Represents an Operations */ - class Operations extends $protobuf.rpc.Service { - - /** - * Constructs a new Operations service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new Operations service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; - - /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListOperationsResponse - */ - public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; - - /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @returns Promise - */ - public listOperations(request: google.longrunning.IListOperationsRequest): Promise; - - /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; - - /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @returns Promise - */ - public getOperation(request: google.longrunning.IGetOperationRequest): Promise; - - /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; - - /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @returns Promise - */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; - - /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; - - /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @returns Promise - */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; - - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; - - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @returns Promise - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; - } - - namespace Operations { - - /** - * Callback as used by {@link google.longrunning.Operations|listOperations}. - * @param error Error, if any - * @param [response] ListOperationsResponse - */ - type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|getOperation}. - * @param error Error, if any - * @param [response] Operation - */ - type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|deleteOperation}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|cancelOperation}. - * @param error Error, if any - * @param [response] Empty - */ - type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|waitOperation}. - * @param error Error, if any - * @param [response] Operation - */ - type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of an Operation. */ - interface IOperation { - - /** Operation name */ - name?: (string|null); - - /** Operation metadata */ - metadata?: (google.protobuf.IAny|null); - - /** Operation done */ - done?: (boolean|null); - - /** Operation error */ - error?: (google.rpc.IStatus|null); - - /** Operation response */ - response?: (google.protobuf.IAny|null); - } - - /** Represents an Operation. */ - class Operation implements IOperation { - - /** - * Constructs a new Operation. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IOperation); - - /** Operation name. */ - public name: string; - - /** Operation metadata. */ - public metadata?: (google.protobuf.IAny|null); - - /** Operation done. */ - public done: boolean; - - /** Operation error. */ - public error?: (google.rpc.IStatus|null); - - /** Operation response. */ - public response?: (google.protobuf.IAny|null); - - /** Operation result. */ - public result?: ("error"|"response"); - - /** - * Creates a new Operation instance using the specified properties. - * @param [properties] Properties to set - * @returns Operation instance - */ - public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; - - /** - * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @param message Operation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @param message Operation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Operation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; - - /** - * Decodes an Operation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; - - /** - * Verifies an Operation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Operation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Operation - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; - - /** - * Creates a plain object from an Operation message. Also converts values to other types if specified. - * @param message Operation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Operation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Operation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetOperationRequest. */ - interface IGetOperationRequest { - - /** GetOperationRequest name */ - name?: (string|null); - } - - /** Represents a GetOperationRequest. */ - class GetOperationRequest implements IGetOperationRequest { - - /** - * Constructs a new GetOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IGetOperationRequest); - - /** GetOperationRequest name. */ - public name: string; - - /** - * Creates a new GetOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetOperationRequest instance - */ - public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; - - /** - * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @param message GetOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @param message GetOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; - - /** - * Verifies a GetOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; - - /** - * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. - * @param message GetOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListOperationsRequest. */ - interface IListOperationsRequest { - - /** ListOperationsRequest name */ - name?: (string|null); - - /** ListOperationsRequest filter */ - filter?: (string|null); - - /** ListOperationsRequest pageSize */ - pageSize?: (number|null); - - /** ListOperationsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListOperationsRequest. */ - class ListOperationsRequest implements IListOperationsRequest { - - /** - * Constructs a new ListOperationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IListOperationsRequest); - - /** ListOperationsRequest name. */ - public name: string; - - /** ListOperationsRequest filter. */ - public filter: string; - - /** ListOperationsRequest pageSize. */ - public pageSize: number; - - /** ListOperationsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListOperationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListOperationsRequest instance - */ - public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; - - /** - * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @param message ListOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @param message ListOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; - - /** - * Verifies a ListOperationsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOperationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; - - /** - * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. - * @param message ListOperationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOperationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListOperationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListOperationsResponse. */ - interface IListOperationsResponse { - - /** ListOperationsResponse operations */ - operations?: (google.longrunning.IOperation[]|null); - - /** ListOperationsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListOperationsResponse. */ - class ListOperationsResponse implements IListOperationsResponse { - - /** - * Constructs a new ListOperationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IListOperationsResponse); - - /** ListOperationsResponse operations. */ - public operations: google.longrunning.IOperation[]; - - /** ListOperationsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListOperationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListOperationsResponse instance - */ - public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; - - /** - * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @param message ListOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @param message ListOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; - - /** - * Verifies a ListOperationsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOperationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; - - /** - * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. - * @param message ListOperationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOperationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListOperationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CancelOperationRequest. */ - interface ICancelOperationRequest { - - /** CancelOperationRequest name */ - name?: (string|null); - } - - /** Represents a CancelOperationRequest. */ - class CancelOperationRequest implements ICancelOperationRequest { - - /** - * Constructs a new CancelOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.ICancelOperationRequest); - - /** CancelOperationRequest name. */ - public name: string; - - /** - * Creates a new CancelOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CancelOperationRequest instance - */ - public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; - - /** - * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @param message CancelOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @param message CancelOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; - - /** - * Verifies a CancelOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CancelOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; - - /** - * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. - * @param message CancelOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CancelOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CancelOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteOperationRequest. */ - interface IDeleteOperationRequest { - - /** DeleteOperationRequest name */ - name?: (string|null); - } - - /** Represents a DeleteOperationRequest. */ - class DeleteOperationRequest implements IDeleteOperationRequest { - - /** - * Constructs a new DeleteOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IDeleteOperationRequest); - - /** DeleteOperationRequest name. */ - public name: string; - - /** - * Creates a new DeleteOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteOperationRequest instance - */ - public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; - - /** - * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @param message DeleteOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @param message DeleteOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; - - /** - * Verifies a DeleteOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; - - /** - * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. - * @param message DeleteOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a WaitOperationRequest. */ - interface IWaitOperationRequest { - - /** WaitOperationRequest name */ - name?: (string|null); - - /** WaitOperationRequest timeout */ - timeout?: (google.protobuf.IDuration|null); - } - - /** Represents a WaitOperationRequest. */ - class WaitOperationRequest implements IWaitOperationRequest { - - /** - * Constructs a new WaitOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IWaitOperationRequest); - - /** WaitOperationRequest name. */ - public name: string; - - /** WaitOperationRequest timeout. */ - public timeout?: (google.protobuf.IDuration|null); - - /** - * Creates a new WaitOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns WaitOperationRequest instance - */ - public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; - - /** - * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @param message WaitOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @param message WaitOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; - - /** - * Verifies a WaitOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WaitOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; - - /** - * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. - * @param message WaitOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WaitOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WaitOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OperationInfo. */ - interface IOperationInfo { - - /** OperationInfo responseType */ - responseType?: (string|null); - - /** OperationInfo metadataType */ - metadataType?: (string|null); - } - - /** Represents an OperationInfo. */ - class OperationInfo implements IOperationInfo { - - /** - * Constructs a new OperationInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IOperationInfo); - - /** OperationInfo responseType. */ - public responseType: string; - - /** OperationInfo metadataType. */ - public metadataType: string; - - /** - * Creates a new OperationInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns OperationInfo instance - */ - public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; - - /** - * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @param message OperationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @param message OperationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OperationInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; - - /** - * Decodes an OperationInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; - - /** - * Verifies an OperationInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OperationInfo - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; - - /** - * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. - * @param message OperationInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OperationInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OperationInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace rpc. */ - namespace rpc { - - /** Properties of a Status. */ - interface IStatus { - - /** Status code */ - code?: (number|null); - - /** Status message */ - message?: (string|null); - - /** Status details */ - details?: (google.protobuf.IAny[]|null); - } - - /** Represents a Status. */ - class Status implements IStatus { - - /** - * Constructs a new Status. - * @param [properties] Properties to set - */ - constructor(properties?: google.rpc.IStatus); - - /** Status code. */ - public code: number; - - /** Status message. */ - public message: string; - - /** Status details. */ - public details: google.protobuf.IAny[]; - - /** - * Creates a new Status instance using the specified properties. - * @param [properties] Properties to set - * @returns Status instance - */ - public static create(properties?: google.rpc.IStatus): google.rpc.Status; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Status message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; - - /** - * Verifies a Status message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Status - */ - public static fromObject(object: { [k: string]: any }): google.rpc.Status; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @param message Status - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Status to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Status - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace type. */ - namespace type { - - /** Properties of an Interval. */ - interface IInterval { - - /** Interval startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** Interval endTime */ - endTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents an Interval. */ - class Interval implements IInterval { - - /** - * Constructs a new Interval. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.IInterval); - - /** Interval startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** Interval endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new Interval instance using the specified properties. - * @param [properties] Properties to set - * @returns Interval instance - */ - public static create(properties?: google.type.IInterval): google.type.Interval; - - /** - * Encodes the specified Interval message. Does not implicitly {@link google.type.Interval.verify|verify} messages. - * @param message Interval message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.type.IInterval, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Interval message, length delimited. Does not implicitly {@link google.type.Interval.verify|verify} messages. - * @param message Interval message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.type.IInterval, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Interval message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Interval - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Interval; - - /** - * Decodes an Interval message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Interval - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Interval; - - /** - * Verifies an Interval message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Interval message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Interval - */ - public static fromObject(object: { [k: string]: any }): google.type.Interval; - - /** - * Creates a plain object from an Interval message. Also converts values to other types if specified. - * @param message Interval - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.type.Interval, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Interval to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Interval - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } -} diff --git a/owl-bot-staging/google-cloud-dataproc/protos/protos.js b/owl-bot-staging/google-cloud-dataproc/protos/protos.js deleted file mode 100644 index 6dbcef9c0aca..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/protos/protos.js +++ /dev/null @@ -1,77201 +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_dataproc_protos || ($protobuf.roots._google_cloud_dataproc_protos = {}); - - $root.google = (function() { - - /** - * Namespace google. - * @exports google - * @namespace - */ - var google = {}; - - google.cloud = (function() { - - /** - * Namespace cloud. - * @memberof google - * @namespace - */ - var cloud = {}; - - cloud.dataproc = (function() { - - /** - * Namespace dataproc. - * @memberof google.cloud - * @namespace - */ - var dataproc = {}; - - dataproc.v1 = (function() { - - /** - * Namespace v1. - * @memberof google.cloud.dataproc - * @namespace - */ - var v1 = {}; - - v1.AutoscalingPolicyService = (function() { - - /** - * Constructs a new AutoscalingPolicyService service. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents an AutoscalingPolicyService - * @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 AutoscalingPolicyService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (AutoscalingPolicyService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AutoscalingPolicyService; - - /** - * Creates new AutoscalingPolicyService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.dataproc.v1.AutoscalingPolicyService - * @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 {AutoscalingPolicyService} RPC service. Useful where requests and/or responses are streamed. - */ - AutoscalingPolicyService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.AutoscalingPolicyService|createAutoscalingPolicy}. - * @memberof google.cloud.dataproc.v1.AutoscalingPolicyService - * @typedef CreateAutoscalingPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dataproc.v1.AutoscalingPolicy} [response] AutoscalingPolicy - */ - - /** - * Calls CreateAutoscalingPolicy. - * @function createAutoscalingPolicy - * @memberof google.cloud.dataproc.v1.AutoscalingPolicyService - * @instance - * @param {google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest} request CreateAutoscalingPolicyRequest message or plain object - * @param {google.cloud.dataproc.v1.AutoscalingPolicyService.CreateAutoscalingPolicyCallback} callback Node-style callback called with the error, if any, and AutoscalingPolicy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AutoscalingPolicyService.prototype.createAutoscalingPolicy = function createAutoscalingPolicy(request, callback) { - return this.rpcCall(createAutoscalingPolicy, $root.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest, $root.google.cloud.dataproc.v1.AutoscalingPolicy, request, callback); - }, "name", { value: "CreateAutoscalingPolicy" }); - - /** - * Calls CreateAutoscalingPolicy. - * @function createAutoscalingPolicy - * @memberof google.cloud.dataproc.v1.AutoscalingPolicyService - * @instance - * @param {google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest} request CreateAutoscalingPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.AutoscalingPolicyService|updateAutoscalingPolicy}. - * @memberof google.cloud.dataproc.v1.AutoscalingPolicyService - * @typedef UpdateAutoscalingPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dataproc.v1.AutoscalingPolicy} [response] AutoscalingPolicy - */ - - /** - * Calls UpdateAutoscalingPolicy. - * @function updateAutoscalingPolicy - * @memberof google.cloud.dataproc.v1.AutoscalingPolicyService - * @instance - * @param {google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest} request UpdateAutoscalingPolicyRequest message or plain object - * @param {google.cloud.dataproc.v1.AutoscalingPolicyService.UpdateAutoscalingPolicyCallback} callback Node-style callback called with the error, if any, and AutoscalingPolicy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AutoscalingPolicyService.prototype.updateAutoscalingPolicy = function updateAutoscalingPolicy(request, callback) { - return this.rpcCall(updateAutoscalingPolicy, $root.google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest, $root.google.cloud.dataproc.v1.AutoscalingPolicy, request, callback); - }, "name", { value: "UpdateAutoscalingPolicy" }); - - /** - * Calls UpdateAutoscalingPolicy. - * @function updateAutoscalingPolicy - * @memberof google.cloud.dataproc.v1.AutoscalingPolicyService - * @instance - * @param {google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest} request UpdateAutoscalingPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.AutoscalingPolicyService|getAutoscalingPolicy}. - * @memberof google.cloud.dataproc.v1.AutoscalingPolicyService - * @typedef GetAutoscalingPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dataproc.v1.AutoscalingPolicy} [response] AutoscalingPolicy - */ - - /** - * Calls GetAutoscalingPolicy. - * @function getAutoscalingPolicy - * @memberof google.cloud.dataproc.v1.AutoscalingPolicyService - * @instance - * @param {google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest} request GetAutoscalingPolicyRequest message or plain object - * @param {google.cloud.dataproc.v1.AutoscalingPolicyService.GetAutoscalingPolicyCallback} callback Node-style callback called with the error, if any, and AutoscalingPolicy - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AutoscalingPolicyService.prototype.getAutoscalingPolicy = function getAutoscalingPolicy(request, callback) { - return this.rpcCall(getAutoscalingPolicy, $root.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest, $root.google.cloud.dataproc.v1.AutoscalingPolicy, request, callback); - }, "name", { value: "GetAutoscalingPolicy" }); - - /** - * Calls GetAutoscalingPolicy. - * @function getAutoscalingPolicy - * @memberof google.cloud.dataproc.v1.AutoscalingPolicyService - * @instance - * @param {google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest} request GetAutoscalingPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.AutoscalingPolicyService|listAutoscalingPolicies}. - * @memberof google.cloud.dataproc.v1.AutoscalingPolicyService - * @typedef ListAutoscalingPoliciesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse} [response] ListAutoscalingPoliciesResponse - */ - - /** - * Calls ListAutoscalingPolicies. - * @function listAutoscalingPolicies - * @memberof google.cloud.dataproc.v1.AutoscalingPolicyService - * @instance - * @param {google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest} request ListAutoscalingPoliciesRequest message or plain object - * @param {google.cloud.dataproc.v1.AutoscalingPolicyService.ListAutoscalingPoliciesCallback} callback Node-style callback called with the error, if any, and ListAutoscalingPoliciesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AutoscalingPolicyService.prototype.listAutoscalingPolicies = function listAutoscalingPolicies(request, callback) { - return this.rpcCall(listAutoscalingPolicies, $root.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest, $root.google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse, request, callback); - }, "name", { value: "ListAutoscalingPolicies" }); - - /** - * Calls ListAutoscalingPolicies. - * @function listAutoscalingPolicies - * @memberof google.cloud.dataproc.v1.AutoscalingPolicyService - * @instance - * @param {google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest} request ListAutoscalingPoliciesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.AutoscalingPolicyService|deleteAutoscalingPolicy}. - * @memberof google.cloud.dataproc.v1.AutoscalingPolicyService - * @typedef DeleteAutoscalingPolicyCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteAutoscalingPolicy. - * @function deleteAutoscalingPolicy - * @memberof google.cloud.dataproc.v1.AutoscalingPolicyService - * @instance - * @param {google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest} request DeleteAutoscalingPolicyRequest message or plain object - * @param {google.cloud.dataproc.v1.AutoscalingPolicyService.DeleteAutoscalingPolicyCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(AutoscalingPolicyService.prototype.deleteAutoscalingPolicy = function deleteAutoscalingPolicy(request, callback) { - return this.rpcCall(deleteAutoscalingPolicy, $root.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteAutoscalingPolicy" }); - - /** - * Calls DeleteAutoscalingPolicy. - * @function deleteAutoscalingPolicy - * @memberof google.cloud.dataproc.v1.AutoscalingPolicyService - * @instance - * @param {google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest} request DeleteAutoscalingPolicyRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return AutoscalingPolicyService; - })(); - - v1.AutoscalingPolicy = (function() { - - /** - * Properties of an AutoscalingPolicy. - * @memberof google.cloud.dataproc.v1 - * @interface IAutoscalingPolicy - * @property {string|null} [id] AutoscalingPolicy id - * @property {string|null} [name] AutoscalingPolicy name - * @property {google.cloud.dataproc.v1.IBasicAutoscalingAlgorithm|null} [basicAlgorithm] AutoscalingPolicy basicAlgorithm - * @property {google.cloud.dataproc.v1.IInstanceGroupAutoscalingPolicyConfig|null} [workerConfig] AutoscalingPolicy workerConfig - * @property {google.cloud.dataproc.v1.IInstanceGroupAutoscalingPolicyConfig|null} [secondaryWorkerConfig] AutoscalingPolicy secondaryWorkerConfig - * @property {Object.|null} [labels] AutoscalingPolicy labels - * @property {google.cloud.dataproc.v1.AutoscalingPolicy.ClusterType|null} [clusterType] AutoscalingPolicy clusterType - */ - - /** - * Constructs a new AutoscalingPolicy. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents an AutoscalingPolicy. - * @implements IAutoscalingPolicy - * @constructor - * @param {google.cloud.dataproc.v1.IAutoscalingPolicy=} [properties] Properties to set - */ - function AutoscalingPolicy(properties) { - this.labels = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AutoscalingPolicy id. - * @member {string} id - * @memberof google.cloud.dataproc.v1.AutoscalingPolicy - * @instance - */ - AutoscalingPolicy.prototype.id = ""; - - /** - * AutoscalingPolicy name. - * @member {string} name - * @memberof google.cloud.dataproc.v1.AutoscalingPolicy - * @instance - */ - AutoscalingPolicy.prototype.name = ""; - - /** - * AutoscalingPolicy basicAlgorithm. - * @member {google.cloud.dataproc.v1.IBasicAutoscalingAlgorithm|null|undefined} basicAlgorithm - * @memberof google.cloud.dataproc.v1.AutoscalingPolicy - * @instance - */ - AutoscalingPolicy.prototype.basicAlgorithm = null; - - /** - * AutoscalingPolicy workerConfig. - * @member {google.cloud.dataproc.v1.IInstanceGroupAutoscalingPolicyConfig|null|undefined} workerConfig - * @memberof google.cloud.dataproc.v1.AutoscalingPolicy - * @instance - */ - AutoscalingPolicy.prototype.workerConfig = null; - - /** - * AutoscalingPolicy secondaryWorkerConfig. - * @member {google.cloud.dataproc.v1.IInstanceGroupAutoscalingPolicyConfig|null|undefined} secondaryWorkerConfig - * @memberof google.cloud.dataproc.v1.AutoscalingPolicy - * @instance - */ - AutoscalingPolicy.prototype.secondaryWorkerConfig = null; - - /** - * AutoscalingPolicy labels. - * @member {Object.} labels - * @memberof google.cloud.dataproc.v1.AutoscalingPolicy - * @instance - */ - AutoscalingPolicy.prototype.labels = $util.emptyObject; - - /** - * AutoscalingPolicy clusterType. - * @member {google.cloud.dataproc.v1.AutoscalingPolicy.ClusterType} clusterType - * @memberof google.cloud.dataproc.v1.AutoscalingPolicy - * @instance - */ - AutoscalingPolicy.prototype.clusterType = 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * AutoscalingPolicy algorithm. - * @member {"basicAlgorithm"|undefined} algorithm - * @memberof google.cloud.dataproc.v1.AutoscalingPolicy - * @instance - */ - Object.defineProperty(AutoscalingPolicy.prototype, "algorithm", { - get: $util.oneOfGetter($oneOfFields = ["basicAlgorithm"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new AutoscalingPolicy instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.AutoscalingPolicy - * @static - * @param {google.cloud.dataproc.v1.IAutoscalingPolicy=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.AutoscalingPolicy} AutoscalingPolicy instance - */ - AutoscalingPolicy.create = function create(properties) { - return new AutoscalingPolicy(properties); - }; - - /** - * Encodes the specified AutoscalingPolicy message. Does not implicitly {@link google.cloud.dataproc.v1.AutoscalingPolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.AutoscalingPolicy - * @static - * @param {google.cloud.dataproc.v1.IAutoscalingPolicy} message AutoscalingPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoscalingPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); - if (message.basicAlgorithm != null && Object.hasOwnProperty.call(message, "basicAlgorithm")) - $root.google.cloud.dataproc.v1.BasicAutoscalingAlgorithm.encode(message.basicAlgorithm, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.workerConfig != null && Object.hasOwnProperty.call(message, "workerConfig")) - $root.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig.encode(message.workerConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.secondaryWorkerConfig != null && Object.hasOwnProperty.call(message, "secondaryWorkerConfig")) - $root.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig.encode(message.secondaryWorkerConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.clusterType != null && Object.hasOwnProperty.call(message, "clusterType")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.clusterType); - return writer; - }; - - /** - * Encodes the specified AutoscalingPolicy message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.AutoscalingPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.AutoscalingPolicy - * @static - * @param {google.cloud.dataproc.v1.IAutoscalingPolicy} message AutoscalingPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoscalingPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AutoscalingPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.AutoscalingPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.AutoscalingPolicy} AutoscalingPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoscalingPolicy.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.AutoscalingPolicy(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.id = reader.string(); - break; - } - case 2: { - message.name = reader.string(); - break; - } - case 3: { - message.basicAlgorithm = $root.google.cloud.dataproc.v1.BasicAutoscalingAlgorithm.decode(reader, reader.uint32()); - break; - } - case 4: { - message.workerConfig = $root.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig.decode(reader, reader.uint32()); - break; - } - case 5: { - message.secondaryWorkerConfig = $root.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig.decode(reader, reader.uint32()); - break; - } - case 6: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 7: { - message.clusterType = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AutoscalingPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.AutoscalingPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.AutoscalingPolicy} AutoscalingPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoscalingPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AutoscalingPolicy message. - * @function verify - * @memberof google.cloud.dataproc.v1.AutoscalingPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AutoscalingPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.basicAlgorithm != null && message.hasOwnProperty("basicAlgorithm")) { - properties.algorithm = 1; - { - var error = $root.google.cloud.dataproc.v1.BasicAutoscalingAlgorithm.verify(message.basicAlgorithm); - if (error) - return "basicAlgorithm." + error; - } - } - if (message.workerConfig != null && message.hasOwnProperty("workerConfig")) { - var error = $root.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig.verify(message.workerConfig); - if (error) - return "workerConfig." + error; - } - if (message.secondaryWorkerConfig != null && message.hasOwnProperty("secondaryWorkerConfig")) { - var error = $root.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig.verify(message.secondaryWorkerConfig); - if (error) - return "secondaryWorkerConfig." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.clusterType != null && message.hasOwnProperty("clusterType")) - switch (message.clusterType) { - default: - return "clusterType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an AutoscalingPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.AutoscalingPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.AutoscalingPolicy} AutoscalingPolicy - */ - AutoscalingPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.AutoscalingPolicy) - return object; - var message = new $root.google.cloud.dataproc.v1.AutoscalingPolicy(); - if (object.id != null) - message.id = String(object.id); - if (object.name != null) - message.name = String(object.name); - if (object.basicAlgorithm != null) { - if (typeof object.basicAlgorithm !== "object") - throw TypeError(".google.cloud.dataproc.v1.AutoscalingPolicy.basicAlgorithm: object expected"); - message.basicAlgorithm = $root.google.cloud.dataproc.v1.BasicAutoscalingAlgorithm.fromObject(object.basicAlgorithm); - } - if (object.workerConfig != null) { - if (typeof object.workerConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.AutoscalingPolicy.workerConfig: object expected"); - message.workerConfig = $root.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig.fromObject(object.workerConfig); - } - if (object.secondaryWorkerConfig != null) { - if (typeof object.secondaryWorkerConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.AutoscalingPolicy.secondaryWorkerConfig: object expected"); - message.secondaryWorkerConfig = $root.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig.fromObject(object.secondaryWorkerConfig); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.dataproc.v1.AutoscalingPolicy.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - switch (object.clusterType) { - default: - if (typeof object.clusterType === "number") { - message.clusterType = object.clusterType; - break; - } - break; - case "CLUSTER_TYPE_UNSPECIFIED": - case 0: - message.clusterType = 0; - break; - case "STANDARD": - case 1: - message.clusterType = 1; - break; - case "ZERO_SCALE": - case 2: - message.clusterType = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an AutoscalingPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.AutoscalingPolicy - * @static - * @param {google.cloud.dataproc.v1.AutoscalingPolicy} message AutoscalingPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AutoscalingPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.id = ""; - object.name = ""; - object.workerConfig = null; - object.secondaryWorkerConfig = null; - object.clusterType = options.enums === String ? "CLUSTER_TYPE_UNSPECIFIED" : 0; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.basicAlgorithm != null && message.hasOwnProperty("basicAlgorithm")) { - object.basicAlgorithm = $root.google.cloud.dataproc.v1.BasicAutoscalingAlgorithm.toObject(message.basicAlgorithm, options); - if (options.oneofs) - object.algorithm = "basicAlgorithm"; - } - if (message.workerConfig != null && message.hasOwnProperty("workerConfig")) - object.workerConfig = $root.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig.toObject(message.workerConfig, options); - if (message.secondaryWorkerConfig != null && message.hasOwnProperty("secondaryWorkerConfig")) - object.secondaryWorkerConfig = $root.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig.toObject(message.secondaryWorkerConfig, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.clusterType != null && message.hasOwnProperty("clusterType")) - object.clusterType = options.enums === String ? $root.google.cloud.dataproc.v1.AutoscalingPolicy.ClusterType[message.clusterType] === undefined ? message.clusterType : $root.google.cloud.dataproc.v1.AutoscalingPolicy.ClusterType[message.clusterType] : message.clusterType; - return object; - }; - - /** - * Converts this AutoscalingPolicy to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.AutoscalingPolicy - * @instance - * @returns {Object.} JSON object - */ - AutoscalingPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AutoscalingPolicy - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.AutoscalingPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AutoscalingPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.AutoscalingPolicy"; - }; - - /** - * ClusterType enum. - * @name google.cloud.dataproc.v1.AutoscalingPolicy.ClusterType - * @enum {number} - * @property {number} CLUSTER_TYPE_UNSPECIFIED=0 CLUSTER_TYPE_UNSPECIFIED value - * @property {number} STANDARD=1 STANDARD value - * @property {number} ZERO_SCALE=2 ZERO_SCALE value - */ - AutoscalingPolicy.ClusterType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLUSTER_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "STANDARD"] = 1; - values[valuesById[2] = "ZERO_SCALE"] = 2; - return values; - })(); - - return AutoscalingPolicy; - })(); - - v1.BasicAutoscalingAlgorithm = (function() { - - /** - * Properties of a BasicAutoscalingAlgorithm. - * @memberof google.cloud.dataproc.v1 - * @interface IBasicAutoscalingAlgorithm - * @property {google.cloud.dataproc.v1.IBasicYarnAutoscalingConfig|null} [yarnConfig] BasicAutoscalingAlgorithm yarnConfig - * @property {google.protobuf.IDuration|null} [cooldownPeriod] BasicAutoscalingAlgorithm cooldownPeriod - */ - - /** - * Constructs a new BasicAutoscalingAlgorithm. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a BasicAutoscalingAlgorithm. - * @implements IBasicAutoscalingAlgorithm - * @constructor - * @param {google.cloud.dataproc.v1.IBasicAutoscalingAlgorithm=} [properties] Properties to set - */ - function BasicAutoscalingAlgorithm(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BasicAutoscalingAlgorithm yarnConfig. - * @member {google.cloud.dataproc.v1.IBasicYarnAutoscalingConfig|null|undefined} yarnConfig - * @memberof google.cloud.dataproc.v1.BasicAutoscalingAlgorithm - * @instance - */ - BasicAutoscalingAlgorithm.prototype.yarnConfig = null; - - /** - * BasicAutoscalingAlgorithm cooldownPeriod. - * @member {google.protobuf.IDuration|null|undefined} cooldownPeriod - * @memberof google.cloud.dataproc.v1.BasicAutoscalingAlgorithm - * @instance - */ - BasicAutoscalingAlgorithm.prototype.cooldownPeriod = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * BasicAutoscalingAlgorithm config. - * @member {"yarnConfig"|undefined} config - * @memberof google.cloud.dataproc.v1.BasicAutoscalingAlgorithm - * @instance - */ - Object.defineProperty(BasicAutoscalingAlgorithm.prototype, "config", { - get: $util.oneOfGetter($oneOfFields = ["yarnConfig"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new BasicAutoscalingAlgorithm instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.BasicAutoscalingAlgorithm - * @static - * @param {google.cloud.dataproc.v1.IBasicAutoscalingAlgorithm=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.BasicAutoscalingAlgorithm} BasicAutoscalingAlgorithm instance - */ - BasicAutoscalingAlgorithm.create = function create(properties) { - return new BasicAutoscalingAlgorithm(properties); - }; - - /** - * Encodes the specified BasicAutoscalingAlgorithm message. Does not implicitly {@link google.cloud.dataproc.v1.BasicAutoscalingAlgorithm.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.BasicAutoscalingAlgorithm - * @static - * @param {google.cloud.dataproc.v1.IBasicAutoscalingAlgorithm} message BasicAutoscalingAlgorithm message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BasicAutoscalingAlgorithm.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.yarnConfig != null && Object.hasOwnProperty.call(message, "yarnConfig")) - $root.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.encode(message.yarnConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.cooldownPeriod != null && Object.hasOwnProperty.call(message, "cooldownPeriod")) - $root.google.protobuf.Duration.encode(message.cooldownPeriod, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BasicAutoscalingAlgorithm message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.BasicAutoscalingAlgorithm.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.BasicAutoscalingAlgorithm - * @static - * @param {google.cloud.dataproc.v1.IBasicAutoscalingAlgorithm} message BasicAutoscalingAlgorithm message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BasicAutoscalingAlgorithm.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BasicAutoscalingAlgorithm message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.BasicAutoscalingAlgorithm - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.BasicAutoscalingAlgorithm} BasicAutoscalingAlgorithm - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BasicAutoscalingAlgorithm.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.BasicAutoscalingAlgorithm(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.yarnConfig = $root.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.decode(reader, reader.uint32()); - break; - } - case 2: { - message.cooldownPeriod = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BasicAutoscalingAlgorithm message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.BasicAutoscalingAlgorithm - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.BasicAutoscalingAlgorithm} BasicAutoscalingAlgorithm - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BasicAutoscalingAlgorithm.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BasicAutoscalingAlgorithm message. - * @function verify - * @memberof google.cloud.dataproc.v1.BasicAutoscalingAlgorithm - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BasicAutoscalingAlgorithm.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.yarnConfig != null && message.hasOwnProperty("yarnConfig")) { - properties.config = 1; - { - var error = $root.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.verify(message.yarnConfig); - if (error) - return "yarnConfig." + error; - } - } - if (message.cooldownPeriod != null && message.hasOwnProperty("cooldownPeriod")) { - var error = $root.google.protobuf.Duration.verify(message.cooldownPeriod); - if (error) - return "cooldownPeriod." + error; - } - return null; - }; - - /** - * Creates a BasicAutoscalingAlgorithm message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.BasicAutoscalingAlgorithm - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.BasicAutoscalingAlgorithm} BasicAutoscalingAlgorithm - */ - BasicAutoscalingAlgorithm.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.BasicAutoscalingAlgorithm) - return object; - var message = new $root.google.cloud.dataproc.v1.BasicAutoscalingAlgorithm(); - if (object.yarnConfig != null) { - if (typeof object.yarnConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.BasicAutoscalingAlgorithm.yarnConfig: object expected"); - message.yarnConfig = $root.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.fromObject(object.yarnConfig); - } - if (object.cooldownPeriod != null) { - if (typeof object.cooldownPeriod !== "object") - throw TypeError(".google.cloud.dataproc.v1.BasicAutoscalingAlgorithm.cooldownPeriod: object expected"); - message.cooldownPeriod = $root.google.protobuf.Duration.fromObject(object.cooldownPeriod); - } - return message; - }; - - /** - * Creates a plain object from a BasicAutoscalingAlgorithm message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.BasicAutoscalingAlgorithm - * @static - * @param {google.cloud.dataproc.v1.BasicAutoscalingAlgorithm} message BasicAutoscalingAlgorithm - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BasicAutoscalingAlgorithm.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.cooldownPeriod = null; - if (message.yarnConfig != null && message.hasOwnProperty("yarnConfig")) { - object.yarnConfig = $root.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.toObject(message.yarnConfig, options); - if (options.oneofs) - object.config = "yarnConfig"; - } - if (message.cooldownPeriod != null && message.hasOwnProperty("cooldownPeriod")) - object.cooldownPeriod = $root.google.protobuf.Duration.toObject(message.cooldownPeriod, options); - return object; - }; - - /** - * Converts this BasicAutoscalingAlgorithm to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.BasicAutoscalingAlgorithm - * @instance - * @returns {Object.} JSON object - */ - BasicAutoscalingAlgorithm.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BasicAutoscalingAlgorithm - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.BasicAutoscalingAlgorithm - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BasicAutoscalingAlgorithm.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.BasicAutoscalingAlgorithm"; - }; - - return BasicAutoscalingAlgorithm; - })(); - - v1.BasicYarnAutoscalingConfig = (function() { - - /** - * Properties of a BasicYarnAutoscalingConfig. - * @memberof google.cloud.dataproc.v1 - * @interface IBasicYarnAutoscalingConfig - * @property {google.protobuf.IDuration|null} [gracefulDecommissionTimeout] BasicYarnAutoscalingConfig gracefulDecommissionTimeout - * @property {number|null} [scaleUpFactor] BasicYarnAutoscalingConfig scaleUpFactor - * @property {number|null} [scaleDownFactor] BasicYarnAutoscalingConfig scaleDownFactor - * @property {number|null} [scaleUpMinWorkerFraction] BasicYarnAutoscalingConfig scaleUpMinWorkerFraction - * @property {number|null} [scaleDownMinWorkerFraction] BasicYarnAutoscalingConfig scaleDownMinWorkerFraction - */ - - /** - * Constructs a new BasicYarnAutoscalingConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a BasicYarnAutoscalingConfig. - * @implements IBasicYarnAutoscalingConfig - * @constructor - * @param {google.cloud.dataproc.v1.IBasicYarnAutoscalingConfig=} [properties] Properties to set - */ - function BasicYarnAutoscalingConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BasicYarnAutoscalingConfig gracefulDecommissionTimeout. - * @member {google.protobuf.IDuration|null|undefined} gracefulDecommissionTimeout - * @memberof google.cloud.dataproc.v1.BasicYarnAutoscalingConfig - * @instance - */ - BasicYarnAutoscalingConfig.prototype.gracefulDecommissionTimeout = null; - - /** - * BasicYarnAutoscalingConfig scaleUpFactor. - * @member {number} scaleUpFactor - * @memberof google.cloud.dataproc.v1.BasicYarnAutoscalingConfig - * @instance - */ - BasicYarnAutoscalingConfig.prototype.scaleUpFactor = 0; - - /** - * BasicYarnAutoscalingConfig scaleDownFactor. - * @member {number} scaleDownFactor - * @memberof google.cloud.dataproc.v1.BasicYarnAutoscalingConfig - * @instance - */ - BasicYarnAutoscalingConfig.prototype.scaleDownFactor = 0; - - /** - * BasicYarnAutoscalingConfig scaleUpMinWorkerFraction. - * @member {number} scaleUpMinWorkerFraction - * @memberof google.cloud.dataproc.v1.BasicYarnAutoscalingConfig - * @instance - */ - BasicYarnAutoscalingConfig.prototype.scaleUpMinWorkerFraction = 0; - - /** - * BasicYarnAutoscalingConfig scaleDownMinWorkerFraction. - * @member {number} scaleDownMinWorkerFraction - * @memberof google.cloud.dataproc.v1.BasicYarnAutoscalingConfig - * @instance - */ - BasicYarnAutoscalingConfig.prototype.scaleDownMinWorkerFraction = 0; - - /** - * Creates a new BasicYarnAutoscalingConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.BasicYarnAutoscalingConfig - * @static - * @param {google.cloud.dataproc.v1.IBasicYarnAutoscalingConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.BasicYarnAutoscalingConfig} BasicYarnAutoscalingConfig instance - */ - BasicYarnAutoscalingConfig.create = function create(properties) { - return new BasicYarnAutoscalingConfig(properties); - }; - - /** - * Encodes the specified BasicYarnAutoscalingConfig message. Does not implicitly {@link google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.BasicYarnAutoscalingConfig - * @static - * @param {google.cloud.dataproc.v1.IBasicYarnAutoscalingConfig} message BasicYarnAutoscalingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BasicYarnAutoscalingConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.scaleUpFactor != null && Object.hasOwnProperty.call(message, "scaleUpFactor")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.scaleUpFactor); - if (message.scaleDownFactor != null && Object.hasOwnProperty.call(message, "scaleDownFactor")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.scaleDownFactor); - if (message.scaleUpMinWorkerFraction != null && Object.hasOwnProperty.call(message, "scaleUpMinWorkerFraction")) - writer.uint32(/* id 3, wireType 1 =*/25).double(message.scaleUpMinWorkerFraction); - if (message.scaleDownMinWorkerFraction != null && Object.hasOwnProperty.call(message, "scaleDownMinWorkerFraction")) - writer.uint32(/* id 4, wireType 1 =*/33).double(message.scaleDownMinWorkerFraction); - if (message.gracefulDecommissionTimeout != null && Object.hasOwnProperty.call(message, "gracefulDecommissionTimeout")) - $root.google.protobuf.Duration.encode(message.gracefulDecommissionTimeout, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BasicYarnAutoscalingConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.BasicYarnAutoscalingConfig - * @static - * @param {google.cloud.dataproc.v1.IBasicYarnAutoscalingConfig} message BasicYarnAutoscalingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BasicYarnAutoscalingConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BasicYarnAutoscalingConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.BasicYarnAutoscalingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.BasicYarnAutoscalingConfig} BasicYarnAutoscalingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BasicYarnAutoscalingConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 5: { - message.gracefulDecommissionTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 1: { - message.scaleUpFactor = reader.double(); - break; - } - case 2: { - message.scaleDownFactor = reader.double(); - break; - } - case 3: { - message.scaleUpMinWorkerFraction = reader.double(); - break; - } - case 4: { - message.scaleDownMinWorkerFraction = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BasicYarnAutoscalingConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.BasicYarnAutoscalingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.BasicYarnAutoscalingConfig} BasicYarnAutoscalingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BasicYarnAutoscalingConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BasicYarnAutoscalingConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.BasicYarnAutoscalingConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BasicYarnAutoscalingConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.gracefulDecommissionTimeout != null && message.hasOwnProperty("gracefulDecommissionTimeout")) { - var error = $root.google.protobuf.Duration.verify(message.gracefulDecommissionTimeout); - if (error) - return "gracefulDecommissionTimeout." + error; - } - if (message.scaleUpFactor != null && message.hasOwnProperty("scaleUpFactor")) - if (typeof message.scaleUpFactor !== "number") - return "scaleUpFactor: number expected"; - if (message.scaleDownFactor != null && message.hasOwnProperty("scaleDownFactor")) - if (typeof message.scaleDownFactor !== "number") - return "scaleDownFactor: number expected"; - if (message.scaleUpMinWorkerFraction != null && message.hasOwnProperty("scaleUpMinWorkerFraction")) - if (typeof message.scaleUpMinWorkerFraction !== "number") - return "scaleUpMinWorkerFraction: number expected"; - if (message.scaleDownMinWorkerFraction != null && message.hasOwnProperty("scaleDownMinWorkerFraction")) - if (typeof message.scaleDownMinWorkerFraction !== "number") - return "scaleDownMinWorkerFraction: number expected"; - return null; - }; - - /** - * Creates a BasicYarnAutoscalingConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.BasicYarnAutoscalingConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.BasicYarnAutoscalingConfig} BasicYarnAutoscalingConfig - */ - BasicYarnAutoscalingConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.BasicYarnAutoscalingConfig(); - if (object.gracefulDecommissionTimeout != null) { - if (typeof object.gracefulDecommissionTimeout !== "object") - throw TypeError(".google.cloud.dataproc.v1.BasicYarnAutoscalingConfig.gracefulDecommissionTimeout: object expected"); - message.gracefulDecommissionTimeout = $root.google.protobuf.Duration.fromObject(object.gracefulDecommissionTimeout); - } - if (object.scaleUpFactor != null) - message.scaleUpFactor = Number(object.scaleUpFactor); - if (object.scaleDownFactor != null) - message.scaleDownFactor = Number(object.scaleDownFactor); - if (object.scaleUpMinWorkerFraction != null) - message.scaleUpMinWorkerFraction = Number(object.scaleUpMinWorkerFraction); - if (object.scaleDownMinWorkerFraction != null) - message.scaleDownMinWorkerFraction = Number(object.scaleDownMinWorkerFraction); - return message; - }; - - /** - * Creates a plain object from a BasicYarnAutoscalingConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.BasicYarnAutoscalingConfig - * @static - * @param {google.cloud.dataproc.v1.BasicYarnAutoscalingConfig} message BasicYarnAutoscalingConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BasicYarnAutoscalingConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.scaleUpFactor = 0; - object.scaleDownFactor = 0; - object.scaleUpMinWorkerFraction = 0; - object.scaleDownMinWorkerFraction = 0; - object.gracefulDecommissionTimeout = null; - } - if (message.scaleUpFactor != null && message.hasOwnProperty("scaleUpFactor")) - object.scaleUpFactor = options.json && !isFinite(message.scaleUpFactor) ? String(message.scaleUpFactor) : message.scaleUpFactor; - if (message.scaleDownFactor != null && message.hasOwnProperty("scaleDownFactor")) - object.scaleDownFactor = options.json && !isFinite(message.scaleDownFactor) ? String(message.scaleDownFactor) : message.scaleDownFactor; - if (message.scaleUpMinWorkerFraction != null && message.hasOwnProperty("scaleUpMinWorkerFraction")) - object.scaleUpMinWorkerFraction = options.json && !isFinite(message.scaleUpMinWorkerFraction) ? String(message.scaleUpMinWorkerFraction) : message.scaleUpMinWorkerFraction; - if (message.scaleDownMinWorkerFraction != null && message.hasOwnProperty("scaleDownMinWorkerFraction")) - object.scaleDownMinWorkerFraction = options.json && !isFinite(message.scaleDownMinWorkerFraction) ? String(message.scaleDownMinWorkerFraction) : message.scaleDownMinWorkerFraction; - if (message.gracefulDecommissionTimeout != null && message.hasOwnProperty("gracefulDecommissionTimeout")) - object.gracefulDecommissionTimeout = $root.google.protobuf.Duration.toObject(message.gracefulDecommissionTimeout, options); - return object; - }; - - /** - * Converts this BasicYarnAutoscalingConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.BasicYarnAutoscalingConfig - * @instance - * @returns {Object.} JSON object - */ - BasicYarnAutoscalingConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BasicYarnAutoscalingConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.BasicYarnAutoscalingConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BasicYarnAutoscalingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.BasicYarnAutoscalingConfig"; - }; - - return BasicYarnAutoscalingConfig; - })(); - - v1.InstanceGroupAutoscalingPolicyConfig = (function() { - - /** - * Properties of an InstanceGroupAutoscalingPolicyConfig. - * @memberof google.cloud.dataproc.v1 - * @interface IInstanceGroupAutoscalingPolicyConfig - * @property {number|null} [minInstances] InstanceGroupAutoscalingPolicyConfig minInstances - * @property {number|null} [maxInstances] InstanceGroupAutoscalingPolicyConfig maxInstances - * @property {number|null} [weight] InstanceGroupAutoscalingPolicyConfig weight - */ - - /** - * Constructs a new InstanceGroupAutoscalingPolicyConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents an InstanceGroupAutoscalingPolicyConfig. - * @implements IInstanceGroupAutoscalingPolicyConfig - * @constructor - * @param {google.cloud.dataproc.v1.IInstanceGroupAutoscalingPolicyConfig=} [properties] Properties to set - */ - function InstanceGroupAutoscalingPolicyConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstanceGroupAutoscalingPolicyConfig minInstances. - * @member {number} minInstances - * @memberof google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig - * @instance - */ - InstanceGroupAutoscalingPolicyConfig.prototype.minInstances = 0; - - /** - * InstanceGroupAutoscalingPolicyConfig maxInstances. - * @member {number} maxInstances - * @memberof google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig - * @instance - */ - InstanceGroupAutoscalingPolicyConfig.prototype.maxInstances = 0; - - /** - * InstanceGroupAutoscalingPolicyConfig weight. - * @member {number} weight - * @memberof google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig - * @instance - */ - InstanceGroupAutoscalingPolicyConfig.prototype.weight = 0; - - /** - * Creates a new InstanceGroupAutoscalingPolicyConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig - * @static - * @param {google.cloud.dataproc.v1.IInstanceGroupAutoscalingPolicyConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig} InstanceGroupAutoscalingPolicyConfig instance - */ - InstanceGroupAutoscalingPolicyConfig.create = function create(properties) { - return new InstanceGroupAutoscalingPolicyConfig(properties); - }; - - /** - * Encodes the specified InstanceGroupAutoscalingPolicyConfig message. Does not implicitly {@link google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig - * @static - * @param {google.cloud.dataproc.v1.IInstanceGroupAutoscalingPolicyConfig} message InstanceGroupAutoscalingPolicyConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceGroupAutoscalingPolicyConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.minInstances != null && Object.hasOwnProperty.call(message, "minInstances")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.minInstances); - if (message.maxInstances != null && Object.hasOwnProperty.call(message, "maxInstances")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxInstances); - if (message.weight != null && Object.hasOwnProperty.call(message, "weight")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.weight); - return writer; - }; - - /** - * Encodes the specified InstanceGroupAutoscalingPolicyConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig - * @static - * @param {google.cloud.dataproc.v1.IInstanceGroupAutoscalingPolicyConfig} message InstanceGroupAutoscalingPolicyConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceGroupAutoscalingPolicyConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstanceGroupAutoscalingPolicyConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig} InstanceGroupAutoscalingPolicyConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceGroupAutoscalingPolicyConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.minInstances = reader.int32(); - break; - } - case 2: { - message.maxInstances = reader.int32(); - break; - } - case 3: { - message.weight = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstanceGroupAutoscalingPolicyConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig} InstanceGroupAutoscalingPolicyConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceGroupAutoscalingPolicyConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstanceGroupAutoscalingPolicyConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstanceGroupAutoscalingPolicyConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.minInstances != null && message.hasOwnProperty("minInstances")) - if (!$util.isInteger(message.minInstances)) - return "minInstances: integer expected"; - if (message.maxInstances != null && message.hasOwnProperty("maxInstances")) - if (!$util.isInteger(message.maxInstances)) - return "maxInstances: integer expected"; - if (message.weight != null && message.hasOwnProperty("weight")) - if (!$util.isInteger(message.weight)) - return "weight: integer expected"; - return null; - }; - - /** - * Creates an InstanceGroupAutoscalingPolicyConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig} InstanceGroupAutoscalingPolicyConfig - */ - InstanceGroupAutoscalingPolicyConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig(); - if (object.minInstances != null) - message.minInstances = object.minInstances | 0; - if (object.maxInstances != null) - message.maxInstances = object.maxInstances | 0; - if (object.weight != null) - message.weight = object.weight | 0; - return message; - }; - - /** - * Creates a plain object from an InstanceGroupAutoscalingPolicyConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig - * @static - * @param {google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig} message InstanceGroupAutoscalingPolicyConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstanceGroupAutoscalingPolicyConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.minInstances = 0; - object.maxInstances = 0; - object.weight = 0; - } - if (message.minInstances != null && message.hasOwnProperty("minInstances")) - object.minInstances = message.minInstances; - if (message.maxInstances != null && message.hasOwnProperty("maxInstances")) - object.maxInstances = message.maxInstances; - if (message.weight != null && message.hasOwnProperty("weight")) - object.weight = message.weight; - return object; - }; - - /** - * Converts this InstanceGroupAutoscalingPolicyConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig - * @instance - * @returns {Object.} JSON object - */ - InstanceGroupAutoscalingPolicyConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InstanceGroupAutoscalingPolicyConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstanceGroupAutoscalingPolicyConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.InstanceGroupAutoscalingPolicyConfig"; - }; - - return InstanceGroupAutoscalingPolicyConfig; - })(); - - v1.CreateAutoscalingPolicyRequest = (function() { - - /** - * Properties of a CreateAutoscalingPolicyRequest. - * @memberof google.cloud.dataproc.v1 - * @interface ICreateAutoscalingPolicyRequest - * @property {string|null} [parent] CreateAutoscalingPolicyRequest parent - * @property {google.cloud.dataproc.v1.IAutoscalingPolicy|null} [policy] CreateAutoscalingPolicyRequest policy - */ - - /** - * Constructs a new CreateAutoscalingPolicyRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a CreateAutoscalingPolicyRequest. - * @implements ICreateAutoscalingPolicyRequest - * @constructor - * @param {google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest=} [properties] Properties to set - */ - function CreateAutoscalingPolicyRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateAutoscalingPolicyRequest parent. - * @member {string} parent - * @memberof google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest - * @instance - */ - CreateAutoscalingPolicyRequest.prototype.parent = ""; - - /** - * CreateAutoscalingPolicyRequest policy. - * @member {google.cloud.dataproc.v1.IAutoscalingPolicy|null|undefined} policy - * @memberof google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest - * @instance - */ - CreateAutoscalingPolicyRequest.prototype.policy = null; - - /** - * Creates a new CreateAutoscalingPolicyRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest - * @static - * @param {google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest} CreateAutoscalingPolicyRequest instance - */ - CreateAutoscalingPolicyRequest.create = function create(properties) { - return new CreateAutoscalingPolicyRequest(properties); - }; - - /** - * Encodes the specified CreateAutoscalingPolicyRequest message. Does not implicitly {@link google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest - * @static - * @param {google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest} message CreateAutoscalingPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateAutoscalingPolicyRequest.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.policy != null && Object.hasOwnProperty.call(message, "policy")) - $root.google.cloud.dataproc.v1.AutoscalingPolicy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateAutoscalingPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest - * @static - * @param {google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest} message CreateAutoscalingPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateAutoscalingPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateAutoscalingPolicyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest} CreateAutoscalingPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateAutoscalingPolicyRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest(); - 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.policy = $root.google.cloud.dataproc.v1.AutoscalingPolicy.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateAutoscalingPolicyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest} CreateAutoscalingPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateAutoscalingPolicyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateAutoscalingPolicyRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateAutoscalingPolicyRequest.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.policy != null && message.hasOwnProperty("policy")) { - var error = $root.google.cloud.dataproc.v1.AutoscalingPolicy.verify(message.policy); - if (error) - return "policy." + error; - } - return null; - }; - - /** - * Creates a CreateAutoscalingPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest} CreateAutoscalingPolicyRequest - */ - CreateAutoscalingPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.policy != null) { - if (typeof object.policy !== "object") - throw TypeError(".google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest.policy: object expected"); - message.policy = $root.google.cloud.dataproc.v1.AutoscalingPolicy.fromObject(object.policy); - } - return message; - }; - - /** - * Creates a plain object from a CreateAutoscalingPolicyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest - * @static - * @param {google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest} message CreateAutoscalingPolicyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateAutoscalingPolicyRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.policy = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.policy != null && message.hasOwnProperty("policy")) - object.policy = $root.google.cloud.dataproc.v1.AutoscalingPolicy.toObject(message.policy, options); - return object; - }; - - /** - * Converts this CreateAutoscalingPolicyRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest - * @instance - * @returns {Object.} JSON object - */ - CreateAutoscalingPolicyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateAutoscalingPolicyRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateAutoscalingPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest"; - }; - - return CreateAutoscalingPolicyRequest; - })(); - - v1.GetAutoscalingPolicyRequest = (function() { - - /** - * Properties of a GetAutoscalingPolicyRequest. - * @memberof google.cloud.dataproc.v1 - * @interface IGetAutoscalingPolicyRequest - * @property {string|null} [name] GetAutoscalingPolicyRequest name - */ - - /** - * Constructs a new GetAutoscalingPolicyRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a GetAutoscalingPolicyRequest. - * @implements IGetAutoscalingPolicyRequest - * @constructor - * @param {google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest=} [properties] Properties to set - */ - function GetAutoscalingPolicyRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetAutoscalingPolicyRequest name. - * @member {string} name - * @memberof google.cloud.dataproc.v1.GetAutoscalingPolicyRequest - * @instance - */ - GetAutoscalingPolicyRequest.prototype.name = ""; - - /** - * Creates a new GetAutoscalingPolicyRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.GetAutoscalingPolicyRequest - * @static - * @param {google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.GetAutoscalingPolicyRequest} GetAutoscalingPolicyRequest instance - */ - GetAutoscalingPolicyRequest.create = function create(properties) { - return new GetAutoscalingPolicyRequest(properties); - }; - - /** - * Encodes the specified GetAutoscalingPolicyRequest message. Does not implicitly {@link google.cloud.dataproc.v1.GetAutoscalingPolicyRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.GetAutoscalingPolicyRequest - * @static - * @param {google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest} message GetAutoscalingPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetAutoscalingPolicyRequest.encode = function encode(message, writer) { - 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 GetAutoscalingPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GetAutoscalingPolicyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.GetAutoscalingPolicyRequest - * @static - * @param {google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest} message GetAutoscalingPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetAutoscalingPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetAutoscalingPolicyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.GetAutoscalingPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.GetAutoscalingPolicyRequest} GetAutoscalingPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetAutoscalingPolicyRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest(); - 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 GetAutoscalingPolicyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.GetAutoscalingPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.GetAutoscalingPolicyRequest} GetAutoscalingPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetAutoscalingPolicyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetAutoscalingPolicyRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.GetAutoscalingPolicyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetAutoscalingPolicyRequest.verify = function verify(message) { - if (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 GetAutoscalingPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.GetAutoscalingPolicyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.GetAutoscalingPolicyRequest} GetAutoscalingPolicyRequest - */ - GetAutoscalingPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetAutoscalingPolicyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.GetAutoscalingPolicyRequest - * @static - * @param {google.cloud.dataproc.v1.GetAutoscalingPolicyRequest} message GetAutoscalingPolicyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetAutoscalingPolicyRequest.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 GetAutoscalingPolicyRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.GetAutoscalingPolicyRequest - * @instance - * @returns {Object.} JSON object - */ - GetAutoscalingPolicyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetAutoscalingPolicyRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.GetAutoscalingPolicyRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetAutoscalingPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.GetAutoscalingPolicyRequest"; - }; - - return GetAutoscalingPolicyRequest; - })(); - - v1.UpdateAutoscalingPolicyRequest = (function() { - - /** - * Properties of an UpdateAutoscalingPolicyRequest. - * @memberof google.cloud.dataproc.v1 - * @interface IUpdateAutoscalingPolicyRequest - * @property {google.cloud.dataproc.v1.IAutoscalingPolicy|null} [policy] UpdateAutoscalingPolicyRequest policy - */ - - /** - * Constructs a new UpdateAutoscalingPolicyRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents an UpdateAutoscalingPolicyRequest. - * @implements IUpdateAutoscalingPolicyRequest - * @constructor - * @param {google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest=} [properties] Properties to set - */ - function UpdateAutoscalingPolicyRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateAutoscalingPolicyRequest policy. - * @member {google.cloud.dataproc.v1.IAutoscalingPolicy|null|undefined} policy - * @memberof google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest - * @instance - */ - UpdateAutoscalingPolicyRequest.prototype.policy = null; - - /** - * Creates a new UpdateAutoscalingPolicyRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest - * @static - * @param {google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest} UpdateAutoscalingPolicyRequest instance - */ - UpdateAutoscalingPolicyRequest.create = function create(properties) { - return new UpdateAutoscalingPolicyRequest(properties); - }; - - /** - * Encodes the specified UpdateAutoscalingPolicyRequest message. Does not implicitly {@link google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest - * @static - * @param {google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest} message UpdateAutoscalingPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateAutoscalingPolicyRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) - $root.google.cloud.dataproc.v1.AutoscalingPolicy.encode(message.policy, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateAutoscalingPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest - * @static - * @param {google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest} message UpdateAutoscalingPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateAutoscalingPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateAutoscalingPolicyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest} UpdateAutoscalingPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateAutoscalingPolicyRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.policy = $root.google.cloud.dataproc.v1.AutoscalingPolicy.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateAutoscalingPolicyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest} UpdateAutoscalingPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateAutoscalingPolicyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateAutoscalingPolicyRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateAutoscalingPolicyRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.policy != null && message.hasOwnProperty("policy")) { - var error = $root.google.cloud.dataproc.v1.AutoscalingPolicy.verify(message.policy); - if (error) - return "policy." + error; - } - return null; - }; - - /** - * Creates an UpdateAutoscalingPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest} UpdateAutoscalingPolicyRequest - */ - UpdateAutoscalingPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest(); - if (object.policy != null) { - if (typeof object.policy !== "object") - throw TypeError(".google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest.policy: object expected"); - message.policy = $root.google.cloud.dataproc.v1.AutoscalingPolicy.fromObject(object.policy); - } - return message; - }; - - /** - * Creates a plain object from an UpdateAutoscalingPolicyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest - * @static - * @param {google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest} message UpdateAutoscalingPolicyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateAutoscalingPolicyRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.policy = null; - if (message.policy != null && message.hasOwnProperty("policy")) - object.policy = $root.google.cloud.dataproc.v1.AutoscalingPolicy.toObject(message.policy, options); - return object; - }; - - /** - * Converts this UpdateAutoscalingPolicyRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateAutoscalingPolicyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateAutoscalingPolicyRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateAutoscalingPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest"; - }; - - return UpdateAutoscalingPolicyRequest; - })(); - - v1.DeleteAutoscalingPolicyRequest = (function() { - - /** - * Properties of a DeleteAutoscalingPolicyRequest. - * @memberof google.cloud.dataproc.v1 - * @interface IDeleteAutoscalingPolicyRequest - * @property {string|null} [name] DeleteAutoscalingPolicyRequest name - */ - - /** - * Constructs a new DeleteAutoscalingPolicyRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a DeleteAutoscalingPolicyRequest. - * @implements IDeleteAutoscalingPolicyRequest - * @constructor - * @param {google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest=} [properties] Properties to set - */ - function DeleteAutoscalingPolicyRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteAutoscalingPolicyRequest name. - * @member {string} name - * @memberof google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest - * @instance - */ - DeleteAutoscalingPolicyRequest.prototype.name = ""; - - /** - * Creates a new DeleteAutoscalingPolicyRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest - * @static - * @param {google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest} DeleteAutoscalingPolicyRequest instance - */ - DeleteAutoscalingPolicyRequest.create = function create(properties) { - return new DeleteAutoscalingPolicyRequest(properties); - }; - - /** - * Encodes the specified DeleteAutoscalingPolicyRequest message. Does not implicitly {@link google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest - * @static - * @param {google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest} message DeleteAutoscalingPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteAutoscalingPolicyRequest.encode = function encode(message, writer) { - 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 DeleteAutoscalingPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest - * @static - * @param {google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest} message DeleteAutoscalingPolicyRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteAutoscalingPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteAutoscalingPolicyRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest} DeleteAutoscalingPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteAutoscalingPolicyRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest(); - 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 DeleteAutoscalingPolicyRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest} DeleteAutoscalingPolicyRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteAutoscalingPolicyRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteAutoscalingPolicyRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteAutoscalingPolicyRequest.verify = function verify(message) { - if (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 DeleteAutoscalingPolicyRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest} DeleteAutoscalingPolicyRequest - */ - DeleteAutoscalingPolicyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteAutoscalingPolicyRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest - * @static - * @param {google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest} message DeleteAutoscalingPolicyRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteAutoscalingPolicyRequest.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 DeleteAutoscalingPolicyRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteAutoscalingPolicyRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteAutoscalingPolicyRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteAutoscalingPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest"; - }; - - return DeleteAutoscalingPolicyRequest; - })(); - - v1.ListAutoscalingPoliciesRequest = (function() { - - /** - * Properties of a ListAutoscalingPoliciesRequest. - * @memberof google.cloud.dataproc.v1 - * @interface IListAutoscalingPoliciesRequest - * @property {string|null} [parent] ListAutoscalingPoliciesRequest parent - * @property {number|null} [pageSize] ListAutoscalingPoliciesRequest pageSize - * @property {string|null} [pageToken] ListAutoscalingPoliciesRequest pageToken - */ - - /** - * Constructs a new ListAutoscalingPoliciesRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a ListAutoscalingPoliciesRequest. - * @implements IListAutoscalingPoliciesRequest - * @constructor - * @param {google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest=} [properties] Properties to set - */ - function ListAutoscalingPoliciesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListAutoscalingPoliciesRequest parent. - * @member {string} parent - * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest - * @instance - */ - ListAutoscalingPoliciesRequest.prototype.parent = ""; - - /** - * ListAutoscalingPoliciesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest - * @instance - */ - ListAutoscalingPoliciesRequest.prototype.pageSize = 0; - - /** - * ListAutoscalingPoliciesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest - * @instance - */ - ListAutoscalingPoliciesRequest.prototype.pageToken = ""; - - /** - * Creates a new ListAutoscalingPoliciesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest - * @static - * @param {google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest} ListAutoscalingPoliciesRequest instance - */ - ListAutoscalingPoliciesRequest.create = function create(properties) { - return new ListAutoscalingPoliciesRequest(properties); - }; - - /** - * Encodes the specified ListAutoscalingPoliciesRequest message. Does not implicitly {@link google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest - * @static - * @param {google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest} message ListAutoscalingPoliciesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAutoscalingPoliciesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListAutoscalingPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest - * @static - * @param {google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest} message ListAutoscalingPoliciesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAutoscalingPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListAutoscalingPoliciesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest} ListAutoscalingPoliciesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAutoscalingPoliciesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListAutoscalingPoliciesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest} ListAutoscalingPoliciesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAutoscalingPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListAutoscalingPoliciesRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAutoscalingPoliciesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListAutoscalingPoliciesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest} ListAutoscalingPoliciesRequest - */ - ListAutoscalingPoliciesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListAutoscalingPoliciesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest - * @static - * @param {google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest} message ListAutoscalingPoliciesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAutoscalingPoliciesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListAutoscalingPoliciesRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest - * @instance - * @returns {Object.} JSON object - */ - ListAutoscalingPoliciesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListAutoscalingPoliciesRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListAutoscalingPoliciesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest"; - }; - - return ListAutoscalingPoliciesRequest; - })(); - - v1.ListAutoscalingPoliciesResponse = (function() { - - /** - * Properties of a ListAutoscalingPoliciesResponse. - * @memberof google.cloud.dataproc.v1 - * @interface IListAutoscalingPoliciesResponse - * @property {Array.|null} [policies] ListAutoscalingPoliciesResponse policies - * @property {string|null} [nextPageToken] ListAutoscalingPoliciesResponse nextPageToken - */ - - /** - * Constructs a new ListAutoscalingPoliciesResponse. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a ListAutoscalingPoliciesResponse. - * @implements IListAutoscalingPoliciesResponse - * @constructor - * @param {google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse=} [properties] Properties to set - */ - function ListAutoscalingPoliciesResponse(properties) { - this.policies = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListAutoscalingPoliciesResponse policies. - * @member {Array.} policies - * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse - * @instance - */ - ListAutoscalingPoliciesResponse.prototype.policies = $util.emptyArray; - - /** - * ListAutoscalingPoliciesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse - * @instance - */ - ListAutoscalingPoliciesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListAutoscalingPoliciesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse - * @static - * @param {google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse} ListAutoscalingPoliciesResponse instance - */ - ListAutoscalingPoliciesResponse.create = function create(properties) { - return new ListAutoscalingPoliciesResponse(properties); - }; - - /** - * Encodes the specified ListAutoscalingPoliciesResponse message. Does not implicitly {@link google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse - * @static - * @param {google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse} message ListAutoscalingPoliciesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAutoscalingPoliciesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.policies != null && message.policies.length) - for (var i = 0; i < message.policies.length; ++i) - $root.google.cloud.dataproc.v1.AutoscalingPolicy.encode(message.policies[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 ListAutoscalingPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse - * @static - * @param {google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse} message ListAutoscalingPoliciesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListAutoscalingPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListAutoscalingPoliciesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse} ListAutoscalingPoliciesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAutoscalingPoliciesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.policies && message.policies.length)) - message.policies = []; - message.policies.push($root.google.cloud.dataproc.v1.AutoscalingPolicy.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListAutoscalingPoliciesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse} ListAutoscalingPoliciesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListAutoscalingPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListAutoscalingPoliciesResponse message. - * @function verify - * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListAutoscalingPoliciesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.policies != null && message.hasOwnProperty("policies")) { - if (!Array.isArray(message.policies)) - return "policies: array expected"; - for (var i = 0; i < message.policies.length; ++i) { - var error = $root.google.cloud.dataproc.v1.AutoscalingPolicy.verify(message.policies[i]); - if (error) - return "policies." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListAutoscalingPoliciesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse} ListAutoscalingPoliciesResponse - */ - ListAutoscalingPoliciesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse) - return object; - var message = new $root.google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse(); - if (object.policies) { - if (!Array.isArray(object.policies)) - throw TypeError(".google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse.policies: array expected"); - message.policies = []; - for (var i = 0; i < object.policies.length; ++i) { - if (typeof object.policies[i] !== "object") - throw TypeError(".google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse.policies: object expected"); - message.policies[i] = $root.google.cloud.dataproc.v1.AutoscalingPolicy.fromObject(object.policies[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListAutoscalingPoliciesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse - * @static - * @param {google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse} message ListAutoscalingPoliciesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListAutoscalingPoliciesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.policies = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.policies && message.policies.length) { - object.policies = []; - for (var j = 0; j < message.policies.length; ++j) - object.policies[j] = $root.google.cloud.dataproc.v1.AutoscalingPolicy.toObject(message.policies[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListAutoscalingPoliciesResponse to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse - * @instance - * @returns {Object.} JSON object - */ - ListAutoscalingPoliciesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListAutoscalingPoliciesResponse - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListAutoscalingPoliciesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse"; - }; - - return ListAutoscalingPoliciesResponse; - })(); - - v1.BatchController = (function() { - - /** - * Constructs a new BatchController service. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a BatchController - * @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 BatchController(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (BatchController.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = BatchController; - - /** - * Creates new BatchController service using the specified rpc implementation. - * @function create - * @memberof google.cloud.dataproc.v1.BatchController - * @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 {BatchController} RPC service. Useful where requests and/or responses are streamed. - */ - BatchController.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.BatchController|createBatch}. - * @memberof google.cloud.dataproc.v1.BatchController - * @typedef CreateBatchCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateBatch. - * @function createBatch - * @memberof google.cloud.dataproc.v1.BatchController - * @instance - * @param {google.cloud.dataproc.v1.ICreateBatchRequest} request CreateBatchRequest message or plain object - * @param {google.cloud.dataproc.v1.BatchController.CreateBatchCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchController.prototype.createBatch = function createBatch(request, callback) { - return this.rpcCall(createBatch, $root.google.cloud.dataproc.v1.CreateBatchRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateBatch" }); - - /** - * Calls CreateBatch. - * @function createBatch - * @memberof google.cloud.dataproc.v1.BatchController - * @instance - * @param {google.cloud.dataproc.v1.ICreateBatchRequest} request CreateBatchRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.BatchController|getBatch}. - * @memberof google.cloud.dataproc.v1.BatchController - * @typedef GetBatchCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dataproc.v1.Batch} [response] Batch - */ - - /** - * Calls GetBatch. - * @function getBatch - * @memberof google.cloud.dataproc.v1.BatchController - * @instance - * @param {google.cloud.dataproc.v1.IGetBatchRequest} request GetBatchRequest message or plain object - * @param {google.cloud.dataproc.v1.BatchController.GetBatchCallback} callback Node-style callback called with the error, if any, and Batch - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchController.prototype.getBatch = function getBatch(request, callback) { - return this.rpcCall(getBatch, $root.google.cloud.dataproc.v1.GetBatchRequest, $root.google.cloud.dataproc.v1.Batch, request, callback); - }, "name", { value: "GetBatch" }); - - /** - * Calls GetBatch. - * @function getBatch - * @memberof google.cloud.dataproc.v1.BatchController - * @instance - * @param {google.cloud.dataproc.v1.IGetBatchRequest} request GetBatchRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.BatchController|listBatches}. - * @memberof google.cloud.dataproc.v1.BatchController - * @typedef ListBatchesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dataproc.v1.ListBatchesResponse} [response] ListBatchesResponse - */ - - /** - * Calls ListBatches. - * @function listBatches - * @memberof google.cloud.dataproc.v1.BatchController - * @instance - * @param {google.cloud.dataproc.v1.IListBatchesRequest} request ListBatchesRequest message or plain object - * @param {google.cloud.dataproc.v1.BatchController.ListBatchesCallback} callback Node-style callback called with the error, if any, and ListBatchesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchController.prototype.listBatches = function listBatches(request, callback) { - return this.rpcCall(listBatches, $root.google.cloud.dataproc.v1.ListBatchesRequest, $root.google.cloud.dataproc.v1.ListBatchesResponse, request, callback); - }, "name", { value: "ListBatches" }); - - /** - * Calls ListBatches. - * @function listBatches - * @memberof google.cloud.dataproc.v1.BatchController - * @instance - * @param {google.cloud.dataproc.v1.IListBatchesRequest} request ListBatchesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.BatchController|deleteBatch}. - * @memberof google.cloud.dataproc.v1.BatchController - * @typedef DeleteBatchCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteBatch. - * @function deleteBatch - * @memberof google.cloud.dataproc.v1.BatchController - * @instance - * @param {google.cloud.dataproc.v1.IDeleteBatchRequest} request DeleteBatchRequest message or plain object - * @param {google.cloud.dataproc.v1.BatchController.DeleteBatchCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BatchController.prototype.deleteBatch = function deleteBatch(request, callback) { - return this.rpcCall(deleteBatch, $root.google.cloud.dataproc.v1.DeleteBatchRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteBatch" }); - - /** - * Calls DeleteBatch. - * @function deleteBatch - * @memberof google.cloud.dataproc.v1.BatchController - * @instance - * @param {google.cloud.dataproc.v1.IDeleteBatchRequest} request DeleteBatchRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return BatchController; - })(); - - v1.CreateBatchRequest = (function() { - - /** - * Properties of a CreateBatchRequest. - * @memberof google.cloud.dataproc.v1 - * @interface ICreateBatchRequest - * @property {string|null} [parent] CreateBatchRequest parent - * @property {google.cloud.dataproc.v1.IBatch|null} [batch] CreateBatchRequest batch - * @property {string|null} [batchId] CreateBatchRequest batchId - * @property {string|null} [requestId] CreateBatchRequest requestId - */ - - /** - * Constructs a new CreateBatchRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a CreateBatchRequest. - * @implements ICreateBatchRequest - * @constructor - * @param {google.cloud.dataproc.v1.ICreateBatchRequest=} [properties] Properties to set - */ - function CreateBatchRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateBatchRequest parent. - * @member {string} parent - * @memberof google.cloud.dataproc.v1.CreateBatchRequest - * @instance - */ - CreateBatchRequest.prototype.parent = ""; - - /** - * CreateBatchRequest batch. - * @member {google.cloud.dataproc.v1.IBatch|null|undefined} batch - * @memberof google.cloud.dataproc.v1.CreateBatchRequest - * @instance - */ - CreateBatchRequest.prototype.batch = null; - - /** - * CreateBatchRequest batchId. - * @member {string} batchId - * @memberof google.cloud.dataproc.v1.CreateBatchRequest - * @instance - */ - CreateBatchRequest.prototype.batchId = ""; - - /** - * CreateBatchRequest requestId. - * @member {string} requestId - * @memberof google.cloud.dataproc.v1.CreateBatchRequest - * @instance - */ - CreateBatchRequest.prototype.requestId = ""; - - /** - * Creates a new CreateBatchRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.CreateBatchRequest - * @static - * @param {google.cloud.dataproc.v1.ICreateBatchRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.CreateBatchRequest} CreateBatchRequest instance - */ - CreateBatchRequest.create = function create(properties) { - return new CreateBatchRequest(properties); - }; - - /** - * Encodes the specified CreateBatchRequest message. Does not implicitly {@link google.cloud.dataproc.v1.CreateBatchRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.CreateBatchRequest - * @static - * @param {google.cloud.dataproc.v1.ICreateBatchRequest} message CreateBatchRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateBatchRequest.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.batch != null && Object.hasOwnProperty.call(message, "batch")) - $root.google.cloud.dataproc.v1.Batch.encode(message.batch, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.batchId != null && Object.hasOwnProperty.call(message, "batchId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.batchId); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified CreateBatchRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.CreateBatchRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.CreateBatchRequest - * @static - * @param {google.cloud.dataproc.v1.ICreateBatchRequest} message CreateBatchRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateBatchRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateBatchRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.CreateBatchRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.CreateBatchRequest} CreateBatchRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateBatchRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.CreateBatchRequest(); - 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.batch = $root.google.cloud.dataproc.v1.Batch.decode(reader, reader.uint32()); - break; - } - case 3: { - message.batchId = reader.string(); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateBatchRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.CreateBatchRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.CreateBatchRequest} CreateBatchRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateBatchRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateBatchRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.CreateBatchRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateBatchRequest.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.batch != null && message.hasOwnProperty("batch")) { - var error = $root.google.cloud.dataproc.v1.Batch.verify(message.batch); - if (error) - return "batch." + error; - } - if (message.batchId != null && message.hasOwnProperty("batchId")) - if (!$util.isString(message.batchId)) - return "batchId: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a CreateBatchRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.CreateBatchRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.CreateBatchRequest} CreateBatchRequest - */ - CreateBatchRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.CreateBatchRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.CreateBatchRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.batch != null) { - if (typeof object.batch !== "object") - throw TypeError(".google.cloud.dataproc.v1.CreateBatchRequest.batch: object expected"); - message.batch = $root.google.cloud.dataproc.v1.Batch.fromObject(object.batch); - } - if (object.batchId != null) - message.batchId = String(object.batchId); - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a CreateBatchRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.CreateBatchRequest - * @static - * @param {google.cloud.dataproc.v1.CreateBatchRequest} message CreateBatchRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateBatchRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.batch = null; - object.batchId = ""; - object.requestId = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.batch != null && message.hasOwnProperty("batch")) - object.batch = $root.google.cloud.dataproc.v1.Batch.toObject(message.batch, options); - if (message.batchId != null && message.hasOwnProperty("batchId")) - object.batchId = message.batchId; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this CreateBatchRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.CreateBatchRequest - * @instance - * @returns {Object.} JSON object - */ - CreateBatchRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateBatchRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.CreateBatchRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateBatchRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.CreateBatchRequest"; - }; - - return CreateBatchRequest; - })(); - - v1.GetBatchRequest = (function() { - - /** - * Properties of a GetBatchRequest. - * @memberof google.cloud.dataproc.v1 - * @interface IGetBatchRequest - * @property {string|null} [name] GetBatchRequest name - */ - - /** - * Constructs a new GetBatchRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a GetBatchRequest. - * @implements IGetBatchRequest - * @constructor - * @param {google.cloud.dataproc.v1.IGetBatchRequest=} [properties] Properties to set - */ - function GetBatchRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetBatchRequest name. - * @member {string} name - * @memberof google.cloud.dataproc.v1.GetBatchRequest - * @instance - */ - GetBatchRequest.prototype.name = ""; - - /** - * Creates a new GetBatchRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.GetBatchRequest - * @static - * @param {google.cloud.dataproc.v1.IGetBatchRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.GetBatchRequest} GetBatchRequest instance - */ - GetBatchRequest.create = function create(properties) { - return new GetBatchRequest(properties); - }; - - /** - * Encodes the specified GetBatchRequest message. Does not implicitly {@link google.cloud.dataproc.v1.GetBatchRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.GetBatchRequest - * @static - * @param {google.cloud.dataproc.v1.IGetBatchRequest} message GetBatchRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBatchRequest.encode = function encode(message, writer) { - 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 GetBatchRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GetBatchRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.GetBatchRequest - * @static - * @param {google.cloud.dataproc.v1.IGetBatchRequest} message GetBatchRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBatchRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetBatchRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.GetBatchRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.GetBatchRequest} GetBatchRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBatchRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.GetBatchRequest(); - 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 GetBatchRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.GetBatchRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.GetBatchRequest} GetBatchRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBatchRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetBatchRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.GetBatchRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetBatchRequest.verify = function verify(message) { - if (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 GetBatchRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.GetBatchRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.GetBatchRequest} GetBatchRequest - */ - GetBatchRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.GetBatchRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.GetBatchRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetBatchRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.GetBatchRequest - * @static - * @param {google.cloud.dataproc.v1.GetBatchRequest} message GetBatchRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetBatchRequest.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 GetBatchRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.GetBatchRequest - * @instance - * @returns {Object.} JSON object - */ - GetBatchRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetBatchRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.GetBatchRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetBatchRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.GetBatchRequest"; - }; - - return GetBatchRequest; - })(); - - v1.ListBatchesRequest = (function() { - - /** - * Properties of a ListBatchesRequest. - * @memberof google.cloud.dataproc.v1 - * @interface IListBatchesRequest - * @property {string|null} [parent] ListBatchesRequest parent - * @property {number|null} [pageSize] ListBatchesRequest pageSize - * @property {string|null} [pageToken] ListBatchesRequest pageToken - * @property {string|null} [filter] ListBatchesRequest filter - * @property {string|null} [orderBy] ListBatchesRequest orderBy - */ - - /** - * Constructs a new ListBatchesRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a ListBatchesRequest. - * @implements IListBatchesRequest - * @constructor - * @param {google.cloud.dataproc.v1.IListBatchesRequest=} [properties] Properties to set - */ - function ListBatchesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListBatchesRequest parent. - * @member {string} parent - * @memberof google.cloud.dataproc.v1.ListBatchesRequest - * @instance - */ - ListBatchesRequest.prototype.parent = ""; - - /** - * ListBatchesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.dataproc.v1.ListBatchesRequest - * @instance - */ - ListBatchesRequest.prototype.pageSize = 0; - - /** - * ListBatchesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.dataproc.v1.ListBatchesRequest - * @instance - */ - ListBatchesRequest.prototype.pageToken = ""; - - /** - * ListBatchesRequest filter. - * @member {string} filter - * @memberof google.cloud.dataproc.v1.ListBatchesRequest - * @instance - */ - ListBatchesRequest.prototype.filter = ""; - - /** - * ListBatchesRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.dataproc.v1.ListBatchesRequest - * @instance - */ - ListBatchesRequest.prototype.orderBy = ""; - - /** - * Creates a new ListBatchesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.ListBatchesRequest - * @static - * @param {google.cloud.dataproc.v1.IListBatchesRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.ListBatchesRequest} ListBatchesRequest instance - */ - ListBatchesRequest.create = function create(properties) { - return new ListBatchesRequest(properties); - }; - - /** - * Encodes the specified ListBatchesRequest message. Does not implicitly {@link google.cloud.dataproc.v1.ListBatchesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.ListBatchesRequest - * @static - * @param {google.cloud.dataproc.v1.IListBatchesRequest} message ListBatchesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBatchesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - return writer; - }; - - /** - * Encodes the specified ListBatchesRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListBatchesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.ListBatchesRequest - * @static - * @param {google.cloud.dataproc.v1.IListBatchesRequest} message ListBatchesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBatchesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListBatchesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.ListBatchesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.ListBatchesRequest} ListBatchesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBatchesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ListBatchesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListBatchesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.ListBatchesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.ListBatchesRequest} ListBatchesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBatchesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListBatchesRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.ListBatchesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListBatchesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - return null; - }; - - /** - * Creates a ListBatchesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.ListBatchesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.ListBatchesRequest} ListBatchesRequest - */ - ListBatchesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.ListBatchesRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.ListBatchesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - return message; - }; - - /** - * Creates a plain object from a ListBatchesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.ListBatchesRequest - * @static - * @param {google.cloud.dataproc.v1.ListBatchesRequest} message ListBatchesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListBatchesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - - /** - * Converts this ListBatchesRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.ListBatchesRequest - * @instance - * @returns {Object.} JSON object - */ - ListBatchesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListBatchesRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.ListBatchesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListBatchesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.ListBatchesRequest"; - }; - - return ListBatchesRequest; - })(); - - v1.ListBatchesResponse = (function() { - - /** - * Properties of a ListBatchesResponse. - * @memberof google.cloud.dataproc.v1 - * @interface IListBatchesResponse - * @property {Array.|null} [batches] ListBatchesResponse batches - * @property {string|null} [nextPageToken] ListBatchesResponse nextPageToken - * @property {Array.|null} [unreachable] ListBatchesResponse unreachable - */ - - /** - * Constructs a new ListBatchesResponse. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a ListBatchesResponse. - * @implements IListBatchesResponse - * @constructor - * @param {google.cloud.dataproc.v1.IListBatchesResponse=} [properties] Properties to set - */ - function ListBatchesResponse(properties) { - this.batches = []; - 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]]; - } - - /** - * ListBatchesResponse batches. - * @member {Array.} batches - * @memberof google.cloud.dataproc.v1.ListBatchesResponse - * @instance - */ - ListBatchesResponse.prototype.batches = $util.emptyArray; - - /** - * ListBatchesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.dataproc.v1.ListBatchesResponse - * @instance - */ - ListBatchesResponse.prototype.nextPageToken = ""; - - /** - * ListBatchesResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.dataproc.v1.ListBatchesResponse - * @instance - */ - ListBatchesResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListBatchesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.ListBatchesResponse - * @static - * @param {google.cloud.dataproc.v1.IListBatchesResponse=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.ListBatchesResponse} ListBatchesResponse instance - */ - ListBatchesResponse.create = function create(properties) { - return new ListBatchesResponse(properties); - }; - - /** - * Encodes the specified ListBatchesResponse message. Does not implicitly {@link google.cloud.dataproc.v1.ListBatchesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.ListBatchesResponse - * @static - * @param {google.cloud.dataproc.v1.IListBatchesResponse} message ListBatchesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBatchesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.batches != null && message.batches.length) - for (var i = 0; i < message.batches.length; ++i) - $root.google.cloud.dataproc.v1.Batch.encode(message.batches[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 ListBatchesResponse message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListBatchesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.ListBatchesResponse - * @static - * @param {google.cloud.dataproc.v1.IListBatchesResponse} message ListBatchesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBatchesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListBatchesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.ListBatchesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.ListBatchesResponse} ListBatchesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBatchesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ListBatchesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.batches && message.batches.length)) - message.batches = []; - message.batches.push($root.google.cloud.dataproc.v1.Batch.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 ListBatchesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.ListBatchesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.ListBatchesResponse} ListBatchesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBatchesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListBatchesResponse message. - * @function verify - * @memberof google.cloud.dataproc.v1.ListBatchesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListBatchesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.batches != null && message.hasOwnProperty("batches")) { - if (!Array.isArray(message.batches)) - return "batches: array expected"; - for (var i = 0; i < message.batches.length; ++i) { - var error = $root.google.cloud.dataproc.v1.Batch.verify(message.batches[i]); - if (error) - return "batches." + 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 ListBatchesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.ListBatchesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.ListBatchesResponse} ListBatchesResponse - */ - ListBatchesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.ListBatchesResponse) - return object; - var message = new $root.google.cloud.dataproc.v1.ListBatchesResponse(); - if (object.batches) { - if (!Array.isArray(object.batches)) - throw TypeError(".google.cloud.dataproc.v1.ListBatchesResponse.batches: array expected"); - message.batches = []; - for (var i = 0; i < object.batches.length; ++i) { - if (typeof object.batches[i] !== "object") - throw TypeError(".google.cloud.dataproc.v1.ListBatchesResponse.batches: object expected"); - message.batches[i] = $root.google.cloud.dataproc.v1.Batch.fromObject(object.batches[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.dataproc.v1.ListBatchesResponse.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 ListBatchesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.ListBatchesResponse - * @static - * @param {google.cloud.dataproc.v1.ListBatchesResponse} message ListBatchesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListBatchesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.batches = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.batches && message.batches.length) { - object.batches = []; - for (var j = 0; j < message.batches.length; ++j) - object.batches[j] = $root.google.cloud.dataproc.v1.Batch.toObject(message.batches[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 ListBatchesResponse to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.ListBatchesResponse - * @instance - * @returns {Object.} JSON object - */ - ListBatchesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListBatchesResponse - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.ListBatchesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListBatchesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.ListBatchesResponse"; - }; - - return ListBatchesResponse; - })(); - - v1.DeleteBatchRequest = (function() { - - /** - * Properties of a DeleteBatchRequest. - * @memberof google.cloud.dataproc.v1 - * @interface IDeleteBatchRequest - * @property {string|null} [name] DeleteBatchRequest name - */ - - /** - * Constructs a new DeleteBatchRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a DeleteBatchRequest. - * @implements IDeleteBatchRequest - * @constructor - * @param {google.cloud.dataproc.v1.IDeleteBatchRequest=} [properties] Properties to set - */ - function DeleteBatchRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteBatchRequest name. - * @member {string} name - * @memberof google.cloud.dataproc.v1.DeleteBatchRequest - * @instance - */ - DeleteBatchRequest.prototype.name = ""; - - /** - * Creates a new DeleteBatchRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.DeleteBatchRequest - * @static - * @param {google.cloud.dataproc.v1.IDeleteBatchRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.DeleteBatchRequest} DeleteBatchRequest instance - */ - DeleteBatchRequest.create = function create(properties) { - return new DeleteBatchRequest(properties); - }; - - /** - * Encodes the specified DeleteBatchRequest message. Does not implicitly {@link google.cloud.dataproc.v1.DeleteBatchRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.DeleteBatchRequest - * @static - * @param {google.cloud.dataproc.v1.IDeleteBatchRequest} message DeleteBatchRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteBatchRequest.encode = function encode(message, writer) { - 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 DeleteBatchRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DeleteBatchRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.DeleteBatchRequest - * @static - * @param {google.cloud.dataproc.v1.IDeleteBatchRequest} message DeleteBatchRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteBatchRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteBatchRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.DeleteBatchRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.DeleteBatchRequest} DeleteBatchRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteBatchRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.DeleteBatchRequest(); - 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 DeleteBatchRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.DeleteBatchRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.DeleteBatchRequest} DeleteBatchRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteBatchRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteBatchRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.DeleteBatchRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteBatchRequest.verify = function verify(message) { - if (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 DeleteBatchRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.DeleteBatchRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.DeleteBatchRequest} DeleteBatchRequest - */ - DeleteBatchRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.DeleteBatchRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.DeleteBatchRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteBatchRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.DeleteBatchRequest - * @static - * @param {google.cloud.dataproc.v1.DeleteBatchRequest} message DeleteBatchRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteBatchRequest.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 DeleteBatchRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.DeleteBatchRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteBatchRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteBatchRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.DeleteBatchRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteBatchRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.DeleteBatchRequest"; - }; - - return DeleteBatchRequest; - })(); - - v1.Batch = (function() { - - /** - * Properties of a Batch. - * @memberof google.cloud.dataproc.v1 - * @interface IBatch - * @property {string|null} [name] Batch name - * @property {string|null} [uuid] Batch uuid - * @property {google.protobuf.ITimestamp|null} [createTime] Batch createTime - * @property {google.cloud.dataproc.v1.IPySparkBatch|null} [pysparkBatch] Batch pysparkBatch - * @property {google.cloud.dataproc.v1.ISparkBatch|null} [sparkBatch] Batch sparkBatch - * @property {google.cloud.dataproc.v1.ISparkRBatch|null} [sparkRBatch] Batch sparkRBatch - * @property {google.cloud.dataproc.v1.ISparkSqlBatch|null} [sparkSqlBatch] Batch sparkSqlBatch - * @property {google.cloud.dataproc.v1.IPySparkNotebookBatch|null} [pysparkNotebookBatch] Batch pysparkNotebookBatch - * @property {google.cloud.dataproc.v1.IRuntimeInfo|null} [runtimeInfo] Batch runtimeInfo - * @property {google.cloud.dataproc.v1.Batch.State|null} [state] Batch state - * @property {string|null} [stateMessage] Batch stateMessage - * @property {google.protobuf.ITimestamp|null} [stateTime] Batch stateTime - * @property {string|null} [creator] Batch creator - * @property {Object.|null} [labels] Batch labels - * @property {google.cloud.dataproc.v1.IRuntimeConfig|null} [runtimeConfig] Batch runtimeConfig - * @property {google.cloud.dataproc.v1.IEnvironmentConfig|null} [environmentConfig] Batch environmentConfig - * @property {string|null} [operation] Batch operation - * @property {Array.|null} [stateHistory] Batch stateHistory - */ - - /** - * Constructs a new Batch. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a Batch. - * @implements IBatch - * @constructor - * @param {google.cloud.dataproc.v1.IBatch=} [properties] Properties to set - */ - function Batch(properties) { - this.labels = {}; - this.stateHistory = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Batch name. - * @member {string} name - * @memberof google.cloud.dataproc.v1.Batch - * @instance - */ - Batch.prototype.name = ""; - - /** - * Batch uuid. - * @member {string} uuid - * @memberof google.cloud.dataproc.v1.Batch - * @instance - */ - Batch.prototype.uuid = ""; - - /** - * Batch createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.dataproc.v1.Batch - * @instance - */ - Batch.prototype.createTime = null; - - /** - * Batch pysparkBatch. - * @member {google.cloud.dataproc.v1.IPySparkBatch|null|undefined} pysparkBatch - * @memberof google.cloud.dataproc.v1.Batch - * @instance - */ - Batch.prototype.pysparkBatch = null; - - /** - * Batch sparkBatch. - * @member {google.cloud.dataproc.v1.ISparkBatch|null|undefined} sparkBatch - * @memberof google.cloud.dataproc.v1.Batch - * @instance - */ - Batch.prototype.sparkBatch = null; - - /** - * Batch sparkRBatch. - * @member {google.cloud.dataproc.v1.ISparkRBatch|null|undefined} sparkRBatch - * @memberof google.cloud.dataproc.v1.Batch - * @instance - */ - Batch.prototype.sparkRBatch = null; - - /** - * Batch sparkSqlBatch. - * @member {google.cloud.dataproc.v1.ISparkSqlBatch|null|undefined} sparkSqlBatch - * @memberof google.cloud.dataproc.v1.Batch - * @instance - */ - Batch.prototype.sparkSqlBatch = null; - - /** - * Batch pysparkNotebookBatch. - * @member {google.cloud.dataproc.v1.IPySparkNotebookBatch|null|undefined} pysparkNotebookBatch - * @memberof google.cloud.dataproc.v1.Batch - * @instance - */ - Batch.prototype.pysparkNotebookBatch = null; - - /** - * Batch runtimeInfo. - * @member {google.cloud.dataproc.v1.IRuntimeInfo|null|undefined} runtimeInfo - * @memberof google.cloud.dataproc.v1.Batch - * @instance - */ - Batch.prototype.runtimeInfo = null; - - /** - * Batch state. - * @member {google.cloud.dataproc.v1.Batch.State} state - * @memberof google.cloud.dataproc.v1.Batch - * @instance - */ - Batch.prototype.state = 0; - - /** - * Batch stateMessage. - * @member {string} stateMessage - * @memberof google.cloud.dataproc.v1.Batch - * @instance - */ - Batch.prototype.stateMessage = ""; - - /** - * Batch stateTime. - * @member {google.protobuf.ITimestamp|null|undefined} stateTime - * @memberof google.cloud.dataproc.v1.Batch - * @instance - */ - Batch.prototype.stateTime = null; - - /** - * Batch creator. - * @member {string} creator - * @memberof google.cloud.dataproc.v1.Batch - * @instance - */ - Batch.prototype.creator = ""; - - /** - * Batch labels. - * @member {Object.} labels - * @memberof google.cloud.dataproc.v1.Batch - * @instance - */ - Batch.prototype.labels = $util.emptyObject; - - /** - * Batch runtimeConfig. - * @member {google.cloud.dataproc.v1.IRuntimeConfig|null|undefined} runtimeConfig - * @memberof google.cloud.dataproc.v1.Batch - * @instance - */ - Batch.prototype.runtimeConfig = null; - - /** - * Batch environmentConfig. - * @member {google.cloud.dataproc.v1.IEnvironmentConfig|null|undefined} environmentConfig - * @memberof google.cloud.dataproc.v1.Batch - * @instance - */ - Batch.prototype.environmentConfig = null; - - /** - * Batch operation. - * @member {string} operation - * @memberof google.cloud.dataproc.v1.Batch - * @instance - */ - Batch.prototype.operation = ""; - - /** - * Batch stateHistory. - * @member {Array.} stateHistory - * @memberof google.cloud.dataproc.v1.Batch - * @instance - */ - Batch.prototype.stateHistory = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Batch batchConfig. - * @member {"pysparkBatch"|"sparkBatch"|"sparkRBatch"|"sparkSqlBatch"|"pysparkNotebookBatch"|undefined} batchConfig - * @memberof google.cloud.dataproc.v1.Batch - * @instance - */ - Object.defineProperty(Batch.prototype, "batchConfig", { - get: $util.oneOfGetter($oneOfFields = ["pysparkBatch", "sparkBatch", "sparkRBatch", "sparkSqlBatch", "pysparkNotebookBatch"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Batch instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.Batch - * @static - * @param {google.cloud.dataproc.v1.IBatch=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.Batch} Batch instance - */ - Batch.create = function create(properties) { - return new Batch(properties); - }; - - /** - * Encodes the specified Batch message. Does not implicitly {@link google.cloud.dataproc.v1.Batch.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.Batch - * @static - * @param {google.cloud.dataproc.v1.IBatch} message Batch message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Batch.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.uuid != null && Object.hasOwnProperty.call(message, "uuid")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.uuid); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.pysparkBatch != null && Object.hasOwnProperty.call(message, "pysparkBatch")) - $root.google.cloud.dataproc.v1.PySparkBatch.encode(message.pysparkBatch, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.sparkBatch != null && Object.hasOwnProperty.call(message, "sparkBatch")) - $root.google.cloud.dataproc.v1.SparkBatch.encode(message.sparkBatch, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.sparkRBatch != null && Object.hasOwnProperty.call(message, "sparkRBatch")) - $root.google.cloud.dataproc.v1.SparkRBatch.encode(message.sparkRBatch, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.sparkSqlBatch != null && Object.hasOwnProperty.call(message, "sparkSqlBatch")) - $root.google.cloud.dataproc.v1.SparkSqlBatch.encode(message.sparkSqlBatch, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.runtimeInfo != null && Object.hasOwnProperty.call(message, "runtimeInfo")) - $root.google.cloud.dataproc.v1.RuntimeInfo.encode(message.runtimeInfo, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.state); - if (message.stateMessage != null && Object.hasOwnProperty.call(message, "stateMessage")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.stateMessage); - if (message.stateTime != null && Object.hasOwnProperty.call(message, "stateTime")) - $root.google.protobuf.Timestamp.encode(message.stateTime, 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.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.runtimeConfig != null && Object.hasOwnProperty.call(message, "runtimeConfig")) - $root.google.cloud.dataproc.v1.RuntimeConfig.encode(message.runtimeConfig, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.environmentConfig != null && Object.hasOwnProperty.call(message, "environmentConfig")) - $root.google.cloud.dataproc.v1.EnvironmentConfig.encode(message.environmentConfig, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) - writer.uint32(/* id 16, wireType 2 =*/130).string(message.operation); - if (message.stateHistory != null && message.stateHistory.length) - for (var i = 0; i < message.stateHistory.length; ++i) - $root.google.cloud.dataproc.v1.Batch.StateHistory.encode(message.stateHistory[i], writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.pysparkNotebookBatch != null && Object.hasOwnProperty.call(message, "pysparkNotebookBatch")) - $root.google.cloud.dataproc.v1.PySparkNotebookBatch.encode(message.pysparkNotebookBatch, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Batch message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.Batch.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.Batch - * @static - * @param {google.cloud.dataproc.v1.IBatch} message Batch message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Batch.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Batch message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.Batch - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.Batch} Batch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Batch.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.Batch(), 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.uuid = reader.string(); - break; - } - case 3: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.pysparkBatch = $root.google.cloud.dataproc.v1.PySparkBatch.decode(reader, reader.uint32()); - break; - } - case 5: { - message.sparkBatch = $root.google.cloud.dataproc.v1.SparkBatch.decode(reader, reader.uint32()); - break; - } - case 6: { - message.sparkRBatch = $root.google.cloud.dataproc.v1.SparkRBatch.decode(reader, reader.uint32()); - break; - } - case 7: { - message.sparkSqlBatch = $root.google.cloud.dataproc.v1.SparkSqlBatch.decode(reader, reader.uint32()); - break; - } - case 19: { - message.pysparkNotebookBatch = $root.google.cloud.dataproc.v1.PySparkNotebookBatch.decode(reader, reader.uint32()); - break; - } - case 8: { - message.runtimeInfo = $root.google.cloud.dataproc.v1.RuntimeInfo.decode(reader, reader.uint32()); - break; - } - case 9: { - message.state = reader.int32(); - break; - } - case 10: { - message.stateMessage = reader.string(); - break; - } - case 11: { - message.stateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 12: { - message.creator = reader.string(); - break; - } - case 13: { - 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 14: { - message.runtimeConfig = $root.google.cloud.dataproc.v1.RuntimeConfig.decode(reader, reader.uint32()); - break; - } - case 15: { - message.environmentConfig = $root.google.cloud.dataproc.v1.EnvironmentConfig.decode(reader, reader.uint32()); - break; - } - case 16: { - message.operation = reader.string(); - break; - } - case 17: { - if (!(message.stateHistory && message.stateHistory.length)) - message.stateHistory = []; - message.stateHistory.push($root.google.cloud.dataproc.v1.Batch.StateHistory.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Batch message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.Batch - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.Batch} Batch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Batch.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Batch message. - * @function verify - * @memberof google.cloud.dataproc.v1.Batch - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Batch.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.uuid != null && message.hasOwnProperty("uuid")) - if (!$util.isString(message.uuid)) - return "uuid: 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.pysparkBatch != null && message.hasOwnProperty("pysparkBatch")) { - properties.batchConfig = 1; - { - var error = $root.google.cloud.dataproc.v1.PySparkBatch.verify(message.pysparkBatch); - if (error) - return "pysparkBatch." + error; - } - } - if (message.sparkBatch != null && message.hasOwnProperty("sparkBatch")) { - if (properties.batchConfig === 1) - return "batchConfig: multiple values"; - properties.batchConfig = 1; - { - var error = $root.google.cloud.dataproc.v1.SparkBatch.verify(message.sparkBatch); - if (error) - return "sparkBatch." + error; - } - } - if (message.sparkRBatch != null && message.hasOwnProperty("sparkRBatch")) { - if (properties.batchConfig === 1) - return "batchConfig: multiple values"; - properties.batchConfig = 1; - { - var error = $root.google.cloud.dataproc.v1.SparkRBatch.verify(message.sparkRBatch); - if (error) - return "sparkRBatch." + error; - } - } - if (message.sparkSqlBatch != null && message.hasOwnProperty("sparkSqlBatch")) { - if (properties.batchConfig === 1) - return "batchConfig: multiple values"; - properties.batchConfig = 1; - { - var error = $root.google.cloud.dataproc.v1.SparkSqlBatch.verify(message.sparkSqlBatch); - if (error) - return "sparkSqlBatch." + error; - } - } - if (message.pysparkNotebookBatch != null && message.hasOwnProperty("pysparkNotebookBatch")) { - if (properties.batchConfig === 1) - return "batchConfig: multiple values"; - properties.batchConfig = 1; - { - var error = $root.google.cloud.dataproc.v1.PySparkNotebookBatch.verify(message.pysparkNotebookBatch); - if (error) - return "pysparkNotebookBatch." + error; - } - } - if (message.runtimeInfo != null && message.hasOwnProperty("runtimeInfo")) { - var error = $root.google.cloud.dataproc.v1.RuntimeInfo.verify(message.runtimeInfo); - if (error) - return "runtimeInfo." + error; - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) - if (!$util.isString(message.stateMessage)) - return "stateMessage: string expected"; - if (message.stateTime != null && message.hasOwnProperty("stateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.stateTime); - if (error) - return "stateTime." + error; - } - if (message.creator != null && message.hasOwnProperty("creator")) - if (!$util.isString(message.creator)) - return "creator: 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.runtimeConfig != null && message.hasOwnProperty("runtimeConfig")) { - var error = $root.google.cloud.dataproc.v1.RuntimeConfig.verify(message.runtimeConfig); - if (error) - return "runtimeConfig." + error; - } - if (message.environmentConfig != null && message.hasOwnProperty("environmentConfig")) { - var error = $root.google.cloud.dataproc.v1.EnvironmentConfig.verify(message.environmentConfig); - if (error) - return "environmentConfig." + error; - } - if (message.operation != null && message.hasOwnProperty("operation")) - if (!$util.isString(message.operation)) - return "operation: string expected"; - if (message.stateHistory != null && message.hasOwnProperty("stateHistory")) { - if (!Array.isArray(message.stateHistory)) - return "stateHistory: array expected"; - for (var i = 0; i < message.stateHistory.length; ++i) { - var error = $root.google.cloud.dataproc.v1.Batch.StateHistory.verify(message.stateHistory[i]); - if (error) - return "stateHistory." + error; - } - } - return null; - }; - - /** - * Creates a Batch message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.Batch - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.Batch} Batch - */ - Batch.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.Batch) - return object; - var message = new $root.google.cloud.dataproc.v1.Batch(); - if (object.name != null) - message.name = String(object.name); - if (object.uuid != null) - message.uuid = String(object.uuid); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.dataproc.v1.Batch.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.pysparkBatch != null) { - if (typeof object.pysparkBatch !== "object") - throw TypeError(".google.cloud.dataproc.v1.Batch.pysparkBatch: object expected"); - message.pysparkBatch = $root.google.cloud.dataproc.v1.PySparkBatch.fromObject(object.pysparkBatch); - } - if (object.sparkBatch != null) { - if (typeof object.sparkBatch !== "object") - throw TypeError(".google.cloud.dataproc.v1.Batch.sparkBatch: object expected"); - message.sparkBatch = $root.google.cloud.dataproc.v1.SparkBatch.fromObject(object.sparkBatch); - } - if (object.sparkRBatch != null) { - if (typeof object.sparkRBatch !== "object") - throw TypeError(".google.cloud.dataproc.v1.Batch.sparkRBatch: object expected"); - message.sparkRBatch = $root.google.cloud.dataproc.v1.SparkRBatch.fromObject(object.sparkRBatch); - } - if (object.sparkSqlBatch != null) { - if (typeof object.sparkSqlBatch !== "object") - throw TypeError(".google.cloud.dataproc.v1.Batch.sparkSqlBatch: object expected"); - message.sparkSqlBatch = $root.google.cloud.dataproc.v1.SparkSqlBatch.fromObject(object.sparkSqlBatch); - } - if (object.pysparkNotebookBatch != null) { - if (typeof object.pysparkNotebookBatch !== "object") - throw TypeError(".google.cloud.dataproc.v1.Batch.pysparkNotebookBatch: object expected"); - message.pysparkNotebookBatch = $root.google.cloud.dataproc.v1.PySparkNotebookBatch.fromObject(object.pysparkNotebookBatch); - } - if (object.runtimeInfo != null) { - if (typeof object.runtimeInfo !== "object") - throw TypeError(".google.cloud.dataproc.v1.Batch.runtimeInfo: object expected"); - message.runtimeInfo = $root.google.cloud.dataproc.v1.RuntimeInfo.fromObject(object.runtimeInfo); - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "PENDING": - case 1: - message.state = 1; - break; - case "RUNNING": - case 2: - message.state = 2; - break; - case "CANCELLING": - case 3: - message.state = 3; - break; - case "CANCELLED": - case 4: - message.state = 4; - break; - case "SUCCEEDED": - case 5: - message.state = 5; - break; - case "FAILED": - case 6: - message.state = 6; - break; - } - if (object.stateMessage != null) - message.stateMessage = String(object.stateMessage); - if (object.stateTime != null) { - if (typeof object.stateTime !== "object") - throw TypeError(".google.cloud.dataproc.v1.Batch.stateTime: object expected"); - message.stateTime = $root.google.protobuf.Timestamp.fromObject(object.stateTime); - } - if (object.creator != null) - message.creator = String(object.creator); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.dataproc.v1.Batch.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.runtimeConfig != null) { - if (typeof object.runtimeConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.Batch.runtimeConfig: object expected"); - message.runtimeConfig = $root.google.cloud.dataproc.v1.RuntimeConfig.fromObject(object.runtimeConfig); - } - if (object.environmentConfig != null) { - if (typeof object.environmentConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.Batch.environmentConfig: object expected"); - message.environmentConfig = $root.google.cloud.dataproc.v1.EnvironmentConfig.fromObject(object.environmentConfig); - } - if (object.operation != null) - message.operation = String(object.operation); - if (object.stateHistory) { - if (!Array.isArray(object.stateHistory)) - throw TypeError(".google.cloud.dataproc.v1.Batch.stateHistory: array expected"); - message.stateHistory = []; - for (var i = 0; i < object.stateHistory.length; ++i) { - if (typeof object.stateHistory[i] !== "object") - throw TypeError(".google.cloud.dataproc.v1.Batch.stateHistory: object expected"); - message.stateHistory[i] = $root.google.cloud.dataproc.v1.Batch.StateHistory.fromObject(object.stateHistory[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Batch message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.Batch - * @static - * @param {google.cloud.dataproc.v1.Batch} message Batch - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Batch.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.stateHistory = []; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.uuid = ""; - object.createTime = null; - object.runtimeInfo = null; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.stateMessage = ""; - object.stateTime = null; - object.creator = ""; - object.runtimeConfig = null; - object.environmentConfig = null; - object.operation = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.uuid != null && message.hasOwnProperty("uuid")) - object.uuid = message.uuid; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.pysparkBatch != null && message.hasOwnProperty("pysparkBatch")) { - object.pysparkBatch = $root.google.cloud.dataproc.v1.PySparkBatch.toObject(message.pysparkBatch, options); - if (options.oneofs) - object.batchConfig = "pysparkBatch"; - } - if (message.sparkBatch != null && message.hasOwnProperty("sparkBatch")) { - object.sparkBatch = $root.google.cloud.dataproc.v1.SparkBatch.toObject(message.sparkBatch, options); - if (options.oneofs) - object.batchConfig = "sparkBatch"; - } - if (message.sparkRBatch != null && message.hasOwnProperty("sparkRBatch")) { - object.sparkRBatch = $root.google.cloud.dataproc.v1.SparkRBatch.toObject(message.sparkRBatch, options); - if (options.oneofs) - object.batchConfig = "sparkRBatch"; - } - if (message.sparkSqlBatch != null && message.hasOwnProperty("sparkSqlBatch")) { - object.sparkSqlBatch = $root.google.cloud.dataproc.v1.SparkSqlBatch.toObject(message.sparkSqlBatch, options); - if (options.oneofs) - object.batchConfig = "sparkSqlBatch"; - } - if (message.runtimeInfo != null && message.hasOwnProperty("runtimeInfo")) - object.runtimeInfo = $root.google.cloud.dataproc.v1.RuntimeInfo.toObject(message.runtimeInfo, options); - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.dataproc.v1.Batch.State[message.state] === undefined ? message.state : $root.google.cloud.dataproc.v1.Batch.State[message.state] : message.state; - if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) - object.stateMessage = message.stateMessage; - if (message.stateTime != null && message.hasOwnProperty("stateTime")) - object.stateTime = $root.google.protobuf.Timestamp.toObject(message.stateTime, options); - if (message.creator != null && message.hasOwnProperty("creator")) - object.creator = message.creator; - 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.runtimeConfig != null && message.hasOwnProperty("runtimeConfig")) - object.runtimeConfig = $root.google.cloud.dataproc.v1.RuntimeConfig.toObject(message.runtimeConfig, options); - if (message.environmentConfig != null && message.hasOwnProperty("environmentConfig")) - object.environmentConfig = $root.google.cloud.dataproc.v1.EnvironmentConfig.toObject(message.environmentConfig, options); - if (message.operation != null && message.hasOwnProperty("operation")) - object.operation = message.operation; - if (message.stateHistory && message.stateHistory.length) { - object.stateHistory = []; - for (var j = 0; j < message.stateHistory.length; ++j) - object.stateHistory[j] = $root.google.cloud.dataproc.v1.Batch.StateHistory.toObject(message.stateHistory[j], options); - } - if (message.pysparkNotebookBatch != null && message.hasOwnProperty("pysparkNotebookBatch")) { - object.pysparkNotebookBatch = $root.google.cloud.dataproc.v1.PySparkNotebookBatch.toObject(message.pysparkNotebookBatch, options); - if (options.oneofs) - object.batchConfig = "pysparkNotebookBatch"; - } - return object; - }; - - /** - * Converts this Batch to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.Batch - * @instance - * @returns {Object.} JSON object - */ - Batch.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Batch - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.Batch - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Batch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.Batch"; - }; - - /** - * State enum. - * @name google.cloud.dataproc.v1.Batch.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} PENDING=1 PENDING value - * @property {number} RUNNING=2 RUNNING value - * @property {number} CANCELLING=3 CANCELLING value - * @property {number} CANCELLED=4 CANCELLED value - * @property {number} SUCCEEDED=5 SUCCEEDED value - * @property {number} FAILED=6 FAILED value - */ - Batch.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PENDING"] = 1; - values[valuesById[2] = "RUNNING"] = 2; - values[valuesById[3] = "CANCELLING"] = 3; - values[valuesById[4] = "CANCELLED"] = 4; - values[valuesById[5] = "SUCCEEDED"] = 5; - values[valuesById[6] = "FAILED"] = 6; - return values; - })(); - - Batch.StateHistory = (function() { - - /** - * Properties of a StateHistory. - * @memberof google.cloud.dataproc.v1.Batch - * @interface IStateHistory - * @property {google.cloud.dataproc.v1.Batch.State|null} [state] StateHistory state - * @property {string|null} [stateMessage] StateHistory stateMessage - * @property {google.protobuf.ITimestamp|null} [stateStartTime] StateHistory stateStartTime - */ - - /** - * Constructs a new StateHistory. - * @memberof google.cloud.dataproc.v1.Batch - * @classdesc Represents a StateHistory. - * @implements IStateHistory - * @constructor - * @param {google.cloud.dataproc.v1.Batch.IStateHistory=} [properties] Properties to set - */ - function StateHistory(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StateHistory state. - * @member {google.cloud.dataproc.v1.Batch.State} state - * @memberof google.cloud.dataproc.v1.Batch.StateHistory - * @instance - */ - StateHistory.prototype.state = 0; - - /** - * StateHistory stateMessage. - * @member {string} stateMessage - * @memberof google.cloud.dataproc.v1.Batch.StateHistory - * @instance - */ - StateHistory.prototype.stateMessage = ""; - - /** - * StateHistory stateStartTime. - * @member {google.protobuf.ITimestamp|null|undefined} stateStartTime - * @memberof google.cloud.dataproc.v1.Batch.StateHistory - * @instance - */ - StateHistory.prototype.stateStartTime = null; - - /** - * Creates a new StateHistory instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.Batch.StateHistory - * @static - * @param {google.cloud.dataproc.v1.Batch.IStateHistory=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.Batch.StateHistory} StateHistory instance - */ - StateHistory.create = function create(properties) { - return new StateHistory(properties); - }; - - /** - * Encodes the specified StateHistory message. Does not implicitly {@link google.cloud.dataproc.v1.Batch.StateHistory.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.Batch.StateHistory - * @static - * @param {google.cloud.dataproc.v1.Batch.IStateHistory} message StateHistory message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StateHistory.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.stateMessage != null && Object.hasOwnProperty.call(message, "stateMessage")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.stateMessage); - if (message.stateStartTime != null && Object.hasOwnProperty.call(message, "stateStartTime")) - $root.google.protobuf.Timestamp.encode(message.stateStartTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified StateHistory message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.Batch.StateHistory.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.Batch.StateHistory - * @static - * @param {google.cloud.dataproc.v1.Batch.IStateHistory} message StateHistory message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StateHistory.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StateHistory message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.Batch.StateHistory - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.Batch.StateHistory} StateHistory - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StateHistory.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.Batch.StateHistory(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.state = reader.int32(); - break; - } - case 2: { - message.stateMessage = reader.string(); - break; - } - case 3: { - message.stateStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StateHistory message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.Batch.StateHistory - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.Batch.StateHistory} StateHistory - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StateHistory.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StateHistory message. - * @function verify - * @memberof google.cloud.dataproc.v1.Batch.StateHistory - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StateHistory.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) - if (!$util.isString(message.stateMessage)) - return "stateMessage: string expected"; - if (message.stateStartTime != null && message.hasOwnProperty("stateStartTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.stateStartTime); - if (error) - return "stateStartTime." + error; - } - return null; - }; - - /** - * Creates a StateHistory message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.Batch.StateHistory - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.Batch.StateHistory} StateHistory - */ - StateHistory.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.Batch.StateHistory) - return object; - var message = new $root.google.cloud.dataproc.v1.Batch.StateHistory(); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "PENDING": - case 1: - message.state = 1; - break; - case "RUNNING": - case 2: - message.state = 2; - break; - case "CANCELLING": - case 3: - message.state = 3; - break; - case "CANCELLED": - case 4: - message.state = 4; - break; - case "SUCCEEDED": - case 5: - message.state = 5; - break; - case "FAILED": - case 6: - message.state = 6; - break; - } - if (object.stateMessage != null) - message.stateMessage = String(object.stateMessage); - if (object.stateStartTime != null) { - if (typeof object.stateStartTime !== "object") - throw TypeError(".google.cloud.dataproc.v1.Batch.StateHistory.stateStartTime: object expected"); - message.stateStartTime = $root.google.protobuf.Timestamp.fromObject(object.stateStartTime); - } - return message; - }; - - /** - * Creates a plain object from a StateHistory message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.Batch.StateHistory - * @static - * @param {google.cloud.dataproc.v1.Batch.StateHistory} message StateHistory - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StateHistory.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.stateMessage = ""; - object.stateStartTime = null; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.dataproc.v1.Batch.State[message.state] === undefined ? message.state : $root.google.cloud.dataproc.v1.Batch.State[message.state] : message.state; - if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) - object.stateMessage = message.stateMessage; - if (message.stateStartTime != null && message.hasOwnProperty("stateStartTime")) - object.stateStartTime = $root.google.protobuf.Timestamp.toObject(message.stateStartTime, options); - return object; - }; - - /** - * Converts this StateHistory to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.Batch.StateHistory - * @instance - * @returns {Object.} JSON object - */ - StateHistory.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StateHistory - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.Batch.StateHistory - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StateHistory.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.Batch.StateHistory"; - }; - - return StateHistory; - })(); - - return Batch; - })(); - - v1.PySparkBatch = (function() { - - /** - * Properties of a PySparkBatch. - * @memberof google.cloud.dataproc.v1 - * @interface IPySparkBatch - * @property {string|null} [mainPythonFileUri] PySparkBatch mainPythonFileUri - * @property {Array.|null} [args] PySparkBatch args - * @property {Array.|null} [pythonFileUris] PySparkBatch pythonFileUris - * @property {Array.|null} [jarFileUris] PySparkBatch jarFileUris - * @property {Array.|null} [fileUris] PySparkBatch fileUris - * @property {Array.|null} [archiveUris] PySparkBatch archiveUris - */ - - /** - * Constructs a new PySparkBatch. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a PySparkBatch. - * @implements IPySparkBatch - * @constructor - * @param {google.cloud.dataproc.v1.IPySparkBatch=} [properties] Properties to set - */ - function PySparkBatch(properties) { - this.args = []; - this.pythonFileUris = []; - this.jarFileUris = []; - this.fileUris = []; - this.archiveUris = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PySparkBatch mainPythonFileUri. - * @member {string} mainPythonFileUri - * @memberof google.cloud.dataproc.v1.PySparkBatch - * @instance - */ - PySparkBatch.prototype.mainPythonFileUri = ""; - - /** - * PySparkBatch args. - * @member {Array.} args - * @memberof google.cloud.dataproc.v1.PySparkBatch - * @instance - */ - PySparkBatch.prototype.args = $util.emptyArray; - - /** - * PySparkBatch pythonFileUris. - * @member {Array.} pythonFileUris - * @memberof google.cloud.dataproc.v1.PySparkBatch - * @instance - */ - PySparkBatch.prototype.pythonFileUris = $util.emptyArray; - - /** - * PySparkBatch jarFileUris. - * @member {Array.} jarFileUris - * @memberof google.cloud.dataproc.v1.PySparkBatch - * @instance - */ - PySparkBatch.prototype.jarFileUris = $util.emptyArray; - - /** - * PySparkBatch fileUris. - * @member {Array.} fileUris - * @memberof google.cloud.dataproc.v1.PySparkBatch - * @instance - */ - PySparkBatch.prototype.fileUris = $util.emptyArray; - - /** - * PySparkBatch archiveUris. - * @member {Array.} archiveUris - * @memberof google.cloud.dataproc.v1.PySparkBatch - * @instance - */ - PySparkBatch.prototype.archiveUris = $util.emptyArray; - - /** - * Creates a new PySparkBatch instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.PySparkBatch - * @static - * @param {google.cloud.dataproc.v1.IPySparkBatch=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.PySparkBatch} PySparkBatch instance - */ - PySparkBatch.create = function create(properties) { - return new PySparkBatch(properties); - }; - - /** - * Encodes the specified PySparkBatch message. Does not implicitly {@link google.cloud.dataproc.v1.PySparkBatch.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.PySparkBatch - * @static - * @param {google.cloud.dataproc.v1.IPySparkBatch} message PySparkBatch message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PySparkBatch.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.mainPythonFileUri != null && Object.hasOwnProperty.call(message, "mainPythonFileUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.mainPythonFileUri); - 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.pythonFileUris != null && message.pythonFileUris.length) - for (var i = 0; i < message.pythonFileUris.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pythonFileUris[i]); - if (message.jarFileUris != null && message.jarFileUris.length) - for (var i = 0; i < message.jarFileUris.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.jarFileUris[i]); - if (message.fileUris != null && message.fileUris.length) - for (var i = 0; i < message.fileUris.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.fileUris[i]); - if (message.archiveUris != null && message.archiveUris.length) - for (var i = 0; i < message.archiveUris.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.archiveUris[i]); - return writer; - }; - - /** - * Encodes the specified PySparkBatch message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.PySparkBatch.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.PySparkBatch - * @static - * @param {google.cloud.dataproc.v1.IPySparkBatch} message PySparkBatch message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PySparkBatch.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PySparkBatch message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.PySparkBatch - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.PySparkBatch} PySparkBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PySparkBatch.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.PySparkBatch(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.mainPythonFileUri = reader.string(); - break; - } - case 2: { - if (!(message.args && message.args.length)) - message.args = []; - message.args.push(reader.string()); - break; - } - case 3: { - if (!(message.pythonFileUris && message.pythonFileUris.length)) - message.pythonFileUris = []; - message.pythonFileUris.push(reader.string()); - break; - } - case 4: { - if (!(message.jarFileUris && message.jarFileUris.length)) - message.jarFileUris = []; - message.jarFileUris.push(reader.string()); - break; - } - case 5: { - if (!(message.fileUris && message.fileUris.length)) - message.fileUris = []; - message.fileUris.push(reader.string()); - break; - } - case 6: { - if (!(message.archiveUris && message.archiveUris.length)) - message.archiveUris = []; - message.archiveUris.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PySparkBatch message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.PySparkBatch - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.PySparkBatch} PySparkBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PySparkBatch.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PySparkBatch message. - * @function verify - * @memberof google.cloud.dataproc.v1.PySparkBatch - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PySparkBatch.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.mainPythonFileUri != null && message.hasOwnProperty("mainPythonFileUri")) - if (!$util.isString(message.mainPythonFileUri)) - return "mainPythonFileUri: 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.pythonFileUris != null && message.hasOwnProperty("pythonFileUris")) { - if (!Array.isArray(message.pythonFileUris)) - return "pythonFileUris: array expected"; - for (var i = 0; i < message.pythonFileUris.length; ++i) - if (!$util.isString(message.pythonFileUris[i])) - return "pythonFileUris: string[] expected"; - } - if (message.jarFileUris != null && message.hasOwnProperty("jarFileUris")) { - if (!Array.isArray(message.jarFileUris)) - return "jarFileUris: array expected"; - for (var i = 0; i < message.jarFileUris.length; ++i) - if (!$util.isString(message.jarFileUris[i])) - return "jarFileUris: string[] expected"; - } - if (message.fileUris != null && message.hasOwnProperty("fileUris")) { - if (!Array.isArray(message.fileUris)) - return "fileUris: array expected"; - for (var i = 0; i < message.fileUris.length; ++i) - if (!$util.isString(message.fileUris[i])) - return "fileUris: string[] expected"; - } - if (message.archiveUris != null && message.hasOwnProperty("archiveUris")) { - if (!Array.isArray(message.archiveUris)) - return "archiveUris: array expected"; - for (var i = 0; i < message.archiveUris.length; ++i) - if (!$util.isString(message.archiveUris[i])) - return "archiveUris: string[] expected"; - } - return null; - }; - - /** - * Creates a PySparkBatch message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.PySparkBatch - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.PySparkBatch} PySparkBatch - */ - PySparkBatch.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.PySparkBatch) - return object; - var message = new $root.google.cloud.dataproc.v1.PySparkBatch(); - if (object.mainPythonFileUri != null) - message.mainPythonFileUri = String(object.mainPythonFileUri); - if (object.args) { - if (!Array.isArray(object.args)) - throw TypeError(".google.cloud.dataproc.v1.PySparkBatch.args: array expected"); - message.args = []; - for (var i = 0; i < object.args.length; ++i) - message.args[i] = String(object.args[i]); - } - if (object.pythonFileUris) { - if (!Array.isArray(object.pythonFileUris)) - throw TypeError(".google.cloud.dataproc.v1.PySparkBatch.pythonFileUris: array expected"); - message.pythonFileUris = []; - for (var i = 0; i < object.pythonFileUris.length; ++i) - message.pythonFileUris[i] = String(object.pythonFileUris[i]); - } - if (object.jarFileUris) { - if (!Array.isArray(object.jarFileUris)) - throw TypeError(".google.cloud.dataproc.v1.PySparkBatch.jarFileUris: array expected"); - message.jarFileUris = []; - for (var i = 0; i < object.jarFileUris.length; ++i) - message.jarFileUris[i] = String(object.jarFileUris[i]); - } - if (object.fileUris) { - if (!Array.isArray(object.fileUris)) - throw TypeError(".google.cloud.dataproc.v1.PySparkBatch.fileUris: array expected"); - message.fileUris = []; - for (var i = 0; i < object.fileUris.length; ++i) - message.fileUris[i] = String(object.fileUris[i]); - } - if (object.archiveUris) { - if (!Array.isArray(object.archiveUris)) - throw TypeError(".google.cloud.dataproc.v1.PySparkBatch.archiveUris: array expected"); - message.archiveUris = []; - for (var i = 0; i < object.archiveUris.length; ++i) - message.archiveUris[i] = String(object.archiveUris[i]); - } - return message; - }; - - /** - * Creates a plain object from a PySparkBatch message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.PySparkBatch - * @static - * @param {google.cloud.dataproc.v1.PySparkBatch} message PySparkBatch - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PySparkBatch.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.args = []; - object.pythonFileUris = []; - object.jarFileUris = []; - object.fileUris = []; - object.archiveUris = []; - } - if (options.defaults) - object.mainPythonFileUri = ""; - if (message.mainPythonFileUri != null && message.hasOwnProperty("mainPythonFileUri")) - object.mainPythonFileUri = message.mainPythonFileUri; - 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.pythonFileUris && message.pythonFileUris.length) { - object.pythonFileUris = []; - for (var j = 0; j < message.pythonFileUris.length; ++j) - object.pythonFileUris[j] = message.pythonFileUris[j]; - } - if (message.jarFileUris && message.jarFileUris.length) { - object.jarFileUris = []; - for (var j = 0; j < message.jarFileUris.length; ++j) - object.jarFileUris[j] = message.jarFileUris[j]; - } - if (message.fileUris && message.fileUris.length) { - object.fileUris = []; - for (var j = 0; j < message.fileUris.length; ++j) - object.fileUris[j] = message.fileUris[j]; - } - if (message.archiveUris && message.archiveUris.length) { - object.archiveUris = []; - for (var j = 0; j < message.archiveUris.length; ++j) - object.archiveUris[j] = message.archiveUris[j]; - } - return object; - }; - - /** - * Converts this PySparkBatch to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.PySparkBatch - * @instance - * @returns {Object.} JSON object - */ - PySparkBatch.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PySparkBatch - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.PySparkBatch - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PySparkBatch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.PySparkBatch"; - }; - - return PySparkBatch; - })(); - - v1.SparkBatch = (function() { - - /** - * Properties of a SparkBatch. - * @memberof google.cloud.dataproc.v1 - * @interface ISparkBatch - * @property {string|null} [mainJarFileUri] SparkBatch mainJarFileUri - * @property {string|null} [mainClass] SparkBatch mainClass - * @property {Array.|null} [args] SparkBatch args - * @property {Array.|null} [jarFileUris] SparkBatch jarFileUris - * @property {Array.|null} [fileUris] SparkBatch fileUris - * @property {Array.|null} [archiveUris] SparkBatch archiveUris - */ - - /** - * Constructs a new SparkBatch. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a SparkBatch. - * @implements ISparkBatch - * @constructor - * @param {google.cloud.dataproc.v1.ISparkBatch=} [properties] Properties to set - */ - function SparkBatch(properties) { - this.args = []; - this.jarFileUris = []; - this.fileUris = []; - this.archiveUris = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SparkBatch mainJarFileUri. - * @member {string|null|undefined} mainJarFileUri - * @memberof google.cloud.dataproc.v1.SparkBatch - * @instance - */ - SparkBatch.prototype.mainJarFileUri = null; - - /** - * SparkBatch mainClass. - * @member {string|null|undefined} mainClass - * @memberof google.cloud.dataproc.v1.SparkBatch - * @instance - */ - SparkBatch.prototype.mainClass = null; - - /** - * SparkBatch args. - * @member {Array.} args - * @memberof google.cloud.dataproc.v1.SparkBatch - * @instance - */ - SparkBatch.prototype.args = $util.emptyArray; - - /** - * SparkBatch jarFileUris. - * @member {Array.} jarFileUris - * @memberof google.cloud.dataproc.v1.SparkBatch - * @instance - */ - SparkBatch.prototype.jarFileUris = $util.emptyArray; - - /** - * SparkBatch fileUris. - * @member {Array.} fileUris - * @memberof google.cloud.dataproc.v1.SparkBatch - * @instance - */ - SparkBatch.prototype.fileUris = $util.emptyArray; - - /** - * SparkBatch archiveUris. - * @member {Array.} archiveUris - * @memberof google.cloud.dataproc.v1.SparkBatch - * @instance - */ - SparkBatch.prototype.archiveUris = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * SparkBatch driver. - * @member {"mainJarFileUri"|"mainClass"|undefined} driver - * @memberof google.cloud.dataproc.v1.SparkBatch - * @instance - */ - Object.defineProperty(SparkBatch.prototype, "driver", { - get: $util.oneOfGetter($oneOfFields = ["mainJarFileUri", "mainClass"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SparkBatch instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.SparkBatch - * @static - * @param {google.cloud.dataproc.v1.ISparkBatch=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.SparkBatch} SparkBatch instance - */ - SparkBatch.create = function create(properties) { - return new SparkBatch(properties); - }; - - /** - * Encodes the specified SparkBatch message. Does not implicitly {@link google.cloud.dataproc.v1.SparkBatch.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.SparkBatch - * @static - * @param {google.cloud.dataproc.v1.ISparkBatch} message SparkBatch message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SparkBatch.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.mainJarFileUri != null && Object.hasOwnProperty.call(message, "mainJarFileUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.mainJarFileUri); - if (message.mainClass != null && Object.hasOwnProperty.call(message, "mainClass")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.mainClass); - if (message.args != null && message.args.length) - for (var i = 0; i < message.args.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.args[i]); - if (message.jarFileUris != null && message.jarFileUris.length) - for (var i = 0; i < message.jarFileUris.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.jarFileUris[i]); - if (message.fileUris != null && message.fileUris.length) - for (var i = 0; i < message.fileUris.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.fileUris[i]); - if (message.archiveUris != null && message.archiveUris.length) - for (var i = 0; i < message.archiveUris.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.archiveUris[i]); - return writer; - }; - - /** - * Encodes the specified SparkBatch message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SparkBatch.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.SparkBatch - * @static - * @param {google.cloud.dataproc.v1.ISparkBatch} message SparkBatch message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SparkBatch.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SparkBatch message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.SparkBatch - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.SparkBatch} SparkBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SparkBatch.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.SparkBatch(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.mainJarFileUri = reader.string(); - break; - } - case 2: { - message.mainClass = reader.string(); - break; - } - case 3: { - if (!(message.args && message.args.length)) - message.args = []; - message.args.push(reader.string()); - break; - } - case 4: { - if (!(message.jarFileUris && message.jarFileUris.length)) - message.jarFileUris = []; - message.jarFileUris.push(reader.string()); - break; - } - case 5: { - if (!(message.fileUris && message.fileUris.length)) - message.fileUris = []; - message.fileUris.push(reader.string()); - break; - } - case 6: { - if (!(message.archiveUris && message.archiveUris.length)) - message.archiveUris = []; - message.archiveUris.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SparkBatch message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.SparkBatch - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.SparkBatch} SparkBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SparkBatch.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SparkBatch message. - * @function verify - * @memberof google.cloud.dataproc.v1.SparkBatch - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SparkBatch.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.mainJarFileUri != null && message.hasOwnProperty("mainJarFileUri")) { - properties.driver = 1; - if (!$util.isString(message.mainJarFileUri)) - return "mainJarFileUri: string expected"; - } - if (message.mainClass != null && message.hasOwnProperty("mainClass")) { - if (properties.driver === 1) - return "driver: multiple values"; - properties.driver = 1; - if (!$util.isString(message.mainClass)) - return "mainClass: 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.jarFileUris != null && message.hasOwnProperty("jarFileUris")) { - if (!Array.isArray(message.jarFileUris)) - return "jarFileUris: array expected"; - for (var i = 0; i < message.jarFileUris.length; ++i) - if (!$util.isString(message.jarFileUris[i])) - return "jarFileUris: string[] expected"; - } - if (message.fileUris != null && message.hasOwnProperty("fileUris")) { - if (!Array.isArray(message.fileUris)) - return "fileUris: array expected"; - for (var i = 0; i < message.fileUris.length; ++i) - if (!$util.isString(message.fileUris[i])) - return "fileUris: string[] expected"; - } - if (message.archiveUris != null && message.hasOwnProperty("archiveUris")) { - if (!Array.isArray(message.archiveUris)) - return "archiveUris: array expected"; - for (var i = 0; i < message.archiveUris.length; ++i) - if (!$util.isString(message.archiveUris[i])) - return "archiveUris: string[] expected"; - } - return null; - }; - - /** - * Creates a SparkBatch message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.SparkBatch - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.SparkBatch} SparkBatch - */ - SparkBatch.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.SparkBatch) - return object; - var message = new $root.google.cloud.dataproc.v1.SparkBatch(); - if (object.mainJarFileUri != null) - message.mainJarFileUri = String(object.mainJarFileUri); - if (object.mainClass != null) - message.mainClass = String(object.mainClass); - if (object.args) { - if (!Array.isArray(object.args)) - throw TypeError(".google.cloud.dataproc.v1.SparkBatch.args: array expected"); - message.args = []; - for (var i = 0; i < object.args.length; ++i) - message.args[i] = String(object.args[i]); - } - if (object.jarFileUris) { - if (!Array.isArray(object.jarFileUris)) - throw TypeError(".google.cloud.dataproc.v1.SparkBatch.jarFileUris: array expected"); - message.jarFileUris = []; - for (var i = 0; i < object.jarFileUris.length; ++i) - message.jarFileUris[i] = String(object.jarFileUris[i]); - } - if (object.fileUris) { - if (!Array.isArray(object.fileUris)) - throw TypeError(".google.cloud.dataproc.v1.SparkBatch.fileUris: array expected"); - message.fileUris = []; - for (var i = 0; i < object.fileUris.length; ++i) - message.fileUris[i] = String(object.fileUris[i]); - } - if (object.archiveUris) { - if (!Array.isArray(object.archiveUris)) - throw TypeError(".google.cloud.dataproc.v1.SparkBatch.archiveUris: array expected"); - message.archiveUris = []; - for (var i = 0; i < object.archiveUris.length; ++i) - message.archiveUris[i] = String(object.archiveUris[i]); - } - return message; - }; - - /** - * Creates a plain object from a SparkBatch message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.SparkBatch - * @static - * @param {google.cloud.dataproc.v1.SparkBatch} message SparkBatch - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SparkBatch.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.args = []; - object.jarFileUris = []; - object.fileUris = []; - object.archiveUris = []; - } - if (message.mainJarFileUri != null && message.hasOwnProperty("mainJarFileUri")) { - object.mainJarFileUri = message.mainJarFileUri; - if (options.oneofs) - object.driver = "mainJarFileUri"; - } - if (message.mainClass != null && message.hasOwnProperty("mainClass")) { - object.mainClass = message.mainClass; - if (options.oneofs) - object.driver = "mainClass"; - } - 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.jarFileUris && message.jarFileUris.length) { - object.jarFileUris = []; - for (var j = 0; j < message.jarFileUris.length; ++j) - object.jarFileUris[j] = message.jarFileUris[j]; - } - if (message.fileUris && message.fileUris.length) { - object.fileUris = []; - for (var j = 0; j < message.fileUris.length; ++j) - object.fileUris[j] = message.fileUris[j]; - } - if (message.archiveUris && message.archiveUris.length) { - object.archiveUris = []; - for (var j = 0; j < message.archiveUris.length; ++j) - object.archiveUris[j] = message.archiveUris[j]; - } - return object; - }; - - /** - * Converts this SparkBatch to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.SparkBatch - * @instance - * @returns {Object.} JSON object - */ - SparkBatch.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SparkBatch - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.SparkBatch - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SparkBatch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.SparkBatch"; - }; - - return SparkBatch; - })(); - - v1.SparkRBatch = (function() { - - /** - * Properties of a SparkRBatch. - * @memberof google.cloud.dataproc.v1 - * @interface ISparkRBatch - * @property {string|null} [mainRFileUri] SparkRBatch mainRFileUri - * @property {Array.|null} [args] SparkRBatch args - * @property {Array.|null} [fileUris] SparkRBatch fileUris - * @property {Array.|null} [archiveUris] SparkRBatch archiveUris - */ - - /** - * Constructs a new SparkRBatch. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a SparkRBatch. - * @implements ISparkRBatch - * @constructor - * @param {google.cloud.dataproc.v1.ISparkRBatch=} [properties] Properties to set - */ - function SparkRBatch(properties) { - this.args = []; - this.fileUris = []; - this.archiveUris = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SparkRBatch mainRFileUri. - * @member {string} mainRFileUri - * @memberof google.cloud.dataproc.v1.SparkRBatch - * @instance - */ - SparkRBatch.prototype.mainRFileUri = ""; - - /** - * SparkRBatch args. - * @member {Array.} args - * @memberof google.cloud.dataproc.v1.SparkRBatch - * @instance - */ - SparkRBatch.prototype.args = $util.emptyArray; - - /** - * SparkRBatch fileUris. - * @member {Array.} fileUris - * @memberof google.cloud.dataproc.v1.SparkRBatch - * @instance - */ - SparkRBatch.prototype.fileUris = $util.emptyArray; - - /** - * SparkRBatch archiveUris. - * @member {Array.} archiveUris - * @memberof google.cloud.dataproc.v1.SparkRBatch - * @instance - */ - SparkRBatch.prototype.archiveUris = $util.emptyArray; - - /** - * Creates a new SparkRBatch instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.SparkRBatch - * @static - * @param {google.cloud.dataproc.v1.ISparkRBatch=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.SparkRBatch} SparkRBatch instance - */ - SparkRBatch.create = function create(properties) { - return new SparkRBatch(properties); - }; - - /** - * Encodes the specified SparkRBatch message. Does not implicitly {@link google.cloud.dataproc.v1.SparkRBatch.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.SparkRBatch - * @static - * @param {google.cloud.dataproc.v1.ISparkRBatch} message SparkRBatch message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SparkRBatch.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.mainRFileUri != null && Object.hasOwnProperty.call(message, "mainRFileUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.mainRFileUri); - 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.fileUris != null && message.fileUris.length) - for (var i = 0; i < message.fileUris.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.fileUris[i]); - if (message.archiveUris != null && message.archiveUris.length) - for (var i = 0; i < message.archiveUris.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.archiveUris[i]); - return writer; - }; - - /** - * Encodes the specified SparkRBatch message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SparkRBatch.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.SparkRBatch - * @static - * @param {google.cloud.dataproc.v1.ISparkRBatch} message SparkRBatch message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SparkRBatch.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SparkRBatch message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.SparkRBatch - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.SparkRBatch} SparkRBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SparkRBatch.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.SparkRBatch(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.mainRFileUri = reader.string(); - break; - } - case 2: { - if (!(message.args && message.args.length)) - message.args = []; - message.args.push(reader.string()); - break; - } - case 3: { - if (!(message.fileUris && message.fileUris.length)) - message.fileUris = []; - message.fileUris.push(reader.string()); - break; - } - case 4: { - if (!(message.archiveUris && message.archiveUris.length)) - message.archiveUris = []; - message.archiveUris.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SparkRBatch message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.SparkRBatch - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.SparkRBatch} SparkRBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SparkRBatch.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SparkRBatch message. - * @function verify - * @memberof google.cloud.dataproc.v1.SparkRBatch - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SparkRBatch.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.mainRFileUri != null && message.hasOwnProperty("mainRFileUri")) - if (!$util.isString(message.mainRFileUri)) - return "mainRFileUri: 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.fileUris != null && message.hasOwnProperty("fileUris")) { - if (!Array.isArray(message.fileUris)) - return "fileUris: array expected"; - for (var i = 0; i < message.fileUris.length; ++i) - if (!$util.isString(message.fileUris[i])) - return "fileUris: string[] expected"; - } - if (message.archiveUris != null && message.hasOwnProperty("archiveUris")) { - if (!Array.isArray(message.archiveUris)) - return "archiveUris: array expected"; - for (var i = 0; i < message.archiveUris.length; ++i) - if (!$util.isString(message.archiveUris[i])) - return "archiveUris: string[] expected"; - } - return null; - }; - - /** - * Creates a SparkRBatch message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.SparkRBatch - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.SparkRBatch} SparkRBatch - */ - SparkRBatch.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.SparkRBatch) - return object; - var message = new $root.google.cloud.dataproc.v1.SparkRBatch(); - if (object.mainRFileUri != null) - message.mainRFileUri = String(object.mainRFileUri); - if (object.args) { - if (!Array.isArray(object.args)) - throw TypeError(".google.cloud.dataproc.v1.SparkRBatch.args: array expected"); - message.args = []; - for (var i = 0; i < object.args.length; ++i) - message.args[i] = String(object.args[i]); - } - if (object.fileUris) { - if (!Array.isArray(object.fileUris)) - throw TypeError(".google.cloud.dataproc.v1.SparkRBatch.fileUris: array expected"); - message.fileUris = []; - for (var i = 0; i < object.fileUris.length; ++i) - message.fileUris[i] = String(object.fileUris[i]); - } - if (object.archiveUris) { - if (!Array.isArray(object.archiveUris)) - throw TypeError(".google.cloud.dataproc.v1.SparkRBatch.archiveUris: array expected"); - message.archiveUris = []; - for (var i = 0; i < object.archiveUris.length; ++i) - message.archiveUris[i] = String(object.archiveUris[i]); - } - return message; - }; - - /** - * Creates a plain object from a SparkRBatch message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.SparkRBatch - * @static - * @param {google.cloud.dataproc.v1.SparkRBatch} message SparkRBatch - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SparkRBatch.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.args = []; - object.fileUris = []; - object.archiveUris = []; - } - if (options.defaults) - object.mainRFileUri = ""; - if (message.mainRFileUri != null && message.hasOwnProperty("mainRFileUri")) - object.mainRFileUri = message.mainRFileUri; - 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.fileUris && message.fileUris.length) { - object.fileUris = []; - for (var j = 0; j < message.fileUris.length; ++j) - object.fileUris[j] = message.fileUris[j]; - } - if (message.archiveUris && message.archiveUris.length) { - object.archiveUris = []; - for (var j = 0; j < message.archiveUris.length; ++j) - object.archiveUris[j] = message.archiveUris[j]; - } - return object; - }; - - /** - * Converts this SparkRBatch to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.SparkRBatch - * @instance - * @returns {Object.} JSON object - */ - SparkRBatch.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SparkRBatch - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.SparkRBatch - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SparkRBatch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.SparkRBatch"; - }; - - return SparkRBatch; - })(); - - v1.SparkSqlBatch = (function() { - - /** - * Properties of a SparkSqlBatch. - * @memberof google.cloud.dataproc.v1 - * @interface ISparkSqlBatch - * @property {string|null} [queryFileUri] SparkSqlBatch queryFileUri - * @property {Object.|null} [queryVariables] SparkSqlBatch queryVariables - * @property {Array.|null} [jarFileUris] SparkSqlBatch jarFileUris - */ - - /** - * Constructs a new SparkSqlBatch. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a SparkSqlBatch. - * @implements ISparkSqlBatch - * @constructor - * @param {google.cloud.dataproc.v1.ISparkSqlBatch=} [properties] Properties to set - */ - function SparkSqlBatch(properties) { - this.queryVariables = {}; - this.jarFileUris = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SparkSqlBatch queryFileUri. - * @member {string} queryFileUri - * @memberof google.cloud.dataproc.v1.SparkSqlBatch - * @instance - */ - SparkSqlBatch.prototype.queryFileUri = ""; - - /** - * SparkSqlBatch queryVariables. - * @member {Object.} queryVariables - * @memberof google.cloud.dataproc.v1.SparkSqlBatch - * @instance - */ - SparkSqlBatch.prototype.queryVariables = $util.emptyObject; - - /** - * SparkSqlBatch jarFileUris. - * @member {Array.} jarFileUris - * @memberof google.cloud.dataproc.v1.SparkSqlBatch - * @instance - */ - SparkSqlBatch.prototype.jarFileUris = $util.emptyArray; - - /** - * Creates a new SparkSqlBatch instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.SparkSqlBatch - * @static - * @param {google.cloud.dataproc.v1.ISparkSqlBatch=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.SparkSqlBatch} SparkSqlBatch instance - */ - SparkSqlBatch.create = function create(properties) { - return new SparkSqlBatch(properties); - }; - - /** - * Encodes the specified SparkSqlBatch message. Does not implicitly {@link google.cloud.dataproc.v1.SparkSqlBatch.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.SparkSqlBatch - * @static - * @param {google.cloud.dataproc.v1.ISparkSqlBatch} message SparkSqlBatch message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SparkSqlBatch.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.queryFileUri != null && Object.hasOwnProperty.call(message, "queryFileUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.queryFileUri); - if (message.queryVariables != null && Object.hasOwnProperty.call(message, "queryVariables")) - for (var keys = Object.keys(message.queryVariables), 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.queryVariables[keys[i]]).ldelim(); - if (message.jarFileUris != null && message.jarFileUris.length) - for (var i = 0; i < message.jarFileUris.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.jarFileUris[i]); - return writer; - }; - - /** - * Encodes the specified SparkSqlBatch message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SparkSqlBatch.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.SparkSqlBatch - * @static - * @param {google.cloud.dataproc.v1.ISparkSqlBatch} message SparkSqlBatch message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SparkSqlBatch.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SparkSqlBatch message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.SparkSqlBatch - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.SparkSqlBatch} SparkSqlBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SparkSqlBatch.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.SparkSqlBatch(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.queryFileUri = reader.string(); - break; - } - case 2: { - if (message.queryVariables === $util.emptyObject) - message.queryVariables = {}; - 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.queryVariables[key] = value; - break; - } - case 3: { - if (!(message.jarFileUris && message.jarFileUris.length)) - message.jarFileUris = []; - message.jarFileUris.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SparkSqlBatch message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.SparkSqlBatch - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.SparkSqlBatch} SparkSqlBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SparkSqlBatch.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SparkSqlBatch message. - * @function verify - * @memberof google.cloud.dataproc.v1.SparkSqlBatch - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SparkSqlBatch.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.queryFileUri != null && message.hasOwnProperty("queryFileUri")) - if (!$util.isString(message.queryFileUri)) - return "queryFileUri: string expected"; - if (message.queryVariables != null && message.hasOwnProperty("queryVariables")) { - if (!$util.isObject(message.queryVariables)) - return "queryVariables: object expected"; - var key = Object.keys(message.queryVariables); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.queryVariables[key[i]])) - return "queryVariables: string{k:string} expected"; - } - if (message.jarFileUris != null && message.hasOwnProperty("jarFileUris")) { - if (!Array.isArray(message.jarFileUris)) - return "jarFileUris: array expected"; - for (var i = 0; i < message.jarFileUris.length; ++i) - if (!$util.isString(message.jarFileUris[i])) - return "jarFileUris: string[] expected"; - } - return null; - }; - - /** - * Creates a SparkSqlBatch message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.SparkSqlBatch - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.SparkSqlBatch} SparkSqlBatch - */ - SparkSqlBatch.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.SparkSqlBatch) - return object; - var message = new $root.google.cloud.dataproc.v1.SparkSqlBatch(); - if (object.queryFileUri != null) - message.queryFileUri = String(object.queryFileUri); - if (object.queryVariables) { - if (typeof object.queryVariables !== "object") - throw TypeError(".google.cloud.dataproc.v1.SparkSqlBatch.queryVariables: object expected"); - message.queryVariables = {}; - for (var keys = Object.keys(object.queryVariables), i = 0; i < keys.length; ++i) - message.queryVariables[keys[i]] = String(object.queryVariables[keys[i]]); - } - if (object.jarFileUris) { - if (!Array.isArray(object.jarFileUris)) - throw TypeError(".google.cloud.dataproc.v1.SparkSqlBatch.jarFileUris: array expected"); - message.jarFileUris = []; - for (var i = 0; i < object.jarFileUris.length; ++i) - message.jarFileUris[i] = String(object.jarFileUris[i]); - } - return message; - }; - - /** - * Creates a plain object from a SparkSqlBatch message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.SparkSqlBatch - * @static - * @param {google.cloud.dataproc.v1.SparkSqlBatch} message SparkSqlBatch - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SparkSqlBatch.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.jarFileUris = []; - if (options.objects || options.defaults) - object.queryVariables = {}; - if (options.defaults) - object.queryFileUri = ""; - if (message.queryFileUri != null && message.hasOwnProperty("queryFileUri")) - object.queryFileUri = message.queryFileUri; - var keys2; - if (message.queryVariables && (keys2 = Object.keys(message.queryVariables)).length) { - object.queryVariables = {}; - for (var j = 0; j < keys2.length; ++j) - object.queryVariables[keys2[j]] = message.queryVariables[keys2[j]]; - } - if (message.jarFileUris && message.jarFileUris.length) { - object.jarFileUris = []; - for (var j = 0; j < message.jarFileUris.length; ++j) - object.jarFileUris[j] = message.jarFileUris[j]; - } - return object; - }; - - /** - * Converts this SparkSqlBatch to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.SparkSqlBatch - * @instance - * @returns {Object.} JSON object - */ - SparkSqlBatch.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SparkSqlBatch - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.SparkSqlBatch - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SparkSqlBatch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.SparkSqlBatch"; - }; - - return SparkSqlBatch; - })(); - - v1.PySparkNotebookBatch = (function() { - - /** - * Properties of a PySparkNotebookBatch. - * @memberof google.cloud.dataproc.v1 - * @interface IPySparkNotebookBatch - * @property {string|null} [notebookFileUri] PySparkNotebookBatch notebookFileUri - * @property {Object.|null} [params] PySparkNotebookBatch params - * @property {Array.|null} [pythonFileUris] PySparkNotebookBatch pythonFileUris - * @property {Array.|null} [jarFileUris] PySparkNotebookBatch jarFileUris - * @property {Array.|null} [fileUris] PySparkNotebookBatch fileUris - * @property {Array.|null} [archiveUris] PySparkNotebookBatch archiveUris - */ - - /** - * Constructs a new PySparkNotebookBatch. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a PySparkNotebookBatch. - * @implements IPySparkNotebookBatch - * @constructor - * @param {google.cloud.dataproc.v1.IPySparkNotebookBatch=} [properties] Properties to set - */ - function PySparkNotebookBatch(properties) { - this.params = {}; - this.pythonFileUris = []; - this.jarFileUris = []; - this.fileUris = []; - this.archiveUris = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PySparkNotebookBatch notebookFileUri. - * @member {string} notebookFileUri - * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch - * @instance - */ - PySparkNotebookBatch.prototype.notebookFileUri = ""; - - /** - * PySparkNotebookBatch params. - * @member {Object.} params - * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch - * @instance - */ - PySparkNotebookBatch.prototype.params = $util.emptyObject; - - /** - * PySparkNotebookBatch pythonFileUris. - * @member {Array.} pythonFileUris - * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch - * @instance - */ - PySparkNotebookBatch.prototype.pythonFileUris = $util.emptyArray; - - /** - * PySparkNotebookBatch jarFileUris. - * @member {Array.} jarFileUris - * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch - * @instance - */ - PySparkNotebookBatch.prototype.jarFileUris = $util.emptyArray; - - /** - * PySparkNotebookBatch fileUris. - * @member {Array.} fileUris - * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch - * @instance - */ - PySparkNotebookBatch.prototype.fileUris = $util.emptyArray; - - /** - * PySparkNotebookBatch archiveUris. - * @member {Array.} archiveUris - * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch - * @instance - */ - PySparkNotebookBatch.prototype.archiveUris = $util.emptyArray; - - /** - * Creates a new PySparkNotebookBatch instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch - * @static - * @param {google.cloud.dataproc.v1.IPySparkNotebookBatch=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.PySparkNotebookBatch} PySparkNotebookBatch instance - */ - PySparkNotebookBatch.create = function create(properties) { - return new PySparkNotebookBatch(properties); - }; - - /** - * Encodes the specified PySparkNotebookBatch message. Does not implicitly {@link google.cloud.dataproc.v1.PySparkNotebookBatch.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch - * @static - * @param {google.cloud.dataproc.v1.IPySparkNotebookBatch} message PySparkNotebookBatch message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PySparkNotebookBatch.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.notebookFileUri != null && Object.hasOwnProperty.call(message, "notebookFileUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.notebookFileUri); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - for (var keys = Object.keys(message.params), 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.params[keys[i]]).ldelim(); - if (message.pythonFileUris != null && message.pythonFileUris.length) - for (var i = 0; i < message.pythonFileUris.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pythonFileUris[i]); - if (message.jarFileUris != null && message.jarFileUris.length) - for (var i = 0; i < message.jarFileUris.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.jarFileUris[i]); - if (message.fileUris != null && message.fileUris.length) - for (var i = 0; i < message.fileUris.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.fileUris[i]); - if (message.archiveUris != null && message.archiveUris.length) - for (var i = 0; i < message.archiveUris.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.archiveUris[i]); - return writer; - }; - - /** - * Encodes the specified PySparkNotebookBatch message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.PySparkNotebookBatch.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch - * @static - * @param {google.cloud.dataproc.v1.IPySparkNotebookBatch} message PySparkNotebookBatch message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PySparkNotebookBatch.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PySparkNotebookBatch message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.PySparkNotebookBatch} PySparkNotebookBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PySparkNotebookBatch.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.PySparkNotebookBatch(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.notebookFileUri = reader.string(); - break; - } - case 2: { - if (message.params === $util.emptyObject) - message.params = {}; - 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.params[key] = value; - break; - } - case 3: { - if (!(message.pythonFileUris && message.pythonFileUris.length)) - message.pythonFileUris = []; - message.pythonFileUris.push(reader.string()); - break; - } - case 4: { - if (!(message.jarFileUris && message.jarFileUris.length)) - message.jarFileUris = []; - message.jarFileUris.push(reader.string()); - break; - } - case 5: { - if (!(message.fileUris && message.fileUris.length)) - message.fileUris = []; - message.fileUris.push(reader.string()); - break; - } - case 6: { - if (!(message.archiveUris && message.archiveUris.length)) - message.archiveUris = []; - message.archiveUris.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PySparkNotebookBatch message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.PySparkNotebookBatch} PySparkNotebookBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PySparkNotebookBatch.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PySparkNotebookBatch message. - * @function verify - * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PySparkNotebookBatch.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.notebookFileUri != null && message.hasOwnProperty("notebookFileUri")) - if (!$util.isString(message.notebookFileUri)) - return "notebookFileUri: string expected"; - if (message.params != null && message.hasOwnProperty("params")) { - if (!$util.isObject(message.params)) - return "params: object expected"; - var key = Object.keys(message.params); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.params[key[i]])) - return "params: string{k:string} expected"; - } - if (message.pythonFileUris != null && message.hasOwnProperty("pythonFileUris")) { - if (!Array.isArray(message.pythonFileUris)) - return "pythonFileUris: array expected"; - for (var i = 0; i < message.pythonFileUris.length; ++i) - if (!$util.isString(message.pythonFileUris[i])) - return "pythonFileUris: string[] expected"; - } - if (message.jarFileUris != null && message.hasOwnProperty("jarFileUris")) { - if (!Array.isArray(message.jarFileUris)) - return "jarFileUris: array expected"; - for (var i = 0; i < message.jarFileUris.length; ++i) - if (!$util.isString(message.jarFileUris[i])) - return "jarFileUris: string[] expected"; - } - if (message.fileUris != null && message.hasOwnProperty("fileUris")) { - if (!Array.isArray(message.fileUris)) - return "fileUris: array expected"; - for (var i = 0; i < message.fileUris.length; ++i) - if (!$util.isString(message.fileUris[i])) - return "fileUris: string[] expected"; - } - if (message.archiveUris != null && message.hasOwnProperty("archiveUris")) { - if (!Array.isArray(message.archiveUris)) - return "archiveUris: array expected"; - for (var i = 0; i < message.archiveUris.length; ++i) - if (!$util.isString(message.archiveUris[i])) - return "archiveUris: string[] expected"; - } - return null; - }; - - /** - * Creates a PySparkNotebookBatch message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.PySparkNotebookBatch} PySparkNotebookBatch - */ - PySparkNotebookBatch.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.PySparkNotebookBatch) - return object; - var message = new $root.google.cloud.dataproc.v1.PySparkNotebookBatch(); - if (object.notebookFileUri != null) - message.notebookFileUri = String(object.notebookFileUri); - if (object.params) { - if (typeof object.params !== "object") - throw TypeError(".google.cloud.dataproc.v1.PySparkNotebookBatch.params: object expected"); - message.params = {}; - for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) - message.params[keys[i]] = String(object.params[keys[i]]); - } - if (object.pythonFileUris) { - if (!Array.isArray(object.pythonFileUris)) - throw TypeError(".google.cloud.dataproc.v1.PySparkNotebookBatch.pythonFileUris: array expected"); - message.pythonFileUris = []; - for (var i = 0; i < object.pythonFileUris.length; ++i) - message.pythonFileUris[i] = String(object.pythonFileUris[i]); - } - if (object.jarFileUris) { - if (!Array.isArray(object.jarFileUris)) - throw TypeError(".google.cloud.dataproc.v1.PySparkNotebookBatch.jarFileUris: array expected"); - message.jarFileUris = []; - for (var i = 0; i < object.jarFileUris.length; ++i) - message.jarFileUris[i] = String(object.jarFileUris[i]); - } - if (object.fileUris) { - if (!Array.isArray(object.fileUris)) - throw TypeError(".google.cloud.dataproc.v1.PySparkNotebookBatch.fileUris: array expected"); - message.fileUris = []; - for (var i = 0; i < object.fileUris.length; ++i) - message.fileUris[i] = String(object.fileUris[i]); - } - if (object.archiveUris) { - if (!Array.isArray(object.archiveUris)) - throw TypeError(".google.cloud.dataproc.v1.PySparkNotebookBatch.archiveUris: array expected"); - message.archiveUris = []; - for (var i = 0; i < object.archiveUris.length; ++i) - message.archiveUris[i] = String(object.archiveUris[i]); - } - return message; - }; - - /** - * Creates a plain object from a PySparkNotebookBatch message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch - * @static - * @param {google.cloud.dataproc.v1.PySparkNotebookBatch} message PySparkNotebookBatch - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PySparkNotebookBatch.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.pythonFileUris = []; - object.jarFileUris = []; - object.fileUris = []; - object.archiveUris = []; - } - if (options.objects || options.defaults) - object.params = {}; - if (options.defaults) - object.notebookFileUri = ""; - if (message.notebookFileUri != null && message.hasOwnProperty("notebookFileUri")) - object.notebookFileUri = message.notebookFileUri; - var keys2; - if (message.params && (keys2 = Object.keys(message.params)).length) { - object.params = {}; - for (var j = 0; j < keys2.length; ++j) - object.params[keys2[j]] = message.params[keys2[j]]; - } - if (message.pythonFileUris && message.pythonFileUris.length) { - object.pythonFileUris = []; - for (var j = 0; j < message.pythonFileUris.length; ++j) - object.pythonFileUris[j] = message.pythonFileUris[j]; - } - if (message.jarFileUris && message.jarFileUris.length) { - object.jarFileUris = []; - for (var j = 0; j < message.jarFileUris.length; ++j) - object.jarFileUris[j] = message.jarFileUris[j]; - } - if (message.fileUris && message.fileUris.length) { - object.fileUris = []; - for (var j = 0; j < message.fileUris.length; ++j) - object.fileUris[j] = message.fileUris[j]; - } - if (message.archiveUris && message.archiveUris.length) { - object.archiveUris = []; - for (var j = 0; j < message.archiveUris.length; ++j) - object.archiveUris[j] = message.archiveUris[j]; - } - return object; - }; - - /** - * Converts this PySparkNotebookBatch to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch - * @instance - * @returns {Object.} JSON object - */ - PySparkNotebookBatch.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PySparkNotebookBatch - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PySparkNotebookBatch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.PySparkNotebookBatch"; - }; - - return PySparkNotebookBatch; - })(); - - v1.RuntimeConfig = (function() { - - /** - * Properties of a RuntimeConfig. - * @memberof google.cloud.dataproc.v1 - * @interface IRuntimeConfig - * @property {string|null} [version] RuntimeConfig version - * @property {string|null} [containerImage] RuntimeConfig containerImage - * @property {Object.|null} [properties] RuntimeConfig properties - * @property {google.cloud.dataproc.v1.IRepositoryConfig|null} [repositoryConfig] RuntimeConfig repositoryConfig - * @property {google.cloud.dataproc.v1.IAutotuningConfig|null} [autotuningConfig] RuntimeConfig autotuningConfig - * @property {string|null} [cohort] RuntimeConfig cohort - */ - - /** - * Constructs a new RuntimeConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a RuntimeConfig. - * @implements IRuntimeConfig - * @constructor - * @param {google.cloud.dataproc.v1.IRuntimeConfig=} [properties] Properties to set - */ - function RuntimeConfig(properties) { - this.properties = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RuntimeConfig version. - * @member {string} version - * @memberof google.cloud.dataproc.v1.RuntimeConfig - * @instance - */ - RuntimeConfig.prototype.version = ""; - - /** - * RuntimeConfig containerImage. - * @member {string} containerImage - * @memberof google.cloud.dataproc.v1.RuntimeConfig - * @instance - */ - RuntimeConfig.prototype.containerImage = ""; - - /** - * RuntimeConfig properties. - * @member {Object.} properties - * @memberof google.cloud.dataproc.v1.RuntimeConfig - * @instance - */ - RuntimeConfig.prototype.properties = $util.emptyObject; - - /** - * RuntimeConfig repositoryConfig. - * @member {google.cloud.dataproc.v1.IRepositoryConfig|null|undefined} repositoryConfig - * @memberof google.cloud.dataproc.v1.RuntimeConfig - * @instance - */ - RuntimeConfig.prototype.repositoryConfig = null; - - /** - * RuntimeConfig autotuningConfig. - * @member {google.cloud.dataproc.v1.IAutotuningConfig|null|undefined} autotuningConfig - * @memberof google.cloud.dataproc.v1.RuntimeConfig - * @instance - */ - RuntimeConfig.prototype.autotuningConfig = null; - - /** - * RuntimeConfig cohort. - * @member {string} cohort - * @memberof google.cloud.dataproc.v1.RuntimeConfig - * @instance - */ - RuntimeConfig.prototype.cohort = ""; - - /** - * Creates a new RuntimeConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.RuntimeConfig - * @static - * @param {google.cloud.dataproc.v1.IRuntimeConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.RuntimeConfig} RuntimeConfig instance - */ - RuntimeConfig.create = function create(properties) { - return new RuntimeConfig(properties); - }; - - /** - * Encodes the specified RuntimeConfig message. Does not implicitly {@link google.cloud.dataproc.v1.RuntimeConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.RuntimeConfig - * @static - * @param {google.cloud.dataproc.v1.IRuntimeConfig} message RuntimeConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RuntimeConfig.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.containerImage != null && Object.hasOwnProperty.call(message, "containerImage")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.containerImage); - if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) - for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.properties[keys[i]]).ldelim(); - if (message.repositoryConfig != null && Object.hasOwnProperty.call(message, "repositoryConfig")) - $root.google.cloud.dataproc.v1.RepositoryConfig.encode(message.repositoryConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.autotuningConfig != null && Object.hasOwnProperty.call(message, "autotuningConfig")) - $root.google.cloud.dataproc.v1.AutotuningConfig.encode(message.autotuningConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.cohort != null && Object.hasOwnProperty.call(message, "cohort")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.cohort); - return writer; - }; - - /** - * Encodes the specified RuntimeConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.RuntimeConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.RuntimeConfig - * @static - * @param {google.cloud.dataproc.v1.IRuntimeConfig} message RuntimeConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RuntimeConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RuntimeConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.RuntimeConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.RuntimeConfig} RuntimeConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RuntimeConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.RuntimeConfig(), key, value; - 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.containerImage = reader.string(); - break; - } - case 3: { - if (message.properties === $util.emptyObject) - message.properties = {}; - 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.properties[key] = value; - break; - } - case 5: { - message.repositoryConfig = $root.google.cloud.dataproc.v1.RepositoryConfig.decode(reader, reader.uint32()); - break; - } - case 6: { - message.autotuningConfig = $root.google.cloud.dataproc.v1.AutotuningConfig.decode(reader, reader.uint32()); - break; - } - case 7: { - message.cohort = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RuntimeConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.RuntimeConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.RuntimeConfig} RuntimeConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RuntimeConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RuntimeConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.RuntimeConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RuntimeConfig.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.containerImage != null && message.hasOwnProperty("containerImage")) - if (!$util.isString(message.containerImage)) - return "containerImage: string expected"; - if (message.properties != null && message.hasOwnProperty("properties")) { - if (!$util.isObject(message.properties)) - return "properties: object expected"; - var key = Object.keys(message.properties); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.properties[key[i]])) - return "properties: string{k:string} expected"; - } - if (message.repositoryConfig != null && message.hasOwnProperty("repositoryConfig")) { - var error = $root.google.cloud.dataproc.v1.RepositoryConfig.verify(message.repositoryConfig); - if (error) - return "repositoryConfig." + error; - } - if (message.autotuningConfig != null && message.hasOwnProperty("autotuningConfig")) { - var error = $root.google.cloud.dataproc.v1.AutotuningConfig.verify(message.autotuningConfig); - if (error) - return "autotuningConfig." + error; - } - if (message.cohort != null && message.hasOwnProperty("cohort")) - if (!$util.isString(message.cohort)) - return "cohort: string expected"; - return null; - }; - - /** - * Creates a RuntimeConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.RuntimeConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.RuntimeConfig} RuntimeConfig - */ - RuntimeConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.RuntimeConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.RuntimeConfig(); - if (object.version != null) - message.version = String(object.version); - if (object.containerImage != null) - message.containerImage = String(object.containerImage); - if (object.properties) { - if (typeof object.properties !== "object") - throw TypeError(".google.cloud.dataproc.v1.RuntimeConfig.properties: object expected"); - message.properties = {}; - for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) - message.properties[keys[i]] = String(object.properties[keys[i]]); - } - if (object.repositoryConfig != null) { - if (typeof object.repositoryConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.RuntimeConfig.repositoryConfig: object expected"); - message.repositoryConfig = $root.google.cloud.dataproc.v1.RepositoryConfig.fromObject(object.repositoryConfig); - } - if (object.autotuningConfig != null) { - if (typeof object.autotuningConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.RuntimeConfig.autotuningConfig: object expected"); - message.autotuningConfig = $root.google.cloud.dataproc.v1.AutotuningConfig.fromObject(object.autotuningConfig); - } - if (object.cohort != null) - message.cohort = String(object.cohort); - return message; - }; - - /** - * Creates a plain object from a RuntimeConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.RuntimeConfig - * @static - * @param {google.cloud.dataproc.v1.RuntimeConfig} message RuntimeConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RuntimeConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.properties = {}; - if (options.defaults) { - object.version = ""; - object.containerImage = ""; - object.repositoryConfig = null; - object.autotuningConfig = null; - object.cohort = ""; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.containerImage != null && message.hasOwnProperty("containerImage")) - object.containerImage = message.containerImage; - var keys2; - if (message.properties && (keys2 = Object.keys(message.properties)).length) { - object.properties = {}; - for (var j = 0; j < keys2.length; ++j) - object.properties[keys2[j]] = message.properties[keys2[j]]; - } - if (message.repositoryConfig != null && message.hasOwnProperty("repositoryConfig")) - object.repositoryConfig = $root.google.cloud.dataproc.v1.RepositoryConfig.toObject(message.repositoryConfig, options); - if (message.autotuningConfig != null && message.hasOwnProperty("autotuningConfig")) - object.autotuningConfig = $root.google.cloud.dataproc.v1.AutotuningConfig.toObject(message.autotuningConfig, options); - if (message.cohort != null && message.hasOwnProperty("cohort")) - object.cohort = message.cohort; - return object; - }; - - /** - * Converts this RuntimeConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.RuntimeConfig - * @instance - * @returns {Object.} JSON object - */ - RuntimeConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RuntimeConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.RuntimeConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RuntimeConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.RuntimeConfig"; - }; - - return RuntimeConfig; - })(); - - v1.EnvironmentConfig = (function() { - - /** - * Properties of an EnvironmentConfig. - * @memberof google.cloud.dataproc.v1 - * @interface IEnvironmentConfig - * @property {google.cloud.dataproc.v1.IExecutionConfig|null} [executionConfig] EnvironmentConfig executionConfig - * @property {google.cloud.dataproc.v1.IPeripheralsConfig|null} [peripheralsConfig] EnvironmentConfig peripheralsConfig - */ - - /** - * Constructs a new EnvironmentConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents an EnvironmentConfig. - * @implements IEnvironmentConfig - * @constructor - * @param {google.cloud.dataproc.v1.IEnvironmentConfig=} [properties] Properties to set - */ - function EnvironmentConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnvironmentConfig executionConfig. - * @member {google.cloud.dataproc.v1.IExecutionConfig|null|undefined} executionConfig - * @memberof google.cloud.dataproc.v1.EnvironmentConfig - * @instance - */ - EnvironmentConfig.prototype.executionConfig = null; - - /** - * EnvironmentConfig peripheralsConfig. - * @member {google.cloud.dataproc.v1.IPeripheralsConfig|null|undefined} peripheralsConfig - * @memberof google.cloud.dataproc.v1.EnvironmentConfig - * @instance - */ - EnvironmentConfig.prototype.peripheralsConfig = null; - - /** - * Creates a new EnvironmentConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.EnvironmentConfig - * @static - * @param {google.cloud.dataproc.v1.IEnvironmentConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.EnvironmentConfig} EnvironmentConfig instance - */ - EnvironmentConfig.create = function create(properties) { - return new EnvironmentConfig(properties); - }; - - /** - * Encodes the specified EnvironmentConfig message. Does not implicitly {@link google.cloud.dataproc.v1.EnvironmentConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.EnvironmentConfig - * @static - * @param {google.cloud.dataproc.v1.IEnvironmentConfig} message EnvironmentConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnvironmentConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.executionConfig != null && Object.hasOwnProperty.call(message, "executionConfig")) - $root.google.cloud.dataproc.v1.ExecutionConfig.encode(message.executionConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.peripheralsConfig != null && Object.hasOwnProperty.call(message, "peripheralsConfig")) - $root.google.cloud.dataproc.v1.PeripheralsConfig.encode(message.peripheralsConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnvironmentConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.EnvironmentConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.EnvironmentConfig - * @static - * @param {google.cloud.dataproc.v1.IEnvironmentConfig} message EnvironmentConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnvironmentConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnvironmentConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.EnvironmentConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.EnvironmentConfig} EnvironmentConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnvironmentConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.EnvironmentConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.executionConfig = $root.google.cloud.dataproc.v1.ExecutionConfig.decode(reader, reader.uint32()); - break; - } - case 2: { - message.peripheralsConfig = $root.google.cloud.dataproc.v1.PeripheralsConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnvironmentConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.EnvironmentConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.EnvironmentConfig} EnvironmentConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnvironmentConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnvironmentConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.EnvironmentConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnvironmentConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.executionConfig != null && message.hasOwnProperty("executionConfig")) { - var error = $root.google.cloud.dataproc.v1.ExecutionConfig.verify(message.executionConfig); - if (error) - return "executionConfig." + error; - } - if (message.peripheralsConfig != null && message.hasOwnProperty("peripheralsConfig")) { - var error = $root.google.cloud.dataproc.v1.PeripheralsConfig.verify(message.peripheralsConfig); - if (error) - return "peripheralsConfig." + error; - } - return null; - }; - - /** - * Creates an EnvironmentConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.EnvironmentConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.EnvironmentConfig} EnvironmentConfig - */ - EnvironmentConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.EnvironmentConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.EnvironmentConfig(); - if (object.executionConfig != null) { - if (typeof object.executionConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.EnvironmentConfig.executionConfig: object expected"); - message.executionConfig = $root.google.cloud.dataproc.v1.ExecutionConfig.fromObject(object.executionConfig); - } - if (object.peripheralsConfig != null) { - if (typeof object.peripheralsConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.EnvironmentConfig.peripheralsConfig: object expected"); - message.peripheralsConfig = $root.google.cloud.dataproc.v1.PeripheralsConfig.fromObject(object.peripheralsConfig); - } - return message; - }; - - /** - * Creates a plain object from an EnvironmentConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.EnvironmentConfig - * @static - * @param {google.cloud.dataproc.v1.EnvironmentConfig} message EnvironmentConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnvironmentConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.executionConfig = null; - object.peripheralsConfig = null; - } - if (message.executionConfig != null && message.hasOwnProperty("executionConfig")) - object.executionConfig = $root.google.cloud.dataproc.v1.ExecutionConfig.toObject(message.executionConfig, options); - if (message.peripheralsConfig != null && message.hasOwnProperty("peripheralsConfig")) - object.peripheralsConfig = $root.google.cloud.dataproc.v1.PeripheralsConfig.toObject(message.peripheralsConfig, options); - return object; - }; - - /** - * Converts this EnvironmentConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.EnvironmentConfig - * @instance - * @returns {Object.} JSON object - */ - EnvironmentConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnvironmentConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.EnvironmentConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnvironmentConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.EnvironmentConfig"; - }; - - return EnvironmentConfig; - })(); - - v1.ExecutionConfig = (function() { - - /** - * Properties of an ExecutionConfig. - * @memberof google.cloud.dataproc.v1 - * @interface IExecutionConfig - * @property {string|null} [serviceAccount] ExecutionConfig serviceAccount - * @property {string|null} [networkUri] ExecutionConfig networkUri - * @property {string|null} [subnetworkUri] ExecutionConfig subnetworkUri - * @property {Array.|null} [networkTags] ExecutionConfig networkTags - * @property {string|null} [kmsKey] ExecutionConfig kmsKey - * @property {google.protobuf.IDuration|null} [idleTtl] ExecutionConfig idleTtl - * @property {google.protobuf.IDuration|null} [ttl] ExecutionConfig ttl - * @property {string|null} [stagingBucket] ExecutionConfig stagingBucket - * @property {google.cloud.dataproc.v1.IAuthenticationConfig|null} [authenticationConfig] ExecutionConfig authenticationConfig - */ - - /** - * Constructs a new ExecutionConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents an ExecutionConfig. - * @implements IExecutionConfig - * @constructor - * @param {google.cloud.dataproc.v1.IExecutionConfig=} [properties] Properties to set - */ - function ExecutionConfig(properties) { - this.networkTags = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExecutionConfig serviceAccount. - * @member {string} serviceAccount - * @memberof google.cloud.dataproc.v1.ExecutionConfig - * @instance - */ - ExecutionConfig.prototype.serviceAccount = ""; - - /** - * ExecutionConfig networkUri. - * @member {string|null|undefined} networkUri - * @memberof google.cloud.dataproc.v1.ExecutionConfig - * @instance - */ - ExecutionConfig.prototype.networkUri = null; - - /** - * ExecutionConfig subnetworkUri. - * @member {string|null|undefined} subnetworkUri - * @memberof google.cloud.dataproc.v1.ExecutionConfig - * @instance - */ - ExecutionConfig.prototype.subnetworkUri = null; - - /** - * ExecutionConfig networkTags. - * @member {Array.} networkTags - * @memberof google.cloud.dataproc.v1.ExecutionConfig - * @instance - */ - ExecutionConfig.prototype.networkTags = $util.emptyArray; - - /** - * ExecutionConfig kmsKey. - * @member {string} kmsKey - * @memberof google.cloud.dataproc.v1.ExecutionConfig - * @instance - */ - ExecutionConfig.prototype.kmsKey = ""; - - /** - * ExecutionConfig idleTtl. - * @member {google.protobuf.IDuration|null|undefined} idleTtl - * @memberof google.cloud.dataproc.v1.ExecutionConfig - * @instance - */ - ExecutionConfig.prototype.idleTtl = null; - - /** - * ExecutionConfig ttl. - * @member {google.protobuf.IDuration|null|undefined} ttl - * @memberof google.cloud.dataproc.v1.ExecutionConfig - * @instance - */ - ExecutionConfig.prototype.ttl = null; - - /** - * ExecutionConfig stagingBucket. - * @member {string} stagingBucket - * @memberof google.cloud.dataproc.v1.ExecutionConfig - * @instance - */ - ExecutionConfig.prototype.stagingBucket = ""; - - /** - * ExecutionConfig authenticationConfig. - * @member {google.cloud.dataproc.v1.IAuthenticationConfig|null|undefined} authenticationConfig - * @memberof google.cloud.dataproc.v1.ExecutionConfig - * @instance - */ - ExecutionConfig.prototype.authenticationConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ExecutionConfig network. - * @member {"networkUri"|"subnetworkUri"|undefined} network - * @memberof google.cloud.dataproc.v1.ExecutionConfig - * @instance - */ - Object.defineProperty(ExecutionConfig.prototype, "network", { - get: $util.oneOfGetter($oneOfFields = ["networkUri", "subnetworkUri"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ExecutionConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.ExecutionConfig - * @static - * @param {google.cloud.dataproc.v1.IExecutionConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.ExecutionConfig} ExecutionConfig instance - */ - ExecutionConfig.create = function create(properties) { - return new ExecutionConfig(properties); - }; - - /** - * Encodes the specified ExecutionConfig message. Does not implicitly {@link google.cloud.dataproc.v1.ExecutionConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.ExecutionConfig - * @static - * @param {google.cloud.dataproc.v1.IExecutionConfig} message ExecutionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecutionConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.serviceAccount); - if (message.networkUri != null && Object.hasOwnProperty.call(message, "networkUri")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.networkUri); - if (message.subnetworkUri != null && Object.hasOwnProperty.call(message, "subnetworkUri")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.subnetworkUri); - if (message.networkTags != null && message.networkTags.length) - for (var i = 0; i < message.networkTags.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.networkTags[i]); - if (message.kmsKey != null && Object.hasOwnProperty.call(message, "kmsKey")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.kmsKey); - if (message.idleTtl != null && Object.hasOwnProperty.call(message, "idleTtl")) - $root.google.protobuf.Duration.encode(message.idleTtl, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.ttl != null && Object.hasOwnProperty.call(message, "ttl")) - $root.google.protobuf.Duration.encode(message.ttl, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.stagingBucket != null && Object.hasOwnProperty.call(message, "stagingBucket")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.stagingBucket); - if (message.authenticationConfig != null && Object.hasOwnProperty.call(message, "authenticationConfig")) - $root.google.cloud.dataproc.v1.AuthenticationConfig.encode(message.authenticationConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExecutionConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ExecutionConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.ExecutionConfig - * @static - * @param {google.cloud.dataproc.v1.IExecutionConfig} message ExecutionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecutionConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExecutionConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.ExecutionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.ExecutionConfig} ExecutionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecutionConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ExecutionConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.serviceAccount = reader.string(); - break; - } - case 4: { - message.networkUri = reader.string(); - break; - } - case 5: { - message.subnetworkUri = reader.string(); - break; - } - case 6: { - if (!(message.networkTags && message.networkTags.length)) - message.networkTags = []; - message.networkTags.push(reader.string()); - break; - } - case 7: { - message.kmsKey = reader.string(); - break; - } - case 8: { - message.idleTtl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 9: { - message.ttl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 10: { - message.stagingBucket = reader.string(); - break; - } - case 11: { - message.authenticationConfig = $root.google.cloud.dataproc.v1.AuthenticationConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExecutionConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.ExecutionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.ExecutionConfig} ExecutionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecutionConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExecutionConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.ExecutionConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExecutionConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - if (!$util.isString(message.serviceAccount)) - return "serviceAccount: string expected"; - if (message.networkUri != null && message.hasOwnProperty("networkUri")) { - properties.network = 1; - if (!$util.isString(message.networkUri)) - return "networkUri: string expected"; - } - if (message.subnetworkUri != null && message.hasOwnProperty("subnetworkUri")) { - if (properties.network === 1) - return "network: multiple values"; - properties.network = 1; - if (!$util.isString(message.subnetworkUri)) - return "subnetworkUri: string expected"; - } - if (message.networkTags != null && message.hasOwnProperty("networkTags")) { - if (!Array.isArray(message.networkTags)) - return "networkTags: array expected"; - for (var i = 0; i < message.networkTags.length; ++i) - if (!$util.isString(message.networkTags[i])) - return "networkTags: string[] expected"; - } - if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) - if (!$util.isString(message.kmsKey)) - return "kmsKey: string expected"; - if (message.idleTtl != null && message.hasOwnProperty("idleTtl")) { - var error = $root.google.protobuf.Duration.verify(message.idleTtl); - if (error) - return "idleTtl." + error; - } - if (message.ttl != null && message.hasOwnProperty("ttl")) { - var error = $root.google.protobuf.Duration.verify(message.ttl); - if (error) - return "ttl." + error; - } - if (message.stagingBucket != null && message.hasOwnProperty("stagingBucket")) - if (!$util.isString(message.stagingBucket)) - return "stagingBucket: string expected"; - if (message.authenticationConfig != null && message.hasOwnProperty("authenticationConfig")) { - var error = $root.google.cloud.dataproc.v1.AuthenticationConfig.verify(message.authenticationConfig); - if (error) - return "authenticationConfig." + error; - } - return null; - }; - - /** - * Creates an ExecutionConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.ExecutionConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.ExecutionConfig} ExecutionConfig - */ - ExecutionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.ExecutionConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.ExecutionConfig(); - if (object.serviceAccount != null) - message.serviceAccount = String(object.serviceAccount); - if (object.networkUri != null) - message.networkUri = String(object.networkUri); - if (object.subnetworkUri != null) - message.subnetworkUri = String(object.subnetworkUri); - if (object.networkTags) { - if (!Array.isArray(object.networkTags)) - throw TypeError(".google.cloud.dataproc.v1.ExecutionConfig.networkTags: array expected"); - message.networkTags = []; - for (var i = 0; i < object.networkTags.length; ++i) - message.networkTags[i] = String(object.networkTags[i]); - } - if (object.kmsKey != null) - message.kmsKey = String(object.kmsKey); - if (object.idleTtl != null) { - if (typeof object.idleTtl !== "object") - throw TypeError(".google.cloud.dataproc.v1.ExecutionConfig.idleTtl: object expected"); - message.idleTtl = $root.google.protobuf.Duration.fromObject(object.idleTtl); - } - if (object.ttl != null) { - if (typeof object.ttl !== "object") - throw TypeError(".google.cloud.dataproc.v1.ExecutionConfig.ttl: object expected"); - message.ttl = $root.google.protobuf.Duration.fromObject(object.ttl); - } - if (object.stagingBucket != null) - message.stagingBucket = String(object.stagingBucket); - if (object.authenticationConfig != null) { - if (typeof object.authenticationConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.ExecutionConfig.authenticationConfig: object expected"); - message.authenticationConfig = $root.google.cloud.dataproc.v1.AuthenticationConfig.fromObject(object.authenticationConfig); - } - return message; - }; - - /** - * Creates a plain object from an ExecutionConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.ExecutionConfig - * @static - * @param {google.cloud.dataproc.v1.ExecutionConfig} message ExecutionConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExecutionConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.networkTags = []; - if (options.defaults) { - object.serviceAccount = ""; - object.kmsKey = ""; - object.idleTtl = null; - object.ttl = null; - object.stagingBucket = ""; - object.authenticationConfig = null; - } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - object.serviceAccount = message.serviceAccount; - if (message.networkUri != null && message.hasOwnProperty("networkUri")) { - object.networkUri = message.networkUri; - if (options.oneofs) - object.network = "networkUri"; - } - if (message.subnetworkUri != null && message.hasOwnProperty("subnetworkUri")) { - object.subnetworkUri = message.subnetworkUri; - if (options.oneofs) - object.network = "subnetworkUri"; - } - if (message.networkTags && message.networkTags.length) { - object.networkTags = []; - for (var j = 0; j < message.networkTags.length; ++j) - object.networkTags[j] = message.networkTags[j]; - } - if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) - object.kmsKey = message.kmsKey; - if (message.idleTtl != null && message.hasOwnProperty("idleTtl")) - object.idleTtl = $root.google.protobuf.Duration.toObject(message.idleTtl, options); - if (message.ttl != null && message.hasOwnProperty("ttl")) - object.ttl = $root.google.protobuf.Duration.toObject(message.ttl, options); - if (message.stagingBucket != null && message.hasOwnProperty("stagingBucket")) - object.stagingBucket = message.stagingBucket; - if (message.authenticationConfig != null && message.hasOwnProperty("authenticationConfig")) - object.authenticationConfig = $root.google.cloud.dataproc.v1.AuthenticationConfig.toObject(message.authenticationConfig, options); - return object; - }; - - /** - * Converts this ExecutionConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.ExecutionConfig - * @instance - * @returns {Object.} JSON object - */ - ExecutionConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExecutionConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.ExecutionConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExecutionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.ExecutionConfig"; - }; - - return ExecutionConfig; - })(); - - v1.SparkHistoryServerConfig = (function() { - - /** - * Properties of a SparkHistoryServerConfig. - * @memberof google.cloud.dataproc.v1 - * @interface ISparkHistoryServerConfig - * @property {string|null} [dataprocCluster] SparkHistoryServerConfig dataprocCluster - */ - - /** - * Constructs a new SparkHistoryServerConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a SparkHistoryServerConfig. - * @implements ISparkHistoryServerConfig - * @constructor - * @param {google.cloud.dataproc.v1.ISparkHistoryServerConfig=} [properties] Properties to set - */ - function SparkHistoryServerConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SparkHistoryServerConfig dataprocCluster. - * @member {string} dataprocCluster - * @memberof google.cloud.dataproc.v1.SparkHistoryServerConfig - * @instance - */ - SparkHistoryServerConfig.prototype.dataprocCluster = ""; - - /** - * Creates a new SparkHistoryServerConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.SparkHistoryServerConfig - * @static - * @param {google.cloud.dataproc.v1.ISparkHistoryServerConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.SparkHistoryServerConfig} SparkHistoryServerConfig instance - */ - SparkHistoryServerConfig.create = function create(properties) { - return new SparkHistoryServerConfig(properties); - }; - - /** - * Encodes the specified SparkHistoryServerConfig message. Does not implicitly {@link google.cloud.dataproc.v1.SparkHistoryServerConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.SparkHistoryServerConfig - * @static - * @param {google.cloud.dataproc.v1.ISparkHistoryServerConfig} message SparkHistoryServerConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SparkHistoryServerConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dataprocCluster != null && Object.hasOwnProperty.call(message, "dataprocCluster")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataprocCluster); - return writer; - }; - - /** - * Encodes the specified SparkHistoryServerConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SparkHistoryServerConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.SparkHistoryServerConfig - * @static - * @param {google.cloud.dataproc.v1.ISparkHistoryServerConfig} message SparkHistoryServerConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SparkHistoryServerConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SparkHistoryServerConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.SparkHistoryServerConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.SparkHistoryServerConfig} SparkHistoryServerConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SparkHistoryServerConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.SparkHistoryServerConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.dataprocCluster = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SparkHistoryServerConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.SparkHistoryServerConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.SparkHistoryServerConfig} SparkHistoryServerConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SparkHistoryServerConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SparkHistoryServerConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.SparkHistoryServerConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SparkHistoryServerConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.dataprocCluster != null && message.hasOwnProperty("dataprocCluster")) - if (!$util.isString(message.dataprocCluster)) - return "dataprocCluster: string expected"; - return null; - }; - - /** - * Creates a SparkHistoryServerConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.SparkHistoryServerConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.SparkHistoryServerConfig} SparkHistoryServerConfig - */ - SparkHistoryServerConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.SparkHistoryServerConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.SparkHistoryServerConfig(); - if (object.dataprocCluster != null) - message.dataprocCluster = String(object.dataprocCluster); - return message; - }; - - /** - * Creates a plain object from a SparkHistoryServerConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.SparkHistoryServerConfig - * @static - * @param {google.cloud.dataproc.v1.SparkHistoryServerConfig} message SparkHistoryServerConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SparkHistoryServerConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.dataprocCluster = ""; - if (message.dataprocCluster != null && message.hasOwnProperty("dataprocCluster")) - object.dataprocCluster = message.dataprocCluster; - return object; - }; - - /** - * Converts this SparkHistoryServerConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.SparkHistoryServerConfig - * @instance - * @returns {Object.} JSON object - */ - SparkHistoryServerConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SparkHistoryServerConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.SparkHistoryServerConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SparkHistoryServerConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.SparkHistoryServerConfig"; - }; - - return SparkHistoryServerConfig; - })(); - - v1.PeripheralsConfig = (function() { - - /** - * Properties of a PeripheralsConfig. - * @memberof google.cloud.dataproc.v1 - * @interface IPeripheralsConfig - * @property {string|null} [metastoreService] PeripheralsConfig metastoreService - * @property {google.cloud.dataproc.v1.ISparkHistoryServerConfig|null} [sparkHistoryServerConfig] PeripheralsConfig sparkHistoryServerConfig - */ - - /** - * Constructs a new PeripheralsConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a PeripheralsConfig. - * @implements IPeripheralsConfig - * @constructor - * @param {google.cloud.dataproc.v1.IPeripheralsConfig=} [properties] Properties to set - */ - function PeripheralsConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PeripheralsConfig metastoreService. - * @member {string} metastoreService - * @memberof google.cloud.dataproc.v1.PeripheralsConfig - * @instance - */ - PeripheralsConfig.prototype.metastoreService = ""; - - /** - * PeripheralsConfig sparkHistoryServerConfig. - * @member {google.cloud.dataproc.v1.ISparkHistoryServerConfig|null|undefined} sparkHistoryServerConfig - * @memberof google.cloud.dataproc.v1.PeripheralsConfig - * @instance - */ - PeripheralsConfig.prototype.sparkHistoryServerConfig = null; - - /** - * Creates a new PeripheralsConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.PeripheralsConfig - * @static - * @param {google.cloud.dataproc.v1.IPeripheralsConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.PeripheralsConfig} PeripheralsConfig instance - */ - PeripheralsConfig.create = function create(properties) { - return new PeripheralsConfig(properties); - }; - - /** - * Encodes the specified PeripheralsConfig message. Does not implicitly {@link google.cloud.dataproc.v1.PeripheralsConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.PeripheralsConfig - * @static - * @param {google.cloud.dataproc.v1.IPeripheralsConfig} message PeripheralsConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PeripheralsConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.metastoreService != null && Object.hasOwnProperty.call(message, "metastoreService")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.metastoreService); - if (message.sparkHistoryServerConfig != null && Object.hasOwnProperty.call(message, "sparkHistoryServerConfig")) - $root.google.cloud.dataproc.v1.SparkHistoryServerConfig.encode(message.sparkHistoryServerConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PeripheralsConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.PeripheralsConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.PeripheralsConfig - * @static - * @param {google.cloud.dataproc.v1.IPeripheralsConfig} message PeripheralsConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PeripheralsConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PeripheralsConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.PeripheralsConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.PeripheralsConfig} PeripheralsConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PeripheralsConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.PeripheralsConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.metastoreService = reader.string(); - break; - } - case 2: { - message.sparkHistoryServerConfig = $root.google.cloud.dataproc.v1.SparkHistoryServerConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PeripheralsConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.PeripheralsConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.PeripheralsConfig} PeripheralsConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PeripheralsConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PeripheralsConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.PeripheralsConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PeripheralsConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.metastoreService != null && message.hasOwnProperty("metastoreService")) - if (!$util.isString(message.metastoreService)) - return "metastoreService: string expected"; - if (message.sparkHistoryServerConfig != null && message.hasOwnProperty("sparkHistoryServerConfig")) { - var error = $root.google.cloud.dataproc.v1.SparkHistoryServerConfig.verify(message.sparkHistoryServerConfig); - if (error) - return "sparkHistoryServerConfig." + error; - } - return null; - }; - - /** - * Creates a PeripheralsConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.PeripheralsConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.PeripheralsConfig} PeripheralsConfig - */ - PeripheralsConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.PeripheralsConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.PeripheralsConfig(); - if (object.metastoreService != null) - message.metastoreService = String(object.metastoreService); - if (object.sparkHistoryServerConfig != null) { - if (typeof object.sparkHistoryServerConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.PeripheralsConfig.sparkHistoryServerConfig: object expected"); - message.sparkHistoryServerConfig = $root.google.cloud.dataproc.v1.SparkHistoryServerConfig.fromObject(object.sparkHistoryServerConfig); - } - return message; - }; - - /** - * Creates a plain object from a PeripheralsConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.PeripheralsConfig - * @static - * @param {google.cloud.dataproc.v1.PeripheralsConfig} message PeripheralsConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PeripheralsConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.metastoreService = ""; - object.sparkHistoryServerConfig = null; - } - if (message.metastoreService != null && message.hasOwnProperty("metastoreService")) - object.metastoreService = message.metastoreService; - if (message.sparkHistoryServerConfig != null && message.hasOwnProperty("sparkHistoryServerConfig")) - object.sparkHistoryServerConfig = $root.google.cloud.dataproc.v1.SparkHistoryServerConfig.toObject(message.sparkHistoryServerConfig, options); - return object; - }; - - /** - * Converts this PeripheralsConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.PeripheralsConfig - * @instance - * @returns {Object.} JSON object - */ - PeripheralsConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PeripheralsConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.PeripheralsConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PeripheralsConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.PeripheralsConfig"; - }; - - return PeripheralsConfig; - })(); - - v1.RuntimeInfo = (function() { - - /** - * Properties of a RuntimeInfo. - * @memberof google.cloud.dataproc.v1 - * @interface IRuntimeInfo - * @property {Object.|null} [endpoints] RuntimeInfo endpoints - * @property {string|null} [outputUri] RuntimeInfo outputUri - * @property {string|null} [diagnosticOutputUri] RuntimeInfo diagnosticOutputUri - * @property {google.cloud.dataproc.v1.IUsageMetrics|null} [approximateUsage] RuntimeInfo approximateUsage - * @property {google.cloud.dataproc.v1.IUsageSnapshot|null} [currentUsage] RuntimeInfo currentUsage - */ - - /** - * Constructs a new RuntimeInfo. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a RuntimeInfo. - * @implements IRuntimeInfo - * @constructor - * @param {google.cloud.dataproc.v1.IRuntimeInfo=} [properties] Properties to set - */ - function RuntimeInfo(properties) { - this.endpoints = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RuntimeInfo endpoints. - * @member {Object.} endpoints - * @memberof google.cloud.dataproc.v1.RuntimeInfo - * @instance - */ - RuntimeInfo.prototype.endpoints = $util.emptyObject; - - /** - * RuntimeInfo outputUri. - * @member {string} outputUri - * @memberof google.cloud.dataproc.v1.RuntimeInfo - * @instance - */ - RuntimeInfo.prototype.outputUri = ""; - - /** - * RuntimeInfo diagnosticOutputUri. - * @member {string} diagnosticOutputUri - * @memberof google.cloud.dataproc.v1.RuntimeInfo - * @instance - */ - RuntimeInfo.prototype.diagnosticOutputUri = ""; - - /** - * RuntimeInfo approximateUsage. - * @member {google.cloud.dataproc.v1.IUsageMetrics|null|undefined} approximateUsage - * @memberof google.cloud.dataproc.v1.RuntimeInfo - * @instance - */ - RuntimeInfo.prototype.approximateUsage = null; - - /** - * RuntimeInfo currentUsage. - * @member {google.cloud.dataproc.v1.IUsageSnapshot|null|undefined} currentUsage - * @memberof google.cloud.dataproc.v1.RuntimeInfo - * @instance - */ - RuntimeInfo.prototype.currentUsage = null; - - /** - * Creates a new RuntimeInfo instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.RuntimeInfo - * @static - * @param {google.cloud.dataproc.v1.IRuntimeInfo=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.RuntimeInfo} RuntimeInfo instance - */ - RuntimeInfo.create = function create(properties) { - return new RuntimeInfo(properties); - }; - - /** - * Encodes the specified RuntimeInfo message. Does not implicitly {@link google.cloud.dataproc.v1.RuntimeInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.RuntimeInfo - * @static - * @param {google.cloud.dataproc.v1.IRuntimeInfo} message RuntimeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RuntimeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.endpoints != null && Object.hasOwnProperty.call(message, "endpoints")) - for (var keys = Object.keys(message.endpoints), 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.endpoints[keys[i]]).ldelim(); - if (message.outputUri != null && Object.hasOwnProperty.call(message, "outputUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.outputUri); - if (message.diagnosticOutputUri != null && Object.hasOwnProperty.call(message, "diagnosticOutputUri")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.diagnosticOutputUri); - if (message.approximateUsage != null && Object.hasOwnProperty.call(message, "approximateUsage")) - $root.google.cloud.dataproc.v1.UsageMetrics.encode(message.approximateUsage, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.currentUsage != null && Object.hasOwnProperty.call(message, "currentUsage")) - $root.google.cloud.dataproc.v1.UsageSnapshot.encode(message.currentUsage, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RuntimeInfo message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.RuntimeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.RuntimeInfo - * @static - * @param {google.cloud.dataproc.v1.IRuntimeInfo} message RuntimeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RuntimeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RuntimeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.RuntimeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.RuntimeInfo} RuntimeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RuntimeInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.RuntimeInfo(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (message.endpoints === $util.emptyObject) - message.endpoints = {}; - 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.endpoints[key] = value; - break; - } - case 2: { - message.outputUri = reader.string(); - break; - } - case 3: { - message.diagnosticOutputUri = reader.string(); - break; - } - case 6: { - message.approximateUsage = $root.google.cloud.dataproc.v1.UsageMetrics.decode(reader, reader.uint32()); - break; - } - case 7: { - message.currentUsage = $root.google.cloud.dataproc.v1.UsageSnapshot.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RuntimeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.RuntimeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.RuntimeInfo} RuntimeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RuntimeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RuntimeInfo message. - * @function verify - * @memberof google.cloud.dataproc.v1.RuntimeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RuntimeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.endpoints != null && message.hasOwnProperty("endpoints")) { - if (!$util.isObject(message.endpoints)) - return "endpoints: object expected"; - var key = Object.keys(message.endpoints); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.endpoints[key[i]])) - return "endpoints: string{k:string} expected"; - } - if (message.outputUri != null && message.hasOwnProperty("outputUri")) - if (!$util.isString(message.outputUri)) - return "outputUri: string expected"; - if (message.diagnosticOutputUri != null && message.hasOwnProperty("diagnosticOutputUri")) - if (!$util.isString(message.diagnosticOutputUri)) - return "diagnosticOutputUri: string expected"; - if (message.approximateUsage != null && message.hasOwnProperty("approximateUsage")) { - var error = $root.google.cloud.dataproc.v1.UsageMetrics.verify(message.approximateUsage); - if (error) - return "approximateUsage." + error; - } - if (message.currentUsage != null && message.hasOwnProperty("currentUsage")) { - var error = $root.google.cloud.dataproc.v1.UsageSnapshot.verify(message.currentUsage); - if (error) - return "currentUsage." + error; - } - return null; - }; - - /** - * Creates a RuntimeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.RuntimeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.RuntimeInfo} RuntimeInfo - */ - RuntimeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.RuntimeInfo) - return object; - var message = new $root.google.cloud.dataproc.v1.RuntimeInfo(); - if (object.endpoints) { - if (typeof object.endpoints !== "object") - throw TypeError(".google.cloud.dataproc.v1.RuntimeInfo.endpoints: object expected"); - message.endpoints = {}; - for (var keys = Object.keys(object.endpoints), i = 0; i < keys.length; ++i) - message.endpoints[keys[i]] = String(object.endpoints[keys[i]]); - } - if (object.outputUri != null) - message.outputUri = String(object.outputUri); - if (object.diagnosticOutputUri != null) - message.diagnosticOutputUri = String(object.diagnosticOutputUri); - if (object.approximateUsage != null) { - if (typeof object.approximateUsage !== "object") - throw TypeError(".google.cloud.dataproc.v1.RuntimeInfo.approximateUsage: object expected"); - message.approximateUsage = $root.google.cloud.dataproc.v1.UsageMetrics.fromObject(object.approximateUsage); - } - if (object.currentUsage != null) { - if (typeof object.currentUsage !== "object") - throw TypeError(".google.cloud.dataproc.v1.RuntimeInfo.currentUsage: object expected"); - message.currentUsage = $root.google.cloud.dataproc.v1.UsageSnapshot.fromObject(object.currentUsage); - } - return message; - }; - - /** - * Creates a plain object from a RuntimeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.RuntimeInfo - * @static - * @param {google.cloud.dataproc.v1.RuntimeInfo} message RuntimeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RuntimeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.endpoints = {}; - if (options.defaults) { - object.outputUri = ""; - object.diagnosticOutputUri = ""; - object.approximateUsage = null; - object.currentUsage = null; - } - var keys2; - if (message.endpoints && (keys2 = Object.keys(message.endpoints)).length) { - object.endpoints = {}; - for (var j = 0; j < keys2.length; ++j) - object.endpoints[keys2[j]] = message.endpoints[keys2[j]]; - } - if (message.outputUri != null && message.hasOwnProperty("outputUri")) - object.outputUri = message.outputUri; - if (message.diagnosticOutputUri != null && message.hasOwnProperty("diagnosticOutputUri")) - object.diagnosticOutputUri = message.diagnosticOutputUri; - if (message.approximateUsage != null && message.hasOwnProperty("approximateUsage")) - object.approximateUsage = $root.google.cloud.dataproc.v1.UsageMetrics.toObject(message.approximateUsage, options); - if (message.currentUsage != null && message.hasOwnProperty("currentUsage")) - object.currentUsage = $root.google.cloud.dataproc.v1.UsageSnapshot.toObject(message.currentUsage, options); - return object; - }; - - /** - * Converts this RuntimeInfo to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.RuntimeInfo - * @instance - * @returns {Object.} JSON object - */ - RuntimeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RuntimeInfo - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.RuntimeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RuntimeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.RuntimeInfo"; - }; - - return RuntimeInfo; - })(); - - v1.UsageMetrics = (function() { - - /** - * Properties of a UsageMetrics. - * @memberof google.cloud.dataproc.v1 - * @interface IUsageMetrics - * @property {number|Long|null} [milliDcuSeconds] UsageMetrics milliDcuSeconds - * @property {number|Long|null} [shuffleStorageGbSeconds] UsageMetrics shuffleStorageGbSeconds - * @property {number|Long|null} [milliAcceleratorSeconds] UsageMetrics milliAcceleratorSeconds - * @property {string|null} [acceleratorType] UsageMetrics acceleratorType - */ - - /** - * Constructs a new UsageMetrics. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a UsageMetrics. - * @implements IUsageMetrics - * @constructor - * @param {google.cloud.dataproc.v1.IUsageMetrics=} [properties] Properties to set - */ - function UsageMetrics(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UsageMetrics milliDcuSeconds. - * @member {number|Long} milliDcuSeconds - * @memberof google.cloud.dataproc.v1.UsageMetrics - * @instance - */ - UsageMetrics.prototype.milliDcuSeconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * UsageMetrics shuffleStorageGbSeconds. - * @member {number|Long} shuffleStorageGbSeconds - * @memberof google.cloud.dataproc.v1.UsageMetrics - * @instance - */ - UsageMetrics.prototype.shuffleStorageGbSeconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * UsageMetrics milliAcceleratorSeconds. - * @member {number|Long} milliAcceleratorSeconds - * @memberof google.cloud.dataproc.v1.UsageMetrics - * @instance - */ - UsageMetrics.prototype.milliAcceleratorSeconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * UsageMetrics acceleratorType. - * @member {string} acceleratorType - * @memberof google.cloud.dataproc.v1.UsageMetrics - * @instance - */ - UsageMetrics.prototype.acceleratorType = ""; - - /** - * Creates a new UsageMetrics instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.UsageMetrics - * @static - * @param {google.cloud.dataproc.v1.IUsageMetrics=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.UsageMetrics} UsageMetrics instance - */ - UsageMetrics.create = function create(properties) { - return new UsageMetrics(properties); - }; - - /** - * Encodes the specified UsageMetrics message. Does not implicitly {@link google.cloud.dataproc.v1.UsageMetrics.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.UsageMetrics - * @static - * @param {google.cloud.dataproc.v1.IUsageMetrics} message UsageMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UsageMetrics.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.milliDcuSeconds != null && Object.hasOwnProperty.call(message, "milliDcuSeconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.milliDcuSeconds); - if (message.shuffleStorageGbSeconds != null && Object.hasOwnProperty.call(message, "shuffleStorageGbSeconds")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.shuffleStorageGbSeconds); - if (message.milliAcceleratorSeconds != null && Object.hasOwnProperty.call(message, "milliAcceleratorSeconds")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.milliAcceleratorSeconds); - if (message.acceleratorType != null && Object.hasOwnProperty.call(message, "acceleratorType")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.acceleratorType); - return writer; - }; - - /** - * Encodes the specified UsageMetrics message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.UsageMetrics.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.UsageMetrics - * @static - * @param {google.cloud.dataproc.v1.IUsageMetrics} message UsageMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UsageMetrics.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UsageMetrics message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.UsageMetrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.UsageMetrics} UsageMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UsageMetrics.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.UsageMetrics(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.milliDcuSeconds = reader.int64(); - break; - } - case 2: { - message.shuffleStorageGbSeconds = reader.int64(); - break; - } - case 3: { - message.milliAcceleratorSeconds = reader.int64(); - break; - } - case 4: { - message.acceleratorType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a UsageMetrics message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.UsageMetrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.UsageMetrics} UsageMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UsageMetrics.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UsageMetrics message. - * @function verify - * @memberof google.cloud.dataproc.v1.UsageMetrics - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UsageMetrics.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.milliDcuSeconds != null && message.hasOwnProperty("milliDcuSeconds")) - if (!$util.isInteger(message.milliDcuSeconds) && !(message.milliDcuSeconds && $util.isInteger(message.milliDcuSeconds.low) && $util.isInteger(message.milliDcuSeconds.high))) - return "milliDcuSeconds: integer|Long expected"; - if (message.shuffleStorageGbSeconds != null && message.hasOwnProperty("shuffleStorageGbSeconds")) - if (!$util.isInteger(message.shuffleStorageGbSeconds) && !(message.shuffleStorageGbSeconds && $util.isInteger(message.shuffleStorageGbSeconds.low) && $util.isInteger(message.shuffleStorageGbSeconds.high))) - return "shuffleStorageGbSeconds: integer|Long expected"; - if (message.milliAcceleratorSeconds != null && message.hasOwnProperty("milliAcceleratorSeconds")) - if (!$util.isInteger(message.milliAcceleratorSeconds) && !(message.milliAcceleratorSeconds && $util.isInteger(message.milliAcceleratorSeconds.low) && $util.isInteger(message.milliAcceleratorSeconds.high))) - return "milliAcceleratorSeconds: integer|Long expected"; - if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) - if (!$util.isString(message.acceleratorType)) - return "acceleratorType: string expected"; - return null; - }; - - /** - * Creates a UsageMetrics message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.UsageMetrics - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.UsageMetrics} UsageMetrics - */ - UsageMetrics.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.UsageMetrics) - return object; - var message = new $root.google.cloud.dataproc.v1.UsageMetrics(); - if (object.milliDcuSeconds != null) - if ($util.Long) - (message.milliDcuSeconds = $util.Long.fromValue(object.milliDcuSeconds)).unsigned = false; - else if (typeof object.milliDcuSeconds === "string") - message.milliDcuSeconds = parseInt(object.milliDcuSeconds, 10); - else if (typeof object.milliDcuSeconds === "number") - message.milliDcuSeconds = object.milliDcuSeconds; - else if (typeof object.milliDcuSeconds === "object") - message.milliDcuSeconds = new $util.LongBits(object.milliDcuSeconds.low >>> 0, object.milliDcuSeconds.high >>> 0).toNumber(); - if (object.shuffleStorageGbSeconds != null) - if ($util.Long) - (message.shuffleStorageGbSeconds = $util.Long.fromValue(object.shuffleStorageGbSeconds)).unsigned = false; - else if (typeof object.shuffleStorageGbSeconds === "string") - message.shuffleStorageGbSeconds = parseInt(object.shuffleStorageGbSeconds, 10); - else if (typeof object.shuffleStorageGbSeconds === "number") - message.shuffleStorageGbSeconds = object.shuffleStorageGbSeconds; - else if (typeof object.shuffleStorageGbSeconds === "object") - message.shuffleStorageGbSeconds = new $util.LongBits(object.shuffleStorageGbSeconds.low >>> 0, object.shuffleStorageGbSeconds.high >>> 0).toNumber(); - if (object.milliAcceleratorSeconds != null) - if ($util.Long) - (message.milliAcceleratorSeconds = $util.Long.fromValue(object.milliAcceleratorSeconds)).unsigned = false; - else if (typeof object.milliAcceleratorSeconds === "string") - message.milliAcceleratorSeconds = parseInt(object.milliAcceleratorSeconds, 10); - else if (typeof object.milliAcceleratorSeconds === "number") - message.milliAcceleratorSeconds = object.milliAcceleratorSeconds; - else if (typeof object.milliAcceleratorSeconds === "object") - message.milliAcceleratorSeconds = new $util.LongBits(object.milliAcceleratorSeconds.low >>> 0, object.milliAcceleratorSeconds.high >>> 0).toNumber(); - if (object.acceleratorType != null) - message.acceleratorType = String(object.acceleratorType); - return message; - }; - - /** - * Creates a plain object from a UsageMetrics message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.UsageMetrics - * @static - * @param {google.cloud.dataproc.v1.UsageMetrics} message UsageMetrics - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UsageMetrics.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.milliDcuSeconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.milliDcuSeconds = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.shuffleStorageGbSeconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.shuffleStorageGbSeconds = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.milliAcceleratorSeconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.milliAcceleratorSeconds = options.longs === String ? "0" : 0; - object.acceleratorType = ""; - } - if (message.milliDcuSeconds != null && message.hasOwnProperty("milliDcuSeconds")) - if (typeof message.milliDcuSeconds === "number") - object.milliDcuSeconds = options.longs === String ? String(message.milliDcuSeconds) : message.milliDcuSeconds; - else - object.milliDcuSeconds = options.longs === String ? $util.Long.prototype.toString.call(message.milliDcuSeconds) : options.longs === Number ? new $util.LongBits(message.milliDcuSeconds.low >>> 0, message.milliDcuSeconds.high >>> 0).toNumber() : message.milliDcuSeconds; - if (message.shuffleStorageGbSeconds != null && message.hasOwnProperty("shuffleStorageGbSeconds")) - if (typeof message.shuffleStorageGbSeconds === "number") - object.shuffleStorageGbSeconds = options.longs === String ? String(message.shuffleStorageGbSeconds) : message.shuffleStorageGbSeconds; - else - object.shuffleStorageGbSeconds = options.longs === String ? $util.Long.prototype.toString.call(message.shuffleStorageGbSeconds) : options.longs === Number ? new $util.LongBits(message.shuffleStorageGbSeconds.low >>> 0, message.shuffleStorageGbSeconds.high >>> 0).toNumber() : message.shuffleStorageGbSeconds; - if (message.milliAcceleratorSeconds != null && message.hasOwnProperty("milliAcceleratorSeconds")) - if (typeof message.milliAcceleratorSeconds === "number") - object.milliAcceleratorSeconds = options.longs === String ? String(message.milliAcceleratorSeconds) : message.milliAcceleratorSeconds; - else - object.milliAcceleratorSeconds = options.longs === String ? $util.Long.prototype.toString.call(message.milliAcceleratorSeconds) : options.longs === Number ? new $util.LongBits(message.milliAcceleratorSeconds.low >>> 0, message.milliAcceleratorSeconds.high >>> 0).toNumber() : message.milliAcceleratorSeconds; - if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) - object.acceleratorType = message.acceleratorType; - return object; - }; - - /** - * Converts this UsageMetrics to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.UsageMetrics - * @instance - * @returns {Object.} JSON object - */ - UsageMetrics.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UsageMetrics - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.UsageMetrics - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UsageMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.UsageMetrics"; - }; - - return UsageMetrics; - })(); - - v1.UsageSnapshot = (function() { - - /** - * Properties of a UsageSnapshot. - * @memberof google.cloud.dataproc.v1 - * @interface IUsageSnapshot - * @property {number|Long|null} [milliDcu] UsageSnapshot milliDcu - * @property {number|Long|null} [shuffleStorageGb] UsageSnapshot shuffleStorageGb - * @property {number|Long|null} [milliDcuPremium] UsageSnapshot milliDcuPremium - * @property {number|Long|null} [shuffleStorageGbPremium] UsageSnapshot shuffleStorageGbPremium - * @property {number|Long|null} [milliAccelerator] UsageSnapshot milliAccelerator - * @property {string|null} [acceleratorType] UsageSnapshot acceleratorType - * @property {google.protobuf.ITimestamp|null} [snapshotTime] UsageSnapshot snapshotTime - */ - - /** - * Constructs a new UsageSnapshot. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a UsageSnapshot. - * @implements IUsageSnapshot - * @constructor - * @param {google.cloud.dataproc.v1.IUsageSnapshot=} [properties] Properties to set - */ - function UsageSnapshot(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UsageSnapshot milliDcu. - * @member {number|Long} milliDcu - * @memberof google.cloud.dataproc.v1.UsageSnapshot - * @instance - */ - UsageSnapshot.prototype.milliDcu = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * UsageSnapshot shuffleStorageGb. - * @member {number|Long} shuffleStorageGb - * @memberof google.cloud.dataproc.v1.UsageSnapshot - * @instance - */ - UsageSnapshot.prototype.shuffleStorageGb = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * UsageSnapshot milliDcuPremium. - * @member {number|Long} milliDcuPremium - * @memberof google.cloud.dataproc.v1.UsageSnapshot - * @instance - */ - UsageSnapshot.prototype.milliDcuPremium = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * UsageSnapshot shuffleStorageGbPremium. - * @member {number|Long} shuffleStorageGbPremium - * @memberof google.cloud.dataproc.v1.UsageSnapshot - * @instance - */ - UsageSnapshot.prototype.shuffleStorageGbPremium = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * UsageSnapshot milliAccelerator. - * @member {number|Long} milliAccelerator - * @memberof google.cloud.dataproc.v1.UsageSnapshot - * @instance - */ - UsageSnapshot.prototype.milliAccelerator = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * UsageSnapshot acceleratorType. - * @member {string} acceleratorType - * @memberof google.cloud.dataproc.v1.UsageSnapshot - * @instance - */ - UsageSnapshot.prototype.acceleratorType = ""; - - /** - * UsageSnapshot snapshotTime. - * @member {google.protobuf.ITimestamp|null|undefined} snapshotTime - * @memberof google.cloud.dataproc.v1.UsageSnapshot - * @instance - */ - UsageSnapshot.prototype.snapshotTime = null; - - /** - * Creates a new UsageSnapshot instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.UsageSnapshot - * @static - * @param {google.cloud.dataproc.v1.IUsageSnapshot=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.UsageSnapshot} UsageSnapshot instance - */ - UsageSnapshot.create = function create(properties) { - return new UsageSnapshot(properties); - }; - - /** - * Encodes the specified UsageSnapshot message. Does not implicitly {@link google.cloud.dataproc.v1.UsageSnapshot.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.UsageSnapshot - * @static - * @param {google.cloud.dataproc.v1.IUsageSnapshot} message UsageSnapshot message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UsageSnapshot.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.milliDcu != null && Object.hasOwnProperty.call(message, "milliDcu")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.milliDcu); - if (message.shuffleStorageGb != null && Object.hasOwnProperty.call(message, "shuffleStorageGb")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.shuffleStorageGb); - if (message.snapshotTime != null && Object.hasOwnProperty.call(message, "snapshotTime")) - $root.google.protobuf.Timestamp.encode(message.snapshotTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.milliDcuPremium != null && Object.hasOwnProperty.call(message, "milliDcuPremium")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.milliDcuPremium); - if (message.shuffleStorageGbPremium != null && Object.hasOwnProperty.call(message, "shuffleStorageGbPremium")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.shuffleStorageGbPremium); - if (message.milliAccelerator != null && Object.hasOwnProperty.call(message, "milliAccelerator")) - writer.uint32(/* id 6, wireType 0 =*/48).int64(message.milliAccelerator); - if (message.acceleratorType != null && Object.hasOwnProperty.call(message, "acceleratorType")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.acceleratorType); - return writer; - }; - - /** - * Encodes the specified UsageSnapshot message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.UsageSnapshot.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.UsageSnapshot - * @static - * @param {google.cloud.dataproc.v1.IUsageSnapshot} message UsageSnapshot message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UsageSnapshot.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UsageSnapshot message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.UsageSnapshot - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.UsageSnapshot} UsageSnapshot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UsageSnapshot.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.UsageSnapshot(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.milliDcu = reader.int64(); - break; - } - case 2: { - message.shuffleStorageGb = reader.int64(); - break; - } - case 4: { - message.milliDcuPremium = reader.int64(); - break; - } - case 5: { - message.shuffleStorageGbPremium = reader.int64(); - break; - } - case 6: { - message.milliAccelerator = reader.int64(); - break; - } - case 7: { - message.acceleratorType = reader.string(); - break; - } - case 3: { - message.snapshotTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a UsageSnapshot message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.UsageSnapshot - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.UsageSnapshot} UsageSnapshot - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UsageSnapshot.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UsageSnapshot message. - * @function verify - * @memberof google.cloud.dataproc.v1.UsageSnapshot - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UsageSnapshot.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.milliDcu != null && message.hasOwnProperty("milliDcu")) - if (!$util.isInteger(message.milliDcu) && !(message.milliDcu && $util.isInteger(message.milliDcu.low) && $util.isInteger(message.milliDcu.high))) - return "milliDcu: integer|Long expected"; - if (message.shuffleStorageGb != null && message.hasOwnProperty("shuffleStorageGb")) - if (!$util.isInteger(message.shuffleStorageGb) && !(message.shuffleStorageGb && $util.isInteger(message.shuffleStorageGb.low) && $util.isInteger(message.shuffleStorageGb.high))) - return "shuffleStorageGb: integer|Long expected"; - if (message.milliDcuPremium != null && message.hasOwnProperty("milliDcuPremium")) - if (!$util.isInteger(message.milliDcuPremium) && !(message.milliDcuPremium && $util.isInteger(message.milliDcuPremium.low) && $util.isInteger(message.milliDcuPremium.high))) - return "milliDcuPremium: integer|Long expected"; - if (message.shuffleStorageGbPremium != null && message.hasOwnProperty("shuffleStorageGbPremium")) - if (!$util.isInteger(message.shuffleStorageGbPremium) && !(message.shuffleStorageGbPremium && $util.isInteger(message.shuffleStorageGbPremium.low) && $util.isInteger(message.shuffleStorageGbPremium.high))) - return "shuffleStorageGbPremium: integer|Long expected"; - if (message.milliAccelerator != null && message.hasOwnProperty("milliAccelerator")) - if (!$util.isInteger(message.milliAccelerator) && !(message.milliAccelerator && $util.isInteger(message.milliAccelerator.low) && $util.isInteger(message.milliAccelerator.high))) - return "milliAccelerator: integer|Long expected"; - if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) - if (!$util.isString(message.acceleratorType)) - return "acceleratorType: string expected"; - if (message.snapshotTime != null && message.hasOwnProperty("snapshotTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.snapshotTime); - if (error) - return "snapshotTime." + error; - } - return null; - }; - - /** - * Creates a UsageSnapshot message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.UsageSnapshot - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.UsageSnapshot} UsageSnapshot - */ - UsageSnapshot.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.UsageSnapshot) - return object; - var message = new $root.google.cloud.dataproc.v1.UsageSnapshot(); - if (object.milliDcu != null) - if ($util.Long) - (message.milliDcu = $util.Long.fromValue(object.milliDcu)).unsigned = false; - else if (typeof object.milliDcu === "string") - message.milliDcu = parseInt(object.milliDcu, 10); - else if (typeof object.milliDcu === "number") - message.milliDcu = object.milliDcu; - else if (typeof object.milliDcu === "object") - message.milliDcu = new $util.LongBits(object.milliDcu.low >>> 0, object.milliDcu.high >>> 0).toNumber(); - if (object.shuffleStorageGb != null) - if ($util.Long) - (message.shuffleStorageGb = $util.Long.fromValue(object.shuffleStorageGb)).unsigned = false; - else if (typeof object.shuffleStorageGb === "string") - message.shuffleStorageGb = parseInt(object.shuffleStorageGb, 10); - else if (typeof object.shuffleStorageGb === "number") - message.shuffleStorageGb = object.shuffleStorageGb; - else if (typeof object.shuffleStorageGb === "object") - message.shuffleStorageGb = new $util.LongBits(object.shuffleStorageGb.low >>> 0, object.shuffleStorageGb.high >>> 0).toNumber(); - if (object.milliDcuPremium != null) - if ($util.Long) - (message.milliDcuPremium = $util.Long.fromValue(object.milliDcuPremium)).unsigned = false; - else if (typeof object.milliDcuPremium === "string") - message.milliDcuPremium = parseInt(object.milliDcuPremium, 10); - else if (typeof object.milliDcuPremium === "number") - message.milliDcuPremium = object.milliDcuPremium; - else if (typeof object.milliDcuPremium === "object") - message.milliDcuPremium = new $util.LongBits(object.milliDcuPremium.low >>> 0, object.milliDcuPremium.high >>> 0).toNumber(); - if (object.shuffleStorageGbPremium != null) - if ($util.Long) - (message.shuffleStorageGbPremium = $util.Long.fromValue(object.shuffleStorageGbPremium)).unsigned = false; - else if (typeof object.shuffleStorageGbPremium === "string") - message.shuffleStorageGbPremium = parseInt(object.shuffleStorageGbPremium, 10); - else if (typeof object.shuffleStorageGbPremium === "number") - message.shuffleStorageGbPremium = object.shuffleStorageGbPremium; - else if (typeof object.shuffleStorageGbPremium === "object") - message.shuffleStorageGbPremium = new $util.LongBits(object.shuffleStorageGbPremium.low >>> 0, object.shuffleStorageGbPremium.high >>> 0).toNumber(); - if (object.milliAccelerator != null) - if ($util.Long) - (message.milliAccelerator = $util.Long.fromValue(object.milliAccelerator)).unsigned = false; - else if (typeof object.milliAccelerator === "string") - message.milliAccelerator = parseInt(object.milliAccelerator, 10); - else if (typeof object.milliAccelerator === "number") - message.milliAccelerator = object.milliAccelerator; - else if (typeof object.milliAccelerator === "object") - message.milliAccelerator = new $util.LongBits(object.milliAccelerator.low >>> 0, object.milliAccelerator.high >>> 0).toNumber(); - if (object.acceleratorType != null) - message.acceleratorType = String(object.acceleratorType); - if (object.snapshotTime != null) { - if (typeof object.snapshotTime !== "object") - throw TypeError(".google.cloud.dataproc.v1.UsageSnapshot.snapshotTime: object expected"); - message.snapshotTime = $root.google.protobuf.Timestamp.fromObject(object.snapshotTime); - } - return message; - }; - - /** - * Creates a plain object from a UsageSnapshot message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.UsageSnapshot - * @static - * @param {google.cloud.dataproc.v1.UsageSnapshot} message UsageSnapshot - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UsageSnapshot.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.milliDcu = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.milliDcu = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.shuffleStorageGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.shuffleStorageGb = options.longs === String ? "0" : 0; - object.snapshotTime = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.milliDcuPremium = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.milliDcuPremium = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.shuffleStorageGbPremium = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.shuffleStorageGbPremium = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.milliAccelerator = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.milliAccelerator = options.longs === String ? "0" : 0; - object.acceleratorType = ""; - } - if (message.milliDcu != null && message.hasOwnProperty("milliDcu")) - if (typeof message.milliDcu === "number") - object.milliDcu = options.longs === String ? String(message.milliDcu) : message.milliDcu; - else - object.milliDcu = options.longs === String ? $util.Long.prototype.toString.call(message.milliDcu) : options.longs === Number ? new $util.LongBits(message.milliDcu.low >>> 0, message.milliDcu.high >>> 0).toNumber() : message.milliDcu; - if (message.shuffleStorageGb != null && message.hasOwnProperty("shuffleStorageGb")) - if (typeof message.shuffleStorageGb === "number") - object.shuffleStorageGb = options.longs === String ? String(message.shuffleStorageGb) : message.shuffleStorageGb; - else - object.shuffleStorageGb = options.longs === String ? $util.Long.prototype.toString.call(message.shuffleStorageGb) : options.longs === Number ? new $util.LongBits(message.shuffleStorageGb.low >>> 0, message.shuffleStorageGb.high >>> 0).toNumber() : message.shuffleStorageGb; - if (message.snapshotTime != null && message.hasOwnProperty("snapshotTime")) - object.snapshotTime = $root.google.protobuf.Timestamp.toObject(message.snapshotTime, options); - if (message.milliDcuPremium != null && message.hasOwnProperty("milliDcuPremium")) - if (typeof message.milliDcuPremium === "number") - object.milliDcuPremium = options.longs === String ? String(message.milliDcuPremium) : message.milliDcuPremium; - else - object.milliDcuPremium = options.longs === String ? $util.Long.prototype.toString.call(message.milliDcuPremium) : options.longs === Number ? new $util.LongBits(message.milliDcuPremium.low >>> 0, message.milliDcuPremium.high >>> 0).toNumber() : message.milliDcuPremium; - if (message.shuffleStorageGbPremium != null && message.hasOwnProperty("shuffleStorageGbPremium")) - if (typeof message.shuffleStorageGbPremium === "number") - object.shuffleStorageGbPremium = options.longs === String ? String(message.shuffleStorageGbPremium) : message.shuffleStorageGbPremium; - else - object.shuffleStorageGbPremium = options.longs === String ? $util.Long.prototype.toString.call(message.shuffleStorageGbPremium) : options.longs === Number ? new $util.LongBits(message.shuffleStorageGbPremium.low >>> 0, message.shuffleStorageGbPremium.high >>> 0).toNumber() : message.shuffleStorageGbPremium; - if (message.milliAccelerator != null && message.hasOwnProperty("milliAccelerator")) - if (typeof message.milliAccelerator === "number") - object.milliAccelerator = options.longs === String ? String(message.milliAccelerator) : message.milliAccelerator; - else - object.milliAccelerator = options.longs === String ? $util.Long.prototype.toString.call(message.milliAccelerator) : options.longs === Number ? new $util.LongBits(message.milliAccelerator.low >>> 0, message.milliAccelerator.high >>> 0).toNumber() : message.milliAccelerator; - if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) - object.acceleratorType = message.acceleratorType; - return object; - }; - - /** - * Converts this UsageSnapshot to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.UsageSnapshot - * @instance - * @returns {Object.} JSON object - */ - UsageSnapshot.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UsageSnapshot - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.UsageSnapshot - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UsageSnapshot.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.UsageSnapshot"; - }; - - return UsageSnapshot; - })(); - - v1.GkeClusterConfig = (function() { - - /** - * Properties of a GkeClusterConfig. - * @memberof google.cloud.dataproc.v1 - * @interface IGkeClusterConfig - * @property {string|null} [gkeClusterTarget] GkeClusterConfig gkeClusterTarget - * @property {Array.|null} [nodePoolTarget] GkeClusterConfig nodePoolTarget - */ - - /** - * Constructs a new GkeClusterConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a GkeClusterConfig. - * @implements IGkeClusterConfig - * @constructor - * @param {google.cloud.dataproc.v1.IGkeClusterConfig=} [properties] Properties to set - */ - function GkeClusterConfig(properties) { - this.nodePoolTarget = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GkeClusterConfig gkeClusterTarget. - * @member {string} gkeClusterTarget - * @memberof google.cloud.dataproc.v1.GkeClusterConfig - * @instance - */ - GkeClusterConfig.prototype.gkeClusterTarget = ""; - - /** - * GkeClusterConfig nodePoolTarget. - * @member {Array.} nodePoolTarget - * @memberof google.cloud.dataproc.v1.GkeClusterConfig - * @instance - */ - GkeClusterConfig.prototype.nodePoolTarget = $util.emptyArray; - - /** - * Creates a new GkeClusterConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.GkeClusterConfig - * @static - * @param {google.cloud.dataproc.v1.IGkeClusterConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.GkeClusterConfig} GkeClusterConfig instance - */ - GkeClusterConfig.create = function create(properties) { - return new GkeClusterConfig(properties); - }; - - /** - * Encodes the specified GkeClusterConfig message. Does not implicitly {@link google.cloud.dataproc.v1.GkeClusterConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.GkeClusterConfig - * @static - * @param {google.cloud.dataproc.v1.IGkeClusterConfig} message GkeClusterConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GkeClusterConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.gkeClusterTarget != null && Object.hasOwnProperty.call(message, "gkeClusterTarget")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.gkeClusterTarget); - if (message.nodePoolTarget != null && message.nodePoolTarget.length) - for (var i = 0; i < message.nodePoolTarget.length; ++i) - $root.google.cloud.dataproc.v1.GkeNodePoolTarget.encode(message.nodePoolTarget[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GkeClusterConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GkeClusterConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.GkeClusterConfig - * @static - * @param {google.cloud.dataproc.v1.IGkeClusterConfig} message GkeClusterConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GkeClusterConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GkeClusterConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.GkeClusterConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.GkeClusterConfig} GkeClusterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GkeClusterConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.GkeClusterConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.gkeClusterTarget = reader.string(); - break; - } - case 3: { - if (!(message.nodePoolTarget && message.nodePoolTarget.length)) - message.nodePoolTarget = []; - message.nodePoolTarget.push($root.google.cloud.dataproc.v1.GkeNodePoolTarget.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GkeClusterConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.GkeClusterConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.GkeClusterConfig} GkeClusterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GkeClusterConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GkeClusterConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.GkeClusterConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GkeClusterConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.gkeClusterTarget != null && message.hasOwnProperty("gkeClusterTarget")) - if (!$util.isString(message.gkeClusterTarget)) - return "gkeClusterTarget: string expected"; - if (message.nodePoolTarget != null && message.hasOwnProperty("nodePoolTarget")) { - if (!Array.isArray(message.nodePoolTarget)) - return "nodePoolTarget: array expected"; - for (var i = 0; i < message.nodePoolTarget.length; ++i) { - var error = $root.google.cloud.dataproc.v1.GkeNodePoolTarget.verify(message.nodePoolTarget[i]); - if (error) - return "nodePoolTarget." + error; - } - } - return null; - }; - - /** - * Creates a GkeClusterConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.GkeClusterConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.GkeClusterConfig} GkeClusterConfig - */ - GkeClusterConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.GkeClusterConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.GkeClusterConfig(); - if (object.gkeClusterTarget != null) - message.gkeClusterTarget = String(object.gkeClusterTarget); - if (object.nodePoolTarget) { - if (!Array.isArray(object.nodePoolTarget)) - throw TypeError(".google.cloud.dataproc.v1.GkeClusterConfig.nodePoolTarget: array expected"); - message.nodePoolTarget = []; - for (var i = 0; i < object.nodePoolTarget.length; ++i) { - if (typeof object.nodePoolTarget[i] !== "object") - throw TypeError(".google.cloud.dataproc.v1.GkeClusterConfig.nodePoolTarget: object expected"); - message.nodePoolTarget[i] = $root.google.cloud.dataproc.v1.GkeNodePoolTarget.fromObject(object.nodePoolTarget[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GkeClusterConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.GkeClusterConfig - * @static - * @param {google.cloud.dataproc.v1.GkeClusterConfig} message GkeClusterConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GkeClusterConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.nodePoolTarget = []; - if (options.defaults) - object.gkeClusterTarget = ""; - if (message.gkeClusterTarget != null && message.hasOwnProperty("gkeClusterTarget")) - object.gkeClusterTarget = message.gkeClusterTarget; - if (message.nodePoolTarget && message.nodePoolTarget.length) { - object.nodePoolTarget = []; - for (var j = 0; j < message.nodePoolTarget.length; ++j) - object.nodePoolTarget[j] = $root.google.cloud.dataproc.v1.GkeNodePoolTarget.toObject(message.nodePoolTarget[j], options); - } - return object; - }; - - /** - * Converts this GkeClusterConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.GkeClusterConfig - * @instance - * @returns {Object.} JSON object - */ - GkeClusterConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GkeClusterConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.GkeClusterConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GkeClusterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.GkeClusterConfig"; - }; - - return GkeClusterConfig; - })(); - - v1.KubernetesClusterConfig = (function() { - - /** - * Properties of a KubernetesClusterConfig. - * @memberof google.cloud.dataproc.v1 - * @interface IKubernetesClusterConfig - * @property {string|null} [kubernetesNamespace] KubernetesClusterConfig kubernetesNamespace - * @property {google.cloud.dataproc.v1.IGkeClusterConfig|null} [gkeClusterConfig] KubernetesClusterConfig gkeClusterConfig - * @property {google.cloud.dataproc.v1.IKubernetesSoftwareConfig|null} [kubernetesSoftwareConfig] KubernetesClusterConfig kubernetesSoftwareConfig - */ - - /** - * Constructs a new KubernetesClusterConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a KubernetesClusterConfig. - * @implements IKubernetesClusterConfig - * @constructor - * @param {google.cloud.dataproc.v1.IKubernetesClusterConfig=} [properties] Properties to set - */ - function KubernetesClusterConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * KubernetesClusterConfig kubernetesNamespace. - * @member {string} kubernetesNamespace - * @memberof google.cloud.dataproc.v1.KubernetesClusterConfig - * @instance - */ - KubernetesClusterConfig.prototype.kubernetesNamespace = ""; - - /** - * KubernetesClusterConfig gkeClusterConfig. - * @member {google.cloud.dataproc.v1.IGkeClusterConfig|null|undefined} gkeClusterConfig - * @memberof google.cloud.dataproc.v1.KubernetesClusterConfig - * @instance - */ - KubernetesClusterConfig.prototype.gkeClusterConfig = null; - - /** - * KubernetesClusterConfig kubernetesSoftwareConfig. - * @member {google.cloud.dataproc.v1.IKubernetesSoftwareConfig|null|undefined} kubernetesSoftwareConfig - * @memberof google.cloud.dataproc.v1.KubernetesClusterConfig - * @instance - */ - KubernetesClusterConfig.prototype.kubernetesSoftwareConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * KubernetesClusterConfig config. - * @member {"gkeClusterConfig"|undefined} config - * @memberof google.cloud.dataproc.v1.KubernetesClusterConfig - * @instance - */ - Object.defineProperty(KubernetesClusterConfig.prototype, "config", { - get: $util.oneOfGetter($oneOfFields = ["gkeClusterConfig"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new KubernetesClusterConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.KubernetesClusterConfig - * @static - * @param {google.cloud.dataproc.v1.IKubernetesClusterConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.KubernetesClusterConfig} KubernetesClusterConfig instance - */ - KubernetesClusterConfig.create = function create(properties) { - return new KubernetesClusterConfig(properties); - }; - - /** - * Encodes the specified KubernetesClusterConfig message. Does not implicitly {@link google.cloud.dataproc.v1.KubernetesClusterConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.KubernetesClusterConfig - * @static - * @param {google.cloud.dataproc.v1.IKubernetesClusterConfig} message KubernetesClusterConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KubernetesClusterConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kubernetesNamespace != null && Object.hasOwnProperty.call(message, "kubernetesNamespace")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kubernetesNamespace); - if (message.gkeClusterConfig != null && Object.hasOwnProperty.call(message, "gkeClusterConfig")) - $root.google.cloud.dataproc.v1.GkeClusterConfig.encode(message.gkeClusterConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.kubernetesSoftwareConfig != null && Object.hasOwnProperty.call(message, "kubernetesSoftwareConfig")) - $root.google.cloud.dataproc.v1.KubernetesSoftwareConfig.encode(message.kubernetesSoftwareConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified KubernetesClusterConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.KubernetesClusterConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.KubernetesClusterConfig - * @static - * @param {google.cloud.dataproc.v1.IKubernetesClusterConfig} message KubernetesClusterConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KubernetesClusterConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a KubernetesClusterConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.KubernetesClusterConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.KubernetesClusterConfig} KubernetesClusterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KubernetesClusterConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.KubernetesClusterConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.kubernetesNamespace = reader.string(); - break; - } - case 2: { - message.gkeClusterConfig = $root.google.cloud.dataproc.v1.GkeClusterConfig.decode(reader, reader.uint32()); - break; - } - case 3: { - message.kubernetesSoftwareConfig = $root.google.cloud.dataproc.v1.KubernetesSoftwareConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a KubernetesClusterConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.KubernetesClusterConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.KubernetesClusterConfig} KubernetesClusterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KubernetesClusterConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a KubernetesClusterConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.KubernetesClusterConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KubernetesClusterConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.kubernetesNamespace != null && message.hasOwnProperty("kubernetesNamespace")) - if (!$util.isString(message.kubernetesNamespace)) - return "kubernetesNamespace: string expected"; - if (message.gkeClusterConfig != null && message.hasOwnProperty("gkeClusterConfig")) { - properties.config = 1; - { - var error = $root.google.cloud.dataproc.v1.GkeClusterConfig.verify(message.gkeClusterConfig); - if (error) - return "gkeClusterConfig." + error; - } - } - if (message.kubernetesSoftwareConfig != null && message.hasOwnProperty("kubernetesSoftwareConfig")) { - var error = $root.google.cloud.dataproc.v1.KubernetesSoftwareConfig.verify(message.kubernetesSoftwareConfig); - if (error) - return "kubernetesSoftwareConfig." + error; - } - return null; - }; - - /** - * Creates a KubernetesClusterConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.KubernetesClusterConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.KubernetesClusterConfig} KubernetesClusterConfig - */ - KubernetesClusterConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.KubernetesClusterConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.KubernetesClusterConfig(); - if (object.kubernetesNamespace != null) - message.kubernetesNamespace = String(object.kubernetesNamespace); - if (object.gkeClusterConfig != null) { - if (typeof object.gkeClusterConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.KubernetesClusterConfig.gkeClusterConfig: object expected"); - message.gkeClusterConfig = $root.google.cloud.dataproc.v1.GkeClusterConfig.fromObject(object.gkeClusterConfig); - } - if (object.kubernetesSoftwareConfig != null) { - if (typeof object.kubernetesSoftwareConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.KubernetesClusterConfig.kubernetesSoftwareConfig: object expected"); - message.kubernetesSoftwareConfig = $root.google.cloud.dataproc.v1.KubernetesSoftwareConfig.fromObject(object.kubernetesSoftwareConfig); - } - return message; - }; - - /** - * Creates a plain object from a KubernetesClusterConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.KubernetesClusterConfig - * @static - * @param {google.cloud.dataproc.v1.KubernetesClusterConfig} message KubernetesClusterConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KubernetesClusterConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.kubernetesNamespace = ""; - object.kubernetesSoftwareConfig = null; - } - if (message.kubernetesNamespace != null && message.hasOwnProperty("kubernetesNamespace")) - object.kubernetesNamespace = message.kubernetesNamespace; - if (message.gkeClusterConfig != null && message.hasOwnProperty("gkeClusterConfig")) { - object.gkeClusterConfig = $root.google.cloud.dataproc.v1.GkeClusterConfig.toObject(message.gkeClusterConfig, options); - if (options.oneofs) - object.config = "gkeClusterConfig"; - } - if (message.kubernetesSoftwareConfig != null && message.hasOwnProperty("kubernetesSoftwareConfig")) - object.kubernetesSoftwareConfig = $root.google.cloud.dataproc.v1.KubernetesSoftwareConfig.toObject(message.kubernetesSoftwareConfig, options); - return object; - }; - - /** - * Converts this KubernetesClusterConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.KubernetesClusterConfig - * @instance - * @returns {Object.} JSON object - */ - KubernetesClusterConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for KubernetesClusterConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.KubernetesClusterConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - KubernetesClusterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.KubernetesClusterConfig"; - }; - - return KubernetesClusterConfig; - })(); - - v1.KubernetesSoftwareConfig = (function() { - - /** - * Properties of a KubernetesSoftwareConfig. - * @memberof google.cloud.dataproc.v1 - * @interface IKubernetesSoftwareConfig - * @property {Object.|null} [componentVersion] KubernetesSoftwareConfig componentVersion - * @property {Object.|null} [properties] KubernetesSoftwareConfig properties - */ - - /** - * Constructs a new KubernetesSoftwareConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a KubernetesSoftwareConfig. - * @implements IKubernetesSoftwareConfig - * @constructor - * @param {google.cloud.dataproc.v1.IKubernetesSoftwareConfig=} [properties] Properties to set - */ - function KubernetesSoftwareConfig(properties) { - this.componentVersion = {}; - this.properties = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * KubernetesSoftwareConfig componentVersion. - * @member {Object.} componentVersion - * @memberof google.cloud.dataproc.v1.KubernetesSoftwareConfig - * @instance - */ - KubernetesSoftwareConfig.prototype.componentVersion = $util.emptyObject; - - /** - * KubernetesSoftwareConfig properties. - * @member {Object.} properties - * @memberof google.cloud.dataproc.v1.KubernetesSoftwareConfig - * @instance - */ - KubernetesSoftwareConfig.prototype.properties = $util.emptyObject; - - /** - * Creates a new KubernetesSoftwareConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.KubernetesSoftwareConfig - * @static - * @param {google.cloud.dataproc.v1.IKubernetesSoftwareConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.KubernetesSoftwareConfig} KubernetesSoftwareConfig instance - */ - KubernetesSoftwareConfig.create = function create(properties) { - return new KubernetesSoftwareConfig(properties); - }; - - /** - * Encodes the specified KubernetesSoftwareConfig message. Does not implicitly {@link google.cloud.dataproc.v1.KubernetesSoftwareConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.KubernetesSoftwareConfig - * @static - * @param {google.cloud.dataproc.v1.IKubernetesSoftwareConfig} message KubernetesSoftwareConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KubernetesSoftwareConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.componentVersion != null && Object.hasOwnProperty.call(message, "componentVersion")) - for (var keys = Object.keys(message.componentVersion), 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.componentVersion[keys[i]]).ldelim(); - if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) - for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.properties[keys[i]]).ldelim(); - return writer; - }; - - /** - * Encodes the specified KubernetesSoftwareConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.KubernetesSoftwareConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.KubernetesSoftwareConfig - * @static - * @param {google.cloud.dataproc.v1.IKubernetesSoftwareConfig} message KubernetesSoftwareConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KubernetesSoftwareConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a KubernetesSoftwareConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.KubernetesSoftwareConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.KubernetesSoftwareConfig} KubernetesSoftwareConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KubernetesSoftwareConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.KubernetesSoftwareConfig(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (message.componentVersion === $util.emptyObject) - message.componentVersion = {}; - 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.componentVersion[key] = value; - break; - } - case 2: { - if (message.properties === $util.emptyObject) - message.properties = {}; - 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.properties[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a KubernetesSoftwareConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.KubernetesSoftwareConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.KubernetesSoftwareConfig} KubernetesSoftwareConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KubernetesSoftwareConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a KubernetesSoftwareConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.KubernetesSoftwareConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KubernetesSoftwareConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.componentVersion != null && message.hasOwnProperty("componentVersion")) { - if (!$util.isObject(message.componentVersion)) - return "componentVersion: object expected"; - var key = Object.keys(message.componentVersion); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.componentVersion[key[i]])) - return "componentVersion: string{k:string} expected"; - } - if (message.properties != null && message.hasOwnProperty("properties")) { - if (!$util.isObject(message.properties)) - return "properties: object expected"; - var key = Object.keys(message.properties); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.properties[key[i]])) - return "properties: string{k:string} expected"; - } - return null; - }; - - /** - * Creates a KubernetesSoftwareConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.KubernetesSoftwareConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.KubernetesSoftwareConfig} KubernetesSoftwareConfig - */ - KubernetesSoftwareConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.KubernetesSoftwareConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.KubernetesSoftwareConfig(); - if (object.componentVersion) { - if (typeof object.componentVersion !== "object") - throw TypeError(".google.cloud.dataproc.v1.KubernetesSoftwareConfig.componentVersion: object expected"); - message.componentVersion = {}; - for (var keys = Object.keys(object.componentVersion), i = 0; i < keys.length; ++i) - message.componentVersion[keys[i]] = String(object.componentVersion[keys[i]]); - } - if (object.properties) { - if (typeof object.properties !== "object") - throw TypeError(".google.cloud.dataproc.v1.KubernetesSoftwareConfig.properties: object expected"); - message.properties = {}; - for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) - message.properties[keys[i]] = String(object.properties[keys[i]]); - } - return message; - }; - - /** - * Creates a plain object from a KubernetesSoftwareConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.KubernetesSoftwareConfig - * @static - * @param {google.cloud.dataproc.v1.KubernetesSoftwareConfig} message KubernetesSoftwareConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KubernetesSoftwareConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) { - object.componentVersion = {}; - object.properties = {}; - } - var keys2; - if (message.componentVersion && (keys2 = Object.keys(message.componentVersion)).length) { - object.componentVersion = {}; - for (var j = 0; j < keys2.length; ++j) - object.componentVersion[keys2[j]] = message.componentVersion[keys2[j]]; - } - if (message.properties && (keys2 = Object.keys(message.properties)).length) { - object.properties = {}; - for (var j = 0; j < keys2.length; ++j) - object.properties[keys2[j]] = message.properties[keys2[j]]; - } - return object; - }; - - /** - * Converts this KubernetesSoftwareConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.KubernetesSoftwareConfig - * @instance - * @returns {Object.} JSON object - */ - KubernetesSoftwareConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for KubernetesSoftwareConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.KubernetesSoftwareConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - KubernetesSoftwareConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.KubernetesSoftwareConfig"; - }; - - return KubernetesSoftwareConfig; - })(); - - v1.GkeNodePoolTarget = (function() { - - /** - * Properties of a GkeNodePoolTarget. - * @memberof google.cloud.dataproc.v1 - * @interface IGkeNodePoolTarget - * @property {string|null} [nodePool] GkeNodePoolTarget nodePool - * @property {Array.|null} [roles] GkeNodePoolTarget roles - * @property {google.cloud.dataproc.v1.IGkeNodePoolConfig|null} [nodePoolConfig] GkeNodePoolTarget nodePoolConfig - */ - - /** - * Constructs a new GkeNodePoolTarget. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a GkeNodePoolTarget. - * @implements IGkeNodePoolTarget - * @constructor - * @param {google.cloud.dataproc.v1.IGkeNodePoolTarget=} [properties] Properties to set - */ - function GkeNodePoolTarget(properties) { - this.roles = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GkeNodePoolTarget nodePool. - * @member {string} nodePool - * @memberof google.cloud.dataproc.v1.GkeNodePoolTarget - * @instance - */ - GkeNodePoolTarget.prototype.nodePool = ""; - - /** - * GkeNodePoolTarget roles. - * @member {Array.} roles - * @memberof google.cloud.dataproc.v1.GkeNodePoolTarget - * @instance - */ - GkeNodePoolTarget.prototype.roles = $util.emptyArray; - - /** - * GkeNodePoolTarget nodePoolConfig. - * @member {google.cloud.dataproc.v1.IGkeNodePoolConfig|null|undefined} nodePoolConfig - * @memberof google.cloud.dataproc.v1.GkeNodePoolTarget - * @instance - */ - GkeNodePoolTarget.prototype.nodePoolConfig = null; - - /** - * Creates a new GkeNodePoolTarget instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.GkeNodePoolTarget - * @static - * @param {google.cloud.dataproc.v1.IGkeNodePoolTarget=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.GkeNodePoolTarget} GkeNodePoolTarget instance - */ - GkeNodePoolTarget.create = function create(properties) { - return new GkeNodePoolTarget(properties); - }; - - /** - * Encodes the specified GkeNodePoolTarget message. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolTarget.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.GkeNodePoolTarget - * @static - * @param {google.cloud.dataproc.v1.IGkeNodePoolTarget} message GkeNodePoolTarget message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GkeNodePoolTarget.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nodePool != null && Object.hasOwnProperty.call(message, "nodePool")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.nodePool); - if (message.roles != null && message.roles.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.roles.length; ++i) - writer.int32(message.roles[i]); - writer.ldelim(); - } - if (message.nodePoolConfig != null && Object.hasOwnProperty.call(message, "nodePoolConfig")) - $root.google.cloud.dataproc.v1.GkeNodePoolConfig.encode(message.nodePoolConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GkeNodePoolTarget message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolTarget.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.GkeNodePoolTarget - * @static - * @param {google.cloud.dataproc.v1.IGkeNodePoolTarget} message GkeNodePoolTarget message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GkeNodePoolTarget.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GkeNodePoolTarget message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.GkeNodePoolTarget - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.GkeNodePoolTarget} GkeNodePoolTarget - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GkeNodePoolTarget.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.GkeNodePoolTarget(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.nodePool = reader.string(); - break; - } - case 2: { - if (!(message.roles && message.roles.length)) - message.roles = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.roles.push(reader.int32()); - } else - message.roles.push(reader.int32()); - break; - } - case 3: { - message.nodePoolConfig = $root.google.cloud.dataproc.v1.GkeNodePoolConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GkeNodePoolTarget message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.GkeNodePoolTarget - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.GkeNodePoolTarget} GkeNodePoolTarget - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GkeNodePoolTarget.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GkeNodePoolTarget message. - * @function verify - * @memberof google.cloud.dataproc.v1.GkeNodePoolTarget - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GkeNodePoolTarget.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.nodePool != null && message.hasOwnProperty("nodePool")) - if (!$util.isString(message.nodePool)) - return "nodePool: string expected"; - if (message.roles != null && message.hasOwnProperty("roles")) { - if (!Array.isArray(message.roles)) - return "roles: array expected"; - for (var i = 0; i < message.roles.length; ++i) - switch (message.roles[i]) { - default: - return "roles: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - } - if (message.nodePoolConfig != null && message.hasOwnProperty("nodePoolConfig")) { - var error = $root.google.cloud.dataproc.v1.GkeNodePoolConfig.verify(message.nodePoolConfig); - if (error) - return "nodePoolConfig." + error; - } - return null; - }; - - /** - * Creates a GkeNodePoolTarget message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.GkeNodePoolTarget - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.GkeNodePoolTarget} GkeNodePoolTarget - */ - GkeNodePoolTarget.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.GkeNodePoolTarget) - return object; - var message = new $root.google.cloud.dataproc.v1.GkeNodePoolTarget(); - if (object.nodePool != null) - message.nodePool = String(object.nodePool); - if (object.roles) { - if (!Array.isArray(object.roles)) - throw TypeError(".google.cloud.dataproc.v1.GkeNodePoolTarget.roles: array expected"); - message.roles = []; - for (var i = 0; i < object.roles.length; ++i) - switch (object.roles[i]) { - default: - if (typeof object.roles[i] === "number") { - message.roles[i] = object.roles[i]; - break; - } - case "ROLE_UNSPECIFIED": - case 0: - message.roles[i] = 0; - break; - case "DEFAULT": - case 1: - message.roles[i] = 1; - break; - case "CONTROLLER": - case 2: - message.roles[i] = 2; - break; - case "SPARK_DRIVER": - case 3: - message.roles[i] = 3; - break; - case "SPARK_EXECUTOR": - case 4: - message.roles[i] = 4; - break; - } - } - if (object.nodePoolConfig != null) { - if (typeof object.nodePoolConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.GkeNodePoolTarget.nodePoolConfig: object expected"); - message.nodePoolConfig = $root.google.cloud.dataproc.v1.GkeNodePoolConfig.fromObject(object.nodePoolConfig); - } - return message; - }; - - /** - * Creates a plain object from a GkeNodePoolTarget message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.GkeNodePoolTarget - * @static - * @param {google.cloud.dataproc.v1.GkeNodePoolTarget} message GkeNodePoolTarget - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GkeNodePoolTarget.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.roles = []; - if (options.defaults) { - object.nodePool = ""; - object.nodePoolConfig = null; - } - if (message.nodePool != null && message.hasOwnProperty("nodePool")) - object.nodePool = message.nodePool; - if (message.roles && message.roles.length) { - object.roles = []; - for (var j = 0; j < message.roles.length; ++j) - object.roles[j] = options.enums === String ? $root.google.cloud.dataproc.v1.GkeNodePoolTarget.Role[message.roles[j]] === undefined ? message.roles[j] : $root.google.cloud.dataproc.v1.GkeNodePoolTarget.Role[message.roles[j]] : message.roles[j]; - } - if (message.nodePoolConfig != null && message.hasOwnProperty("nodePoolConfig")) - object.nodePoolConfig = $root.google.cloud.dataproc.v1.GkeNodePoolConfig.toObject(message.nodePoolConfig, options); - return object; - }; - - /** - * Converts this GkeNodePoolTarget to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.GkeNodePoolTarget - * @instance - * @returns {Object.} JSON object - */ - GkeNodePoolTarget.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GkeNodePoolTarget - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.GkeNodePoolTarget - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GkeNodePoolTarget.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.GkeNodePoolTarget"; - }; - - /** - * Role enum. - * @name google.cloud.dataproc.v1.GkeNodePoolTarget.Role - * @enum {number} - * @property {number} ROLE_UNSPECIFIED=0 ROLE_UNSPECIFIED value - * @property {number} DEFAULT=1 DEFAULT value - * @property {number} CONTROLLER=2 CONTROLLER value - * @property {number} SPARK_DRIVER=3 SPARK_DRIVER value - * @property {number} SPARK_EXECUTOR=4 SPARK_EXECUTOR value - */ - GkeNodePoolTarget.Role = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ROLE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DEFAULT"] = 1; - values[valuesById[2] = "CONTROLLER"] = 2; - values[valuesById[3] = "SPARK_DRIVER"] = 3; - values[valuesById[4] = "SPARK_EXECUTOR"] = 4; - return values; - })(); - - return GkeNodePoolTarget; - })(); - - v1.GkeNodePoolConfig = (function() { - - /** - * Properties of a GkeNodePoolConfig. - * @memberof google.cloud.dataproc.v1 - * @interface IGkeNodePoolConfig - * @property {google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodeConfig|null} [config] GkeNodePoolConfig config - * @property {Array.|null} [locations] GkeNodePoolConfig locations - * @property {google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAutoscalingConfig|null} [autoscaling] GkeNodePoolConfig autoscaling - */ - - /** - * Constructs a new GkeNodePoolConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a GkeNodePoolConfig. - * @implements IGkeNodePoolConfig - * @constructor - * @param {google.cloud.dataproc.v1.IGkeNodePoolConfig=} [properties] Properties to set - */ - function GkeNodePoolConfig(properties) { - this.locations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GkeNodePoolConfig config. - * @member {google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodeConfig|null|undefined} config - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig - * @instance - */ - GkeNodePoolConfig.prototype.config = null; - - /** - * GkeNodePoolConfig locations. - * @member {Array.} locations - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig - * @instance - */ - GkeNodePoolConfig.prototype.locations = $util.emptyArray; - - /** - * GkeNodePoolConfig autoscaling. - * @member {google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAutoscalingConfig|null|undefined} autoscaling - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig - * @instance - */ - GkeNodePoolConfig.prototype.autoscaling = null; - - /** - * Creates a new GkeNodePoolConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig - * @static - * @param {google.cloud.dataproc.v1.IGkeNodePoolConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.GkeNodePoolConfig} GkeNodePoolConfig instance - */ - GkeNodePoolConfig.create = function create(properties) { - return new GkeNodePoolConfig(properties); - }; - - /** - * Encodes the specified GkeNodePoolConfig message. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig - * @static - * @param {google.cloud.dataproc.v1.IGkeNodePoolConfig} message GkeNodePoolConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GkeNodePoolConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.config != null && Object.hasOwnProperty.call(message, "config")) - $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.encode(message.config, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.autoscaling != null && Object.hasOwnProperty.call(message, "autoscaling")) - $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig.encode(message.autoscaling, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.locations != null && message.locations.length) - for (var i = 0; i < message.locations.length; ++i) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.locations[i]); - return writer; - }; - - /** - * Encodes the specified GkeNodePoolConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig - * @static - * @param {google.cloud.dataproc.v1.IGkeNodePoolConfig} message GkeNodePoolConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GkeNodePoolConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GkeNodePoolConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.GkeNodePoolConfig} GkeNodePoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GkeNodePoolConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.GkeNodePoolConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.config = $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.decode(reader, reader.uint32()); - break; - } - case 13: { - if (!(message.locations && message.locations.length)) - message.locations = []; - message.locations.push(reader.string()); - break; - } - case 4: { - message.autoscaling = $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GkeNodePoolConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.GkeNodePoolConfig} GkeNodePoolConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GkeNodePoolConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GkeNodePoolConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GkeNodePoolConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.config != null && message.hasOwnProperty("config")) { - var error = $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.verify(message.config); - if (error) - return "config." + error; - } - if (message.locations != null && message.hasOwnProperty("locations")) { - if (!Array.isArray(message.locations)) - return "locations: array expected"; - for (var i = 0; i < message.locations.length; ++i) - if (!$util.isString(message.locations[i])) - return "locations: string[] expected"; - } - if (message.autoscaling != null && message.hasOwnProperty("autoscaling")) { - var error = $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig.verify(message.autoscaling); - if (error) - return "autoscaling." + error; - } - return null; - }; - - /** - * Creates a GkeNodePoolConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.GkeNodePoolConfig} GkeNodePoolConfig - */ - GkeNodePoolConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.GkeNodePoolConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.GkeNodePoolConfig(); - if (object.config != null) { - if (typeof object.config !== "object") - throw TypeError(".google.cloud.dataproc.v1.GkeNodePoolConfig.config: object expected"); - message.config = $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.fromObject(object.config); - } - if (object.locations) { - if (!Array.isArray(object.locations)) - throw TypeError(".google.cloud.dataproc.v1.GkeNodePoolConfig.locations: array expected"); - message.locations = []; - for (var i = 0; i < object.locations.length; ++i) - message.locations[i] = String(object.locations[i]); - } - if (object.autoscaling != null) { - if (typeof object.autoscaling !== "object") - throw TypeError(".google.cloud.dataproc.v1.GkeNodePoolConfig.autoscaling: object expected"); - message.autoscaling = $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig.fromObject(object.autoscaling); - } - return message; - }; - - /** - * Creates a plain object from a GkeNodePoolConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig - * @static - * @param {google.cloud.dataproc.v1.GkeNodePoolConfig} message GkeNodePoolConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GkeNodePoolConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.locations = []; - if (options.defaults) { - object.config = null; - object.autoscaling = null; - } - if (message.config != null && message.hasOwnProperty("config")) - object.config = $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.toObject(message.config, options); - if (message.autoscaling != null && message.hasOwnProperty("autoscaling")) - object.autoscaling = $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig.toObject(message.autoscaling, options); - if (message.locations && message.locations.length) { - object.locations = []; - for (var j = 0; j < message.locations.length; ++j) - object.locations[j] = message.locations[j]; - } - return object; - }; - - /** - * Converts this GkeNodePoolConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig - * @instance - * @returns {Object.} JSON object - */ - GkeNodePoolConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GkeNodePoolConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GkeNodePoolConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.GkeNodePoolConfig"; - }; - - GkeNodePoolConfig.GkeNodeConfig = (function() { - - /** - * Properties of a GkeNodeConfig. - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig - * @interface IGkeNodeConfig - * @property {string|null} [machineType] GkeNodeConfig machineType - * @property {number|null} [localSsdCount] GkeNodeConfig localSsdCount - * @property {boolean|null} [preemptible] GkeNodeConfig preemptible - * @property {Array.|null} [accelerators] GkeNodeConfig accelerators - * @property {string|null} [minCpuPlatform] GkeNodeConfig minCpuPlatform - * @property {string|null} [bootDiskKmsKey] GkeNodeConfig bootDiskKmsKey - * @property {boolean|null} [spot] GkeNodeConfig spot - */ - - /** - * Constructs a new GkeNodeConfig. - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig - * @classdesc Represents a GkeNodeConfig. - * @implements IGkeNodeConfig - * @constructor - * @param {google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodeConfig=} [properties] Properties to set - */ - function GkeNodeConfig(properties) { - this.accelerators = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GkeNodeConfig machineType. - * @member {string} machineType - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig - * @instance - */ - GkeNodeConfig.prototype.machineType = ""; - - /** - * GkeNodeConfig localSsdCount. - * @member {number} localSsdCount - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig - * @instance - */ - GkeNodeConfig.prototype.localSsdCount = 0; - - /** - * GkeNodeConfig preemptible. - * @member {boolean} preemptible - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig - * @instance - */ - GkeNodeConfig.prototype.preemptible = false; - - /** - * GkeNodeConfig accelerators. - * @member {Array.} accelerators - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig - * @instance - */ - GkeNodeConfig.prototype.accelerators = $util.emptyArray; - - /** - * GkeNodeConfig minCpuPlatform. - * @member {string} minCpuPlatform - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig - * @instance - */ - GkeNodeConfig.prototype.minCpuPlatform = ""; - - /** - * GkeNodeConfig bootDiskKmsKey. - * @member {string} bootDiskKmsKey - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig - * @instance - */ - GkeNodeConfig.prototype.bootDiskKmsKey = ""; - - /** - * GkeNodeConfig spot. - * @member {boolean} spot - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig - * @instance - */ - GkeNodeConfig.prototype.spot = false; - - /** - * Creates a new GkeNodeConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig - * @static - * @param {google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodeConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig} GkeNodeConfig instance - */ - GkeNodeConfig.create = function create(properties) { - return new GkeNodeConfig(properties); - }; - - /** - * Encodes the specified GkeNodeConfig message. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig - * @static - * @param {google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodeConfig} message GkeNodeConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GkeNodeConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.machineType); - if (message.localSsdCount != null && Object.hasOwnProperty.call(message, "localSsdCount")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.localSsdCount); - if (message.preemptible != null && Object.hasOwnProperty.call(message, "preemptible")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.preemptible); - if (message.accelerators != null && message.accelerators.length) - for (var i = 0; i < message.accelerators.length; ++i) - $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig.encode(message.accelerators[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.minCpuPlatform != null && Object.hasOwnProperty.call(message, "minCpuPlatform")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.minCpuPlatform); - if (message.bootDiskKmsKey != null && Object.hasOwnProperty.call(message, "bootDiskKmsKey")) - writer.uint32(/* id 23, wireType 2 =*/186).string(message.bootDiskKmsKey); - if (message.spot != null && Object.hasOwnProperty.call(message, "spot")) - writer.uint32(/* id 32, wireType 0 =*/256).bool(message.spot); - return writer; - }; - - /** - * Encodes the specified GkeNodeConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig - * @static - * @param {google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodeConfig} message GkeNodeConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GkeNodeConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GkeNodeConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig} GkeNodeConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GkeNodeConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.machineType = reader.string(); - break; - } - case 7: { - message.localSsdCount = reader.int32(); - break; - } - case 10: { - message.preemptible = reader.bool(); - break; - } - case 11: { - if (!(message.accelerators && message.accelerators.length)) - message.accelerators = []; - message.accelerators.push($root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig.decode(reader, reader.uint32())); - break; - } - case 13: { - message.minCpuPlatform = reader.string(); - break; - } - case 23: { - message.bootDiskKmsKey = reader.string(); - break; - } - case 32: { - message.spot = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GkeNodeConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig} GkeNodeConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GkeNodeConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GkeNodeConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GkeNodeConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.machineType != null && message.hasOwnProperty("machineType")) - if (!$util.isString(message.machineType)) - return "machineType: string expected"; - if (message.localSsdCount != null && message.hasOwnProperty("localSsdCount")) - if (!$util.isInteger(message.localSsdCount)) - return "localSsdCount: integer expected"; - if (message.preemptible != null && message.hasOwnProperty("preemptible")) - if (typeof message.preemptible !== "boolean") - return "preemptible: boolean expected"; - if (message.accelerators != null && message.hasOwnProperty("accelerators")) { - if (!Array.isArray(message.accelerators)) - return "accelerators: array expected"; - for (var i = 0; i < message.accelerators.length; ++i) { - var error = $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig.verify(message.accelerators[i]); - if (error) - return "accelerators." + error; - } - } - if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) - if (!$util.isString(message.minCpuPlatform)) - return "minCpuPlatform: string expected"; - if (message.bootDiskKmsKey != null && message.hasOwnProperty("bootDiskKmsKey")) - if (!$util.isString(message.bootDiskKmsKey)) - return "bootDiskKmsKey: string expected"; - if (message.spot != null && message.hasOwnProperty("spot")) - if (typeof message.spot !== "boolean") - return "spot: boolean expected"; - return null; - }; - - /** - * Creates a GkeNodeConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig} GkeNodeConfig - */ - GkeNodeConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig(); - if (object.machineType != null) - message.machineType = String(object.machineType); - if (object.localSsdCount != null) - message.localSsdCount = object.localSsdCount | 0; - if (object.preemptible != null) - message.preemptible = Boolean(object.preemptible); - if (object.accelerators) { - if (!Array.isArray(object.accelerators)) - throw TypeError(".google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.accelerators: array expected"); - message.accelerators = []; - for (var i = 0; i < object.accelerators.length; ++i) { - if (typeof object.accelerators[i] !== "object") - throw TypeError(".google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig.accelerators: object expected"); - message.accelerators[i] = $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig.fromObject(object.accelerators[i]); - } - } - if (object.minCpuPlatform != null) - message.minCpuPlatform = String(object.minCpuPlatform); - if (object.bootDiskKmsKey != null) - message.bootDiskKmsKey = String(object.bootDiskKmsKey); - if (object.spot != null) - message.spot = Boolean(object.spot); - return message; - }; - - /** - * Creates a plain object from a GkeNodeConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig - * @static - * @param {google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig} message GkeNodeConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GkeNodeConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.accelerators = []; - if (options.defaults) { - object.machineType = ""; - object.localSsdCount = 0; - object.preemptible = false; - object.minCpuPlatform = ""; - object.bootDiskKmsKey = ""; - object.spot = false; - } - if (message.machineType != null && message.hasOwnProperty("machineType")) - object.machineType = message.machineType; - if (message.localSsdCount != null && message.hasOwnProperty("localSsdCount")) - object.localSsdCount = message.localSsdCount; - if (message.preemptible != null && message.hasOwnProperty("preemptible")) - object.preemptible = message.preemptible; - if (message.accelerators && message.accelerators.length) { - object.accelerators = []; - for (var j = 0; j < message.accelerators.length; ++j) - object.accelerators[j] = $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig.toObject(message.accelerators[j], options); - } - if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) - object.minCpuPlatform = message.minCpuPlatform; - if (message.bootDiskKmsKey != null && message.hasOwnProperty("bootDiskKmsKey")) - object.bootDiskKmsKey = message.bootDiskKmsKey; - if (message.spot != null && message.hasOwnProperty("spot")) - object.spot = message.spot; - return object; - }; - - /** - * Converts this GkeNodeConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig - * @instance - * @returns {Object.} JSON object - */ - GkeNodeConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GkeNodeConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GkeNodeConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig"; - }; - - return GkeNodeConfig; - })(); - - GkeNodePoolConfig.GkeNodePoolAcceleratorConfig = (function() { - - /** - * Properties of a GkeNodePoolAcceleratorConfig. - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig - * @interface IGkeNodePoolAcceleratorConfig - * @property {number|Long|null} [acceleratorCount] GkeNodePoolAcceleratorConfig acceleratorCount - * @property {string|null} [acceleratorType] GkeNodePoolAcceleratorConfig acceleratorType - * @property {string|null} [gpuPartitionSize] GkeNodePoolAcceleratorConfig gpuPartitionSize - */ - - /** - * Constructs a new GkeNodePoolAcceleratorConfig. - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig - * @classdesc Represents a GkeNodePoolAcceleratorConfig. - * @implements IGkeNodePoolAcceleratorConfig - * @constructor - * @param {google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAcceleratorConfig=} [properties] Properties to set - */ - function GkeNodePoolAcceleratorConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GkeNodePoolAcceleratorConfig acceleratorCount. - * @member {number|Long} acceleratorCount - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig - * @instance - */ - GkeNodePoolAcceleratorConfig.prototype.acceleratorCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * GkeNodePoolAcceleratorConfig acceleratorType. - * @member {string} acceleratorType - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig - * @instance - */ - GkeNodePoolAcceleratorConfig.prototype.acceleratorType = ""; - - /** - * GkeNodePoolAcceleratorConfig gpuPartitionSize. - * @member {string} gpuPartitionSize - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig - * @instance - */ - GkeNodePoolAcceleratorConfig.prototype.gpuPartitionSize = ""; - - /** - * Creates a new GkeNodePoolAcceleratorConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig - * @static - * @param {google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAcceleratorConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig} GkeNodePoolAcceleratorConfig instance - */ - GkeNodePoolAcceleratorConfig.create = function create(properties) { - return new GkeNodePoolAcceleratorConfig(properties); - }; - - /** - * Encodes the specified GkeNodePoolAcceleratorConfig message. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig - * @static - * @param {google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAcceleratorConfig} message GkeNodePoolAcceleratorConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GkeNodePoolAcceleratorConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.acceleratorCount != null && Object.hasOwnProperty.call(message, "acceleratorCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.acceleratorCount); - if (message.acceleratorType != null && Object.hasOwnProperty.call(message, "acceleratorType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.acceleratorType); - if (message.gpuPartitionSize != null && Object.hasOwnProperty.call(message, "gpuPartitionSize")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.gpuPartitionSize); - return writer; - }; - - /** - * Encodes the specified GkeNodePoolAcceleratorConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig - * @static - * @param {google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAcceleratorConfig} message GkeNodePoolAcceleratorConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GkeNodePoolAcceleratorConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GkeNodePoolAcceleratorConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig} GkeNodePoolAcceleratorConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GkeNodePoolAcceleratorConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.acceleratorCount = reader.int64(); - break; - } - case 2: { - message.acceleratorType = reader.string(); - break; - } - case 3: { - message.gpuPartitionSize = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GkeNodePoolAcceleratorConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig} GkeNodePoolAcceleratorConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GkeNodePoolAcceleratorConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GkeNodePoolAcceleratorConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GkeNodePoolAcceleratorConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.acceleratorCount != null && message.hasOwnProperty("acceleratorCount")) - if (!$util.isInteger(message.acceleratorCount) && !(message.acceleratorCount && $util.isInteger(message.acceleratorCount.low) && $util.isInteger(message.acceleratorCount.high))) - return "acceleratorCount: integer|Long expected"; - if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) - if (!$util.isString(message.acceleratorType)) - return "acceleratorType: string expected"; - if (message.gpuPartitionSize != null && message.hasOwnProperty("gpuPartitionSize")) - if (!$util.isString(message.gpuPartitionSize)) - return "gpuPartitionSize: string expected"; - return null; - }; - - /** - * Creates a GkeNodePoolAcceleratorConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig} GkeNodePoolAcceleratorConfig - */ - GkeNodePoolAcceleratorConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig(); - if (object.acceleratorCount != null) - if ($util.Long) - (message.acceleratorCount = $util.Long.fromValue(object.acceleratorCount)).unsigned = false; - else if (typeof object.acceleratorCount === "string") - message.acceleratorCount = parseInt(object.acceleratorCount, 10); - else if (typeof object.acceleratorCount === "number") - message.acceleratorCount = object.acceleratorCount; - else if (typeof object.acceleratorCount === "object") - message.acceleratorCount = new $util.LongBits(object.acceleratorCount.low >>> 0, object.acceleratorCount.high >>> 0).toNumber(); - if (object.acceleratorType != null) - message.acceleratorType = String(object.acceleratorType); - if (object.gpuPartitionSize != null) - message.gpuPartitionSize = String(object.gpuPartitionSize); - return message; - }; - - /** - * Creates a plain object from a GkeNodePoolAcceleratorConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig - * @static - * @param {google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig} message GkeNodePoolAcceleratorConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GkeNodePoolAcceleratorConfig.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.acceleratorCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.acceleratorCount = options.longs === String ? "0" : 0; - object.acceleratorType = ""; - object.gpuPartitionSize = ""; - } - if (message.acceleratorCount != null && message.hasOwnProperty("acceleratorCount")) - if (typeof message.acceleratorCount === "number") - object.acceleratorCount = options.longs === String ? String(message.acceleratorCount) : message.acceleratorCount; - else - object.acceleratorCount = options.longs === String ? $util.Long.prototype.toString.call(message.acceleratorCount) : options.longs === Number ? new $util.LongBits(message.acceleratorCount.low >>> 0, message.acceleratorCount.high >>> 0).toNumber() : message.acceleratorCount; - if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) - object.acceleratorType = message.acceleratorType; - if (message.gpuPartitionSize != null && message.hasOwnProperty("gpuPartitionSize")) - object.gpuPartitionSize = message.gpuPartitionSize; - return object; - }; - - /** - * Converts this GkeNodePoolAcceleratorConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig - * @instance - * @returns {Object.} JSON object - */ - GkeNodePoolAcceleratorConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GkeNodePoolAcceleratorConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GkeNodePoolAcceleratorConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAcceleratorConfig"; - }; - - return GkeNodePoolAcceleratorConfig; - })(); - - GkeNodePoolConfig.GkeNodePoolAutoscalingConfig = (function() { - - /** - * Properties of a GkeNodePoolAutoscalingConfig. - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig - * @interface IGkeNodePoolAutoscalingConfig - * @property {number|null} [minNodeCount] GkeNodePoolAutoscalingConfig minNodeCount - * @property {number|null} [maxNodeCount] GkeNodePoolAutoscalingConfig maxNodeCount - */ - - /** - * Constructs a new GkeNodePoolAutoscalingConfig. - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig - * @classdesc Represents a GkeNodePoolAutoscalingConfig. - * @implements IGkeNodePoolAutoscalingConfig - * @constructor - * @param {google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAutoscalingConfig=} [properties] Properties to set - */ - function GkeNodePoolAutoscalingConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GkeNodePoolAutoscalingConfig minNodeCount. - * @member {number} minNodeCount - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig - * @instance - */ - GkeNodePoolAutoscalingConfig.prototype.minNodeCount = 0; - - /** - * GkeNodePoolAutoscalingConfig maxNodeCount. - * @member {number} maxNodeCount - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig - * @instance - */ - GkeNodePoolAutoscalingConfig.prototype.maxNodeCount = 0; - - /** - * Creates a new GkeNodePoolAutoscalingConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig - * @static - * @param {google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAutoscalingConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig} GkeNodePoolAutoscalingConfig instance - */ - GkeNodePoolAutoscalingConfig.create = function create(properties) { - return new GkeNodePoolAutoscalingConfig(properties); - }; - - /** - * Encodes the specified GkeNodePoolAutoscalingConfig message. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig - * @static - * @param {google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAutoscalingConfig} message GkeNodePoolAutoscalingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GkeNodePoolAutoscalingConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.minNodeCount != null && Object.hasOwnProperty.call(message, "minNodeCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minNodeCount); - if (message.maxNodeCount != null && Object.hasOwnProperty.call(message, "maxNodeCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxNodeCount); - return writer; - }; - - /** - * Encodes the specified GkeNodePoolAutoscalingConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig - * @static - * @param {google.cloud.dataproc.v1.GkeNodePoolConfig.IGkeNodePoolAutoscalingConfig} message GkeNodePoolAutoscalingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GkeNodePoolAutoscalingConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GkeNodePoolAutoscalingConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig} GkeNodePoolAutoscalingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GkeNodePoolAutoscalingConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.minNodeCount = reader.int32(); - break; - } - case 3: { - message.maxNodeCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GkeNodePoolAutoscalingConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig} GkeNodePoolAutoscalingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GkeNodePoolAutoscalingConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GkeNodePoolAutoscalingConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GkeNodePoolAutoscalingConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.minNodeCount != null && message.hasOwnProperty("minNodeCount")) - if (!$util.isInteger(message.minNodeCount)) - return "minNodeCount: integer expected"; - if (message.maxNodeCount != null && message.hasOwnProperty("maxNodeCount")) - if (!$util.isInteger(message.maxNodeCount)) - return "maxNodeCount: integer expected"; - return null; - }; - - /** - * Creates a GkeNodePoolAutoscalingConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig} GkeNodePoolAutoscalingConfig - */ - GkeNodePoolAutoscalingConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig(); - if (object.minNodeCount != null) - message.minNodeCount = object.minNodeCount | 0; - if (object.maxNodeCount != null) - message.maxNodeCount = object.maxNodeCount | 0; - return message; - }; - - /** - * Creates a plain object from a GkeNodePoolAutoscalingConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig - * @static - * @param {google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig} message GkeNodePoolAutoscalingConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GkeNodePoolAutoscalingConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.minNodeCount = 0; - object.maxNodeCount = 0; - } - if (message.minNodeCount != null && message.hasOwnProperty("minNodeCount")) - object.minNodeCount = message.minNodeCount; - if (message.maxNodeCount != null && message.hasOwnProperty("maxNodeCount")) - object.maxNodeCount = message.maxNodeCount; - return object; - }; - - /** - * Converts this GkeNodePoolAutoscalingConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig - * @instance - * @returns {Object.} JSON object - */ - GkeNodePoolAutoscalingConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GkeNodePoolAutoscalingConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GkeNodePoolAutoscalingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig"; - }; - - return GkeNodePoolAutoscalingConfig; - })(); - - return GkeNodePoolConfig; - })(); - - v1.AuthenticationConfig = (function() { - - /** - * Properties of an AuthenticationConfig. - * @memberof google.cloud.dataproc.v1 - * @interface IAuthenticationConfig - * @property {google.cloud.dataproc.v1.AuthenticationConfig.AuthenticationType|null} [userWorkloadAuthenticationType] AuthenticationConfig userWorkloadAuthenticationType - */ - - /** - * Constructs a new AuthenticationConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents an AuthenticationConfig. - * @implements IAuthenticationConfig - * @constructor - * @param {google.cloud.dataproc.v1.IAuthenticationConfig=} [properties] Properties to set - */ - function AuthenticationConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AuthenticationConfig userWorkloadAuthenticationType. - * @member {google.cloud.dataproc.v1.AuthenticationConfig.AuthenticationType} userWorkloadAuthenticationType - * @memberof google.cloud.dataproc.v1.AuthenticationConfig - * @instance - */ - AuthenticationConfig.prototype.userWorkloadAuthenticationType = 0; - - /** - * Creates a new AuthenticationConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.AuthenticationConfig - * @static - * @param {google.cloud.dataproc.v1.IAuthenticationConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.AuthenticationConfig} AuthenticationConfig instance - */ - AuthenticationConfig.create = function create(properties) { - return new AuthenticationConfig(properties); - }; - - /** - * Encodes the specified AuthenticationConfig message. Does not implicitly {@link google.cloud.dataproc.v1.AuthenticationConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.AuthenticationConfig - * @static - * @param {google.cloud.dataproc.v1.IAuthenticationConfig} message AuthenticationConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuthenticationConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.userWorkloadAuthenticationType != null && Object.hasOwnProperty.call(message, "userWorkloadAuthenticationType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.userWorkloadAuthenticationType); - return writer; - }; - - /** - * Encodes the specified AuthenticationConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.AuthenticationConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.AuthenticationConfig - * @static - * @param {google.cloud.dataproc.v1.IAuthenticationConfig} message AuthenticationConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuthenticationConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AuthenticationConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.AuthenticationConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.AuthenticationConfig} AuthenticationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuthenticationConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.AuthenticationConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.userWorkloadAuthenticationType = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AuthenticationConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.AuthenticationConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.AuthenticationConfig} AuthenticationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuthenticationConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AuthenticationConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.AuthenticationConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AuthenticationConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.userWorkloadAuthenticationType != null && message.hasOwnProperty("userWorkloadAuthenticationType")) - switch (message.userWorkloadAuthenticationType) { - default: - return "userWorkloadAuthenticationType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an AuthenticationConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.AuthenticationConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.AuthenticationConfig} AuthenticationConfig - */ - AuthenticationConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.AuthenticationConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.AuthenticationConfig(); - switch (object.userWorkloadAuthenticationType) { - default: - if (typeof object.userWorkloadAuthenticationType === "number") { - message.userWorkloadAuthenticationType = object.userWorkloadAuthenticationType; - break; - } - break; - case "AUTHENTICATION_TYPE_UNSPECIFIED": - case 0: - message.userWorkloadAuthenticationType = 0; - break; - case "SERVICE_ACCOUNT": - case 1: - message.userWorkloadAuthenticationType = 1; - break; - case "END_USER_CREDENTIALS": - case 2: - message.userWorkloadAuthenticationType = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an AuthenticationConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.AuthenticationConfig - * @static - * @param {google.cloud.dataproc.v1.AuthenticationConfig} message AuthenticationConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AuthenticationConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.userWorkloadAuthenticationType = options.enums === String ? "AUTHENTICATION_TYPE_UNSPECIFIED" : 0; - if (message.userWorkloadAuthenticationType != null && message.hasOwnProperty("userWorkloadAuthenticationType")) - object.userWorkloadAuthenticationType = options.enums === String ? $root.google.cloud.dataproc.v1.AuthenticationConfig.AuthenticationType[message.userWorkloadAuthenticationType] === undefined ? message.userWorkloadAuthenticationType : $root.google.cloud.dataproc.v1.AuthenticationConfig.AuthenticationType[message.userWorkloadAuthenticationType] : message.userWorkloadAuthenticationType; - return object; - }; - - /** - * Converts this AuthenticationConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.AuthenticationConfig - * @instance - * @returns {Object.} JSON object - */ - AuthenticationConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AuthenticationConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.AuthenticationConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AuthenticationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.AuthenticationConfig"; - }; - - /** - * AuthenticationType enum. - * @name google.cloud.dataproc.v1.AuthenticationConfig.AuthenticationType - * @enum {number} - * @property {number} AUTHENTICATION_TYPE_UNSPECIFIED=0 AUTHENTICATION_TYPE_UNSPECIFIED value - * @property {number} SERVICE_ACCOUNT=1 SERVICE_ACCOUNT value - * @property {number} END_USER_CREDENTIALS=2 END_USER_CREDENTIALS value - */ - AuthenticationConfig.AuthenticationType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "AUTHENTICATION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SERVICE_ACCOUNT"] = 1; - values[valuesById[2] = "END_USER_CREDENTIALS"] = 2; - return values; - })(); - - return AuthenticationConfig; - })(); - - v1.AutotuningConfig = (function() { - - /** - * Properties of an AutotuningConfig. - * @memberof google.cloud.dataproc.v1 - * @interface IAutotuningConfig - * @property {Array.|null} [scenarios] AutotuningConfig scenarios - */ - - /** - * Constructs a new AutotuningConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents an AutotuningConfig. - * @implements IAutotuningConfig - * @constructor - * @param {google.cloud.dataproc.v1.IAutotuningConfig=} [properties] Properties to set - */ - function AutotuningConfig(properties) { - this.scenarios = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AutotuningConfig scenarios. - * @member {Array.} scenarios - * @memberof google.cloud.dataproc.v1.AutotuningConfig - * @instance - */ - AutotuningConfig.prototype.scenarios = $util.emptyArray; - - /** - * Creates a new AutotuningConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.AutotuningConfig - * @static - * @param {google.cloud.dataproc.v1.IAutotuningConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.AutotuningConfig} AutotuningConfig instance - */ - AutotuningConfig.create = function create(properties) { - return new AutotuningConfig(properties); - }; - - /** - * Encodes the specified AutotuningConfig message. Does not implicitly {@link google.cloud.dataproc.v1.AutotuningConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.AutotuningConfig - * @static - * @param {google.cloud.dataproc.v1.IAutotuningConfig} message AutotuningConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutotuningConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.scenarios != null && message.scenarios.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.scenarios.length; ++i) - writer.int32(message.scenarios[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified AutotuningConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.AutotuningConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.AutotuningConfig - * @static - * @param {google.cloud.dataproc.v1.IAutotuningConfig} message AutotuningConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutotuningConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AutotuningConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.AutotuningConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.AutotuningConfig} AutotuningConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutotuningConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.AutotuningConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - if (!(message.scenarios && message.scenarios.length)) - message.scenarios = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.scenarios.push(reader.int32()); - } else - message.scenarios.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AutotuningConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.AutotuningConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.AutotuningConfig} AutotuningConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutotuningConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AutotuningConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.AutotuningConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AutotuningConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.scenarios != null && message.hasOwnProperty("scenarios")) { - if (!Array.isArray(message.scenarios)) - return "scenarios: array expected"; - for (var i = 0; i < message.scenarios.length; ++i) - switch (message.scenarios[i]) { - default: - return "scenarios: enum value[] expected"; - case 0: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - } - return null; - }; - - /** - * Creates an AutotuningConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.AutotuningConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.AutotuningConfig} AutotuningConfig - */ - AutotuningConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.AutotuningConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.AutotuningConfig(); - if (object.scenarios) { - if (!Array.isArray(object.scenarios)) - throw TypeError(".google.cloud.dataproc.v1.AutotuningConfig.scenarios: array expected"); - message.scenarios = []; - for (var i = 0; i < object.scenarios.length; ++i) - switch (object.scenarios[i]) { - default: - if (typeof object.scenarios[i] === "number") { - message.scenarios[i] = object.scenarios[i]; - break; - } - case "SCENARIO_UNSPECIFIED": - case 0: - message.scenarios[i] = 0; - break; - case "SCALING": - case 2: - message.scenarios[i] = 2; - break; - case "BROADCAST_HASH_JOIN": - case 3: - message.scenarios[i] = 3; - break; - case "MEMORY": - case 4: - message.scenarios[i] = 4; - break; - case "NONE": - case 5: - message.scenarios[i] = 5; - break; - case "AUTO": - case 6: - message.scenarios[i] = 6; - break; - } - } - return message; - }; - - /** - * Creates a plain object from an AutotuningConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.AutotuningConfig - * @static - * @param {google.cloud.dataproc.v1.AutotuningConfig} message AutotuningConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AutotuningConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.scenarios = []; - if (message.scenarios && message.scenarios.length) { - object.scenarios = []; - for (var j = 0; j < message.scenarios.length; ++j) - object.scenarios[j] = options.enums === String ? $root.google.cloud.dataproc.v1.AutotuningConfig.Scenario[message.scenarios[j]] === undefined ? message.scenarios[j] : $root.google.cloud.dataproc.v1.AutotuningConfig.Scenario[message.scenarios[j]] : message.scenarios[j]; - } - return object; - }; - - /** - * Converts this AutotuningConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.AutotuningConfig - * @instance - * @returns {Object.} JSON object - */ - AutotuningConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AutotuningConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.AutotuningConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AutotuningConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.AutotuningConfig"; - }; - - /** - * Scenario enum. - * @name google.cloud.dataproc.v1.AutotuningConfig.Scenario - * @enum {number} - * @property {number} SCENARIO_UNSPECIFIED=0 SCENARIO_UNSPECIFIED value - * @property {number} SCALING=2 SCALING value - * @property {number} BROADCAST_HASH_JOIN=3 BROADCAST_HASH_JOIN value - * @property {number} MEMORY=4 MEMORY value - * @property {number} NONE=5 NONE value - * @property {number} AUTO=6 AUTO value - */ - AutotuningConfig.Scenario = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SCENARIO_UNSPECIFIED"] = 0; - values[valuesById[2] = "SCALING"] = 2; - values[valuesById[3] = "BROADCAST_HASH_JOIN"] = 3; - values[valuesById[4] = "MEMORY"] = 4; - values[valuesById[5] = "NONE"] = 5; - values[valuesById[6] = "AUTO"] = 6; - return values; - })(); - - return AutotuningConfig; - })(); - - v1.RepositoryConfig = (function() { - - /** - * Properties of a RepositoryConfig. - * @memberof google.cloud.dataproc.v1 - * @interface IRepositoryConfig - * @property {google.cloud.dataproc.v1.IPyPiRepositoryConfig|null} [pypiRepositoryConfig] RepositoryConfig pypiRepositoryConfig - */ - - /** - * Constructs a new RepositoryConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a RepositoryConfig. - * @implements IRepositoryConfig - * @constructor - * @param {google.cloud.dataproc.v1.IRepositoryConfig=} [properties] Properties to set - */ - function RepositoryConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RepositoryConfig pypiRepositoryConfig. - * @member {google.cloud.dataproc.v1.IPyPiRepositoryConfig|null|undefined} pypiRepositoryConfig - * @memberof google.cloud.dataproc.v1.RepositoryConfig - * @instance - */ - RepositoryConfig.prototype.pypiRepositoryConfig = null; - - /** - * Creates a new RepositoryConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.RepositoryConfig - * @static - * @param {google.cloud.dataproc.v1.IRepositoryConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.RepositoryConfig} RepositoryConfig instance - */ - RepositoryConfig.create = function create(properties) { - return new RepositoryConfig(properties); - }; - - /** - * Encodes the specified RepositoryConfig message. Does not implicitly {@link google.cloud.dataproc.v1.RepositoryConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.RepositoryConfig - * @static - * @param {google.cloud.dataproc.v1.IRepositoryConfig} message RepositoryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RepositoryConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pypiRepositoryConfig != null && Object.hasOwnProperty.call(message, "pypiRepositoryConfig")) - $root.google.cloud.dataproc.v1.PyPiRepositoryConfig.encode(message.pypiRepositoryConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RepositoryConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.RepositoryConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.RepositoryConfig - * @static - * @param {google.cloud.dataproc.v1.IRepositoryConfig} message RepositoryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RepositoryConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RepositoryConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.RepositoryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.RepositoryConfig} RepositoryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RepositoryConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.RepositoryConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.pypiRepositoryConfig = $root.google.cloud.dataproc.v1.PyPiRepositoryConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RepositoryConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.RepositoryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.RepositoryConfig} RepositoryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RepositoryConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RepositoryConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.RepositoryConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RepositoryConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pypiRepositoryConfig != null && message.hasOwnProperty("pypiRepositoryConfig")) { - var error = $root.google.cloud.dataproc.v1.PyPiRepositoryConfig.verify(message.pypiRepositoryConfig); - if (error) - return "pypiRepositoryConfig." + error; - } - return null; - }; - - /** - * Creates a RepositoryConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.RepositoryConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.RepositoryConfig} RepositoryConfig - */ - RepositoryConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.RepositoryConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.RepositoryConfig(); - if (object.pypiRepositoryConfig != null) { - if (typeof object.pypiRepositoryConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.RepositoryConfig.pypiRepositoryConfig: object expected"); - message.pypiRepositoryConfig = $root.google.cloud.dataproc.v1.PyPiRepositoryConfig.fromObject(object.pypiRepositoryConfig); - } - return message; - }; - - /** - * Creates a plain object from a RepositoryConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.RepositoryConfig - * @static - * @param {google.cloud.dataproc.v1.RepositoryConfig} message RepositoryConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RepositoryConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.pypiRepositoryConfig = null; - if (message.pypiRepositoryConfig != null && message.hasOwnProperty("pypiRepositoryConfig")) - object.pypiRepositoryConfig = $root.google.cloud.dataproc.v1.PyPiRepositoryConfig.toObject(message.pypiRepositoryConfig, options); - return object; - }; - - /** - * Converts this RepositoryConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.RepositoryConfig - * @instance - * @returns {Object.} JSON object - */ - RepositoryConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RepositoryConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.RepositoryConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RepositoryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.RepositoryConfig"; - }; - - return RepositoryConfig; - })(); - - v1.PyPiRepositoryConfig = (function() { - - /** - * Properties of a PyPiRepositoryConfig. - * @memberof google.cloud.dataproc.v1 - * @interface IPyPiRepositoryConfig - * @property {string|null} [pypiRepository] PyPiRepositoryConfig pypiRepository - */ - - /** - * Constructs a new PyPiRepositoryConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a PyPiRepositoryConfig. - * @implements IPyPiRepositoryConfig - * @constructor - * @param {google.cloud.dataproc.v1.IPyPiRepositoryConfig=} [properties] Properties to set - */ - function PyPiRepositoryConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PyPiRepositoryConfig pypiRepository. - * @member {string} pypiRepository - * @memberof google.cloud.dataproc.v1.PyPiRepositoryConfig - * @instance - */ - PyPiRepositoryConfig.prototype.pypiRepository = ""; - - /** - * Creates a new PyPiRepositoryConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.PyPiRepositoryConfig - * @static - * @param {google.cloud.dataproc.v1.IPyPiRepositoryConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.PyPiRepositoryConfig} PyPiRepositoryConfig instance - */ - PyPiRepositoryConfig.create = function create(properties) { - return new PyPiRepositoryConfig(properties); - }; - - /** - * Encodes the specified PyPiRepositoryConfig message. Does not implicitly {@link google.cloud.dataproc.v1.PyPiRepositoryConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.PyPiRepositoryConfig - * @static - * @param {google.cloud.dataproc.v1.IPyPiRepositoryConfig} message PyPiRepositoryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PyPiRepositoryConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.pypiRepository != null && Object.hasOwnProperty.call(message, "pypiRepository")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.pypiRepository); - return writer; - }; - - /** - * Encodes the specified PyPiRepositoryConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.PyPiRepositoryConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.PyPiRepositoryConfig - * @static - * @param {google.cloud.dataproc.v1.IPyPiRepositoryConfig} message PyPiRepositoryConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PyPiRepositoryConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PyPiRepositoryConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.PyPiRepositoryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.PyPiRepositoryConfig} PyPiRepositoryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PyPiRepositoryConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.PyPiRepositoryConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.pypiRepository = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PyPiRepositoryConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.PyPiRepositoryConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.PyPiRepositoryConfig} PyPiRepositoryConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PyPiRepositoryConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PyPiRepositoryConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.PyPiRepositoryConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PyPiRepositoryConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.pypiRepository != null && message.hasOwnProperty("pypiRepository")) - if (!$util.isString(message.pypiRepository)) - return "pypiRepository: string expected"; - return null; - }; - - /** - * Creates a PyPiRepositoryConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.PyPiRepositoryConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.PyPiRepositoryConfig} PyPiRepositoryConfig - */ - PyPiRepositoryConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.PyPiRepositoryConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.PyPiRepositoryConfig(); - if (object.pypiRepository != null) - message.pypiRepository = String(object.pypiRepository); - return message; - }; - - /** - * Creates a plain object from a PyPiRepositoryConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.PyPiRepositoryConfig - * @static - * @param {google.cloud.dataproc.v1.PyPiRepositoryConfig} message PyPiRepositoryConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PyPiRepositoryConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.pypiRepository = ""; - if (message.pypiRepository != null && message.hasOwnProperty("pypiRepository")) - object.pypiRepository = message.pypiRepository; - return object; - }; - - /** - * Converts this PyPiRepositoryConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.PyPiRepositoryConfig - * @instance - * @returns {Object.} JSON object - */ - PyPiRepositoryConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PyPiRepositoryConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.PyPiRepositoryConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PyPiRepositoryConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.PyPiRepositoryConfig"; - }; - - return PyPiRepositoryConfig; - })(); - - /** - * Component enum. - * @name google.cloud.dataproc.v1.Component - * @enum {number} - * @property {number} COMPONENT_UNSPECIFIED=0 COMPONENT_UNSPECIFIED value - * @property {number} ANACONDA=5 ANACONDA value - * @property {number} DELTA=20 DELTA value - * @property {number} DOCKER=13 DOCKER value - * @property {number} DRUID=9 DRUID value - * @property {number} FLINK=14 FLINK value - * @property {number} HBASE=11 HBASE value - * @property {number} HIVE_WEBHCAT=3 HIVE_WEBHCAT value - * @property {number} HUDI=18 HUDI value - * @property {number} ICEBERG=19 ICEBERG value - * @property {number} JUPYTER=1 JUPYTER value - * @property {number} JUPYTER_KERNEL_GATEWAY=22 JUPYTER_KERNEL_GATEWAY value - * @property {number} PIG=21 PIG value - * @property {number} PRESTO=6 PRESTO value - * @property {number} TRINO=17 TRINO value - * @property {number} RANGER=12 RANGER value - * @property {number} SOLR=10 SOLR value - * @property {number} ZEPPELIN=4 ZEPPELIN value - * @property {number} ZOOKEEPER=8 ZOOKEEPER value - */ - v1.Component = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "COMPONENT_UNSPECIFIED"] = 0; - values[valuesById[5] = "ANACONDA"] = 5; - values[valuesById[20] = "DELTA"] = 20; - values[valuesById[13] = "DOCKER"] = 13; - values[valuesById[9] = "DRUID"] = 9; - values[valuesById[14] = "FLINK"] = 14; - values[valuesById[11] = "HBASE"] = 11; - values[valuesById[3] = "HIVE_WEBHCAT"] = 3; - values[valuesById[18] = "HUDI"] = 18; - values[valuesById[19] = "ICEBERG"] = 19; - values[valuesById[1] = "JUPYTER"] = 1; - values[valuesById[22] = "JUPYTER_KERNEL_GATEWAY"] = 22; - values[valuesById[21] = "PIG"] = 21; - values[valuesById[6] = "PRESTO"] = 6; - values[valuesById[17] = "TRINO"] = 17; - values[valuesById[12] = "RANGER"] = 12; - values[valuesById[10] = "SOLR"] = 10; - values[valuesById[4] = "ZEPPELIN"] = 4; - values[valuesById[8] = "ZOOKEEPER"] = 8; - return values; - })(); - - /** - * FailureAction enum. - * @name google.cloud.dataproc.v1.FailureAction - * @enum {number} - * @property {number} FAILURE_ACTION_UNSPECIFIED=0 FAILURE_ACTION_UNSPECIFIED value - * @property {number} NO_ACTION=1 NO_ACTION value - * @property {number} DELETE=2 DELETE value - */ - v1.FailureAction = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FAILURE_ACTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "NO_ACTION"] = 1; - values[valuesById[2] = "DELETE"] = 2; - return values; - })(); - - v1.ClusterController = (function() { - - /** - * Constructs a new ClusterController service. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a ClusterController - * @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 ClusterController(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (ClusterController.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ClusterController; - - /** - * Creates new ClusterController service using the specified rpc implementation. - * @function create - * @memberof google.cloud.dataproc.v1.ClusterController - * @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 {ClusterController} RPC service. Useful where requests and/or responses are streamed. - */ - ClusterController.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.ClusterController|createCluster}. - * @memberof google.cloud.dataproc.v1.ClusterController - * @typedef CreateClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateCluster. - * @function createCluster - * @memberof google.cloud.dataproc.v1.ClusterController - * @instance - * @param {google.cloud.dataproc.v1.ICreateClusterRequest} request CreateClusterRequest message or plain object - * @param {google.cloud.dataproc.v1.ClusterController.CreateClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ClusterController.prototype.createCluster = function createCluster(request, callback) { - return this.rpcCall(createCluster, $root.google.cloud.dataproc.v1.CreateClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateCluster" }); - - /** - * Calls CreateCluster. - * @function createCluster - * @memberof google.cloud.dataproc.v1.ClusterController - * @instance - * @param {google.cloud.dataproc.v1.ICreateClusterRequest} request CreateClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.ClusterController|updateCluster}. - * @memberof google.cloud.dataproc.v1.ClusterController - * @typedef UpdateClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateCluster. - * @function updateCluster - * @memberof google.cloud.dataproc.v1.ClusterController - * @instance - * @param {google.cloud.dataproc.v1.IUpdateClusterRequest} request UpdateClusterRequest message or plain object - * @param {google.cloud.dataproc.v1.ClusterController.UpdateClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ClusterController.prototype.updateCluster = function updateCluster(request, callback) { - return this.rpcCall(updateCluster, $root.google.cloud.dataproc.v1.UpdateClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateCluster" }); - - /** - * Calls UpdateCluster. - * @function updateCluster - * @memberof google.cloud.dataproc.v1.ClusterController - * @instance - * @param {google.cloud.dataproc.v1.IUpdateClusterRequest} request UpdateClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.ClusterController|stopCluster}. - * @memberof google.cloud.dataproc.v1.ClusterController - * @typedef StopClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls StopCluster. - * @function stopCluster - * @memberof google.cloud.dataproc.v1.ClusterController - * @instance - * @param {google.cloud.dataproc.v1.IStopClusterRequest} request StopClusterRequest message or plain object - * @param {google.cloud.dataproc.v1.ClusterController.StopClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ClusterController.prototype.stopCluster = function stopCluster(request, callback) { - return this.rpcCall(stopCluster, $root.google.cloud.dataproc.v1.StopClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "StopCluster" }); - - /** - * Calls StopCluster. - * @function stopCluster - * @memberof google.cloud.dataproc.v1.ClusterController - * @instance - * @param {google.cloud.dataproc.v1.IStopClusterRequest} request StopClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.ClusterController|startCluster}. - * @memberof google.cloud.dataproc.v1.ClusterController - * @typedef StartClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls StartCluster. - * @function startCluster - * @memberof google.cloud.dataproc.v1.ClusterController - * @instance - * @param {google.cloud.dataproc.v1.IStartClusterRequest} request StartClusterRequest message or plain object - * @param {google.cloud.dataproc.v1.ClusterController.StartClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ClusterController.prototype.startCluster = function startCluster(request, callback) { - return this.rpcCall(startCluster, $root.google.cloud.dataproc.v1.StartClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "StartCluster" }); - - /** - * Calls StartCluster. - * @function startCluster - * @memberof google.cloud.dataproc.v1.ClusterController - * @instance - * @param {google.cloud.dataproc.v1.IStartClusterRequest} request StartClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.ClusterController|deleteCluster}. - * @memberof google.cloud.dataproc.v1.ClusterController - * @typedef DeleteClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteCluster. - * @function deleteCluster - * @memberof google.cloud.dataproc.v1.ClusterController - * @instance - * @param {google.cloud.dataproc.v1.IDeleteClusterRequest} request DeleteClusterRequest message or plain object - * @param {google.cloud.dataproc.v1.ClusterController.DeleteClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ClusterController.prototype.deleteCluster = function deleteCluster(request, callback) { - return this.rpcCall(deleteCluster, $root.google.cloud.dataproc.v1.DeleteClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteCluster" }); - - /** - * Calls DeleteCluster. - * @function deleteCluster - * @memberof google.cloud.dataproc.v1.ClusterController - * @instance - * @param {google.cloud.dataproc.v1.IDeleteClusterRequest} request DeleteClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.ClusterController|getCluster}. - * @memberof google.cloud.dataproc.v1.ClusterController - * @typedef GetClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dataproc.v1.Cluster} [response] Cluster - */ - - /** - * Calls GetCluster. - * @function getCluster - * @memberof google.cloud.dataproc.v1.ClusterController - * @instance - * @param {google.cloud.dataproc.v1.IGetClusterRequest} request GetClusterRequest message or plain object - * @param {google.cloud.dataproc.v1.ClusterController.GetClusterCallback} callback Node-style callback called with the error, if any, and Cluster - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ClusterController.prototype.getCluster = function getCluster(request, callback) { - return this.rpcCall(getCluster, $root.google.cloud.dataproc.v1.GetClusterRequest, $root.google.cloud.dataproc.v1.Cluster, request, callback); - }, "name", { value: "GetCluster" }); - - /** - * Calls GetCluster. - * @function getCluster - * @memberof google.cloud.dataproc.v1.ClusterController - * @instance - * @param {google.cloud.dataproc.v1.IGetClusterRequest} request GetClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.ClusterController|listClusters}. - * @memberof google.cloud.dataproc.v1.ClusterController - * @typedef ListClustersCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dataproc.v1.ListClustersResponse} [response] ListClustersResponse - */ - - /** - * Calls ListClusters. - * @function listClusters - * @memberof google.cloud.dataproc.v1.ClusterController - * @instance - * @param {google.cloud.dataproc.v1.IListClustersRequest} request ListClustersRequest message or plain object - * @param {google.cloud.dataproc.v1.ClusterController.ListClustersCallback} callback Node-style callback called with the error, if any, and ListClustersResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ClusterController.prototype.listClusters = function listClusters(request, callback) { - return this.rpcCall(listClusters, $root.google.cloud.dataproc.v1.ListClustersRequest, $root.google.cloud.dataproc.v1.ListClustersResponse, request, callback); - }, "name", { value: "ListClusters" }); - - /** - * Calls ListClusters. - * @function listClusters - * @memberof google.cloud.dataproc.v1.ClusterController - * @instance - * @param {google.cloud.dataproc.v1.IListClustersRequest} request ListClustersRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.ClusterController|diagnoseCluster}. - * @memberof google.cloud.dataproc.v1.ClusterController - * @typedef DiagnoseClusterCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DiagnoseCluster. - * @function diagnoseCluster - * @memberof google.cloud.dataproc.v1.ClusterController - * @instance - * @param {google.cloud.dataproc.v1.IDiagnoseClusterRequest} request DiagnoseClusterRequest message or plain object - * @param {google.cloud.dataproc.v1.ClusterController.DiagnoseClusterCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ClusterController.prototype.diagnoseCluster = function diagnoseCluster(request, callback) { - return this.rpcCall(diagnoseCluster, $root.google.cloud.dataproc.v1.DiagnoseClusterRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DiagnoseCluster" }); - - /** - * Calls DiagnoseCluster. - * @function diagnoseCluster - * @memberof google.cloud.dataproc.v1.ClusterController - * @instance - * @param {google.cloud.dataproc.v1.IDiagnoseClusterRequest} request DiagnoseClusterRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return ClusterController; - })(); - - v1.Cluster = (function() { - - /** - * Properties of a Cluster. - * @memberof google.cloud.dataproc.v1 - * @interface ICluster - * @property {string|null} [projectId] Cluster projectId - * @property {string|null} [clusterName] Cluster clusterName - * @property {google.cloud.dataproc.v1.IClusterConfig|null} [config] Cluster config - * @property {google.cloud.dataproc.v1.IVirtualClusterConfig|null} [virtualClusterConfig] Cluster virtualClusterConfig - * @property {Object.|null} [labels] Cluster labels - * @property {google.cloud.dataproc.v1.IClusterStatus|null} [status] Cluster status - * @property {Array.|null} [statusHistory] Cluster statusHistory - * @property {string|null} [clusterUuid] Cluster clusterUuid - * @property {google.cloud.dataproc.v1.IClusterMetrics|null} [metrics] Cluster metrics - */ - - /** - * Constructs a new Cluster. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a Cluster. - * @implements ICluster - * @constructor - * @param {google.cloud.dataproc.v1.ICluster=} [properties] Properties to set - */ - function Cluster(properties) { - this.labels = {}; - this.statusHistory = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Cluster projectId. - * @member {string} projectId - * @memberof google.cloud.dataproc.v1.Cluster - * @instance - */ - Cluster.prototype.projectId = ""; - - /** - * Cluster clusterName. - * @member {string} clusterName - * @memberof google.cloud.dataproc.v1.Cluster - * @instance - */ - Cluster.prototype.clusterName = ""; - - /** - * Cluster config. - * @member {google.cloud.dataproc.v1.IClusterConfig|null|undefined} config - * @memberof google.cloud.dataproc.v1.Cluster - * @instance - */ - Cluster.prototype.config = null; - - /** - * Cluster virtualClusterConfig. - * @member {google.cloud.dataproc.v1.IVirtualClusterConfig|null|undefined} virtualClusterConfig - * @memberof google.cloud.dataproc.v1.Cluster - * @instance - */ - Cluster.prototype.virtualClusterConfig = null; - - /** - * Cluster labels. - * @member {Object.} labels - * @memberof google.cloud.dataproc.v1.Cluster - * @instance - */ - Cluster.prototype.labels = $util.emptyObject; - - /** - * Cluster status. - * @member {google.cloud.dataproc.v1.IClusterStatus|null|undefined} status - * @memberof google.cloud.dataproc.v1.Cluster - * @instance - */ - Cluster.prototype.status = null; - - /** - * Cluster statusHistory. - * @member {Array.} statusHistory - * @memberof google.cloud.dataproc.v1.Cluster - * @instance - */ - Cluster.prototype.statusHistory = $util.emptyArray; - - /** - * Cluster clusterUuid. - * @member {string} clusterUuid - * @memberof google.cloud.dataproc.v1.Cluster - * @instance - */ - Cluster.prototype.clusterUuid = ""; - - /** - * Cluster metrics. - * @member {google.cloud.dataproc.v1.IClusterMetrics|null|undefined} metrics - * @memberof google.cloud.dataproc.v1.Cluster - * @instance - */ - Cluster.prototype.metrics = null; - - /** - * Creates a new Cluster instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.Cluster - * @static - * @param {google.cloud.dataproc.v1.ICluster=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.Cluster} Cluster instance - */ - Cluster.create = function create(properties) { - return new Cluster(properties); - }; - - /** - * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.dataproc.v1.Cluster.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.Cluster - * @static - * @param {google.cloud.dataproc.v1.ICluster} message Cluster message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Cluster.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterName); - if (message.config != null && Object.hasOwnProperty.call(message, "config")) - $root.google.cloud.dataproc.v1.ClusterConfig.encode(message.config, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.cloud.dataproc.v1.ClusterStatus.encode(message.status, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.clusterUuid != null && Object.hasOwnProperty.call(message, "clusterUuid")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.clusterUuid); - if (message.statusHistory != null && message.statusHistory.length) - for (var i = 0; i < message.statusHistory.length; ++i) - $root.google.cloud.dataproc.v1.ClusterStatus.encode(message.statusHistory[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.metrics != null && Object.hasOwnProperty.call(message, "metrics")) - $root.google.cloud.dataproc.v1.ClusterMetrics.encode(message.metrics, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.virtualClusterConfig != null && Object.hasOwnProperty.call(message, "virtualClusterConfig")) - $root.google.cloud.dataproc.v1.VirtualClusterConfig.encode(message.virtualClusterConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.Cluster.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.Cluster - * @static - * @param {google.cloud.dataproc.v1.ICluster} message Cluster message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Cluster.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Cluster message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.Cluster - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.Cluster} Cluster - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Cluster.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.Cluster(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.projectId = reader.string(); - break; - } - case 2: { - message.clusterName = reader.string(); - break; - } - case 3: { - message.config = $root.google.cloud.dataproc.v1.ClusterConfig.decode(reader, reader.uint32()); - break; - } - case 10: { - message.virtualClusterConfig = $root.google.cloud.dataproc.v1.VirtualClusterConfig.decode(reader, reader.uint32()); - break; - } - case 8: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 4: { - message.status = $root.google.cloud.dataproc.v1.ClusterStatus.decode(reader, reader.uint32()); - break; - } - case 7: { - if (!(message.statusHistory && message.statusHistory.length)) - message.statusHistory = []; - message.statusHistory.push($root.google.cloud.dataproc.v1.ClusterStatus.decode(reader, reader.uint32())); - break; - } - case 6: { - message.clusterUuid = reader.string(); - break; - } - case 9: { - message.metrics = $root.google.cloud.dataproc.v1.ClusterMetrics.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Cluster message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.Cluster - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.Cluster} Cluster - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Cluster.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Cluster message. - * @function verify - * @memberof google.cloud.dataproc.v1.Cluster - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Cluster.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - if (!$util.isString(message.clusterName)) - return "clusterName: string expected"; - if (message.config != null && message.hasOwnProperty("config")) { - var error = $root.google.cloud.dataproc.v1.ClusterConfig.verify(message.config); - if (error) - return "config." + error; - } - if (message.virtualClusterConfig != null && message.hasOwnProperty("virtualClusterConfig")) { - var error = $root.google.cloud.dataproc.v1.VirtualClusterConfig.verify(message.virtualClusterConfig); - if (error) - return "virtualClusterConfig." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.google.cloud.dataproc.v1.ClusterStatus.verify(message.status); - if (error) - return "status." + error; - } - if (message.statusHistory != null && message.hasOwnProperty("statusHistory")) { - if (!Array.isArray(message.statusHistory)) - return "statusHistory: array expected"; - for (var i = 0; i < message.statusHistory.length; ++i) { - var error = $root.google.cloud.dataproc.v1.ClusterStatus.verify(message.statusHistory[i]); - if (error) - return "statusHistory." + error; - } - } - if (message.clusterUuid != null && message.hasOwnProperty("clusterUuid")) - if (!$util.isString(message.clusterUuid)) - return "clusterUuid: string expected"; - if (message.metrics != null && message.hasOwnProperty("metrics")) { - var error = $root.google.cloud.dataproc.v1.ClusterMetrics.verify(message.metrics); - if (error) - return "metrics." + error; - } - return null; - }; - - /** - * Creates a Cluster message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.Cluster - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.Cluster} Cluster - */ - Cluster.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.Cluster) - return object; - var message = new $root.google.cloud.dataproc.v1.Cluster(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.clusterName != null) - message.clusterName = String(object.clusterName); - if (object.config != null) { - if (typeof object.config !== "object") - throw TypeError(".google.cloud.dataproc.v1.Cluster.config: object expected"); - message.config = $root.google.cloud.dataproc.v1.ClusterConfig.fromObject(object.config); - } - if (object.virtualClusterConfig != null) { - if (typeof object.virtualClusterConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.Cluster.virtualClusterConfig: object expected"); - message.virtualClusterConfig = $root.google.cloud.dataproc.v1.VirtualClusterConfig.fromObject(object.virtualClusterConfig); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.dataproc.v1.Cluster.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.cloud.dataproc.v1.Cluster.status: object expected"); - message.status = $root.google.cloud.dataproc.v1.ClusterStatus.fromObject(object.status); - } - if (object.statusHistory) { - if (!Array.isArray(object.statusHistory)) - throw TypeError(".google.cloud.dataproc.v1.Cluster.statusHistory: array expected"); - message.statusHistory = []; - for (var i = 0; i < object.statusHistory.length; ++i) { - if (typeof object.statusHistory[i] !== "object") - throw TypeError(".google.cloud.dataproc.v1.Cluster.statusHistory: object expected"); - message.statusHistory[i] = $root.google.cloud.dataproc.v1.ClusterStatus.fromObject(object.statusHistory[i]); - } - } - if (object.clusterUuid != null) - message.clusterUuid = String(object.clusterUuid); - if (object.metrics != null) { - if (typeof object.metrics !== "object") - throw TypeError(".google.cloud.dataproc.v1.Cluster.metrics: object expected"); - message.metrics = $root.google.cloud.dataproc.v1.ClusterMetrics.fromObject(object.metrics); - } - return message; - }; - - /** - * Creates a plain object from a Cluster message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.Cluster - * @static - * @param {google.cloud.dataproc.v1.Cluster} message Cluster - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Cluster.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.statusHistory = []; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.projectId = ""; - object.clusterName = ""; - object.config = null; - object.status = null; - object.clusterUuid = ""; - object.metrics = null; - object.virtualClusterConfig = null; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - object.clusterName = message.clusterName; - if (message.config != null && message.hasOwnProperty("config")) - object.config = $root.google.cloud.dataproc.v1.ClusterConfig.toObject(message.config, options); - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.cloud.dataproc.v1.ClusterStatus.toObject(message.status, options); - if (message.clusterUuid != null && message.hasOwnProperty("clusterUuid")) - object.clusterUuid = message.clusterUuid; - if (message.statusHistory && message.statusHistory.length) { - object.statusHistory = []; - for (var j = 0; j < message.statusHistory.length; ++j) - object.statusHistory[j] = $root.google.cloud.dataproc.v1.ClusterStatus.toObject(message.statusHistory[j], options); - } - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.metrics != null && message.hasOwnProperty("metrics")) - object.metrics = $root.google.cloud.dataproc.v1.ClusterMetrics.toObject(message.metrics, options); - if (message.virtualClusterConfig != null && message.hasOwnProperty("virtualClusterConfig")) - object.virtualClusterConfig = $root.google.cloud.dataproc.v1.VirtualClusterConfig.toObject(message.virtualClusterConfig, options); - return object; - }; - - /** - * Converts this Cluster to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.Cluster - * @instance - * @returns {Object.} JSON object - */ - Cluster.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Cluster - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.Cluster - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Cluster.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.Cluster"; - }; - - return Cluster; - })(); - - v1.ClusterConfig = (function() { - - /** - * Properties of a ClusterConfig. - * @memberof google.cloud.dataproc.v1 - * @interface IClusterConfig - * @property {google.cloud.dataproc.v1.ClusterConfig.ClusterType|null} [clusterType] ClusterConfig clusterType - * @property {google.cloud.dataproc.v1.ClusterConfig.ClusterTier|null} [clusterTier] ClusterConfig clusterTier - * @property {google.cloud.dataproc.v1.ClusterConfig.Engine|null} [engine] ClusterConfig engine - * @property {string|null} [configBucket] ClusterConfig configBucket - * @property {string|null} [tempBucket] ClusterConfig tempBucket - * @property {google.cloud.dataproc.v1.IGceClusterConfig|null} [gceClusterConfig] ClusterConfig gceClusterConfig - * @property {google.cloud.dataproc.v1.IInstanceGroupConfig|null} [masterConfig] ClusterConfig masterConfig - * @property {google.cloud.dataproc.v1.IInstanceGroupConfig|null} [workerConfig] ClusterConfig workerConfig - * @property {google.cloud.dataproc.v1.IInstanceGroupConfig|null} [secondaryWorkerConfig] ClusterConfig secondaryWorkerConfig - * @property {google.cloud.dataproc.v1.ISoftwareConfig|null} [softwareConfig] ClusterConfig softwareConfig - * @property {Array.|null} [initializationActions] ClusterConfig initializationActions - * @property {google.cloud.dataproc.v1.IEncryptionConfig|null} [encryptionConfig] ClusterConfig encryptionConfig - * @property {google.cloud.dataproc.v1.IAutoscalingConfig|null} [autoscalingConfig] ClusterConfig autoscalingConfig - * @property {google.cloud.dataproc.v1.ISecurityConfig|null} [securityConfig] ClusterConfig securityConfig - * @property {google.cloud.dataproc.v1.ILifecycleConfig|null} [lifecycleConfig] ClusterConfig lifecycleConfig - * @property {google.cloud.dataproc.v1.IEndpointConfig|null} [endpointConfig] ClusterConfig endpointConfig - * @property {google.cloud.dataproc.v1.IMetastoreConfig|null} [metastoreConfig] ClusterConfig metastoreConfig - * @property {google.cloud.dataproc.v1.IDataprocMetricConfig|null} [dataprocMetricConfig] ClusterConfig dataprocMetricConfig - * @property {Array.|null} [auxiliaryNodeGroups] ClusterConfig auxiliaryNodeGroups - */ - - /** - * Constructs a new ClusterConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a ClusterConfig. - * @implements IClusterConfig - * @constructor - * @param {google.cloud.dataproc.v1.IClusterConfig=} [properties] Properties to set - */ - function ClusterConfig(properties) { - this.initializationActions = []; - this.auxiliaryNodeGroups = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClusterConfig clusterType. - * @member {google.cloud.dataproc.v1.ClusterConfig.ClusterType} clusterType - * @memberof google.cloud.dataproc.v1.ClusterConfig - * @instance - */ - ClusterConfig.prototype.clusterType = 0; - - /** - * ClusterConfig clusterTier. - * @member {google.cloud.dataproc.v1.ClusterConfig.ClusterTier} clusterTier - * @memberof google.cloud.dataproc.v1.ClusterConfig - * @instance - */ - ClusterConfig.prototype.clusterTier = 0; - - /** - * ClusterConfig engine. - * @member {google.cloud.dataproc.v1.ClusterConfig.Engine} engine - * @memberof google.cloud.dataproc.v1.ClusterConfig - * @instance - */ - ClusterConfig.prototype.engine = 0; - - /** - * ClusterConfig configBucket. - * @member {string} configBucket - * @memberof google.cloud.dataproc.v1.ClusterConfig - * @instance - */ - ClusterConfig.prototype.configBucket = ""; - - /** - * ClusterConfig tempBucket. - * @member {string} tempBucket - * @memberof google.cloud.dataproc.v1.ClusterConfig - * @instance - */ - ClusterConfig.prototype.tempBucket = ""; - - /** - * ClusterConfig gceClusterConfig. - * @member {google.cloud.dataproc.v1.IGceClusterConfig|null|undefined} gceClusterConfig - * @memberof google.cloud.dataproc.v1.ClusterConfig - * @instance - */ - ClusterConfig.prototype.gceClusterConfig = null; - - /** - * ClusterConfig masterConfig. - * @member {google.cloud.dataproc.v1.IInstanceGroupConfig|null|undefined} masterConfig - * @memberof google.cloud.dataproc.v1.ClusterConfig - * @instance - */ - ClusterConfig.prototype.masterConfig = null; - - /** - * ClusterConfig workerConfig. - * @member {google.cloud.dataproc.v1.IInstanceGroupConfig|null|undefined} workerConfig - * @memberof google.cloud.dataproc.v1.ClusterConfig - * @instance - */ - ClusterConfig.prototype.workerConfig = null; - - /** - * ClusterConfig secondaryWorkerConfig. - * @member {google.cloud.dataproc.v1.IInstanceGroupConfig|null|undefined} secondaryWorkerConfig - * @memberof google.cloud.dataproc.v1.ClusterConfig - * @instance - */ - ClusterConfig.prototype.secondaryWorkerConfig = null; - - /** - * ClusterConfig softwareConfig. - * @member {google.cloud.dataproc.v1.ISoftwareConfig|null|undefined} softwareConfig - * @memberof google.cloud.dataproc.v1.ClusterConfig - * @instance - */ - ClusterConfig.prototype.softwareConfig = null; - - /** - * ClusterConfig initializationActions. - * @member {Array.} initializationActions - * @memberof google.cloud.dataproc.v1.ClusterConfig - * @instance - */ - ClusterConfig.prototype.initializationActions = $util.emptyArray; - - /** - * ClusterConfig encryptionConfig. - * @member {google.cloud.dataproc.v1.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.cloud.dataproc.v1.ClusterConfig - * @instance - */ - ClusterConfig.prototype.encryptionConfig = null; - - /** - * ClusterConfig autoscalingConfig. - * @member {google.cloud.dataproc.v1.IAutoscalingConfig|null|undefined} autoscalingConfig - * @memberof google.cloud.dataproc.v1.ClusterConfig - * @instance - */ - ClusterConfig.prototype.autoscalingConfig = null; - - /** - * ClusterConfig securityConfig. - * @member {google.cloud.dataproc.v1.ISecurityConfig|null|undefined} securityConfig - * @memberof google.cloud.dataproc.v1.ClusterConfig - * @instance - */ - ClusterConfig.prototype.securityConfig = null; - - /** - * ClusterConfig lifecycleConfig. - * @member {google.cloud.dataproc.v1.ILifecycleConfig|null|undefined} lifecycleConfig - * @memberof google.cloud.dataproc.v1.ClusterConfig - * @instance - */ - ClusterConfig.prototype.lifecycleConfig = null; - - /** - * ClusterConfig endpointConfig. - * @member {google.cloud.dataproc.v1.IEndpointConfig|null|undefined} endpointConfig - * @memberof google.cloud.dataproc.v1.ClusterConfig - * @instance - */ - ClusterConfig.prototype.endpointConfig = null; - - /** - * ClusterConfig metastoreConfig. - * @member {google.cloud.dataproc.v1.IMetastoreConfig|null|undefined} metastoreConfig - * @memberof google.cloud.dataproc.v1.ClusterConfig - * @instance - */ - ClusterConfig.prototype.metastoreConfig = null; - - /** - * ClusterConfig dataprocMetricConfig. - * @member {google.cloud.dataproc.v1.IDataprocMetricConfig|null|undefined} dataprocMetricConfig - * @memberof google.cloud.dataproc.v1.ClusterConfig - * @instance - */ - ClusterConfig.prototype.dataprocMetricConfig = null; - - /** - * ClusterConfig auxiliaryNodeGroups. - * @member {Array.} auxiliaryNodeGroups - * @memberof google.cloud.dataproc.v1.ClusterConfig - * @instance - */ - ClusterConfig.prototype.auxiliaryNodeGroups = $util.emptyArray; - - /** - * Creates a new ClusterConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.ClusterConfig - * @static - * @param {google.cloud.dataproc.v1.IClusterConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.ClusterConfig} ClusterConfig instance - */ - ClusterConfig.create = function create(properties) { - return new ClusterConfig(properties); - }; - - /** - * Encodes the specified ClusterConfig message. Does not implicitly {@link google.cloud.dataproc.v1.ClusterConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.ClusterConfig - * @static - * @param {google.cloud.dataproc.v1.IClusterConfig} message ClusterConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClusterConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.configBucket != null && Object.hasOwnProperty.call(message, "configBucket")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.configBucket); - if (message.tempBucket != null && Object.hasOwnProperty.call(message, "tempBucket")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.tempBucket); - if (message.gceClusterConfig != null && Object.hasOwnProperty.call(message, "gceClusterConfig")) - $root.google.cloud.dataproc.v1.GceClusterConfig.encode(message.gceClusterConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.masterConfig != null && Object.hasOwnProperty.call(message, "masterConfig")) - $root.google.cloud.dataproc.v1.InstanceGroupConfig.encode(message.masterConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.workerConfig != null && Object.hasOwnProperty.call(message, "workerConfig")) - $root.google.cloud.dataproc.v1.InstanceGroupConfig.encode(message.workerConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.initializationActions != null && message.initializationActions.length) - for (var i = 0; i < message.initializationActions.length; ++i) - $root.google.cloud.dataproc.v1.NodeInitializationAction.encode(message.initializationActions[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.secondaryWorkerConfig != null && Object.hasOwnProperty.call(message, "secondaryWorkerConfig")) - $root.google.cloud.dataproc.v1.InstanceGroupConfig.encode(message.secondaryWorkerConfig, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.softwareConfig != null && Object.hasOwnProperty.call(message, "softwareConfig")) - $root.google.cloud.dataproc.v1.SoftwareConfig.encode(message.softwareConfig, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.cloud.dataproc.v1.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.securityConfig != null && Object.hasOwnProperty.call(message, "securityConfig")) - $root.google.cloud.dataproc.v1.SecurityConfig.encode(message.securityConfig, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); - if (message.lifecycleConfig != null && Object.hasOwnProperty.call(message, "lifecycleConfig")) - $root.google.cloud.dataproc.v1.LifecycleConfig.encode(message.lifecycleConfig, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.autoscalingConfig != null && Object.hasOwnProperty.call(message, "autoscalingConfig")) - $root.google.cloud.dataproc.v1.AutoscalingConfig.encode(message.autoscalingConfig, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.endpointConfig != null && Object.hasOwnProperty.call(message, "endpointConfig")) - $root.google.cloud.dataproc.v1.EndpointConfig.encode(message.endpointConfig, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.metastoreConfig != null && Object.hasOwnProperty.call(message, "metastoreConfig")) - $root.google.cloud.dataproc.v1.MetastoreConfig.encode(message.metastoreConfig, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.dataprocMetricConfig != null && Object.hasOwnProperty.call(message, "dataprocMetricConfig")) - $root.google.cloud.dataproc.v1.DataprocMetricConfig.encode(message.dataprocMetricConfig, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.auxiliaryNodeGroups != null && message.auxiliaryNodeGroups.length) - for (var i = 0; i < message.auxiliaryNodeGroups.length; ++i) - $root.google.cloud.dataproc.v1.AuxiliaryNodeGroup.encode(message.auxiliaryNodeGroups[i], writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - if (message.clusterType != null && Object.hasOwnProperty.call(message, "clusterType")) - writer.uint32(/* id 27, wireType 0 =*/216).int32(message.clusterType); - if (message.clusterTier != null && Object.hasOwnProperty.call(message, "clusterTier")) - writer.uint32(/* id 29, wireType 0 =*/232).int32(message.clusterTier); - if (message.engine != null && Object.hasOwnProperty.call(message, "engine")) - writer.uint32(/* id 30, wireType 0 =*/240).int32(message.engine); - return writer; - }; - - /** - * Encodes the specified ClusterConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ClusterConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.ClusterConfig - * @static - * @param {google.cloud.dataproc.v1.IClusterConfig} message ClusterConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClusterConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClusterConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.ClusterConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.ClusterConfig} ClusterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClusterConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ClusterConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 27: { - message.clusterType = reader.int32(); - break; - } - case 29: { - message.clusterTier = reader.int32(); - break; - } - case 30: { - message.engine = reader.int32(); - break; - } - case 1: { - message.configBucket = reader.string(); - break; - } - case 2: { - message.tempBucket = reader.string(); - break; - } - case 8: { - message.gceClusterConfig = $root.google.cloud.dataproc.v1.GceClusterConfig.decode(reader, reader.uint32()); - break; - } - case 9: { - message.masterConfig = $root.google.cloud.dataproc.v1.InstanceGroupConfig.decode(reader, reader.uint32()); - break; - } - case 10: { - message.workerConfig = $root.google.cloud.dataproc.v1.InstanceGroupConfig.decode(reader, reader.uint32()); - break; - } - case 12: { - message.secondaryWorkerConfig = $root.google.cloud.dataproc.v1.InstanceGroupConfig.decode(reader, reader.uint32()); - break; - } - case 13: { - message.softwareConfig = $root.google.cloud.dataproc.v1.SoftwareConfig.decode(reader, reader.uint32()); - break; - } - case 11: { - if (!(message.initializationActions && message.initializationActions.length)) - message.initializationActions = []; - message.initializationActions.push($root.google.cloud.dataproc.v1.NodeInitializationAction.decode(reader, reader.uint32())); - break; - } - case 15: { - message.encryptionConfig = $root.google.cloud.dataproc.v1.EncryptionConfig.decode(reader, reader.uint32()); - break; - } - case 18: { - message.autoscalingConfig = $root.google.cloud.dataproc.v1.AutoscalingConfig.decode(reader, reader.uint32()); - break; - } - case 16: { - message.securityConfig = $root.google.cloud.dataproc.v1.SecurityConfig.decode(reader, reader.uint32()); - break; - } - case 17: { - message.lifecycleConfig = $root.google.cloud.dataproc.v1.LifecycleConfig.decode(reader, reader.uint32()); - break; - } - case 19: { - message.endpointConfig = $root.google.cloud.dataproc.v1.EndpointConfig.decode(reader, reader.uint32()); - break; - } - case 20: { - message.metastoreConfig = $root.google.cloud.dataproc.v1.MetastoreConfig.decode(reader, reader.uint32()); - break; - } - case 23: { - message.dataprocMetricConfig = $root.google.cloud.dataproc.v1.DataprocMetricConfig.decode(reader, reader.uint32()); - break; - } - case 25: { - if (!(message.auxiliaryNodeGroups && message.auxiliaryNodeGroups.length)) - message.auxiliaryNodeGroups = []; - message.auxiliaryNodeGroups.push($root.google.cloud.dataproc.v1.AuxiliaryNodeGroup.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClusterConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.ClusterConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.ClusterConfig} ClusterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClusterConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClusterConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.ClusterConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClusterConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.clusterType != null && message.hasOwnProperty("clusterType")) - switch (message.clusterType) { - default: - return "clusterType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.clusterTier != null && message.hasOwnProperty("clusterTier")) - switch (message.clusterTier) { - default: - return "clusterTier: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.engine != null && message.hasOwnProperty("engine")) - switch (message.engine) { - default: - return "engine: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.configBucket != null && message.hasOwnProperty("configBucket")) - if (!$util.isString(message.configBucket)) - return "configBucket: string expected"; - if (message.tempBucket != null && message.hasOwnProperty("tempBucket")) - if (!$util.isString(message.tempBucket)) - return "tempBucket: string expected"; - if (message.gceClusterConfig != null && message.hasOwnProperty("gceClusterConfig")) { - var error = $root.google.cloud.dataproc.v1.GceClusterConfig.verify(message.gceClusterConfig); - if (error) - return "gceClusterConfig." + error; - } - if (message.masterConfig != null && message.hasOwnProperty("masterConfig")) { - var error = $root.google.cloud.dataproc.v1.InstanceGroupConfig.verify(message.masterConfig); - if (error) - return "masterConfig." + error; - } - if (message.workerConfig != null && message.hasOwnProperty("workerConfig")) { - var error = $root.google.cloud.dataproc.v1.InstanceGroupConfig.verify(message.workerConfig); - if (error) - return "workerConfig." + error; - } - if (message.secondaryWorkerConfig != null && message.hasOwnProperty("secondaryWorkerConfig")) { - var error = $root.google.cloud.dataproc.v1.InstanceGroupConfig.verify(message.secondaryWorkerConfig); - if (error) - return "secondaryWorkerConfig." + error; - } - if (message.softwareConfig != null && message.hasOwnProperty("softwareConfig")) { - var error = $root.google.cloud.dataproc.v1.SoftwareConfig.verify(message.softwareConfig); - if (error) - return "softwareConfig." + error; - } - if (message.initializationActions != null && message.hasOwnProperty("initializationActions")) { - if (!Array.isArray(message.initializationActions)) - return "initializationActions: array expected"; - for (var i = 0; i < message.initializationActions.length; ++i) { - var error = $root.google.cloud.dataproc.v1.NodeInitializationAction.verify(message.initializationActions[i]); - if (error) - return "initializationActions." + error; - } - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.cloud.dataproc.v1.EncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) { - var error = $root.google.cloud.dataproc.v1.AutoscalingConfig.verify(message.autoscalingConfig); - if (error) - return "autoscalingConfig." + error; - } - if (message.securityConfig != null && message.hasOwnProperty("securityConfig")) { - var error = $root.google.cloud.dataproc.v1.SecurityConfig.verify(message.securityConfig); - if (error) - return "securityConfig." + error; - } - if (message.lifecycleConfig != null && message.hasOwnProperty("lifecycleConfig")) { - var error = $root.google.cloud.dataproc.v1.LifecycleConfig.verify(message.lifecycleConfig); - if (error) - return "lifecycleConfig." + error; - } - if (message.endpointConfig != null && message.hasOwnProperty("endpointConfig")) { - var error = $root.google.cloud.dataproc.v1.EndpointConfig.verify(message.endpointConfig); - if (error) - return "endpointConfig." + error; - } - if (message.metastoreConfig != null && message.hasOwnProperty("metastoreConfig")) { - var error = $root.google.cloud.dataproc.v1.MetastoreConfig.verify(message.metastoreConfig); - if (error) - return "metastoreConfig." + error; - } - if (message.dataprocMetricConfig != null && message.hasOwnProperty("dataprocMetricConfig")) { - var error = $root.google.cloud.dataproc.v1.DataprocMetricConfig.verify(message.dataprocMetricConfig); - if (error) - return "dataprocMetricConfig." + error; - } - if (message.auxiliaryNodeGroups != null && message.hasOwnProperty("auxiliaryNodeGroups")) { - if (!Array.isArray(message.auxiliaryNodeGroups)) - return "auxiliaryNodeGroups: array expected"; - for (var i = 0; i < message.auxiliaryNodeGroups.length; ++i) { - var error = $root.google.cloud.dataproc.v1.AuxiliaryNodeGroup.verify(message.auxiliaryNodeGroups[i]); - if (error) - return "auxiliaryNodeGroups." + error; - } - } - return null; - }; - - /** - * Creates a ClusterConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.ClusterConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.ClusterConfig} ClusterConfig - */ - ClusterConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.ClusterConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.ClusterConfig(); - switch (object.clusterType) { - default: - if (typeof object.clusterType === "number") { - message.clusterType = object.clusterType; - break; - } - break; - case "CLUSTER_TYPE_UNSPECIFIED": - case 0: - message.clusterType = 0; - break; - case "STANDARD": - case 1: - message.clusterType = 1; - break; - case "SINGLE_NODE": - case 2: - message.clusterType = 2; - break; - case "ZERO_SCALE": - case 3: - message.clusterType = 3; - break; - } - switch (object.clusterTier) { - default: - if (typeof object.clusterTier === "number") { - message.clusterTier = object.clusterTier; - break; - } - break; - case "CLUSTER_TIER_UNSPECIFIED": - case 0: - message.clusterTier = 0; - break; - case "CLUSTER_TIER_STANDARD": - case 1: - message.clusterTier = 1; - break; - case "CLUSTER_TIER_PREMIUM": - case 2: - message.clusterTier = 2; - break; - } - switch (object.engine) { - default: - if (typeof object.engine === "number") { - message.engine = object.engine; - break; - } - break; - case "ENGINE_UNSPECIFIED": - case 0: - message.engine = 0; - break; - case "DEFAULT": - case 1: - message.engine = 1; - break; - case "LIGHTNING": - case 2: - message.engine = 2; - break; - } - if (object.configBucket != null) - message.configBucket = String(object.configBucket); - if (object.tempBucket != null) - message.tempBucket = String(object.tempBucket); - if (object.gceClusterConfig != null) { - if (typeof object.gceClusterConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.ClusterConfig.gceClusterConfig: object expected"); - message.gceClusterConfig = $root.google.cloud.dataproc.v1.GceClusterConfig.fromObject(object.gceClusterConfig); - } - if (object.masterConfig != null) { - if (typeof object.masterConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.ClusterConfig.masterConfig: object expected"); - message.masterConfig = $root.google.cloud.dataproc.v1.InstanceGroupConfig.fromObject(object.masterConfig); - } - if (object.workerConfig != null) { - if (typeof object.workerConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.ClusterConfig.workerConfig: object expected"); - message.workerConfig = $root.google.cloud.dataproc.v1.InstanceGroupConfig.fromObject(object.workerConfig); - } - if (object.secondaryWorkerConfig != null) { - if (typeof object.secondaryWorkerConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.ClusterConfig.secondaryWorkerConfig: object expected"); - message.secondaryWorkerConfig = $root.google.cloud.dataproc.v1.InstanceGroupConfig.fromObject(object.secondaryWorkerConfig); - } - if (object.softwareConfig != null) { - if (typeof object.softwareConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.ClusterConfig.softwareConfig: object expected"); - message.softwareConfig = $root.google.cloud.dataproc.v1.SoftwareConfig.fromObject(object.softwareConfig); - } - if (object.initializationActions) { - if (!Array.isArray(object.initializationActions)) - throw TypeError(".google.cloud.dataproc.v1.ClusterConfig.initializationActions: array expected"); - message.initializationActions = []; - for (var i = 0; i < object.initializationActions.length; ++i) { - if (typeof object.initializationActions[i] !== "object") - throw TypeError(".google.cloud.dataproc.v1.ClusterConfig.initializationActions: object expected"); - message.initializationActions[i] = $root.google.cloud.dataproc.v1.NodeInitializationAction.fromObject(object.initializationActions[i]); - } - } - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.ClusterConfig.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.cloud.dataproc.v1.EncryptionConfig.fromObject(object.encryptionConfig); - } - if (object.autoscalingConfig != null) { - if (typeof object.autoscalingConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.ClusterConfig.autoscalingConfig: object expected"); - message.autoscalingConfig = $root.google.cloud.dataproc.v1.AutoscalingConfig.fromObject(object.autoscalingConfig); - } - if (object.securityConfig != null) { - if (typeof object.securityConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.ClusterConfig.securityConfig: object expected"); - message.securityConfig = $root.google.cloud.dataproc.v1.SecurityConfig.fromObject(object.securityConfig); - } - if (object.lifecycleConfig != null) { - if (typeof object.lifecycleConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.ClusterConfig.lifecycleConfig: object expected"); - message.lifecycleConfig = $root.google.cloud.dataproc.v1.LifecycleConfig.fromObject(object.lifecycleConfig); - } - if (object.endpointConfig != null) { - if (typeof object.endpointConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.ClusterConfig.endpointConfig: object expected"); - message.endpointConfig = $root.google.cloud.dataproc.v1.EndpointConfig.fromObject(object.endpointConfig); - } - if (object.metastoreConfig != null) { - if (typeof object.metastoreConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.ClusterConfig.metastoreConfig: object expected"); - message.metastoreConfig = $root.google.cloud.dataproc.v1.MetastoreConfig.fromObject(object.metastoreConfig); - } - if (object.dataprocMetricConfig != null) { - if (typeof object.dataprocMetricConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.ClusterConfig.dataprocMetricConfig: object expected"); - message.dataprocMetricConfig = $root.google.cloud.dataproc.v1.DataprocMetricConfig.fromObject(object.dataprocMetricConfig); - } - if (object.auxiliaryNodeGroups) { - if (!Array.isArray(object.auxiliaryNodeGroups)) - throw TypeError(".google.cloud.dataproc.v1.ClusterConfig.auxiliaryNodeGroups: array expected"); - message.auxiliaryNodeGroups = []; - for (var i = 0; i < object.auxiliaryNodeGroups.length; ++i) { - if (typeof object.auxiliaryNodeGroups[i] !== "object") - throw TypeError(".google.cloud.dataproc.v1.ClusterConfig.auxiliaryNodeGroups: object expected"); - message.auxiliaryNodeGroups[i] = $root.google.cloud.dataproc.v1.AuxiliaryNodeGroup.fromObject(object.auxiliaryNodeGroups[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ClusterConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.ClusterConfig - * @static - * @param {google.cloud.dataproc.v1.ClusterConfig} message ClusterConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClusterConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.initializationActions = []; - object.auxiliaryNodeGroups = []; - } - if (options.defaults) { - object.configBucket = ""; - object.tempBucket = ""; - object.gceClusterConfig = null; - object.masterConfig = null; - object.workerConfig = null; - object.secondaryWorkerConfig = null; - object.softwareConfig = null; - object.encryptionConfig = null; - object.securityConfig = null; - object.lifecycleConfig = null; - object.autoscalingConfig = null; - object.endpointConfig = null; - object.metastoreConfig = null; - object.dataprocMetricConfig = null; - object.clusterType = options.enums === String ? "CLUSTER_TYPE_UNSPECIFIED" : 0; - object.clusterTier = options.enums === String ? "CLUSTER_TIER_UNSPECIFIED" : 0; - object.engine = options.enums === String ? "ENGINE_UNSPECIFIED" : 0; - } - if (message.configBucket != null && message.hasOwnProperty("configBucket")) - object.configBucket = message.configBucket; - if (message.tempBucket != null && message.hasOwnProperty("tempBucket")) - object.tempBucket = message.tempBucket; - if (message.gceClusterConfig != null && message.hasOwnProperty("gceClusterConfig")) - object.gceClusterConfig = $root.google.cloud.dataproc.v1.GceClusterConfig.toObject(message.gceClusterConfig, options); - if (message.masterConfig != null && message.hasOwnProperty("masterConfig")) - object.masterConfig = $root.google.cloud.dataproc.v1.InstanceGroupConfig.toObject(message.masterConfig, options); - if (message.workerConfig != null && message.hasOwnProperty("workerConfig")) - object.workerConfig = $root.google.cloud.dataproc.v1.InstanceGroupConfig.toObject(message.workerConfig, options); - if (message.initializationActions && message.initializationActions.length) { - object.initializationActions = []; - for (var j = 0; j < message.initializationActions.length; ++j) - object.initializationActions[j] = $root.google.cloud.dataproc.v1.NodeInitializationAction.toObject(message.initializationActions[j], options); - } - if (message.secondaryWorkerConfig != null && message.hasOwnProperty("secondaryWorkerConfig")) - object.secondaryWorkerConfig = $root.google.cloud.dataproc.v1.InstanceGroupConfig.toObject(message.secondaryWorkerConfig, options); - if (message.softwareConfig != null && message.hasOwnProperty("softwareConfig")) - object.softwareConfig = $root.google.cloud.dataproc.v1.SoftwareConfig.toObject(message.softwareConfig, options); - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.cloud.dataproc.v1.EncryptionConfig.toObject(message.encryptionConfig, options); - if (message.securityConfig != null && message.hasOwnProperty("securityConfig")) - object.securityConfig = $root.google.cloud.dataproc.v1.SecurityConfig.toObject(message.securityConfig, options); - if (message.lifecycleConfig != null && message.hasOwnProperty("lifecycleConfig")) - object.lifecycleConfig = $root.google.cloud.dataproc.v1.LifecycleConfig.toObject(message.lifecycleConfig, options); - if (message.autoscalingConfig != null && message.hasOwnProperty("autoscalingConfig")) - object.autoscalingConfig = $root.google.cloud.dataproc.v1.AutoscalingConfig.toObject(message.autoscalingConfig, options); - if (message.endpointConfig != null && message.hasOwnProperty("endpointConfig")) - object.endpointConfig = $root.google.cloud.dataproc.v1.EndpointConfig.toObject(message.endpointConfig, options); - if (message.metastoreConfig != null && message.hasOwnProperty("metastoreConfig")) - object.metastoreConfig = $root.google.cloud.dataproc.v1.MetastoreConfig.toObject(message.metastoreConfig, options); - if (message.dataprocMetricConfig != null && message.hasOwnProperty("dataprocMetricConfig")) - object.dataprocMetricConfig = $root.google.cloud.dataproc.v1.DataprocMetricConfig.toObject(message.dataprocMetricConfig, options); - if (message.auxiliaryNodeGroups && message.auxiliaryNodeGroups.length) { - object.auxiliaryNodeGroups = []; - for (var j = 0; j < message.auxiliaryNodeGroups.length; ++j) - object.auxiliaryNodeGroups[j] = $root.google.cloud.dataproc.v1.AuxiliaryNodeGroup.toObject(message.auxiliaryNodeGroups[j], options); - } - if (message.clusterType != null && message.hasOwnProperty("clusterType")) - object.clusterType = options.enums === String ? $root.google.cloud.dataproc.v1.ClusterConfig.ClusterType[message.clusterType] === undefined ? message.clusterType : $root.google.cloud.dataproc.v1.ClusterConfig.ClusterType[message.clusterType] : message.clusterType; - if (message.clusterTier != null && message.hasOwnProperty("clusterTier")) - object.clusterTier = options.enums === String ? $root.google.cloud.dataproc.v1.ClusterConfig.ClusterTier[message.clusterTier] === undefined ? message.clusterTier : $root.google.cloud.dataproc.v1.ClusterConfig.ClusterTier[message.clusterTier] : message.clusterTier; - if (message.engine != null && message.hasOwnProperty("engine")) - object.engine = options.enums === String ? $root.google.cloud.dataproc.v1.ClusterConfig.Engine[message.engine] === undefined ? message.engine : $root.google.cloud.dataproc.v1.ClusterConfig.Engine[message.engine] : message.engine; - return object; - }; - - /** - * Converts this ClusterConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.ClusterConfig - * @instance - * @returns {Object.} JSON object - */ - ClusterConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClusterConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.ClusterConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClusterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.ClusterConfig"; - }; - - /** - * ClusterType enum. - * @name google.cloud.dataproc.v1.ClusterConfig.ClusterType - * @enum {number} - * @property {number} CLUSTER_TYPE_UNSPECIFIED=0 CLUSTER_TYPE_UNSPECIFIED value - * @property {number} STANDARD=1 STANDARD value - * @property {number} SINGLE_NODE=2 SINGLE_NODE value - * @property {number} ZERO_SCALE=3 ZERO_SCALE value - */ - ClusterConfig.ClusterType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLUSTER_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "STANDARD"] = 1; - values[valuesById[2] = "SINGLE_NODE"] = 2; - values[valuesById[3] = "ZERO_SCALE"] = 3; - return values; - })(); - - /** - * ClusterTier enum. - * @name google.cloud.dataproc.v1.ClusterConfig.ClusterTier - * @enum {number} - * @property {number} CLUSTER_TIER_UNSPECIFIED=0 CLUSTER_TIER_UNSPECIFIED value - * @property {number} CLUSTER_TIER_STANDARD=1 CLUSTER_TIER_STANDARD value - * @property {number} CLUSTER_TIER_PREMIUM=2 CLUSTER_TIER_PREMIUM value - */ - ClusterConfig.ClusterTier = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLUSTER_TIER_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLUSTER_TIER_STANDARD"] = 1; - values[valuesById[2] = "CLUSTER_TIER_PREMIUM"] = 2; - return values; - })(); - - /** - * Engine enum. - * @name google.cloud.dataproc.v1.ClusterConfig.Engine - * @enum {number} - * @property {number} ENGINE_UNSPECIFIED=0 ENGINE_UNSPECIFIED value - * @property {number} DEFAULT=1 DEFAULT value - * @property {number} LIGHTNING=2 LIGHTNING value - */ - ClusterConfig.Engine = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENGINE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DEFAULT"] = 1; - values[valuesById[2] = "LIGHTNING"] = 2; - return values; - })(); - - return ClusterConfig; - })(); - - v1.VirtualClusterConfig = (function() { - - /** - * Properties of a VirtualClusterConfig. - * @memberof google.cloud.dataproc.v1 - * @interface IVirtualClusterConfig - * @property {string|null} [stagingBucket] VirtualClusterConfig stagingBucket - * @property {google.cloud.dataproc.v1.IKubernetesClusterConfig|null} [kubernetesClusterConfig] VirtualClusterConfig kubernetesClusterConfig - * @property {google.cloud.dataproc.v1.IAuxiliaryServicesConfig|null} [auxiliaryServicesConfig] VirtualClusterConfig auxiliaryServicesConfig - */ - - /** - * Constructs a new VirtualClusterConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a VirtualClusterConfig. - * @implements IVirtualClusterConfig - * @constructor - * @param {google.cloud.dataproc.v1.IVirtualClusterConfig=} [properties] Properties to set - */ - function VirtualClusterConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * VirtualClusterConfig stagingBucket. - * @member {string} stagingBucket - * @memberof google.cloud.dataproc.v1.VirtualClusterConfig - * @instance - */ - VirtualClusterConfig.prototype.stagingBucket = ""; - - /** - * VirtualClusterConfig kubernetesClusterConfig. - * @member {google.cloud.dataproc.v1.IKubernetesClusterConfig|null|undefined} kubernetesClusterConfig - * @memberof google.cloud.dataproc.v1.VirtualClusterConfig - * @instance - */ - VirtualClusterConfig.prototype.kubernetesClusterConfig = null; - - /** - * VirtualClusterConfig auxiliaryServicesConfig. - * @member {google.cloud.dataproc.v1.IAuxiliaryServicesConfig|null|undefined} auxiliaryServicesConfig - * @memberof google.cloud.dataproc.v1.VirtualClusterConfig - * @instance - */ - VirtualClusterConfig.prototype.auxiliaryServicesConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * VirtualClusterConfig infrastructureConfig. - * @member {"kubernetesClusterConfig"|undefined} infrastructureConfig - * @memberof google.cloud.dataproc.v1.VirtualClusterConfig - * @instance - */ - Object.defineProperty(VirtualClusterConfig.prototype, "infrastructureConfig", { - get: $util.oneOfGetter($oneOfFields = ["kubernetesClusterConfig"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new VirtualClusterConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.VirtualClusterConfig - * @static - * @param {google.cloud.dataproc.v1.IVirtualClusterConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.VirtualClusterConfig} VirtualClusterConfig instance - */ - VirtualClusterConfig.create = function create(properties) { - return new VirtualClusterConfig(properties); - }; - - /** - * Encodes the specified VirtualClusterConfig message. Does not implicitly {@link google.cloud.dataproc.v1.VirtualClusterConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.VirtualClusterConfig - * @static - * @param {google.cloud.dataproc.v1.IVirtualClusterConfig} message VirtualClusterConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VirtualClusterConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.stagingBucket != null && Object.hasOwnProperty.call(message, "stagingBucket")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.stagingBucket); - if (message.kubernetesClusterConfig != null && Object.hasOwnProperty.call(message, "kubernetesClusterConfig")) - $root.google.cloud.dataproc.v1.KubernetesClusterConfig.encode(message.kubernetesClusterConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.auxiliaryServicesConfig != null && Object.hasOwnProperty.call(message, "auxiliaryServicesConfig")) - $root.google.cloud.dataproc.v1.AuxiliaryServicesConfig.encode(message.auxiliaryServicesConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified VirtualClusterConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.VirtualClusterConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.VirtualClusterConfig - * @static - * @param {google.cloud.dataproc.v1.IVirtualClusterConfig} message VirtualClusterConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VirtualClusterConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a VirtualClusterConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.VirtualClusterConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.VirtualClusterConfig} VirtualClusterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VirtualClusterConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.VirtualClusterConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.stagingBucket = reader.string(); - break; - } - case 6: { - message.kubernetesClusterConfig = $root.google.cloud.dataproc.v1.KubernetesClusterConfig.decode(reader, reader.uint32()); - break; - } - case 7: { - message.auxiliaryServicesConfig = $root.google.cloud.dataproc.v1.AuxiliaryServicesConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a VirtualClusterConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.VirtualClusterConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.VirtualClusterConfig} VirtualClusterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VirtualClusterConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a VirtualClusterConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.VirtualClusterConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - VirtualClusterConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.stagingBucket != null && message.hasOwnProperty("stagingBucket")) - if (!$util.isString(message.stagingBucket)) - return "stagingBucket: string expected"; - if (message.kubernetesClusterConfig != null && message.hasOwnProperty("kubernetesClusterConfig")) { - properties.infrastructureConfig = 1; - { - var error = $root.google.cloud.dataproc.v1.KubernetesClusterConfig.verify(message.kubernetesClusterConfig); - if (error) - return "kubernetesClusterConfig." + error; - } - } - if (message.auxiliaryServicesConfig != null && message.hasOwnProperty("auxiliaryServicesConfig")) { - var error = $root.google.cloud.dataproc.v1.AuxiliaryServicesConfig.verify(message.auxiliaryServicesConfig); - if (error) - return "auxiliaryServicesConfig." + error; - } - return null; - }; - - /** - * Creates a VirtualClusterConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.VirtualClusterConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.VirtualClusterConfig} VirtualClusterConfig - */ - VirtualClusterConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.VirtualClusterConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.VirtualClusterConfig(); - if (object.stagingBucket != null) - message.stagingBucket = String(object.stagingBucket); - if (object.kubernetesClusterConfig != null) { - if (typeof object.kubernetesClusterConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.VirtualClusterConfig.kubernetesClusterConfig: object expected"); - message.kubernetesClusterConfig = $root.google.cloud.dataproc.v1.KubernetesClusterConfig.fromObject(object.kubernetesClusterConfig); - } - if (object.auxiliaryServicesConfig != null) { - if (typeof object.auxiliaryServicesConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.VirtualClusterConfig.auxiliaryServicesConfig: object expected"); - message.auxiliaryServicesConfig = $root.google.cloud.dataproc.v1.AuxiliaryServicesConfig.fromObject(object.auxiliaryServicesConfig); - } - return message; - }; - - /** - * Creates a plain object from a VirtualClusterConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.VirtualClusterConfig - * @static - * @param {google.cloud.dataproc.v1.VirtualClusterConfig} message VirtualClusterConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - VirtualClusterConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.stagingBucket = ""; - object.auxiliaryServicesConfig = null; - } - if (message.stagingBucket != null && message.hasOwnProperty("stagingBucket")) - object.stagingBucket = message.stagingBucket; - if (message.kubernetesClusterConfig != null && message.hasOwnProperty("kubernetesClusterConfig")) { - object.kubernetesClusterConfig = $root.google.cloud.dataproc.v1.KubernetesClusterConfig.toObject(message.kubernetesClusterConfig, options); - if (options.oneofs) - object.infrastructureConfig = "kubernetesClusterConfig"; - } - if (message.auxiliaryServicesConfig != null && message.hasOwnProperty("auxiliaryServicesConfig")) - object.auxiliaryServicesConfig = $root.google.cloud.dataproc.v1.AuxiliaryServicesConfig.toObject(message.auxiliaryServicesConfig, options); - return object; - }; - - /** - * Converts this VirtualClusterConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.VirtualClusterConfig - * @instance - * @returns {Object.} JSON object - */ - VirtualClusterConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for VirtualClusterConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.VirtualClusterConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - VirtualClusterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.VirtualClusterConfig"; - }; - - return VirtualClusterConfig; - })(); - - v1.AuxiliaryServicesConfig = (function() { - - /** - * Properties of an AuxiliaryServicesConfig. - * @memberof google.cloud.dataproc.v1 - * @interface IAuxiliaryServicesConfig - * @property {google.cloud.dataproc.v1.IMetastoreConfig|null} [metastoreConfig] AuxiliaryServicesConfig metastoreConfig - * @property {google.cloud.dataproc.v1.ISparkHistoryServerConfig|null} [sparkHistoryServerConfig] AuxiliaryServicesConfig sparkHistoryServerConfig - */ - - /** - * Constructs a new AuxiliaryServicesConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents an AuxiliaryServicesConfig. - * @implements IAuxiliaryServicesConfig - * @constructor - * @param {google.cloud.dataproc.v1.IAuxiliaryServicesConfig=} [properties] Properties to set - */ - function AuxiliaryServicesConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AuxiliaryServicesConfig metastoreConfig. - * @member {google.cloud.dataproc.v1.IMetastoreConfig|null|undefined} metastoreConfig - * @memberof google.cloud.dataproc.v1.AuxiliaryServicesConfig - * @instance - */ - AuxiliaryServicesConfig.prototype.metastoreConfig = null; - - /** - * AuxiliaryServicesConfig sparkHistoryServerConfig. - * @member {google.cloud.dataproc.v1.ISparkHistoryServerConfig|null|undefined} sparkHistoryServerConfig - * @memberof google.cloud.dataproc.v1.AuxiliaryServicesConfig - * @instance - */ - AuxiliaryServicesConfig.prototype.sparkHistoryServerConfig = null; - - /** - * Creates a new AuxiliaryServicesConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.AuxiliaryServicesConfig - * @static - * @param {google.cloud.dataproc.v1.IAuxiliaryServicesConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.AuxiliaryServicesConfig} AuxiliaryServicesConfig instance - */ - AuxiliaryServicesConfig.create = function create(properties) { - return new AuxiliaryServicesConfig(properties); - }; - - /** - * Encodes the specified AuxiliaryServicesConfig message. Does not implicitly {@link google.cloud.dataproc.v1.AuxiliaryServicesConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.AuxiliaryServicesConfig - * @static - * @param {google.cloud.dataproc.v1.IAuxiliaryServicesConfig} message AuxiliaryServicesConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuxiliaryServicesConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.metastoreConfig != null && Object.hasOwnProperty.call(message, "metastoreConfig")) - $root.google.cloud.dataproc.v1.MetastoreConfig.encode(message.metastoreConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.sparkHistoryServerConfig != null && Object.hasOwnProperty.call(message, "sparkHistoryServerConfig")) - $root.google.cloud.dataproc.v1.SparkHistoryServerConfig.encode(message.sparkHistoryServerConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AuxiliaryServicesConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.AuxiliaryServicesConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.AuxiliaryServicesConfig - * @static - * @param {google.cloud.dataproc.v1.IAuxiliaryServicesConfig} message AuxiliaryServicesConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuxiliaryServicesConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AuxiliaryServicesConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.AuxiliaryServicesConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.AuxiliaryServicesConfig} AuxiliaryServicesConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuxiliaryServicesConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.AuxiliaryServicesConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.metastoreConfig = $root.google.cloud.dataproc.v1.MetastoreConfig.decode(reader, reader.uint32()); - break; - } - case 2: { - message.sparkHistoryServerConfig = $root.google.cloud.dataproc.v1.SparkHistoryServerConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AuxiliaryServicesConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.AuxiliaryServicesConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.AuxiliaryServicesConfig} AuxiliaryServicesConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuxiliaryServicesConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AuxiliaryServicesConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.AuxiliaryServicesConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AuxiliaryServicesConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.metastoreConfig != null && message.hasOwnProperty("metastoreConfig")) { - var error = $root.google.cloud.dataproc.v1.MetastoreConfig.verify(message.metastoreConfig); - if (error) - return "metastoreConfig." + error; - } - if (message.sparkHistoryServerConfig != null && message.hasOwnProperty("sparkHistoryServerConfig")) { - var error = $root.google.cloud.dataproc.v1.SparkHistoryServerConfig.verify(message.sparkHistoryServerConfig); - if (error) - return "sparkHistoryServerConfig." + error; - } - return null; - }; - - /** - * Creates an AuxiliaryServicesConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.AuxiliaryServicesConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.AuxiliaryServicesConfig} AuxiliaryServicesConfig - */ - AuxiliaryServicesConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.AuxiliaryServicesConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.AuxiliaryServicesConfig(); - if (object.metastoreConfig != null) { - if (typeof object.metastoreConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.AuxiliaryServicesConfig.metastoreConfig: object expected"); - message.metastoreConfig = $root.google.cloud.dataproc.v1.MetastoreConfig.fromObject(object.metastoreConfig); - } - if (object.sparkHistoryServerConfig != null) { - if (typeof object.sparkHistoryServerConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.AuxiliaryServicesConfig.sparkHistoryServerConfig: object expected"); - message.sparkHistoryServerConfig = $root.google.cloud.dataproc.v1.SparkHistoryServerConfig.fromObject(object.sparkHistoryServerConfig); - } - return message; - }; - - /** - * Creates a plain object from an AuxiliaryServicesConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.AuxiliaryServicesConfig - * @static - * @param {google.cloud.dataproc.v1.AuxiliaryServicesConfig} message AuxiliaryServicesConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AuxiliaryServicesConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.metastoreConfig = null; - object.sparkHistoryServerConfig = null; - } - if (message.metastoreConfig != null && message.hasOwnProperty("metastoreConfig")) - object.metastoreConfig = $root.google.cloud.dataproc.v1.MetastoreConfig.toObject(message.metastoreConfig, options); - if (message.sparkHistoryServerConfig != null && message.hasOwnProperty("sparkHistoryServerConfig")) - object.sparkHistoryServerConfig = $root.google.cloud.dataproc.v1.SparkHistoryServerConfig.toObject(message.sparkHistoryServerConfig, options); - return object; - }; - - /** - * Converts this AuxiliaryServicesConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.AuxiliaryServicesConfig - * @instance - * @returns {Object.} JSON object - */ - AuxiliaryServicesConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AuxiliaryServicesConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.AuxiliaryServicesConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AuxiliaryServicesConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.AuxiliaryServicesConfig"; - }; - - return AuxiliaryServicesConfig; - })(); - - v1.EndpointConfig = (function() { - - /** - * Properties of an EndpointConfig. - * @memberof google.cloud.dataproc.v1 - * @interface IEndpointConfig - * @property {Object.|null} [httpPorts] EndpointConfig httpPorts - * @property {boolean|null} [enableHttpPortAccess] EndpointConfig enableHttpPortAccess - */ - - /** - * Constructs a new EndpointConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents an EndpointConfig. - * @implements IEndpointConfig - * @constructor - * @param {google.cloud.dataproc.v1.IEndpointConfig=} [properties] Properties to set - */ - function EndpointConfig(properties) { - this.httpPorts = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EndpointConfig httpPorts. - * @member {Object.} httpPorts - * @memberof google.cloud.dataproc.v1.EndpointConfig - * @instance - */ - EndpointConfig.prototype.httpPorts = $util.emptyObject; - - /** - * EndpointConfig enableHttpPortAccess. - * @member {boolean} enableHttpPortAccess - * @memberof google.cloud.dataproc.v1.EndpointConfig - * @instance - */ - EndpointConfig.prototype.enableHttpPortAccess = false; - - /** - * Creates a new EndpointConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.EndpointConfig - * @static - * @param {google.cloud.dataproc.v1.IEndpointConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.EndpointConfig} EndpointConfig instance - */ - EndpointConfig.create = function create(properties) { - return new EndpointConfig(properties); - }; - - /** - * Encodes the specified EndpointConfig message. Does not implicitly {@link google.cloud.dataproc.v1.EndpointConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.EndpointConfig - * @static - * @param {google.cloud.dataproc.v1.IEndpointConfig} message EndpointConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EndpointConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.httpPorts != null && Object.hasOwnProperty.call(message, "httpPorts")) - for (var keys = Object.keys(message.httpPorts), 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.httpPorts[keys[i]]).ldelim(); - if (message.enableHttpPortAccess != null && Object.hasOwnProperty.call(message, "enableHttpPortAccess")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableHttpPortAccess); - return writer; - }; - - /** - * Encodes the specified EndpointConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.EndpointConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.EndpointConfig - * @static - * @param {google.cloud.dataproc.v1.IEndpointConfig} message EndpointConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EndpointConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EndpointConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.EndpointConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.EndpointConfig} EndpointConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EndpointConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.EndpointConfig(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (message.httpPorts === $util.emptyObject) - message.httpPorts = {}; - 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.httpPorts[key] = value; - break; - } - case 2: { - message.enableHttpPortAccess = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EndpointConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.EndpointConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.EndpointConfig} EndpointConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EndpointConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EndpointConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.EndpointConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EndpointConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.httpPorts != null && message.hasOwnProperty("httpPorts")) { - if (!$util.isObject(message.httpPorts)) - return "httpPorts: object expected"; - var key = Object.keys(message.httpPorts); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.httpPorts[key[i]])) - return "httpPorts: string{k:string} expected"; - } - if (message.enableHttpPortAccess != null && message.hasOwnProperty("enableHttpPortAccess")) - if (typeof message.enableHttpPortAccess !== "boolean") - return "enableHttpPortAccess: boolean expected"; - return null; - }; - - /** - * Creates an EndpointConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.EndpointConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.EndpointConfig} EndpointConfig - */ - EndpointConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.EndpointConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.EndpointConfig(); - if (object.httpPorts) { - if (typeof object.httpPorts !== "object") - throw TypeError(".google.cloud.dataproc.v1.EndpointConfig.httpPorts: object expected"); - message.httpPorts = {}; - for (var keys = Object.keys(object.httpPorts), i = 0; i < keys.length; ++i) - message.httpPorts[keys[i]] = String(object.httpPorts[keys[i]]); - } - if (object.enableHttpPortAccess != null) - message.enableHttpPortAccess = Boolean(object.enableHttpPortAccess); - return message; - }; - - /** - * Creates a plain object from an EndpointConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.EndpointConfig - * @static - * @param {google.cloud.dataproc.v1.EndpointConfig} message EndpointConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EndpointConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.httpPorts = {}; - if (options.defaults) - object.enableHttpPortAccess = false; - var keys2; - if (message.httpPorts && (keys2 = Object.keys(message.httpPorts)).length) { - object.httpPorts = {}; - for (var j = 0; j < keys2.length; ++j) - object.httpPorts[keys2[j]] = message.httpPorts[keys2[j]]; - } - if (message.enableHttpPortAccess != null && message.hasOwnProperty("enableHttpPortAccess")) - object.enableHttpPortAccess = message.enableHttpPortAccess; - return object; - }; - - /** - * Converts this EndpointConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.EndpointConfig - * @instance - * @returns {Object.} JSON object - */ - EndpointConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EndpointConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.EndpointConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EndpointConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.EndpointConfig"; - }; - - return EndpointConfig; - })(); - - v1.AutoscalingConfig = (function() { - - /** - * Properties of an AutoscalingConfig. - * @memberof google.cloud.dataproc.v1 - * @interface IAutoscalingConfig - * @property {string|null} [policyUri] AutoscalingConfig policyUri - */ - - /** - * Constructs a new AutoscalingConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents an AutoscalingConfig. - * @implements IAutoscalingConfig - * @constructor - * @param {google.cloud.dataproc.v1.IAutoscalingConfig=} [properties] Properties to set - */ - function AutoscalingConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AutoscalingConfig policyUri. - * @member {string} policyUri - * @memberof google.cloud.dataproc.v1.AutoscalingConfig - * @instance - */ - AutoscalingConfig.prototype.policyUri = ""; - - /** - * Creates a new AutoscalingConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.AutoscalingConfig - * @static - * @param {google.cloud.dataproc.v1.IAutoscalingConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.AutoscalingConfig} AutoscalingConfig instance - */ - AutoscalingConfig.create = function create(properties) { - return new AutoscalingConfig(properties); - }; - - /** - * Encodes the specified AutoscalingConfig message. Does not implicitly {@link google.cloud.dataproc.v1.AutoscalingConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.AutoscalingConfig - * @static - * @param {google.cloud.dataproc.v1.IAutoscalingConfig} message AutoscalingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoscalingConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.policyUri != null && Object.hasOwnProperty.call(message, "policyUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.policyUri); - return writer; - }; - - /** - * Encodes the specified AutoscalingConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.AutoscalingConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.AutoscalingConfig - * @static - * @param {google.cloud.dataproc.v1.IAutoscalingConfig} message AutoscalingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoscalingConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AutoscalingConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.AutoscalingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.AutoscalingConfig} AutoscalingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoscalingConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.AutoscalingConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.policyUri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AutoscalingConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.AutoscalingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.AutoscalingConfig} AutoscalingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoscalingConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AutoscalingConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.AutoscalingConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AutoscalingConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.policyUri != null && message.hasOwnProperty("policyUri")) - if (!$util.isString(message.policyUri)) - return "policyUri: string expected"; - return null; - }; - - /** - * Creates an AutoscalingConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.AutoscalingConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.AutoscalingConfig} AutoscalingConfig - */ - AutoscalingConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.AutoscalingConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.AutoscalingConfig(); - if (object.policyUri != null) - message.policyUri = String(object.policyUri); - return message; - }; - - /** - * Creates a plain object from an AutoscalingConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.AutoscalingConfig - * @static - * @param {google.cloud.dataproc.v1.AutoscalingConfig} message AutoscalingConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AutoscalingConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.policyUri = ""; - if (message.policyUri != null && message.hasOwnProperty("policyUri")) - object.policyUri = message.policyUri; - return object; - }; - - /** - * Converts this AutoscalingConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.AutoscalingConfig - * @instance - * @returns {Object.} JSON object - */ - AutoscalingConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AutoscalingConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.AutoscalingConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AutoscalingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.AutoscalingConfig"; - }; - - return AutoscalingConfig; - })(); - - v1.EncryptionConfig = (function() { - - /** - * Properties of an EncryptionConfig. - * @memberof google.cloud.dataproc.v1 - * @interface IEncryptionConfig - * @property {string|null} [gcePdKmsKeyName] EncryptionConfig gcePdKmsKeyName - * @property {string|null} [kmsKey] EncryptionConfig kmsKey - */ - - /** - * Constructs a new EncryptionConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents an EncryptionConfig. - * @implements IEncryptionConfig - * @constructor - * @param {google.cloud.dataproc.v1.IEncryptionConfig=} [properties] Properties to set - */ - function EncryptionConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EncryptionConfig gcePdKmsKeyName. - * @member {string} gcePdKmsKeyName - * @memberof google.cloud.dataproc.v1.EncryptionConfig - * @instance - */ - EncryptionConfig.prototype.gcePdKmsKeyName = ""; - - /** - * EncryptionConfig kmsKey. - * @member {string} kmsKey - * @memberof google.cloud.dataproc.v1.EncryptionConfig - * @instance - */ - EncryptionConfig.prototype.kmsKey = ""; - - /** - * Creates a new EncryptionConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.EncryptionConfig - * @static - * @param {google.cloud.dataproc.v1.IEncryptionConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.EncryptionConfig} EncryptionConfig instance - */ - EncryptionConfig.create = function create(properties) { - return new EncryptionConfig(properties); - }; - - /** - * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.dataproc.v1.EncryptionConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.EncryptionConfig - * @static - * @param {google.cloud.dataproc.v1.IEncryptionConfig} message EncryptionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EncryptionConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.gcePdKmsKeyName != null && Object.hasOwnProperty.call(message, "gcePdKmsKeyName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcePdKmsKeyName); - if (message.kmsKey != null && Object.hasOwnProperty.call(message, "kmsKey")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKey); - return writer; - }; - - /** - * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.EncryptionConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.EncryptionConfig - * @static - * @param {google.cloud.dataproc.v1.IEncryptionConfig} message EncryptionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EncryptionConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.EncryptionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.EncryptionConfig} EncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EncryptionConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.EncryptionConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.gcePdKmsKeyName = reader.string(); - break; - } - case 2: { - message.kmsKey = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.EncryptionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.EncryptionConfig} EncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EncryptionConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EncryptionConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.EncryptionConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EncryptionConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.gcePdKmsKeyName != null && message.hasOwnProperty("gcePdKmsKeyName")) - if (!$util.isString(message.gcePdKmsKeyName)) - return "gcePdKmsKeyName: string expected"; - if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) - if (!$util.isString(message.kmsKey)) - return "kmsKey: string expected"; - return null; - }; - - /** - * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.EncryptionConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.EncryptionConfig} EncryptionConfig - */ - EncryptionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.EncryptionConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.EncryptionConfig(); - if (object.gcePdKmsKeyName != null) - message.gcePdKmsKeyName = String(object.gcePdKmsKeyName); - if (object.kmsKey != null) - message.kmsKey = String(object.kmsKey); - return message; - }; - - /** - * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.EncryptionConfig - * @static - * @param {google.cloud.dataproc.v1.EncryptionConfig} message EncryptionConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EncryptionConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.gcePdKmsKeyName = ""; - object.kmsKey = ""; - } - if (message.gcePdKmsKeyName != null && message.hasOwnProperty("gcePdKmsKeyName")) - object.gcePdKmsKeyName = message.gcePdKmsKeyName; - if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) - object.kmsKey = message.kmsKey; - return object; - }; - - /** - * Converts this EncryptionConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.EncryptionConfig - * @instance - * @returns {Object.} JSON object - */ - EncryptionConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EncryptionConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.EncryptionConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.EncryptionConfig"; - }; - - return EncryptionConfig; - })(); - - v1.GceClusterConfig = (function() { - - /** - * Properties of a GceClusterConfig. - * @memberof google.cloud.dataproc.v1 - * @interface IGceClusterConfig - * @property {string|null} [zoneUri] GceClusterConfig zoneUri - * @property {string|null} [networkUri] GceClusterConfig networkUri - * @property {string|null} [subnetworkUri] GceClusterConfig subnetworkUri - * @property {boolean|null} [internalIpOnly] GceClusterConfig internalIpOnly - * @property {google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccess|null} [privateIpv6GoogleAccess] GceClusterConfig privateIpv6GoogleAccess - * @property {string|null} [serviceAccount] GceClusterConfig serviceAccount - * @property {Array.|null} [serviceAccountScopes] GceClusterConfig serviceAccountScopes - * @property {Array.|null} [tags] GceClusterConfig tags - * @property {Object.|null} [metadata] GceClusterConfig metadata - * @property {google.cloud.dataproc.v1.IReservationAffinity|null} [reservationAffinity] GceClusterConfig reservationAffinity - * @property {google.cloud.dataproc.v1.INodeGroupAffinity|null} [nodeGroupAffinity] GceClusterConfig nodeGroupAffinity - * @property {google.cloud.dataproc.v1.IShieldedInstanceConfig|null} [shieldedInstanceConfig] GceClusterConfig shieldedInstanceConfig - * @property {google.cloud.dataproc.v1.IConfidentialInstanceConfig|null} [confidentialInstanceConfig] GceClusterConfig confidentialInstanceConfig - */ - - /** - * Constructs a new GceClusterConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a GceClusterConfig. - * @implements IGceClusterConfig - * @constructor - * @param {google.cloud.dataproc.v1.IGceClusterConfig=} [properties] Properties to set - */ - function GceClusterConfig(properties) { - this.serviceAccountScopes = []; - this.tags = []; - this.metadata = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GceClusterConfig zoneUri. - * @member {string} zoneUri - * @memberof google.cloud.dataproc.v1.GceClusterConfig - * @instance - */ - GceClusterConfig.prototype.zoneUri = ""; - - /** - * GceClusterConfig networkUri. - * @member {string} networkUri - * @memberof google.cloud.dataproc.v1.GceClusterConfig - * @instance - */ - GceClusterConfig.prototype.networkUri = ""; - - /** - * GceClusterConfig subnetworkUri. - * @member {string} subnetworkUri - * @memberof google.cloud.dataproc.v1.GceClusterConfig - * @instance - */ - GceClusterConfig.prototype.subnetworkUri = ""; - - /** - * GceClusterConfig internalIpOnly. - * @member {boolean|null|undefined} internalIpOnly - * @memberof google.cloud.dataproc.v1.GceClusterConfig - * @instance - */ - GceClusterConfig.prototype.internalIpOnly = null; - - /** - * GceClusterConfig privateIpv6GoogleAccess. - * @member {google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccess} privateIpv6GoogleAccess - * @memberof google.cloud.dataproc.v1.GceClusterConfig - * @instance - */ - GceClusterConfig.prototype.privateIpv6GoogleAccess = 0; - - /** - * GceClusterConfig serviceAccount. - * @member {string} serviceAccount - * @memberof google.cloud.dataproc.v1.GceClusterConfig - * @instance - */ - GceClusterConfig.prototype.serviceAccount = ""; - - /** - * GceClusterConfig serviceAccountScopes. - * @member {Array.} serviceAccountScopes - * @memberof google.cloud.dataproc.v1.GceClusterConfig - * @instance - */ - GceClusterConfig.prototype.serviceAccountScopes = $util.emptyArray; - - /** - * GceClusterConfig tags. - * @member {Array.} tags - * @memberof google.cloud.dataproc.v1.GceClusterConfig - * @instance - */ - GceClusterConfig.prototype.tags = $util.emptyArray; - - /** - * GceClusterConfig metadata. - * @member {Object.} metadata - * @memberof google.cloud.dataproc.v1.GceClusterConfig - * @instance - */ - GceClusterConfig.prototype.metadata = $util.emptyObject; - - /** - * GceClusterConfig reservationAffinity. - * @member {google.cloud.dataproc.v1.IReservationAffinity|null|undefined} reservationAffinity - * @memberof google.cloud.dataproc.v1.GceClusterConfig - * @instance - */ - GceClusterConfig.prototype.reservationAffinity = null; - - /** - * GceClusterConfig nodeGroupAffinity. - * @member {google.cloud.dataproc.v1.INodeGroupAffinity|null|undefined} nodeGroupAffinity - * @memberof google.cloud.dataproc.v1.GceClusterConfig - * @instance - */ - GceClusterConfig.prototype.nodeGroupAffinity = null; - - /** - * GceClusterConfig shieldedInstanceConfig. - * @member {google.cloud.dataproc.v1.IShieldedInstanceConfig|null|undefined} shieldedInstanceConfig - * @memberof google.cloud.dataproc.v1.GceClusterConfig - * @instance - */ - GceClusterConfig.prototype.shieldedInstanceConfig = null; - - /** - * GceClusterConfig confidentialInstanceConfig. - * @member {google.cloud.dataproc.v1.IConfidentialInstanceConfig|null|undefined} confidentialInstanceConfig - * @memberof google.cloud.dataproc.v1.GceClusterConfig - * @instance - */ - GceClusterConfig.prototype.confidentialInstanceConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(GceClusterConfig.prototype, "_internalIpOnly", { - get: $util.oneOfGetter($oneOfFields = ["internalIpOnly"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GceClusterConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.GceClusterConfig - * @static - * @param {google.cloud.dataproc.v1.IGceClusterConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.GceClusterConfig} GceClusterConfig instance - */ - GceClusterConfig.create = function create(properties) { - return new GceClusterConfig(properties); - }; - - /** - * Encodes the specified GceClusterConfig message. Does not implicitly {@link google.cloud.dataproc.v1.GceClusterConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.GceClusterConfig - * @static - * @param {google.cloud.dataproc.v1.IGceClusterConfig} message GceClusterConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GceClusterConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.zoneUri != null && Object.hasOwnProperty.call(message, "zoneUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.zoneUri); - if (message.networkUri != null && Object.hasOwnProperty.call(message, "networkUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.networkUri); - if (message.serviceAccountScopes != null && message.serviceAccountScopes.length) - for (var i = 0; i < message.serviceAccountScopes.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.serviceAccountScopes[i]); - if (message.tags != null && message.tags.length) - for (var i = 0; i < message.tags.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.tags[i]); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - for (var keys = Object.keys(message.metadata), 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.metadata[keys[i]]).ldelim(); - if (message.subnetworkUri != null && Object.hasOwnProperty.call(message, "subnetworkUri")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.subnetworkUri); - if (message.internalIpOnly != null && Object.hasOwnProperty.call(message, "internalIpOnly")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.internalIpOnly); - if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.serviceAccount); - if (message.reservationAffinity != null && Object.hasOwnProperty.call(message, "reservationAffinity")) - $root.google.cloud.dataproc.v1.ReservationAffinity.encode(message.reservationAffinity, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.privateIpv6GoogleAccess != null && Object.hasOwnProperty.call(message, "privateIpv6GoogleAccess")) - writer.uint32(/* id 12, wireType 0 =*/96).int32(message.privateIpv6GoogleAccess); - if (message.nodeGroupAffinity != null && Object.hasOwnProperty.call(message, "nodeGroupAffinity")) - $root.google.cloud.dataproc.v1.NodeGroupAffinity.encode(message.nodeGroupAffinity, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.shieldedInstanceConfig != null && Object.hasOwnProperty.call(message, "shieldedInstanceConfig")) - $root.google.cloud.dataproc.v1.ShieldedInstanceConfig.encode(message.shieldedInstanceConfig, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.confidentialInstanceConfig != null && Object.hasOwnProperty.call(message, "confidentialInstanceConfig")) - $root.google.cloud.dataproc.v1.ConfidentialInstanceConfig.encode(message.confidentialInstanceConfig, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GceClusterConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GceClusterConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.GceClusterConfig - * @static - * @param {google.cloud.dataproc.v1.IGceClusterConfig} message GceClusterConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GceClusterConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GceClusterConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.GceClusterConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.GceClusterConfig} GceClusterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GceClusterConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.GceClusterConfig(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.zoneUri = reader.string(); - break; - } - case 2: { - message.networkUri = reader.string(); - break; - } - case 6: { - message.subnetworkUri = reader.string(); - break; - } - case 7: { - message.internalIpOnly = reader.bool(); - break; - } - case 12: { - message.privateIpv6GoogleAccess = reader.int32(); - break; - } - case 8: { - message.serviceAccount = reader.string(); - break; - } - case 3: { - if (!(message.serviceAccountScopes && message.serviceAccountScopes.length)) - message.serviceAccountScopes = []; - message.serviceAccountScopes.push(reader.string()); - break; - } - case 4: { - if (!(message.tags && message.tags.length)) - message.tags = []; - message.tags.push(reader.string()); - break; - } - case 5: { - if (message.metadata === $util.emptyObject) - message.metadata = {}; - 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.metadata[key] = value; - break; - } - case 11: { - message.reservationAffinity = $root.google.cloud.dataproc.v1.ReservationAffinity.decode(reader, reader.uint32()); - break; - } - case 13: { - message.nodeGroupAffinity = $root.google.cloud.dataproc.v1.NodeGroupAffinity.decode(reader, reader.uint32()); - break; - } - case 14: { - message.shieldedInstanceConfig = $root.google.cloud.dataproc.v1.ShieldedInstanceConfig.decode(reader, reader.uint32()); - break; - } - case 15: { - message.confidentialInstanceConfig = $root.google.cloud.dataproc.v1.ConfidentialInstanceConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GceClusterConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.GceClusterConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.GceClusterConfig} GceClusterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GceClusterConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GceClusterConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.GceClusterConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GceClusterConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.zoneUri != null && message.hasOwnProperty("zoneUri")) - if (!$util.isString(message.zoneUri)) - return "zoneUri: string expected"; - if (message.networkUri != null && message.hasOwnProperty("networkUri")) - if (!$util.isString(message.networkUri)) - return "networkUri: string expected"; - if (message.subnetworkUri != null && message.hasOwnProperty("subnetworkUri")) - if (!$util.isString(message.subnetworkUri)) - return "subnetworkUri: string expected"; - if (message.internalIpOnly != null && message.hasOwnProperty("internalIpOnly")) { - properties._internalIpOnly = 1; - if (typeof message.internalIpOnly !== "boolean") - return "internalIpOnly: boolean expected"; - } - if (message.privateIpv6GoogleAccess != null && message.hasOwnProperty("privateIpv6GoogleAccess")) - switch (message.privateIpv6GoogleAccess) { - default: - return "privateIpv6GoogleAccess: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - if (!$util.isString(message.serviceAccount)) - return "serviceAccount: string expected"; - if (message.serviceAccountScopes != null && message.hasOwnProperty("serviceAccountScopes")) { - if (!Array.isArray(message.serviceAccountScopes)) - return "serviceAccountScopes: array expected"; - for (var i = 0; i < message.serviceAccountScopes.length; ++i) - if (!$util.isString(message.serviceAccountScopes[i])) - return "serviceAccountScopes: 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.metadata != null && message.hasOwnProperty("metadata")) { - if (!$util.isObject(message.metadata)) - return "metadata: object expected"; - var key = Object.keys(message.metadata); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.metadata[key[i]])) - return "metadata: string{k:string} expected"; - } - if (message.reservationAffinity != null && message.hasOwnProperty("reservationAffinity")) { - var error = $root.google.cloud.dataproc.v1.ReservationAffinity.verify(message.reservationAffinity); - if (error) - return "reservationAffinity." + error; - } - if (message.nodeGroupAffinity != null && message.hasOwnProperty("nodeGroupAffinity")) { - var error = $root.google.cloud.dataproc.v1.NodeGroupAffinity.verify(message.nodeGroupAffinity); - if (error) - return "nodeGroupAffinity." + error; - } - if (message.shieldedInstanceConfig != null && message.hasOwnProperty("shieldedInstanceConfig")) { - var error = $root.google.cloud.dataproc.v1.ShieldedInstanceConfig.verify(message.shieldedInstanceConfig); - if (error) - return "shieldedInstanceConfig." + error; - } - if (message.confidentialInstanceConfig != null && message.hasOwnProperty("confidentialInstanceConfig")) { - var error = $root.google.cloud.dataproc.v1.ConfidentialInstanceConfig.verify(message.confidentialInstanceConfig); - if (error) - return "confidentialInstanceConfig." + error; - } - return null; - }; - - /** - * Creates a GceClusterConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.GceClusterConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.GceClusterConfig} GceClusterConfig - */ - GceClusterConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.GceClusterConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.GceClusterConfig(); - if (object.zoneUri != null) - message.zoneUri = String(object.zoneUri); - if (object.networkUri != null) - message.networkUri = String(object.networkUri); - if (object.subnetworkUri != null) - message.subnetworkUri = String(object.subnetworkUri); - if (object.internalIpOnly != null) - message.internalIpOnly = Boolean(object.internalIpOnly); - switch (object.privateIpv6GoogleAccess) { - default: - if (typeof object.privateIpv6GoogleAccess === "number") { - message.privateIpv6GoogleAccess = object.privateIpv6GoogleAccess; - break; - } - break; - case "PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED": - case 0: - message.privateIpv6GoogleAccess = 0; - break; - case "INHERIT_FROM_SUBNETWORK": - case 1: - message.privateIpv6GoogleAccess = 1; - break; - case "OUTBOUND": - case 2: - message.privateIpv6GoogleAccess = 2; - break; - case "BIDIRECTIONAL": - case 3: - message.privateIpv6GoogleAccess = 3; - break; - } - if (object.serviceAccount != null) - message.serviceAccount = String(object.serviceAccount); - if (object.serviceAccountScopes) { - if (!Array.isArray(object.serviceAccountScopes)) - throw TypeError(".google.cloud.dataproc.v1.GceClusterConfig.serviceAccountScopes: array expected"); - message.serviceAccountScopes = []; - for (var i = 0; i < object.serviceAccountScopes.length; ++i) - message.serviceAccountScopes[i] = String(object.serviceAccountScopes[i]); - } - if (object.tags) { - if (!Array.isArray(object.tags)) - throw TypeError(".google.cloud.dataproc.v1.GceClusterConfig.tags: array expected"); - message.tags = []; - for (var i = 0; i < object.tags.length; ++i) - message.tags[i] = String(object.tags[i]); - } - if (object.metadata) { - if (typeof object.metadata !== "object") - throw TypeError(".google.cloud.dataproc.v1.GceClusterConfig.metadata: object expected"); - message.metadata = {}; - for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) - message.metadata[keys[i]] = String(object.metadata[keys[i]]); - } - if (object.reservationAffinity != null) { - if (typeof object.reservationAffinity !== "object") - throw TypeError(".google.cloud.dataproc.v1.GceClusterConfig.reservationAffinity: object expected"); - message.reservationAffinity = $root.google.cloud.dataproc.v1.ReservationAffinity.fromObject(object.reservationAffinity); - } - if (object.nodeGroupAffinity != null) { - if (typeof object.nodeGroupAffinity !== "object") - throw TypeError(".google.cloud.dataproc.v1.GceClusterConfig.nodeGroupAffinity: object expected"); - message.nodeGroupAffinity = $root.google.cloud.dataproc.v1.NodeGroupAffinity.fromObject(object.nodeGroupAffinity); - } - if (object.shieldedInstanceConfig != null) { - if (typeof object.shieldedInstanceConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.GceClusterConfig.shieldedInstanceConfig: object expected"); - message.shieldedInstanceConfig = $root.google.cloud.dataproc.v1.ShieldedInstanceConfig.fromObject(object.shieldedInstanceConfig); - } - if (object.confidentialInstanceConfig != null) { - if (typeof object.confidentialInstanceConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.GceClusterConfig.confidentialInstanceConfig: object expected"); - message.confidentialInstanceConfig = $root.google.cloud.dataproc.v1.ConfidentialInstanceConfig.fromObject(object.confidentialInstanceConfig); - } - return message; - }; - - /** - * Creates a plain object from a GceClusterConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.GceClusterConfig - * @static - * @param {google.cloud.dataproc.v1.GceClusterConfig} message GceClusterConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GceClusterConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.serviceAccountScopes = []; - object.tags = []; - } - if (options.objects || options.defaults) - object.metadata = {}; - if (options.defaults) { - object.zoneUri = ""; - object.networkUri = ""; - object.subnetworkUri = ""; - object.serviceAccount = ""; - object.reservationAffinity = null; - object.privateIpv6GoogleAccess = options.enums === String ? "PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED" : 0; - object.nodeGroupAffinity = null; - object.shieldedInstanceConfig = null; - object.confidentialInstanceConfig = null; - } - if (message.zoneUri != null && message.hasOwnProperty("zoneUri")) - object.zoneUri = message.zoneUri; - if (message.networkUri != null && message.hasOwnProperty("networkUri")) - object.networkUri = message.networkUri; - if (message.serviceAccountScopes && message.serviceAccountScopes.length) { - object.serviceAccountScopes = []; - for (var j = 0; j < message.serviceAccountScopes.length; ++j) - object.serviceAccountScopes[j] = message.serviceAccountScopes[j]; - } - if (message.tags && message.tags.length) { - object.tags = []; - for (var j = 0; j < message.tags.length; ++j) - object.tags[j] = message.tags[j]; - } - var keys2; - if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { - object.metadata = {}; - for (var j = 0; j < keys2.length; ++j) - object.metadata[keys2[j]] = message.metadata[keys2[j]]; - } - if (message.subnetworkUri != null && message.hasOwnProperty("subnetworkUri")) - object.subnetworkUri = message.subnetworkUri; - if (message.internalIpOnly != null && message.hasOwnProperty("internalIpOnly")) { - object.internalIpOnly = message.internalIpOnly; - if (options.oneofs) - object._internalIpOnly = "internalIpOnly"; - } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - object.serviceAccount = message.serviceAccount; - if (message.reservationAffinity != null && message.hasOwnProperty("reservationAffinity")) - object.reservationAffinity = $root.google.cloud.dataproc.v1.ReservationAffinity.toObject(message.reservationAffinity, options); - if (message.privateIpv6GoogleAccess != null && message.hasOwnProperty("privateIpv6GoogleAccess")) - object.privateIpv6GoogleAccess = options.enums === String ? $root.google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccess[message.privateIpv6GoogleAccess] === undefined ? message.privateIpv6GoogleAccess : $root.google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccess[message.privateIpv6GoogleAccess] : message.privateIpv6GoogleAccess; - if (message.nodeGroupAffinity != null && message.hasOwnProperty("nodeGroupAffinity")) - object.nodeGroupAffinity = $root.google.cloud.dataproc.v1.NodeGroupAffinity.toObject(message.nodeGroupAffinity, options); - if (message.shieldedInstanceConfig != null && message.hasOwnProperty("shieldedInstanceConfig")) - object.shieldedInstanceConfig = $root.google.cloud.dataproc.v1.ShieldedInstanceConfig.toObject(message.shieldedInstanceConfig, options); - if (message.confidentialInstanceConfig != null && message.hasOwnProperty("confidentialInstanceConfig")) - object.confidentialInstanceConfig = $root.google.cloud.dataproc.v1.ConfidentialInstanceConfig.toObject(message.confidentialInstanceConfig, options); - return object; - }; - - /** - * Converts this GceClusterConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.GceClusterConfig - * @instance - * @returns {Object.} JSON object - */ - GceClusterConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GceClusterConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.GceClusterConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GceClusterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.GceClusterConfig"; - }; - - /** - * PrivateIpv6GoogleAccess enum. - * @name google.cloud.dataproc.v1.GceClusterConfig.PrivateIpv6GoogleAccess - * @enum {number} - * @property {number} PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED=0 PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED value - * @property {number} INHERIT_FROM_SUBNETWORK=1 INHERIT_FROM_SUBNETWORK value - * @property {number} OUTBOUND=2 OUTBOUND value - * @property {number} BIDIRECTIONAL=3 BIDIRECTIONAL value - */ - GceClusterConfig.PrivateIpv6GoogleAccess = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED"] = 0; - values[valuesById[1] = "INHERIT_FROM_SUBNETWORK"] = 1; - values[valuesById[2] = "OUTBOUND"] = 2; - values[valuesById[3] = "BIDIRECTIONAL"] = 3; - return values; - })(); - - return GceClusterConfig; - })(); - - v1.NodeGroupAffinity = (function() { - - /** - * Properties of a NodeGroupAffinity. - * @memberof google.cloud.dataproc.v1 - * @interface INodeGroupAffinity - * @property {string|null} [nodeGroupUri] NodeGroupAffinity nodeGroupUri - */ - - /** - * Constructs a new NodeGroupAffinity. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a NodeGroupAffinity. - * @implements INodeGroupAffinity - * @constructor - * @param {google.cloud.dataproc.v1.INodeGroupAffinity=} [properties] Properties to set - */ - function NodeGroupAffinity(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NodeGroupAffinity nodeGroupUri. - * @member {string} nodeGroupUri - * @memberof google.cloud.dataproc.v1.NodeGroupAffinity - * @instance - */ - NodeGroupAffinity.prototype.nodeGroupUri = ""; - - /** - * Creates a new NodeGroupAffinity instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.NodeGroupAffinity - * @static - * @param {google.cloud.dataproc.v1.INodeGroupAffinity=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.NodeGroupAffinity} NodeGroupAffinity instance - */ - NodeGroupAffinity.create = function create(properties) { - return new NodeGroupAffinity(properties); - }; - - /** - * Encodes the specified NodeGroupAffinity message. Does not implicitly {@link google.cloud.dataproc.v1.NodeGroupAffinity.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.NodeGroupAffinity - * @static - * @param {google.cloud.dataproc.v1.INodeGroupAffinity} message NodeGroupAffinity message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeGroupAffinity.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nodeGroupUri != null && Object.hasOwnProperty.call(message, "nodeGroupUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.nodeGroupUri); - return writer; - }; - - /** - * Encodes the specified NodeGroupAffinity message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.NodeGroupAffinity.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.NodeGroupAffinity - * @static - * @param {google.cloud.dataproc.v1.INodeGroupAffinity} message NodeGroupAffinity message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeGroupAffinity.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NodeGroupAffinity message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.NodeGroupAffinity - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.NodeGroupAffinity} NodeGroupAffinity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeGroupAffinity.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.NodeGroupAffinity(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.nodeGroupUri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NodeGroupAffinity message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.NodeGroupAffinity - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.NodeGroupAffinity} NodeGroupAffinity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeGroupAffinity.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NodeGroupAffinity message. - * @function verify - * @memberof google.cloud.dataproc.v1.NodeGroupAffinity - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NodeGroupAffinity.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.nodeGroupUri != null && message.hasOwnProperty("nodeGroupUri")) - if (!$util.isString(message.nodeGroupUri)) - return "nodeGroupUri: string expected"; - return null; - }; - - /** - * Creates a NodeGroupAffinity message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.NodeGroupAffinity - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.NodeGroupAffinity} NodeGroupAffinity - */ - NodeGroupAffinity.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.NodeGroupAffinity) - return object; - var message = new $root.google.cloud.dataproc.v1.NodeGroupAffinity(); - if (object.nodeGroupUri != null) - message.nodeGroupUri = String(object.nodeGroupUri); - return message; - }; - - /** - * Creates a plain object from a NodeGroupAffinity message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.NodeGroupAffinity - * @static - * @param {google.cloud.dataproc.v1.NodeGroupAffinity} message NodeGroupAffinity - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NodeGroupAffinity.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.nodeGroupUri = ""; - if (message.nodeGroupUri != null && message.hasOwnProperty("nodeGroupUri")) - object.nodeGroupUri = message.nodeGroupUri; - return object; - }; - - /** - * Converts this NodeGroupAffinity to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.NodeGroupAffinity - * @instance - * @returns {Object.} JSON object - */ - NodeGroupAffinity.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NodeGroupAffinity - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.NodeGroupAffinity - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NodeGroupAffinity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.NodeGroupAffinity"; - }; - - return NodeGroupAffinity; - })(); - - v1.ShieldedInstanceConfig = (function() { - - /** - * Properties of a ShieldedInstanceConfig. - * @memberof google.cloud.dataproc.v1 - * @interface IShieldedInstanceConfig - * @property {boolean|null} [enableSecureBoot] ShieldedInstanceConfig enableSecureBoot - * @property {boolean|null} [enableVtpm] ShieldedInstanceConfig enableVtpm - * @property {boolean|null} [enableIntegrityMonitoring] ShieldedInstanceConfig enableIntegrityMonitoring - */ - - /** - * Constructs a new ShieldedInstanceConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a ShieldedInstanceConfig. - * @implements IShieldedInstanceConfig - * @constructor - * @param {google.cloud.dataproc.v1.IShieldedInstanceConfig=} [properties] Properties to set - */ - function ShieldedInstanceConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ShieldedInstanceConfig enableSecureBoot. - * @member {boolean|null|undefined} enableSecureBoot - * @memberof google.cloud.dataproc.v1.ShieldedInstanceConfig - * @instance - */ - ShieldedInstanceConfig.prototype.enableSecureBoot = null; - - /** - * ShieldedInstanceConfig enableVtpm. - * @member {boolean|null|undefined} enableVtpm - * @memberof google.cloud.dataproc.v1.ShieldedInstanceConfig - * @instance - */ - ShieldedInstanceConfig.prototype.enableVtpm = null; - - /** - * ShieldedInstanceConfig enableIntegrityMonitoring. - * @member {boolean|null|undefined} enableIntegrityMonitoring - * @memberof google.cloud.dataproc.v1.ShieldedInstanceConfig - * @instance - */ - ShieldedInstanceConfig.prototype.enableIntegrityMonitoring = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ShieldedInstanceConfig.prototype, "_enableSecureBoot", { - get: $util.oneOfGetter($oneOfFields = ["enableSecureBoot"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ShieldedInstanceConfig.prototype, "_enableVtpm", { - get: $util.oneOfGetter($oneOfFields = ["enableVtpm"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ShieldedInstanceConfig.prototype, "_enableIntegrityMonitoring", { - get: $util.oneOfGetter($oneOfFields = ["enableIntegrityMonitoring"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ShieldedInstanceConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.ShieldedInstanceConfig - * @static - * @param {google.cloud.dataproc.v1.IShieldedInstanceConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.ShieldedInstanceConfig} ShieldedInstanceConfig instance - */ - ShieldedInstanceConfig.create = function create(properties) { - return new ShieldedInstanceConfig(properties); - }; - - /** - * Encodes the specified ShieldedInstanceConfig message. Does not implicitly {@link google.cloud.dataproc.v1.ShieldedInstanceConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.ShieldedInstanceConfig - * @static - * @param {google.cloud.dataproc.v1.IShieldedInstanceConfig} message ShieldedInstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ShieldedInstanceConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.enableSecureBoot != null && Object.hasOwnProperty.call(message, "enableSecureBoot")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableSecureBoot); - if (message.enableVtpm != null && Object.hasOwnProperty.call(message, "enableVtpm")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableVtpm); - if (message.enableIntegrityMonitoring != null && Object.hasOwnProperty.call(message, "enableIntegrityMonitoring")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableIntegrityMonitoring); - return writer; - }; - - /** - * Encodes the specified ShieldedInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ShieldedInstanceConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.ShieldedInstanceConfig - * @static - * @param {google.cloud.dataproc.v1.IShieldedInstanceConfig} message ShieldedInstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ShieldedInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ShieldedInstanceConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.ShieldedInstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.ShieldedInstanceConfig} ShieldedInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ShieldedInstanceConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ShieldedInstanceConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.enableSecureBoot = reader.bool(); - break; - } - case 2: { - message.enableVtpm = reader.bool(); - break; - } - case 3: { - message.enableIntegrityMonitoring = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ShieldedInstanceConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.ShieldedInstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.ShieldedInstanceConfig} ShieldedInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ShieldedInstanceConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ShieldedInstanceConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.ShieldedInstanceConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ShieldedInstanceConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.enableSecureBoot != null && message.hasOwnProperty("enableSecureBoot")) { - properties._enableSecureBoot = 1; - if (typeof message.enableSecureBoot !== "boolean") - return "enableSecureBoot: boolean expected"; - } - if (message.enableVtpm != null && message.hasOwnProperty("enableVtpm")) { - properties._enableVtpm = 1; - if (typeof message.enableVtpm !== "boolean") - return "enableVtpm: boolean expected"; - } - if (message.enableIntegrityMonitoring != null && message.hasOwnProperty("enableIntegrityMonitoring")) { - properties._enableIntegrityMonitoring = 1; - if (typeof message.enableIntegrityMonitoring !== "boolean") - return "enableIntegrityMonitoring: boolean expected"; - } - return null; - }; - - /** - * Creates a ShieldedInstanceConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.ShieldedInstanceConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.ShieldedInstanceConfig} ShieldedInstanceConfig - */ - ShieldedInstanceConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.ShieldedInstanceConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.ShieldedInstanceConfig(); - if (object.enableSecureBoot != null) - message.enableSecureBoot = Boolean(object.enableSecureBoot); - if (object.enableVtpm != null) - message.enableVtpm = Boolean(object.enableVtpm); - if (object.enableIntegrityMonitoring != null) - message.enableIntegrityMonitoring = Boolean(object.enableIntegrityMonitoring); - return message; - }; - - /** - * Creates a plain object from a ShieldedInstanceConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.ShieldedInstanceConfig - * @static - * @param {google.cloud.dataproc.v1.ShieldedInstanceConfig} message ShieldedInstanceConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ShieldedInstanceConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.enableSecureBoot != null && message.hasOwnProperty("enableSecureBoot")) { - object.enableSecureBoot = message.enableSecureBoot; - if (options.oneofs) - object._enableSecureBoot = "enableSecureBoot"; - } - if (message.enableVtpm != null && message.hasOwnProperty("enableVtpm")) { - object.enableVtpm = message.enableVtpm; - if (options.oneofs) - object._enableVtpm = "enableVtpm"; - } - if (message.enableIntegrityMonitoring != null && message.hasOwnProperty("enableIntegrityMonitoring")) { - object.enableIntegrityMonitoring = message.enableIntegrityMonitoring; - if (options.oneofs) - object._enableIntegrityMonitoring = "enableIntegrityMonitoring"; - } - return object; - }; - - /** - * Converts this ShieldedInstanceConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.ShieldedInstanceConfig - * @instance - * @returns {Object.} JSON object - */ - ShieldedInstanceConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ShieldedInstanceConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.ShieldedInstanceConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ShieldedInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.ShieldedInstanceConfig"; - }; - - return ShieldedInstanceConfig; - })(); - - v1.ConfidentialInstanceConfig = (function() { - - /** - * Properties of a ConfidentialInstanceConfig. - * @memberof google.cloud.dataproc.v1 - * @interface IConfidentialInstanceConfig - * @property {boolean|null} [enableConfidentialCompute] ConfidentialInstanceConfig enableConfidentialCompute - */ - - /** - * Constructs a new ConfidentialInstanceConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a ConfidentialInstanceConfig. - * @implements IConfidentialInstanceConfig - * @constructor - * @param {google.cloud.dataproc.v1.IConfidentialInstanceConfig=} [properties] Properties to set - */ - function ConfidentialInstanceConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ConfidentialInstanceConfig enableConfidentialCompute. - * @member {boolean} enableConfidentialCompute - * @memberof google.cloud.dataproc.v1.ConfidentialInstanceConfig - * @instance - */ - ConfidentialInstanceConfig.prototype.enableConfidentialCompute = false; - - /** - * Creates a new ConfidentialInstanceConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.ConfidentialInstanceConfig - * @static - * @param {google.cloud.dataproc.v1.IConfidentialInstanceConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.ConfidentialInstanceConfig} ConfidentialInstanceConfig instance - */ - ConfidentialInstanceConfig.create = function create(properties) { - return new ConfidentialInstanceConfig(properties); - }; - - /** - * Encodes the specified ConfidentialInstanceConfig message. Does not implicitly {@link google.cloud.dataproc.v1.ConfidentialInstanceConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.ConfidentialInstanceConfig - * @static - * @param {google.cloud.dataproc.v1.IConfidentialInstanceConfig} message ConfidentialInstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConfidentialInstanceConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.enableConfidentialCompute != null && Object.hasOwnProperty.call(message, "enableConfidentialCompute")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableConfidentialCompute); - return writer; - }; - - /** - * Encodes the specified ConfidentialInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ConfidentialInstanceConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.ConfidentialInstanceConfig - * @static - * @param {google.cloud.dataproc.v1.IConfidentialInstanceConfig} message ConfidentialInstanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ConfidentialInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ConfidentialInstanceConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.ConfidentialInstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.ConfidentialInstanceConfig} ConfidentialInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConfidentialInstanceConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ConfidentialInstanceConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.enableConfidentialCompute = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ConfidentialInstanceConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.ConfidentialInstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.ConfidentialInstanceConfig} ConfidentialInstanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ConfidentialInstanceConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ConfidentialInstanceConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.ConfidentialInstanceConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ConfidentialInstanceConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.enableConfidentialCompute != null && message.hasOwnProperty("enableConfidentialCompute")) - if (typeof message.enableConfidentialCompute !== "boolean") - return "enableConfidentialCompute: boolean expected"; - return null; - }; - - /** - * Creates a ConfidentialInstanceConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.ConfidentialInstanceConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.ConfidentialInstanceConfig} ConfidentialInstanceConfig - */ - ConfidentialInstanceConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.ConfidentialInstanceConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.ConfidentialInstanceConfig(); - if (object.enableConfidentialCompute != null) - message.enableConfidentialCompute = Boolean(object.enableConfidentialCompute); - return message; - }; - - /** - * Creates a plain object from a ConfidentialInstanceConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.ConfidentialInstanceConfig - * @static - * @param {google.cloud.dataproc.v1.ConfidentialInstanceConfig} message ConfidentialInstanceConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ConfidentialInstanceConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.enableConfidentialCompute = false; - if (message.enableConfidentialCompute != null && message.hasOwnProperty("enableConfidentialCompute")) - object.enableConfidentialCompute = message.enableConfidentialCompute; - return object; - }; - - /** - * Converts this ConfidentialInstanceConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.ConfidentialInstanceConfig - * @instance - * @returns {Object.} JSON object - */ - ConfidentialInstanceConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ConfidentialInstanceConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.ConfidentialInstanceConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ConfidentialInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.ConfidentialInstanceConfig"; - }; - - return ConfidentialInstanceConfig; - })(); - - v1.InstanceGroupConfig = (function() { - - /** - * Properties of an InstanceGroupConfig. - * @memberof google.cloud.dataproc.v1 - * @interface IInstanceGroupConfig - * @property {number|null} [numInstances] InstanceGroupConfig numInstances - * @property {Array.|null} [instanceNames] InstanceGroupConfig instanceNames - * @property {Array.|null} [instanceReferences] InstanceGroupConfig instanceReferences - * @property {string|null} [imageUri] InstanceGroupConfig imageUri - * @property {string|null} [machineTypeUri] InstanceGroupConfig machineTypeUri - * @property {google.cloud.dataproc.v1.IDiskConfig|null} [diskConfig] InstanceGroupConfig diskConfig - * @property {boolean|null} [isPreemptible] InstanceGroupConfig isPreemptible - * @property {google.cloud.dataproc.v1.InstanceGroupConfig.Preemptibility|null} [preemptibility] InstanceGroupConfig preemptibility - * @property {google.cloud.dataproc.v1.IManagedGroupConfig|null} [managedGroupConfig] InstanceGroupConfig managedGroupConfig - * @property {Array.|null} [accelerators] InstanceGroupConfig accelerators - * @property {string|null} [minCpuPlatform] InstanceGroupConfig minCpuPlatform - * @property {number|null} [minNumInstances] InstanceGroupConfig minNumInstances - * @property {google.cloud.dataproc.v1.IInstanceFlexibilityPolicy|null} [instanceFlexibilityPolicy] InstanceGroupConfig instanceFlexibilityPolicy - * @property {google.cloud.dataproc.v1.IStartupConfig|null} [startupConfig] InstanceGroupConfig startupConfig - */ - - /** - * Constructs a new InstanceGroupConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents an InstanceGroupConfig. - * @implements IInstanceGroupConfig - * @constructor - * @param {google.cloud.dataproc.v1.IInstanceGroupConfig=} [properties] Properties to set - */ - function InstanceGroupConfig(properties) { - this.instanceNames = []; - this.instanceReferences = []; - this.accelerators = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstanceGroupConfig numInstances. - * @member {number} numInstances - * @memberof google.cloud.dataproc.v1.InstanceGroupConfig - * @instance - */ - InstanceGroupConfig.prototype.numInstances = 0; - - /** - * InstanceGroupConfig instanceNames. - * @member {Array.} instanceNames - * @memberof google.cloud.dataproc.v1.InstanceGroupConfig - * @instance - */ - InstanceGroupConfig.prototype.instanceNames = $util.emptyArray; - - /** - * InstanceGroupConfig instanceReferences. - * @member {Array.} instanceReferences - * @memberof google.cloud.dataproc.v1.InstanceGroupConfig - * @instance - */ - InstanceGroupConfig.prototype.instanceReferences = $util.emptyArray; - - /** - * InstanceGroupConfig imageUri. - * @member {string} imageUri - * @memberof google.cloud.dataproc.v1.InstanceGroupConfig - * @instance - */ - InstanceGroupConfig.prototype.imageUri = ""; - - /** - * InstanceGroupConfig machineTypeUri. - * @member {string} machineTypeUri - * @memberof google.cloud.dataproc.v1.InstanceGroupConfig - * @instance - */ - InstanceGroupConfig.prototype.machineTypeUri = ""; - - /** - * InstanceGroupConfig diskConfig. - * @member {google.cloud.dataproc.v1.IDiskConfig|null|undefined} diskConfig - * @memberof google.cloud.dataproc.v1.InstanceGroupConfig - * @instance - */ - InstanceGroupConfig.prototype.diskConfig = null; - - /** - * InstanceGroupConfig isPreemptible. - * @member {boolean} isPreemptible - * @memberof google.cloud.dataproc.v1.InstanceGroupConfig - * @instance - */ - InstanceGroupConfig.prototype.isPreemptible = false; - - /** - * InstanceGroupConfig preemptibility. - * @member {google.cloud.dataproc.v1.InstanceGroupConfig.Preemptibility} preemptibility - * @memberof google.cloud.dataproc.v1.InstanceGroupConfig - * @instance - */ - InstanceGroupConfig.prototype.preemptibility = 0; - - /** - * InstanceGroupConfig managedGroupConfig. - * @member {google.cloud.dataproc.v1.IManagedGroupConfig|null|undefined} managedGroupConfig - * @memberof google.cloud.dataproc.v1.InstanceGroupConfig - * @instance - */ - InstanceGroupConfig.prototype.managedGroupConfig = null; - - /** - * InstanceGroupConfig accelerators. - * @member {Array.} accelerators - * @memberof google.cloud.dataproc.v1.InstanceGroupConfig - * @instance - */ - InstanceGroupConfig.prototype.accelerators = $util.emptyArray; - - /** - * InstanceGroupConfig minCpuPlatform. - * @member {string} minCpuPlatform - * @memberof google.cloud.dataproc.v1.InstanceGroupConfig - * @instance - */ - InstanceGroupConfig.prototype.minCpuPlatform = ""; - - /** - * InstanceGroupConfig minNumInstances. - * @member {number} minNumInstances - * @memberof google.cloud.dataproc.v1.InstanceGroupConfig - * @instance - */ - InstanceGroupConfig.prototype.minNumInstances = 0; - - /** - * InstanceGroupConfig instanceFlexibilityPolicy. - * @member {google.cloud.dataproc.v1.IInstanceFlexibilityPolicy|null|undefined} instanceFlexibilityPolicy - * @memberof google.cloud.dataproc.v1.InstanceGroupConfig - * @instance - */ - InstanceGroupConfig.prototype.instanceFlexibilityPolicy = null; - - /** - * InstanceGroupConfig startupConfig. - * @member {google.cloud.dataproc.v1.IStartupConfig|null|undefined} startupConfig - * @memberof google.cloud.dataproc.v1.InstanceGroupConfig - * @instance - */ - InstanceGroupConfig.prototype.startupConfig = null; - - /** - * Creates a new InstanceGroupConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.InstanceGroupConfig - * @static - * @param {google.cloud.dataproc.v1.IInstanceGroupConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.InstanceGroupConfig} InstanceGroupConfig instance - */ - InstanceGroupConfig.create = function create(properties) { - return new InstanceGroupConfig(properties); - }; - - /** - * Encodes the specified InstanceGroupConfig message. Does not implicitly {@link google.cloud.dataproc.v1.InstanceGroupConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.InstanceGroupConfig - * @static - * @param {google.cloud.dataproc.v1.IInstanceGroupConfig} message InstanceGroupConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceGroupConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.numInstances != null && Object.hasOwnProperty.call(message, "numInstances")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.numInstances); - if (message.instanceNames != null && message.instanceNames.length) - for (var i = 0; i < message.instanceNames.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceNames[i]); - if (message.imageUri != null && Object.hasOwnProperty.call(message, "imageUri")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.imageUri); - if (message.machineTypeUri != null && Object.hasOwnProperty.call(message, "machineTypeUri")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.machineTypeUri); - if (message.diskConfig != null && Object.hasOwnProperty.call(message, "diskConfig")) - $root.google.cloud.dataproc.v1.DiskConfig.encode(message.diskConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.isPreemptible != null && Object.hasOwnProperty.call(message, "isPreemptible")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.isPreemptible); - if (message.managedGroupConfig != null && Object.hasOwnProperty.call(message, "managedGroupConfig")) - $root.google.cloud.dataproc.v1.ManagedGroupConfig.encode(message.managedGroupConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.accelerators != null && message.accelerators.length) - for (var i = 0; i < message.accelerators.length; ++i) - $root.google.cloud.dataproc.v1.AcceleratorConfig.encode(message.accelerators[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.minCpuPlatform != null && Object.hasOwnProperty.call(message, "minCpuPlatform")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.minCpuPlatform); - if (message.preemptibility != null && Object.hasOwnProperty.call(message, "preemptibility")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.preemptibility); - if (message.instanceReferences != null && message.instanceReferences.length) - for (var i = 0; i < message.instanceReferences.length; ++i) - $root.google.cloud.dataproc.v1.InstanceReference.encode(message.instanceReferences[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.minNumInstances != null && Object.hasOwnProperty.call(message, "minNumInstances")) - writer.uint32(/* id 12, wireType 0 =*/96).int32(message.minNumInstances); - if (message.instanceFlexibilityPolicy != null && Object.hasOwnProperty.call(message, "instanceFlexibilityPolicy")) - $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.encode(message.instanceFlexibilityPolicy, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.startupConfig != null && Object.hasOwnProperty.call(message, "startupConfig")) - $root.google.cloud.dataproc.v1.StartupConfig.encode(message.startupConfig, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified InstanceGroupConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstanceGroupConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.InstanceGroupConfig - * @static - * @param {google.cloud.dataproc.v1.IInstanceGroupConfig} message InstanceGroupConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceGroupConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstanceGroupConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.InstanceGroupConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.InstanceGroupConfig} InstanceGroupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceGroupConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.InstanceGroupConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.numInstances = reader.int32(); - break; - } - case 2: { - if (!(message.instanceNames && message.instanceNames.length)) - message.instanceNames = []; - message.instanceNames.push(reader.string()); - break; - } - case 11: { - if (!(message.instanceReferences && message.instanceReferences.length)) - message.instanceReferences = []; - message.instanceReferences.push($root.google.cloud.dataproc.v1.InstanceReference.decode(reader, reader.uint32())); - break; - } - case 3: { - message.imageUri = reader.string(); - break; - } - case 4: { - message.machineTypeUri = reader.string(); - break; - } - case 5: { - message.diskConfig = $root.google.cloud.dataproc.v1.DiskConfig.decode(reader, reader.uint32()); - break; - } - case 6: { - message.isPreemptible = reader.bool(); - break; - } - case 10: { - message.preemptibility = reader.int32(); - break; - } - case 7: { - message.managedGroupConfig = $root.google.cloud.dataproc.v1.ManagedGroupConfig.decode(reader, reader.uint32()); - break; - } - case 8: { - if (!(message.accelerators && message.accelerators.length)) - message.accelerators = []; - message.accelerators.push($root.google.cloud.dataproc.v1.AcceleratorConfig.decode(reader, reader.uint32())); - break; - } - case 9: { - message.minCpuPlatform = reader.string(); - break; - } - case 12: { - message.minNumInstances = reader.int32(); - break; - } - case 13: { - message.instanceFlexibilityPolicy = $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.decode(reader, reader.uint32()); - break; - } - case 14: { - message.startupConfig = $root.google.cloud.dataproc.v1.StartupConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstanceGroupConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.InstanceGroupConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.InstanceGroupConfig} InstanceGroupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceGroupConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstanceGroupConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.InstanceGroupConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstanceGroupConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.numInstances != null && message.hasOwnProperty("numInstances")) - if (!$util.isInteger(message.numInstances)) - return "numInstances: integer expected"; - if (message.instanceNames != null && message.hasOwnProperty("instanceNames")) { - if (!Array.isArray(message.instanceNames)) - return "instanceNames: array expected"; - for (var i = 0; i < message.instanceNames.length; ++i) - if (!$util.isString(message.instanceNames[i])) - return "instanceNames: string[] expected"; - } - if (message.instanceReferences != null && message.hasOwnProperty("instanceReferences")) { - if (!Array.isArray(message.instanceReferences)) - return "instanceReferences: array expected"; - for (var i = 0; i < message.instanceReferences.length; ++i) { - var error = $root.google.cloud.dataproc.v1.InstanceReference.verify(message.instanceReferences[i]); - if (error) - return "instanceReferences." + error; - } - } - if (message.imageUri != null && message.hasOwnProperty("imageUri")) - if (!$util.isString(message.imageUri)) - return "imageUri: string expected"; - if (message.machineTypeUri != null && message.hasOwnProperty("machineTypeUri")) - if (!$util.isString(message.machineTypeUri)) - return "machineTypeUri: string expected"; - if (message.diskConfig != null && message.hasOwnProperty("diskConfig")) { - var error = $root.google.cloud.dataproc.v1.DiskConfig.verify(message.diskConfig); - if (error) - return "diskConfig." + error; - } - if (message.isPreemptible != null && message.hasOwnProperty("isPreemptible")) - if (typeof message.isPreemptible !== "boolean") - return "isPreemptible: boolean expected"; - if (message.preemptibility != null && message.hasOwnProperty("preemptibility")) - switch (message.preemptibility) { - default: - return "preemptibility: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.managedGroupConfig != null && message.hasOwnProperty("managedGroupConfig")) { - var error = $root.google.cloud.dataproc.v1.ManagedGroupConfig.verify(message.managedGroupConfig); - if (error) - return "managedGroupConfig." + error; - } - if (message.accelerators != null && message.hasOwnProperty("accelerators")) { - if (!Array.isArray(message.accelerators)) - return "accelerators: array expected"; - for (var i = 0; i < message.accelerators.length; ++i) { - var error = $root.google.cloud.dataproc.v1.AcceleratorConfig.verify(message.accelerators[i]); - if (error) - return "accelerators." + error; - } - } - if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) - if (!$util.isString(message.minCpuPlatform)) - return "minCpuPlatform: string expected"; - if (message.minNumInstances != null && message.hasOwnProperty("minNumInstances")) - if (!$util.isInteger(message.minNumInstances)) - return "minNumInstances: integer expected"; - if (message.instanceFlexibilityPolicy != null && message.hasOwnProperty("instanceFlexibilityPolicy")) { - var error = $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.verify(message.instanceFlexibilityPolicy); - if (error) - return "instanceFlexibilityPolicy." + error; - } - if (message.startupConfig != null && message.hasOwnProperty("startupConfig")) { - var error = $root.google.cloud.dataproc.v1.StartupConfig.verify(message.startupConfig); - if (error) - return "startupConfig." + error; - } - return null; - }; - - /** - * Creates an InstanceGroupConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.InstanceGroupConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.InstanceGroupConfig} InstanceGroupConfig - */ - InstanceGroupConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.InstanceGroupConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.InstanceGroupConfig(); - if (object.numInstances != null) - message.numInstances = object.numInstances | 0; - if (object.instanceNames) { - if (!Array.isArray(object.instanceNames)) - throw TypeError(".google.cloud.dataproc.v1.InstanceGroupConfig.instanceNames: array expected"); - message.instanceNames = []; - for (var i = 0; i < object.instanceNames.length; ++i) - message.instanceNames[i] = String(object.instanceNames[i]); - } - if (object.instanceReferences) { - if (!Array.isArray(object.instanceReferences)) - throw TypeError(".google.cloud.dataproc.v1.InstanceGroupConfig.instanceReferences: array expected"); - message.instanceReferences = []; - for (var i = 0; i < object.instanceReferences.length; ++i) { - if (typeof object.instanceReferences[i] !== "object") - throw TypeError(".google.cloud.dataproc.v1.InstanceGroupConfig.instanceReferences: object expected"); - message.instanceReferences[i] = $root.google.cloud.dataproc.v1.InstanceReference.fromObject(object.instanceReferences[i]); - } - } - if (object.imageUri != null) - message.imageUri = String(object.imageUri); - if (object.machineTypeUri != null) - message.machineTypeUri = String(object.machineTypeUri); - if (object.diskConfig != null) { - if (typeof object.diskConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.InstanceGroupConfig.diskConfig: object expected"); - message.diskConfig = $root.google.cloud.dataproc.v1.DiskConfig.fromObject(object.diskConfig); - } - if (object.isPreemptible != null) - message.isPreemptible = Boolean(object.isPreemptible); - switch (object.preemptibility) { - default: - if (typeof object.preemptibility === "number") { - message.preemptibility = object.preemptibility; - break; - } - break; - case "PREEMPTIBILITY_UNSPECIFIED": - case 0: - message.preemptibility = 0; - break; - case "NON_PREEMPTIBLE": - case 1: - message.preemptibility = 1; - break; - case "PREEMPTIBLE": - case 2: - message.preemptibility = 2; - break; - case "SPOT": - case 3: - message.preemptibility = 3; - break; - } - if (object.managedGroupConfig != null) { - if (typeof object.managedGroupConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.InstanceGroupConfig.managedGroupConfig: object expected"); - message.managedGroupConfig = $root.google.cloud.dataproc.v1.ManagedGroupConfig.fromObject(object.managedGroupConfig); - } - if (object.accelerators) { - if (!Array.isArray(object.accelerators)) - throw TypeError(".google.cloud.dataproc.v1.InstanceGroupConfig.accelerators: array expected"); - message.accelerators = []; - for (var i = 0; i < object.accelerators.length; ++i) { - if (typeof object.accelerators[i] !== "object") - throw TypeError(".google.cloud.dataproc.v1.InstanceGroupConfig.accelerators: object expected"); - message.accelerators[i] = $root.google.cloud.dataproc.v1.AcceleratorConfig.fromObject(object.accelerators[i]); - } - } - if (object.minCpuPlatform != null) - message.minCpuPlatform = String(object.minCpuPlatform); - if (object.minNumInstances != null) - message.minNumInstances = object.minNumInstances | 0; - if (object.instanceFlexibilityPolicy != null) { - if (typeof object.instanceFlexibilityPolicy !== "object") - throw TypeError(".google.cloud.dataproc.v1.InstanceGroupConfig.instanceFlexibilityPolicy: object expected"); - message.instanceFlexibilityPolicy = $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.fromObject(object.instanceFlexibilityPolicy); - } - if (object.startupConfig != null) { - if (typeof object.startupConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.InstanceGroupConfig.startupConfig: object expected"); - message.startupConfig = $root.google.cloud.dataproc.v1.StartupConfig.fromObject(object.startupConfig); - } - return message; - }; - - /** - * Creates a plain object from an InstanceGroupConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.InstanceGroupConfig - * @static - * @param {google.cloud.dataproc.v1.InstanceGroupConfig} message InstanceGroupConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstanceGroupConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.instanceNames = []; - object.accelerators = []; - object.instanceReferences = []; - } - if (options.defaults) { - object.numInstances = 0; - object.imageUri = ""; - object.machineTypeUri = ""; - object.diskConfig = null; - object.isPreemptible = false; - object.managedGroupConfig = null; - object.minCpuPlatform = ""; - object.preemptibility = options.enums === String ? "PREEMPTIBILITY_UNSPECIFIED" : 0; - object.minNumInstances = 0; - object.instanceFlexibilityPolicy = null; - object.startupConfig = null; - } - if (message.numInstances != null && message.hasOwnProperty("numInstances")) - object.numInstances = message.numInstances; - if (message.instanceNames && message.instanceNames.length) { - object.instanceNames = []; - for (var j = 0; j < message.instanceNames.length; ++j) - object.instanceNames[j] = message.instanceNames[j]; - } - if (message.imageUri != null && message.hasOwnProperty("imageUri")) - object.imageUri = message.imageUri; - if (message.machineTypeUri != null && message.hasOwnProperty("machineTypeUri")) - object.machineTypeUri = message.machineTypeUri; - if (message.diskConfig != null && message.hasOwnProperty("diskConfig")) - object.diskConfig = $root.google.cloud.dataproc.v1.DiskConfig.toObject(message.diskConfig, options); - if (message.isPreemptible != null && message.hasOwnProperty("isPreemptible")) - object.isPreemptible = message.isPreemptible; - if (message.managedGroupConfig != null && message.hasOwnProperty("managedGroupConfig")) - object.managedGroupConfig = $root.google.cloud.dataproc.v1.ManagedGroupConfig.toObject(message.managedGroupConfig, options); - if (message.accelerators && message.accelerators.length) { - object.accelerators = []; - for (var j = 0; j < message.accelerators.length; ++j) - object.accelerators[j] = $root.google.cloud.dataproc.v1.AcceleratorConfig.toObject(message.accelerators[j], options); - } - if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) - object.minCpuPlatform = message.minCpuPlatform; - if (message.preemptibility != null && message.hasOwnProperty("preemptibility")) - object.preemptibility = options.enums === String ? $root.google.cloud.dataproc.v1.InstanceGroupConfig.Preemptibility[message.preemptibility] === undefined ? message.preemptibility : $root.google.cloud.dataproc.v1.InstanceGroupConfig.Preemptibility[message.preemptibility] : message.preemptibility; - if (message.instanceReferences && message.instanceReferences.length) { - object.instanceReferences = []; - for (var j = 0; j < message.instanceReferences.length; ++j) - object.instanceReferences[j] = $root.google.cloud.dataproc.v1.InstanceReference.toObject(message.instanceReferences[j], options); - } - if (message.minNumInstances != null && message.hasOwnProperty("minNumInstances")) - object.minNumInstances = message.minNumInstances; - if (message.instanceFlexibilityPolicy != null && message.hasOwnProperty("instanceFlexibilityPolicy")) - object.instanceFlexibilityPolicy = $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.toObject(message.instanceFlexibilityPolicy, options); - if (message.startupConfig != null && message.hasOwnProperty("startupConfig")) - object.startupConfig = $root.google.cloud.dataproc.v1.StartupConfig.toObject(message.startupConfig, options); - return object; - }; - - /** - * Converts this InstanceGroupConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.InstanceGroupConfig - * @instance - * @returns {Object.} JSON object - */ - InstanceGroupConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InstanceGroupConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.InstanceGroupConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstanceGroupConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.InstanceGroupConfig"; - }; - - /** - * Preemptibility enum. - * @name google.cloud.dataproc.v1.InstanceGroupConfig.Preemptibility - * @enum {number} - * @property {number} PREEMPTIBILITY_UNSPECIFIED=0 PREEMPTIBILITY_UNSPECIFIED value - * @property {number} NON_PREEMPTIBLE=1 NON_PREEMPTIBLE value - * @property {number} PREEMPTIBLE=2 PREEMPTIBLE value - * @property {number} SPOT=3 SPOT value - */ - InstanceGroupConfig.Preemptibility = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PREEMPTIBILITY_UNSPECIFIED"] = 0; - values[valuesById[1] = "NON_PREEMPTIBLE"] = 1; - values[valuesById[2] = "PREEMPTIBLE"] = 2; - values[valuesById[3] = "SPOT"] = 3; - return values; - })(); - - return InstanceGroupConfig; - })(); - - v1.StartupConfig = (function() { - - /** - * Properties of a StartupConfig. - * @memberof google.cloud.dataproc.v1 - * @interface IStartupConfig - * @property {number|null} [requiredRegistrationFraction] StartupConfig requiredRegistrationFraction - */ - - /** - * Constructs a new StartupConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a StartupConfig. - * @implements IStartupConfig - * @constructor - * @param {google.cloud.dataproc.v1.IStartupConfig=} [properties] Properties to set - */ - function StartupConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StartupConfig requiredRegistrationFraction. - * @member {number|null|undefined} requiredRegistrationFraction - * @memberof google.cloud.dataproc.v1.StartupConfig - * @instance - */ - StartupConfig.prototype.requiredRegistrationFraction = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(StartupConfig.prototype, "_requiredRegistrationFraction", { - get: $util.oneOfGetter($oneOfFields = ["requiredRegistrationFraction"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new StartupConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.StartupConfig - * @static - * @param {google.cloud.dataproc.v1.IStartupConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.StartupConfig} StartupConfig instance - */ - StartupConfig.create = function create(properties) { - return new StartupConfig(properties); - }; - - /** - * Encodes the specified StartupConfig message. Does not implicitly {@link google.cloud.dataproc.v1.StartupConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.StartupConfig - * @static - * @param {google.cloud.dataproc.v1.IStartupConfig} message StartupConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartupConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.requiredRegistrationFraction != null && Object.hasOwnProperty.call(message, "requiredRegistrationFraction")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.requiredRegistrationFraction); - return writer; - }; - - /** - * Encodes the specified StartupConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.StartupConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.StartupConfig - * @static - * @param {google.cloud.dataproc.v1.IStartupConfig} message StartupConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartupConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StartupConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.StartupConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.StartupConfig} StartupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartupConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.StartupConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.requiredRegistrationFraction = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StartupConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.StartupConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.StartupConfig} StartupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartupConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StartupConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.StartupConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StartupConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.requiredRegistrationFraction != null && message.hasOwnProperty("requiredRegistrationFraction")) { - properties._requiredRegistrationFraction = 1; - if (typeof message.requiredRegistrationFraction !== "number") - return "requiredRegistrationFraction: number expected"; - } - return null; - }; - - /** - * Creates a StartupConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.StartupConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.StartupConfig} StartupConfig - */ - StartupConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.StartupConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.StartupConfig(); - if (object.requiredRegistrationFraction != null) - message.requiredRegistrationFraction = Number(object.requiredRegistrationFraction); - return message; - }; - - /** - * Creates a plain object from a StartupConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.StartupConfig - * @static - * @param {google.cloud.dataproc.v1.StartupConfig} message StartupConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StartupConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.requiredRegistrationFraction != null && message.hasOwnProperty("requiredRegistrationFraction")) { - object.requiredRegistrationFraction = options.json && !isFinite(message.requiredRegistrationFraction) ? String(message.requiredRegistrationFraction) : message.requiredRegistrationFraction; - if (options.oneofs) - object._requiredRegistrationFraction = "requiredRegistrationFraction"; - } - return object; - }; - - /** - * Converts this StartupConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.StartupConfig - * @instance - * @returns {Object.} JSON object - */ - StartupConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StartupConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.StartupConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StartupConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.StartupConfig"; - }; - - return StartupConfig; - })(); - - v1.InstanceReference = (function() { - - /** - * Properties of an InstanceReference. - * @memberof google.cloud.dataproc.v1 - * @interface IInstanceReference - * @property {string|null} [instanceName] InstanceReference instanceName - * @property {string|null} [instanceId] InstanceReference instanceId - * @property {string|null} [publicKey] InstanceReference publicKey - * @property {string|null} [publicEciesKey] InstanceReference publicEciesKey - */ - - /** - * Constructs a new InstanceReference. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents an InstanceReference. - * @implements IInstanceReference - * @constructor - * @param {google.cloud.dataproc.v1.IInstanceReference=} [properties] Properties to set - */ - function InstanceReference(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstanceReference instanceName. - * @member {string} instanceName - * @memberof google.cloud.dataproc.v1.InstanceReference - * @instance - */ - InstanceReference.prototype.instanceName = ""; - - /** - * InstanceReference instanceId. - * @member {string} instanceId - * @memberof google.cloud.dataproc.v1.InstanceReference - * @instance - */ - InstanceReference.prototype.instanceId = ""; - - /** - * InstanceReference publicKey. - * @member {string} publicKey - * @memberof google.cloud.dataproc.v1.InstanceReference - * @instance - */ - InstanceReference.prototype.publicKey = ""; - - /** - * InstanceReference publicEciesKey. - * @member {string} publicEciesKey - * @memberof google.cloud.dataproc.v1.InstanceReference - * @instance - */ - InstanceReference.prototype.publicEciesKey = ""; - - /** - * Creates a new InstanceReference instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.InstanceReference - * @static - * @param {google.cloud.dataproc.v1.IInstanceReference=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.InstanceReference} InstanceReference instance - */ - InstanceReference.create = function create(properties) { - return new InstanceReference(properties); - }; - - /** - * Encodes the specified InstanceReference message. Does not implicitly {@link google.cloud.dataproc.v1.InstanceReference.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.InstanceReference - * @static - * @param {google.cloud.dataproc.v1.IInstanceReference} message InstanceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceReference.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instanceName != null && Object.hasOwnProperty.call(message, "instanceName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceName); - if (message.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); - if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.publicKey); - if (message.publicEciesKey != null && Object.hasOwnProperty.call(message, "publicEciesKey")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.publicEciesKey); - return writer; - }; - - /** - * Encodes the specified InstanceReference message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstanceReference.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.InstanceReference - * @static - * @param {google.cloud.dataproc.v1.IInstanceReference} message InstanceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceReference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstanceReference message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.InstanceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.InstanceReference} InstanceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceReference.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.InstanceReference(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.instanceName = reader.string(); - break; - } - case 2: { - message.instanceId = reader.string(); - break; - } - case 3: { - message.publicKey = reader.string(); - break; - } - case 4: { - message.publicEciesKey = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstanceReference message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.InstanceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.InstanceReference} InstanceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceReference.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstanceReference message. - * @function verify - * @memberof google.cloud.dataproc.v1.InstanceReference - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstanceReference.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instanceName != null && message.hasOwnProperty("instanceName")) - if (!$util.isString(message.instanceName)) - return "instanceName: string expected"; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - if (!$util.isString(message.instanceId)) - return "instanceId: string expected"; - if (message.publicKey != null && message.hasOwnProperty("publicKey")) - if (!$util.isString(message.publicKey)) - return "publicKey: string expected"; - if (message.publicEciesKey != null && message.hasOwnProperty("publicEciesKey")) - if (!$util.isString(message.publicEciesKey)) - return "publicEciesKey: string expected"; - return null; - }; - - /** - * Creates an InstanceReference message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.InstanceReference - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.InstanceReference} InstanceReference - */ - InstanceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.InstanceReference) - return object; - var message = new $root.google.cloud.dataproc.v1.InstanceReference(); - if (object.instanceName != null) - message.instanceName = String(object.instanceName); - if (object.instanceId != null) - message.instanceId = String(object.instanceId); - if (object.publicKey != null) - message.publicKey = String(object.publicKey); - if (object.publicEciesKey != null) - message.publicEciesKey = String(object.publicEciesKey); - return message; - }; - - /** - * Creates a plain object from an InstanceReference message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.InstanceReference - * @static - * @param {google.cloud.dataproc.v1.InstanceReference} message InstanceReference - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstanceReference.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.instanceName = ""; - object.instanceId = ""; - object.publicKey = ""; - object.publicEciesKey = ""; - } - if (message.instanceName != null && message.hasOwnProperty("instanceName")) - object.instanceName = message.instanceName; - if (message.instanceId != null && message.hasOwnProperty("instanceId")) - object.instanceId = message.instanceId; - if (message.publicKey != null && message.hasOwnProperty("publicKey")) - object.publicKey = message.publicKey; - if (message.publicEciesKey != null && message.hasOwnProperty("publicEciesKey")) - object.publicEciesKey = message.publicEciesKey; - return object; - }; - - /** - * Converts this InstanceReference to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.InstanceReference - * @instance - * @returns {Object.} JSON object - */ - InstanceReference.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InstanceReference - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.InstanceReference - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstanceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.InstanceReference"; - }; - - return InstanceReference; - })(); - - v1.ManagedGroupConfig = (function() { - - /** - * Properties of a ManagedGroupConfig. - * @memberof google.cloud.dataproc.v1 - * @interface IManagedGroupConfig - * @property {string|null} [instanceTemplateName] ManagedGroupConfig instanceTemplateName - * @property {string|null} [instanceGroupManagerName] ManagedGroupConfig instanceGroupManagerName - * @property {string|null} [instanceGroupManagerUri] ManagedGroupConfig instanceGroupManagerUri - */ - - /** - * Constructs a new ManagedGroupConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a ManagedGroupConfig. - * @implements IManagedGroupConfig - * @constructor - * @param {google.cloud.dataproc.v1.IManagedGroupConfig=} [properties] Properties to set - */ - function ManagedGroupConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ManagedGroupConfig instanceTemplateName. - * @member {string} instanceTemplateName - * @memberof google.cloud.dataproc.v1.ManagedGroupConfig - * @instance - */ - ManagedGroupConfig.prototype.instanceTemplateName = ""; - - /** - * ManagedGroupConfig instanceGroupManagerName. - * @member {string} instanceGroupManagerName - * @memberof google.cloud.dataproc.v1.ManagedGroupConfig - * @instance - */ - ManagedGroupConfig.prototype.instanceGroupManagerName = ""; - - /** - * ManagedGroupConfig instanceGroupManagerUri. - * @member {string} instanceGroupManagerUri - * @memberof google.cloud.dataproc.v1.ManagedGroupConfig - * @instance - */ - ManagedGroupConfig.prototype.instanceGroupManagerUri = ""; - - /** - * Creates a new ManagedGroupConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.ManagedGroupConfig - * @static - * @param {google.cloud.dataproc.v1.IManagedGroupConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.ManagedGroupConfig} ManagedGroupConfig instance - */ - ManagedGroupConfig.create = function create(properties) { - return new ManagedGroupConfig(properties); - }; - - /** - * Encodes the specified ManagedGroupConfig message. Does not implicitly {@link google.cloud.dataproc.v1.ManagedGroupConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.ManagedGroupConfig - * @static - * @param {google.cloud.dataproc.v1.IManagedGroupConfig} message ManagedGroupConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ManagedGroupConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instanceTemplateName != null && Object.hasOwnProperty.call(message, "instanceTemplateName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.instanceTemplateName); - if (message.instanceGroupManagerName != null && Object.hasOwnProperty.call(message, "instanceGroupManagerName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceGroupManagerName); - if (message.instanceGroupManagerUri != null && Object.hasOwnProperty.call(message, "instanceGroupManagerUri")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.instanceGroupManagerUri); - return writer; - }; - - /** - * Encodes the specified ManagedGroupConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ManagedGroupConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.ManagedGroupConfig - * @static - * @param {google.cloud.dataproc.v1.IManagedGroupConfig} message ManagedGroupConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ManagedGroupConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ManagedGroupConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.ManagedGroupConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.ManagedGroupConfig} ManagedGroupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ManagedGroupConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ManagedGroupConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.instanceTemplateName = reader.string(); - break; - } - case 2: { - message.instanceGroupManagerName = reader.string(); - break; - } - case 3: { - message.instanceGroupManagerUri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ManagedGroupConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.ManagedGroupConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.ManagedGroupConfig} ManagedGroupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ManagedGroupConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ManagedGroupConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.ManagedGroupConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ManagedGroupConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instanceTemplateName != null && message.hasOwnProperty("instanceTemplateName")) - if (!$util.isString(message.instanceTemplateName)) - return "instanceTemplateName: string expected"; - if (message.instanceGroupManagerName != null && message.hasOwnProperty("instanceGroupManagerName")) - if (!$util.isString(message.instanceGroupManagerName)) - return "instanceGroupManagerName: string expected"; - if (message.instanceGroupManagerUri != null && message.hasOwnProperty("instanceGroupManagerUri")) - if (!$util.isString(message.instanceGroupManagerUri)) - return "instanceGroupManagerUri: string expected"; - return null; - }; - - /** - * Creates a ManagedGroupConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.ManagedGroupConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.ManagedGroupConfig} ManagedGroupConfig - */ - ManagedGroupConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.ManagedGroupConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.ManagedGroupConfig(); - if (object.instanceTemplateName != null) - message.instanceTemplateName = String(object.instanceTemplateName); - if (object.instanceGroupManagerName != null) - message.instanceGroupManagerName = String(object.instanceGroupManagerName); - if (object.instanceGroupManagerUri != null) - message.instanceGroupManagerUri = String(object.instanceGroupManagerUri); - return message; - }; - - /** - * Creates a plain object from a ManagedGroupConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.ManagedGroupConfig - * @static - * @param {google.cloud.dataproc.v1.ManagedGroupConfig} message ManagedGroupConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ManagedGroupConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.instanceTemplateName = ""; - object.instanceGroupManagerName = ""; - object.instanceGroupManagerUri = ""; - } - if (message.instanceTemplateName != null && message.hasOwnProperty("instanceTemplateName")) - object.instanceTemplateName = message.instanceTemplateName; - if (message.instanceGroupManagerName != null && message.hasOwnProperty("instanceGroupManagerName")) - object.instanceGroupManagerName = message.instanceGroupManagerName; - if (message.instanceGroupManagerUri != null && message.hasOwnProperty("instanceGroupManagerUri")) - object.instanceGroupManagerUri = message.instanceGroupManagerUri; - return object; - }; - - /** - * Converts this ManagedGroupConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.ManagedGroupConfig - * @instance - * @returns {Object.} JSON object - */ - ManagedGroupConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ManagedGroupConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.ManagedGroupConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ManagedGroupConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.ManagedGroupConfig"; - }; - - return ManagedGroupConfig; - })(); - - v1.InstanceFlexibilityPolicy = (function() { - - /** - * Properties of an InstanceFlexibilityPolicy. - * @memberof google.cloud.dataproc.v1 - * @interface IInstanceFlexibilityPolicy - * @property {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IProvisioningModelMix|null} [provisioningModelMix] InstanceFlexibilityPolicy provisioningModelMix - * @property {Array.|null} [instanceSelectionList] InstanceFlexibilityPolicy instanceSelectionList - * @property {Array.|null} [instanceSelectionResults] InstanceFlexibilityPolicy instanceSelectionResults - */ - - /** - * Constructs a new InstanceFlexibilityPolicy. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents an InstanceFlexibilityPolicy. - * @implements IInstanceFlexibilityPolicy - * @constructor - * @param {google.cloud.dataproc.v1.IInstanceFlexibilityPolicy=} [properties] Properties to set - */ - function InstanceFlexibilityPolicy(properties) { - this.instanceSelectionList = []; - this.instanceSelectionResults = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstanceFlexibilityPolicy provisioningModelMix. - * @member {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IProvisioningModelMix|null|undefined} provisioningModelMix - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy - * @instance - */ - InstanceFlexibilityPolicy.prototype.provisioningModelMix = null; - - /** - * InstanceFlexibilityPolicy instanceSelectionList. - * @member {Array.} instanceSelectionList - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy - * @instance - */ - InstanceFlexibilityPolicy.prototype.instanceSelectionList = $util.emptyArray; - - /** - * InstanceFlexibilityPolicy instanceSelectionResults. - * @member {Array.} instanceSelectionResults - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy - * @instance - */ - InstanceFlexibilityPolicy.prototype.instanceSelectionResults = $util.emptyArray; - - /** - * Creates a new InstanceFlexibilityPolicy instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy - * @static - * @param {google.cloud.dataproc.v1.IInstanceFlexibilityPolicy=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.InstanceFlexibilityPolicy} InstanceFlexibilityPolicy instance - */ - InstanceFlexibilityPolicy.create = function create(properties) { - return new InstanceFlexibilityPolicy(properties); - }; - - /** - * Encodes the specified InstanceFlexibilityPolicy message. Does not implicitly {@link google.cloud.dataproc.v1.InstanceFlexibilityPolicy.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy - * @static - * @param {google.cloud.dataproc.v1.IInstanceFlexibilityPolicy} message InstanceFlexibilityPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceFlexibilityPolicy.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.provisioningModelMix != null && Object.hasOwnProperty.call(message, "provisioningModelMix")) - $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix.encode(message.provisioningModelMix, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.instanceSelectionList != null && message.instanceSelectionList.length) - for (var i = 0; i < message.instanceSelectionList.length; ++i) - $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection.encode(message.instanceSelectionList[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.instanceSelectionResults != null && message.instanceSelectionResults.length) - for (var i = 0; i < message.instanceSelectionResults.length; ++i) - $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult.encode(message.instanceSelectionResults[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified InstanceFlexibilityPolicy message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstanceFlexibilityPolicy.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy - * @static - * @param {google.cloud.dataproc.v1.IInstanceFlexibilityPolicy} message InstanceFlexibilityPolicy message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceFlexibilityPolicy.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstanceFlexibilityPolicy message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.InstanceFlexibilityPolicy} InstanceFlexibilityPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceFlexibilityPolicy.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.provisioningModelMix = $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix.decode(reader, reader.uint32()); - break; - } - case 2: { - if (!(message.instanceSelectionList && message.instanceSelectionList.length)) - message.instanceSelectionList = []; - message.instanceSelectionList.push($root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.instanceSelectionResults && message.instanceSelectionResults.length)) - message.instanceSelectionResults = []; - message.instanceSelectionResults.push($root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstanceFlexibilityPolicy message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.InstanceFlexibilityPolicy} InstanceFlexibilityPolicy - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceFlexibilityPolicy.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstanceFlexibilityPolicy message. - * @function verify - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstanceFlexibilityPolicy.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.provisioningModelMix != null && message.hasOwnProperty("provisioningModelMix")) { - var error = $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix.verify(message.provisioningModelMix); - if (error) - return "provisioningModelMix." + error; - } - if (message.instanceSelectionList != null && message.hasOwnProperty("instanceSelectionList")) { - if (!Array.isArray(message.instanceSelectionList)) - return "instanceSelectionList: array expected"; - for (var i = 0; i < message.instanceSelectionList.length; ++i) { - var error = $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection.verify(message.instanceSelectionList[i]); - if (error) - return "instanceSelectionList." + error; - } - } - if (message.instanceSelectionResults != null && message.hasOwnProperty("instanceSelectionResults")) { - if (!Array.isArray(message.instanceSelectionResults)) - return "instanceSelectionResults: array expected"; - for (var i = 0; i < message.instanceSelectionResults.length; ++i) { - var error = $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult.verify(message.instanceSelectionResults[i]); - if (error) - return "instanceSelectionResults." + error; - } - } - return null; - }; - - /** - * Creates an InstanceFlexibilityPolicy message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.InstanceFlexibilityPolicy} InstanceFlexibilityPolicy - */ - InstanceFlexibilityPolicy.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy) - return object; - var message = new $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy(); - if (object.provisioningModelMix != null) { - if (typeof object.provisioningModelMix !== "object") - throw TypeError(".google.cloud.dataproc.v1.InstanceFlexibilityPolicy.provisioningModelMix: object expected"); - message.provisioningModelMix = $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix.fromObject(object.provisioningModelMix); - } - if (object.instanceSelectionList) { - if (!Array.isArray(object.instanceSelectionList)) - throw TypeError(".google.cloud.dataproc.v1.InstanceFlexibilityPolicy.instanceSelectionList: array expected"); - message.instanceSelectionList = []; - for (var i = 0; i < object.instanceSelectionList.length; ++i) { - if (typeof object.instanceSelectionList[i] !== "object") - throw TypeError(".google.cloud.dataproc.v1.InstanceFlexibilityPolicy.instanceSelectionList: object expected"); - message.instanceSelectionList[i] = $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection.fromObject(object.instanceSelectionList[i]); - } - } - if (object.instanceSelectionResults) { - if (!Array.isArray(object.instanceSelectionResults)) - throw TypeError(".google.cloud.dataproc.v1.InstanceFlexibilityPolicy.instanceSelectionResults: array expected"); - message.instanceSelectionResults = []; - for (var i = 0; i < object.instanceSelectionResults.length; ++i) { - if (typeof object.instanceSelectionResults[i] !== "object") - throw TypeError(".google.cloud.dataproc.v1.InstanceFlexibilityPolicy.instanceSelectionResults: object expected"); - message.instanceSelectionResults[i] = $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult.fromObject(object.instanceSelectionResults[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an InstanceFlexibilityPolicy message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy - * @static - * @param {google.cloud.dataproc.v1.InstanceFlexibilityPolicy} message InstanceFlexibilityPolicy - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstanceFlexibilityPolicy.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.instanceSelectionList = []; - object.instanceSelectionResults = []; - } - if (options.defaults) - object.provisioningModelMix = null; - if (message.provisioningModelMix != null && message.hasOwnProperty("provisioningModelMix")) - object.provisioningModelMix = $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix.toObject(message.provisioningModelMix, options); - if (message.instanceSelectionList && message.instanceSelectionList.length) { - object.instanceSelectionList = []; - for (var j = 0; j < message.instanceSelectionList.length; ++j) - object.instanceSelectionList[j] = $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection.toObject(message.instanceSelectionList[j], options); - } - if (message.instanceSelectionResults && message.instanceSelectionResults.length) { - object.instanceSelectionResults = []; - for (var j = 0; j < message.instanceSelectionResults.length; ++j) - object.instanceSelectionResults[j] = $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult.toObject(message.instanceSelectionResults[j], options); - } - return object; - }; - - /** - * Converts this InstanceFlexibilityPolicy to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy - * @instance - * @returns {Object.} JSON object - */ - InstanceFlexibilityPolicy.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InstanceFlexibilityPolicy - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstanceFlexibilityPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.InstanceFlexibilityPolicy"; - }; - - InstanceFlexibilityPolicy.ProvisioningModelMix = (function() { - - /** - * Properties of a ProvisioningModelMix. - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy - * @interface IProvisioningModelMix - * @property {number|null} [standardCapacityBase] ProvisioningModelMix standardCapacityBase - * @property {number|null} [standardCapacityPercentAboveBase] ProvisioningModelMix standardCapacityPercentAboveBase - */ - - /** - * Constructs a new ProvisioningModelMix. - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy - * @classdesc Represents a ProvisioningModelMix. - * @implements IProvisioningModelMix - * @constructor - * @param {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IProvisioningModelMix=} [properties] Properties to set - */ - function ProvisioningModelMix(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ProvisioningModelMix standardCapacityBase. - * @member {number|null|undefined} standardCapacityBase - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix - * @instance - */ - ProvisioningModelMix.prototype.standardCapacityBase = null; - - /** - * ProvisioningModelMix standardCapacityPercentAboveBase. - * @member {number|null|undefined} standardCapacityPercentAboveBase - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix - * @instance - */ - ProvisioningModelMix.prototype.standardCapacityPercentAboveBase = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ProvisioningModelMix.prototype, "_standardCapacityBase", { - get: $util.oneOfGetter($oneOfFields = ["standardCapacityBase"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ProvisioningModelMix.prototype, "_standardCapacityPercentAboveBase", { - get: $util.oneOfGetter($oneOfFields = ["standardCapacityPercentAboveBase"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ProvisioningModelMix instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix - * @static - * @param {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IProvisioningModelMix=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix} ProvisioningModelMix instance - */ - ProvisioningModelMix.create = function create(properties) { - return new ProvisioningModelMix(properties); - }; - - /** - * Encodes the specified ProvisioningModelMix message. Does not implicitly {@link google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix - * @static - * @param {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IProvisioningModelMix} message ProvisioningModelMix message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProvisioningModelMix.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.standardCapacityBase != null && Object.hasOwnProperty.call(message, "standardCapacityBase")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.standardCapacityBase); - if (message.standardCapacityPercentAboveBase != null && Object.hasOwnProperty.call(message, "standardCapacityPercentAboveBase")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.standardCapacityPercentAboveBase); - return writer; - }; - - /** - * Encodes the specified ProvisioningModelMix message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix - * @static - * @param {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IProvisioningModelMix} message ProvisioningModelMix message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProvisioningModelMix.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ProvisioningModelMix message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix} ProvisioningModelMix - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProvisioningModelMix.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.standardCapacityBase = reader.int32(); - break; - } - case 2: { - message.standardCapacityPercentAboveBase = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ProvisioningModelMix message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix} ProvisioningModelMix - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProvisioningModelMix.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ProvisioningModelMix message. - * @function verify - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ProvisioningModelMix.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.standardCapacityBase != null && message.hasOwnProperty("standardCapacityBase")) { - properties._standardCapacityBase = 1; - if (!$util.isInteger(message.standardCapacityBase)) - return "standardCapacityBase: integer expected"; - } - if (message.standardCapacityPercentAboveBase != null && message.hasOwnProperty("standardCapacityPercentAboveBase")) { - properties._standardCapacityPercentAboveBase = 1; - if (!$util.isInteger(message.standardCapacityPercentAboveBase)) - return "standardCapacityPercentAboveBase: integer expected"; - } - return null; - }; - - /** - * Creates a ProvisioningModelMix message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix} ProvisioningModelMix - */ - ProvisioningModelMix.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix) - return object; - var message = new $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix(); - if (object.standardCapacityBase != null) - message.standardCapacityBase = object.standardCapacityBase | 0; - if (object.standardCapacityPercentAboveBase != null) - message.standardCapacityPercentAboveBase = object.standardCapacityPercentAboveBase | 0; - return message; - }; - - /** - * Creates a plain object from a ProvisioningModelMix message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix - * @static - * @param {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix} message ProvisioningModelMix - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ProvisioningModelMix.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.standardCapacityBase != null && message.hasOwnProperty("standardCapacityBase")) { - object.standardCapacityBase = message.standardCapacityBase; - if (options.oneofs) - object._standardCapacityBase = "standardCapacityBase"; - } - if (message.standardCapacityPercentAboveBase != null && message.hasOwnProperty("standardCapacityPercentAboveBase")) { - object.standardCapacityPercentAboveBase = message.standardCapacityPercentAboveBase; - if (options.oneofs) - object._standardCapacityPercentAboveBase = "standardCapacityPercentAboveBase"; - } - return object; - }; - - /** - * Converts this ProvisioningModelMix to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix - * @instance - * @returns {Object.} JSON object - */ - ProvisioningModelMix.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ProvisioningModelMix - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ProvisioningModelMix.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.InstanceFlexibilityPolicy.ProvisioningModelMix"; - }; - - return ProvisioningModelMix; - })(); - - InstanceFlexibilityPolicy.InstanceSelection = (function() { - - /** - * Properties of an InstanceSelection. - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy - * @interface IInstanceSelection - * @property {Array.|null} [machineTypes] InstanceSelection machineTypes - * @property {number|null} [rank] InstanceSelection rank - */ - - /** - * Constructs a new InstanceSelection. - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy - * @classdesc Represents an InstanceSelection. - * @implements IInstanceSelection - * @constructor - * @param {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelection=} [properties] Properties to set - */ - function InstanceSelection(properties) { - this.machineTypes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstanceSelection machineTypes. - * @member {Array.} machineTypes - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection - * @instance - */ - InstanceSelection.prototype.machineTypes = $util.emptyArray; - - /** - * InstanceSelection rank. - * @member {number} rank - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection - * @instance - */ - InstanceSelection.prototype.rank = 0; - - /** - * Creates a new InstanceSelection instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection - * @static - * @param {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelection=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection} InstanceSelection instance - */ - InstanceSelection.create = function create(properties) { - return new InstanceSelection(properties); - }; - - /** - * Encodes the specified InstanceSelection message. Does not implicitly {@link google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection - * @static - * @param {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelection} message InstanceSelection message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceSelection.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.machineTypes != null && message.machineTypes.length) - for (var i = 0; i < message.machineTypes.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.machineTypes[i]); - if (message.rank != null && Object.hasOwnProperty.call(message, "rank")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.rank); - return writer; - }; - - /** - * Encodes the specified InstanceSelection message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection - * @static - * @param {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelection} message InstanceSelection message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceSelection.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstanceSelection message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection} InstanceSelection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceSelection.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.machineTypes && message.machineTypes.length)) - message.machineTypes = []; - message.machineTypes.push(reader.string()); - break; - } - case 2: { - message.rank = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstanceSelection message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection} InstanceSelection - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceSelection.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstanceSelection message. - * @function verify - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstanceSelection.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.machineTypes != null && message.hasOwnProperty("machineTypes")) { - if (!Array.isArray(message.machineTypes)) - return "machineTypes: array expected"; - for (var i = 0; i < message.machineTypes.length; ++i) - if (!$util.isString(message.machineTypes[i])) - return "machineTypes: string[] expected"; - } - if (message.rank != null && message.hasOwnProperty("rank")) - if (!$util.isInteger(message.rank)) - return "rank: integer expected"; - return null; - }; - - /** - * Creates an InstanceSelection message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection} InstanceSelection - */ - InstanceSelection.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection) - return object; - var message = new $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection(); - if (object.machineTypes) { - if (!Array.isArray(object.machineTypes)) - throw TypeError(".google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection.machineTypes: array expected"); - message.machineTypes = []; - for (var i = 0; i < object.machineTypes.length; ++i) - message.machineTypes[i] = String(object.machineTypes[i]); - } - if (object.rank != null) - message.rank = object.rank | 0; - return message; - }; - - /** - * Creates a plain object from an InstanceSelection message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection - * @static - * @param {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection} message InstanceSelection - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstanceSelection.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.machineTypes = []; - if (options.defaults) - object.rank = 0; - if (message.machineTypes && message.machineTypes.length) { - object.machineTypes = []; - for (var j = 0; j < message.machineTypes.length; ++j) - object.machineTypes[j] = message.machineTypes[j]; - } - if (message.rank != null && message.hasOwnProperty("rank")) - object.rank = message.rank; - return object; - }; - - /** - * Converts this InstanceSelection to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection - * @instance - * @returns {Object.} JSON object - */ - InstanceSelection.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InstanceSelection - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstanceSelection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelection"; - }; - - return InstanceSelection; - })(); - - InstanceFlexibilityPolicy.InstanceSelectionResult = (function() { - - /** - * Properties of an InstanceSelectionResult. - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy - * @interface IInstanceSelectionResult - * @property {string|null} [machineType] InstanceSelectionResult machineType - * @property {number|null} [vmCount] InstanceSelectionResult vmCount - */ - - /** - * Constructs a new InstanceSelectionResult. - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy - * @classdesc Represents an InstanceSelectionResult. - * @implements IInstanceSelectionResult - * @constructor - * @param {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelectionResult=} [properties] Properties to set - */ - function InstanceSelectionResult(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstanceSelectionResult machineType. - * @member {string|null|undefined} machineType - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult - * @instance - */ - InstanceSelectionResult.prototype.machineType = null; - - /** - * InstanceSelectionResult vmCount. - * @member {number|null|undefined} vmCount - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult - * @instance - */ - InstanceSelectionResult.prototype.vmCount = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(InstanceSelectionResult.prototype, "_machineType", { - get: $util.oneOfGetter($oneOfFields = ["machineType"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(InstanceSelectionResult.prototype, "_vmCount", { - get: $util.oneOfGetter($oneOfFields = ["vmCount"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new InstanceSelectionResult instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult - * @static - * @param {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelectionResult=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult} InstanceSelectionResult instance - */ - InstanceSelectionResult.create = function create(properties) { - return new InstanceSelectionResult(properties); - }; - - /** - * Encodes the specified InstanceSelectionResult message. Does not implicitly {@link google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult - * @static - * @param {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelectionResult} message InstanceSelectionResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceSelectionResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.machineType); - if (message.vmCount != null && Object.hasOwnProperty.call(message, "vmCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.vmCount); - return writer; - }; - - /** - * Encodes the specified InstanceSelectionResult message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult - * @static - * @param {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.IInstanceSelectionResult} message InstanceSelectionResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceSelectionResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstanceSelectionResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult} InstanceSelectionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceSelectionResult.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.machineType = reader.string(); - break; - } - case 2: { - message.vmCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstanceSelectionResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult} InstanceSelectionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceSelectionResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstanceSelectionResult message. - * @function verify - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstanceSelectionResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.machineType != null && message.hasOwnProperty("machineType")) { - properties._machineType = 1; - if (!$util.isString(message.machineType)) - return "machineType: string expected"; - } - if (message.vmCount != null && message.hasOwnProperty("vmCount")) { - properties._vmCount = 1; - if (!$util.isInteger(message.vmCount)) - return "vmCount: integer expected"; - } - return null; - }; - - /** - * Creates an InstanceSelectionResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult} InstanceSelectionResult - */ - InstanceSelectionResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult) - return object; - var message = new $root.google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult(); - if (object.machineType != null) - message.machineType = String(object.machineType); - if (object.vmCount != null) - message.vmCount = object.vmCount | 0; - return message; - }; - - /** - * Creates a plain object from an InstanceSelectionResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult - * @static - * @param {google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult} message InstanceSelectionResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstanceSelectionResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.machineType != null && message.hasOwnProperty("machineType")) { - object.machineType = message.machineType; - if (options.oneofs) - object._machineType = "machineType"; - } - if (message.vmCount != null && message.hasOwnProperty("vmCount")) { - object.vmCount = message.vmCount; - if (options.oneofs) - object._vmCount = "vmCount"; - } - return object; - }; - - /** - * Converts this InstanceSelectionResult to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult - * @instance - * @returns {Object.} JSON object - */ - InstanceSelectionResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InstanceSelectionResult - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstanceSelectionResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.InstanceFlexibilityPolicy.InstanceSelectionResult"; - }; - - return InstanceSelectionResult; - })(); - - return InstanceFlexibilityPolicy; - })(); - - v1.AcceleratorConfig = (function() { - - /** - * Properties of an AcceleratorConfig. - * @memberof google.cloud.dataproc.v1 - * @interface IAcceleratorConfig - * @property {string|null} [acceleratorTypeUri] AcceleratorConfig acceleratorTypeUri - * @property {number|null} [acceleratorCount] AcceleratorConfig acceleratorCount - */ - - /** - * Constructs a new AcceleratorConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents an AcceleratorConfig. - * @implements IAcceleratorConfig - * @constructor - * @param {google.cloud.dataproc.v1.IAcceleratorConfig=} [properties] Properties to set - */ - function AcceleratorConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AcceleratorConfig acceleratorTypeUri. - * @member {string} acceleratorTypeUri - * @memberof google.cloud.dataproc.v1.AcceleratorConfig - * @instance - */ - AcceleratorConfig.prototype.acceleratorTypeUri = ""; - - /** - * AcceleratorConfig acceleratorCount. - * @member {number} acceleratorCount - * @memberof google.cloud.dataproc.v1.AcceleratorConfig - * @instance - */ - AcceleratorConfig.prototype.acceleratorCount = 0; - - /** - * Creates a new AcceleratorConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.AcceleratorConfig - * @static - * @param {google.cloud.dataproc.v1.IAcceleratorConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.AcceleratorConfig} AcceleratorConfig instance - */ - AcceleratorConfig.create = function create(properties) { - return new AcceleratorConfig(properties); - }; - - /** - * Encodes the specified AcceleratorConfig message. Does not implicitly {@link google.cloud.dataproc.v1.AcceleratorConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.AcceleratorConfig - * @static - * @param {google.cloud.dataproc.v1.IAcceleratorConfig} message AcceleratorConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AcceleratorConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.acceleratorTypeUri != null && Object.hasOwnProperty.call(message, "acceleratorTypeUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.acceleratorTypeUri); - if (message.acceleratorCount != null && Object.hasOwnProperty.call(message, "acceleratorCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.acceleratorCount); - return writer; - }; - - /** - * Encodes the specified AcceleratorConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.AcceleratorConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.AcceleratorConfig - * @static - * @param {google.cloud.dataproc.v1.IAcceleratorConfig} message AcceleratorConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AcceleratorConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AcceleratorConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.AcceleratorConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.AcceleratorConfig} AcceleratorConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AcceleratorConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.AcceleratorConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.acceleratorTypeUri = reader.string(); - break; - } - case 2: { - message.acceleratorCount = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AcceleratorConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.AcceleratorConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.AcceleratorConfig} AcceleratorConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AcceleratorConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AcceleratorConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.AcceleratorConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AcceleratorConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.acceleratorTypeUri != null && message.hasOwnProperty("acceleratorTypeUri")) - if (!$util.isString(message.acceleratorTypeUri)) - return "acceleratorTypeUri: string expected"; - if (message.acceleratorCount != null && message.hasOwnProperty("acceleratorCount")) - if (!$util.isInteger(message.acceleratorCount)) - return "acceleratorCount: integer expected"; - return null; - }; - - /** - * Creates an AcceleratorConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.AcceleratorConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.AcceleratorConfig} AcceleratorConfig - */ - AcceleratorConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.AcceleratorConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.AcceleratorConfig(); - if (object.acceleratorTypeUri != null) - message.acceleratorTypeUri = String(object.acceleratorTypeUri); - if (object.acceleratorCount != null) - message.acceleratorCount = object.acceleratorCount | 0; - return message; - }; - - /** - * Creates a plain object from an AcceleratorConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.AcceleratorConfig - * @static - * @param {google.cloud.dataproc.v1.AcceleratorConfig} message AcceleratorConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AcceleratorConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.acceleratorTypeUri = ""; - object.acceleratorCount = 0; - } - if (message.acceleratorTypeUri != null && message.hasOwnProperty("acceleratorTypeUri")) - object.acceleratorTypeUri = message.acceleratorTypeUri; - if (message.acceleratorCount != null && message.hasOwnProperty("acceleratorCount")) - object.acceleratorCount = message.acceleratorCount; - return object; - }; - - /** - * Converts this AcceleratorConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.AcceleratorConfig - * @instance - * @returns {Object.} JSON object - */ - AcceleratorConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AcceleratorConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.AcceleratorConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AcceleratorConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.AcceleratorConfig"; - }; - - return AcceleratorConfig; - })(); - - v1.DiskConfig = (function() { - - /** - * Properties of a DiskConfig. - * @memberof google.cloud.dataproc.v1 - * @interface IDiskConfig - * @property {string|null} [bootDiskType] DiskConfig bootDiskType - * @property {number|null} [bootDiskSizeGb] DiskConfig bootDiskSizeGb - * @property {number|null} [numLocalSsds] DiskConfig numLocalSsds - * @property {string|null} [localSsdInterface] DiskConfig localSsdInterface - * @property {number|Long|null} [bootDiskProvisionedIops] DiskConfig bootDiskProvisionedIops - * @property {number|Long|null} [bootDiskProvisionedThroughput] DiskConfig bootDiskProvisionedThroughput - */ - - /** - * Constructs a new DiskConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a DiskConfig. - * @implements IDiskConfig - * @constructor - * @param {google.cloud.dataproc.v1.IDiskConfig=} [properties] Properties to set - */ - function DiskConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DiskConfig bootDiskType. - * @member {string} bootDiskType - * @memberof google.cloud.dataproc.v1.DiskConfig - * @instance - */ - DiskConfig.prototype.bootDiskType = ""; - - /** - * DiskConfig bootDiskSizeGb. - * @member {number} bootDiskSizeGb - * @memberof google.cloud.dataproc.v1.DiskConfig - * @instance - */ - DiskConfig.prototype.bootDiskSizeGb = 0; - - /** - * DiskConfig numLocalSsds. - * @member {number} numLocalSsds - * @memberof google.cloud.dataproc.v1.DiskConfig - * @instance - */ - DiskConfig.prototype.numLocalSsds = 0; - - /** - * DiskConfig localSsdInterface. - * @member {string} localSsdInterface - * @memberof google.cloud.dataproc.v1.DiskConfig - * @instance - */ - DiskConfig.prototype.localSsdInterface = ""; - - /** - * DiskConfig bootDiskProvisionedIops. - * @member {number|Long|null|undefined} bootDiskProvisionedIops - * @memberof google.cloud.dataproc.v1.DiskConfig - * @instance - */ - DiskConfig.prototype.bootDiskProvisionedIops = null; - - /** - * DiskConfig bootDiskProvisionedThroughput. - * @member {number|Long|null|undefined} bootDiskProvisionedThroughput - * @memberof google.cloud.dataproc.v1.DiskConfig - * @instance - */ - DiskConfig.prototype.bootDiskProvisionedThroughput = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(DiskConfig.prototype, "_bootDiskProvisionedIops", { - get: $util.oneOfGetter($oneOfFields = ["bootDiskProvisionedIops"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(DiskConfig.prototype, "_bootDiskProvisionedThroughput", { - get: $util.oneOfGetter($oneOfFields = ["bootDiskProvisionedThroughput"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new DiskConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.DiskConfig - * @static - * @param {google.cloud.dataproc.v1.IDiskConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.DiskConfig} DiskConfig instance - */ - DiskConfig.create = function create(properties) { - return new DiskConfig(properties); - }; - - /** - * Encodes the specified DiskConfig message. Does not implicitly {@link google.cloud.dataproc.v1.DiskConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.DiskConfig - * @static - * @param {google.cloud.dataproc.v1.IDiskConfig} message DiskConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DiskConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.bootDiskSizeGb != null && Object.hasOwnProperty.call(message, "bootDiskSizeGb")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.bootDiskSizeGb); - if (message.numLocalSsds != null && Object.hasOwnProperty.call(message, "numLocalSsds")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.numLocalSsds); - if (message.bootDiskType != null && Object.hasOwnProperty.call(message, "bootDiskType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.bootDiskType); - if (message.localSsdInterface != null && Object.hasOwnProperty.call(message, "localSsdInterface")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.localSsdInterface); - if (message.bootDiskProvisionedIops != null && Object.hasOwnProperty.call(message, "bootDiskProvisionedIops")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.bootDiskProvisionedIops); - if (message.bootDiskProvisionedThroughput != null && Object.hasOwnProperty.call(message, "bootDiskProvisionedThroughput")) - writer.uint32(/* id 6, wireType 0 =*/48).int64(message.bootDiskProvisionedThroughput); - return writer; - }; - - /** - * Encodes the specified DiskConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DiskConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.DiskConfig - * @static - * @param {google.cloud.dataproc.v1.IDiskConfig} message DiskConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DiskConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DiskConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.DiskConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.DiskConfig} DiskConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DiskConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.DiskConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.bootDiskType = reader.string(); - break; - } - case 1: { - message.bootDiskSizeGb = reader.int32(); - break; - } - case 2: { - message.numLocalSsds = reader.int32(); - break; - } - case 4: { - message.localSsdInterface = reader.string(); - break; - } - case 5: { - message.bootDiskProvisionedIops = reader.int64(); - break; - } - case 6: { - message.bootDiskProvisionedThroughput = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DiskConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.DiskConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.DiskConfig} DiskConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DiskConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DiskConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.DiskConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DiskConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.bootDiskType != null && message.hasOwnProperty("bootDiskType")) - if (!$util.isString(message.bootDiskType)) - return "bootDiskType: string expected"; - if (message.bootDiskSizeGb != null && message.hasOwnProperty("bootDiskSizeGb")) - if (!$util.isInteger(message.bootDiskSizeGb)) - return "bootDiskSizeGb: integer expected"; - if (message.numLocalSsds != null && message.hasOwnProperty("numLocalSsds")) - if (!$util.isInteger(message.numLocalSsds)) - return "numLocalSsds: integer expected"; - if (message.localSsdInterface != null && message.hasOwnProperty("localSsdInterface")) - if (!$util.isString(message.localSsdInterface)) - return "localSsdInterface: string expected"; - if (message.bootDiskProvisionedIops != null && message.hasOwnProperty("bootDiskProvisionedIops")) { - properties._bootDiskProvisionedIops = 1; - if (!$util.isInteger(message.bootDiskProvisionedIops) && !(message.bootDiskProvisionedIops && $util.isInteger(message.bootDiskProvisionedIops.low) && $util.isInteger(message.bootDiskProvisionedIops.high))) - return "bootDiskProvisionedIops: integer|Long expected"; - } - if (message.bootDiskProvisionedThroughput != null && message.hasOwnProperty("bootDiskProvisionedThroughput")) { - properties._bootDiskProvisionedThroughput = 1; - if (!$util.isInteger(message.bootDiskProvisionedThroughput) && !(message.bootDiskProvisionedThroughput && $util.isInteger(message.bootDiskProvisionedThroughput.low) && $util.isInteger(message.bootDiskProvisionedThroughput.high))) - return "bootDiskProvisionedThroughput: integer|Long expected"; - } - return null; - }; - - /** - * Creates a DiskConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.DiskConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.DiskConfig} DiskConfig - */ - DiskConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.DiskConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.DiskConfig(); - if (object.bootDiskType != null) - message.bootDiskType = String(object.bootDiskType); - if (object.bootDiskSizeGb != null) - message.bootDiskSizeGb = object.bootDiskSizeGb | 0; - if (object.numLocalSsds != null) - message.numLocalSsds = object.numLocalSsds | 0; - if (object.localSsdInterface != null) - message.localSsdInterface = String(object.localSsdInterface); - if (object.bootDiskProvisionedIops != null) - if ($util.Long) - (message.bootDiskProvisionedIops = $util.Long.fromValue(object.bootDiskProvisionedIops)).unsigned = false; - else if (typeof object.bootDiskProvisionedIops === "string") - message.bootDiskProvisionedIops = parseInt(object.bootDiskProvisionedIops, 10); - else if (typeof object.bootDiskProvisionedIops === "number") - message.bootDiskProvisionedIops = object.bootDiskProvisionedIops; - else if (typeof object.bootDiskProvisionedIops === "object") - message.bootDiskProvisionedIops = new $util.LongBits(object.bootDiskProvisionedIops.low >>> 0, object.bootDiskProvisionedIops.high >>> 0).toNumber(); - if (object.bootDiskProvisionedThroughput != null) - if ($util.Long) - (message.bootDiskProvisionedThroughput = $util.Long.fromValue(object.bootDiskProvisionedThroughput)).unsigned = false; - else if (typeof object.bootDiskProvisionedThroughput === "string") - message.bootDiskProvisionedThroughput = parseInt(object.bootDiskProvisionedThroughput, 10); - else if (typeof object.bootDiskProvisionedThroughput === "number") - message.bootDiskProvisionedThroughput = object.bootDiskProvisionedThroughput; - else if (typeof object.bootDiskProvisionedThroughput === "object") - message.bootDiskProvisionedThroughput = new $util.LongBits(object.bootDiskProvisionedThroughput.low >>> 0, object.bootDiskProvisionedThroughput.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a DiskConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.DiskConfig - * @static - * @param {google.cloud.dataproc.v1.DiskConfig} message DiskConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DiskConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.bootDiskSizeGb = 0; - object.numLocalSsds = 0; - object.bootDiskType = ""; - object.localSsdInterface = ""; - } - if (message.bootDiskSizeGb != null && message.hasOwnProperty("bootDiskSizeGb")) - object.bootDiskSizeGb = message.bootDiskSizeGb; - if (message.numLocalSsds != null && message.hasOwnProperty("numLocalSsds")) - object.numLocalSsds = message.numLocalSsds; - if (message.bootDiskType != null && message.hasOwnProperty("bootDiskType")) - object.bootDiskType = message.bootDiskType; - if (message.localSsdInterface != null && message.hasOwnProperty("localSsdInterface")) - object.localSsdInterface = message.localSsdInterface; - if (message.bootDiskProvisionedIops != null && message.hasOwnProperty("bootDiskProvisionedIops")) { - if (typeof message.bootDiskProvisionedIops === "number") - object.bootDiskProvisionedIops = options.longs === String ? String(message.bootDiskProvisionedIops) : message.bootDiskProvisionedIops; - else - object.bootDiskProvisionedIops = options.longs === String ? $util.Long.prototype.toString.call(message.bootDiskProvisionedIops) : options.longs === Number ? new $util.LongBits(message.bootDiskProvisionedIops.low >>> 0, message.bootDiskProvisionedIops.high >>> 0).toNumber() : message.bootDiskProvisionedIops; - if (options.oneofs) - object._bootDiskProvisionedIops = "bootDiskProvisionedIops"; - } - if (message.bootDiskProvisionedThroughput != null && message.hasOwnProperty("bootDiskProvisionedThroughput")) { - if (typeof message.bootDiskProvisionedThroughput === "number") - object.bootDiskProvisionedThroughput = options.longs === String ? String(message.bootDiskProvisionedThroughput) : message.bootDiskProvisionedThroughput; - else - object.bootDiskProvisionedThroughput = options.longs === String ? $util.Long.prototype.toString.call(message.bootDiskProvisionedThroughput) : options.longs === Number ? new $util.LongBits(message.bootDiskProvisionedThroughput.low >>> 0, message.bootDiskProvisionedThroughput.high >>> 0).toNumber() : message.bootDiskProvisionedThroughput; - if (options.oneofs) - object._bootDiskProvisionedThroughput = "bootDiskProvisionedThroughput"; - } - return object; - }; - - /** - * Converts this DiskConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.DiskConfig - * @instance - * @returns {Object.} JSON object - */ - DiskConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DiskConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.DiskConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DiskConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.DiskConfig"; - }; - - return DiskConfig; - })(); - - v1.AuxiliaryNodeGroup = (function() { - - /** - * Properties of an AuxiliaryNodeGroup. - * @memberof google.cloud.dataproc.v1 - * @interface IAuxiliaryNodeGroup - * @property {google.cloud.dataproc.v1.INodeGroup|null} [nodeGroup] AuxiliaryNodeGroup nodeGroup - * @property {string|null} [nodeGroupId] AuxiliaryNodeGroup nodeGroupId - */ - - /** - * Constructs a new AuxiliaryNodeGroup. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents an AuxiliaryNodeGroup. - * @implements IAuxiliaryNodeGroup - * @constructor - * @param {google.cloud.dataproc.v1.IAuxiliaryNodeGroup=} [properties] Properties to set - */ - function AuxiliaryNodeGroup(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AuxiliaryNodeGroup nodeGroup. - * @member {google.cloud.dataproc.v1.INodeGroup|null|undefined} nodeGroup - * @memberof google.cloud.dataproc.v1.AuxiliaryNodeGroup - * @instance - */ - AuxiliaryNodeGroup.prototype.nodeGroup = null; - - /** - * AuxiliaryNodeGroup nodeGroupId. - * @member {string} nodeGroupId - * @memberof google.cloud.dataproc.v1.AuxiliaryNodeGroup - * @instance - */ - AuxiliaryNodeGroup.prototype.nodeGroupId = ""; - - /** - * Creates a new AuxiliaryNodeGroup instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.AuxiliaryNodeGroup - * @static - * @param {google.cloud.dataproc.v1.IAuxiliaryNodeGroup=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.AuxiliaryNodeGroup} AuxiliaryNodeGroup instance - */ - AuxiliaryNodeGroup.create = function create(properties) { - return new AuxiliaryNodeGroup(properties); - }; - - /** - * Encodes the specified AuxiliaryNodeGroup message. Does not implicitly {@link google.cloud.dataproc.v1.AuxiliaryNodeGroup.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.AuxiliaryNodeGroup - * @static - * @param {google.cloud.dataproc.v1.IAuxiliaryNodeGroup} message AuxiliaryNodeGroup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuxiliaryNodeGroup.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nodeGroup != null && Object.hasOwnProperty.call(message, "nodeGroup")) - $root.google.cloud.dataproc.v1.NodeGroup.encode(message.nodeGroup, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nodeGroupId != null && Object.hasOwnProperty.call(message, "nodeGroupId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nodeGroupId); - return writer; - }; - - /** - * Encodes the specified AuxiliaryNodeGroup message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.AuxiliaryNodeGroup.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.AuxiliaryNodeGroup - * @static - * @param {google.cloud.dataproc.v1.IAuxiliaryNodeGroup} message AuxiliaryNodeGroup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AuxiliaryNodeGroup.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AuxiliaryNodeGroup message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.AuxiliaryNodeGroup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.AuxiliaryNodeGroup} AuxiliaryNodeGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuxiliaryNodeGroup.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.AuxiliaryNodeGroup(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.nodeGroup = $root.google.cloud.dataproc.v1.NodeGroup.decode(reader, reader.uint32()); - break; - } - case 2: { - message.nodeGroupId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AuxiliaryNodeGroup message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.AuxiliaryNodeGroup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.AuxiliaryNodeGroup} AuxiliaryNodeGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AuxiliaryNodeGroup.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AuxiliaryNodeGroup message. - * @function verify - * @memberof google.cloud.dataproc.v1.AuxiliaryNodeGroup - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AuxiliaryNodeGroup.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.nodeGroup != null && message.hasOwnProperty("nodeGroup")) { - var error = $root.google.cloud.dataproc.v1.NodeGroup.verify(message.nodeGroup); - if (error) - return "nodeGroup." + error; - } - if (message.nodeGroupId != null && message.hasOwnProperty("nodeGroupId")) - if (!$util.isString(message.nodeGroupId)) - return "nodeGroupId: string expected"; - return null; - }; - - /** - * Creates an AuxiliaryNodeGroup message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.AuxiliaryNodeGroup - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.AuxiliaryNodeGroup} AuxiliaryNodeGroup - */ - AuxiliaryNodeGroup.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.AuxiliaryNodeGroup) - return object; - var message = new $root.google.cloud.dataproc.v1.AuxiliaryNodeGroup(); - if (object.nodeGroup != null) { - if (typeof object.nodeGroup !== "object") - throw TypeError(".google.cloud.dataproc.v1.AuxiliaryNodeGroup.nodeGroup: object expected"); - message.nodeGroup = $root.google.cloud.dataproc.v1.NodeGroup.fromObject(object.nodeGroup); - } - if (object.nodeGroupId != null) - message.nodeGroupId = String(object.nodeGroupId); - return message; - }; - - /** - * Creates a plain object from an AuxiliaryNodeGroup message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.AuxiliaryNodeGroup - * @static - * @param {google.cloud.dataproc.v1.AuxiliaryNodeGroup} message AuxiliaryNodeGroup - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AuxiliaryNodeGroup.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.nodeGroup = null; - object.nodeGroupId = ""; - } - if (message.nodeGroup != null && message.hasOwnProperty("nodeGroup")) - object.nodeGroup = $root.google.cloud.dataproc.v1.NodeGroup.toObject(message.nodeGroup, options); - if (message.nodeGroupId != null && message.hasOwnProperty("nodeGroupId")) - object.nodeGroupId = message.nodeGroupId; - return object; - }; - - /** - * Converts this AuxiliaryNodeGroup to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.AuxiliaryNodeGroup - * @instance - * @returns {Object.} JSON object - */ - AuxiliaryNodeGroup.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AuxiliaryNodeGroup - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.AuxiliaryNodeGroup - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AuxiliaryNodeGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.AuxiliaryNodeGroup"; - }; - - return AuxiliaryNodeGroup; - })(); - - v1.NodeGroup = (function() { - - /** - * Properties of a NodeGroup. - * @memberof google.cloud.dataproc.v1 - * @interface INodeGroup - * @property {string|null} [name] NodeGroup name - * @property {Array.|null} [roles] NodeGroup roles - * @property {google.cloud.dataproc.v1.IInstanceGroupConfig|null} [nodeGroupConfig] NodeGroup nodeGroupConfig - * @property {Object.|null} [labels] NodeGroup labels - */ - - /** - * Constructs a new NodeGroup. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a NodeGroup. - * @implements INodeGroup - * @constructor - * @param {google.cloud.dataproc.v1.INodeGroup=} [properties] Properties to set - */ - function NodeGroup(properties) { - this.roles = []; - this.labels = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NodeGroup name. - * @member {string} name - * @memberof google.cloud.dataproc.v1.NodeGroup - * @instance - */ - NodeGroup.prototype.name = ""; - - /** - * NodeGroup roles. - * @member {Array.} roles - * @memberof google.cloud.dataproc.v1.NodeGroup - * @instance - */ - NodeGroup.prototype.roles = $util.emptyArray; - - /** - * NodeGroup nodeGroupConfig. - * @member {google.cloud.dataproc.v1.IInstanceGroupConfig|null|undefined} nodeGroupConfig - * @memberof google.cloud.dataproc.v1.NodeGroup - * @instance - */ - NodeGroup.prototype.nodeGroupConfig = null; - - /** - * NodeGroup labels. - * @member {Object.} labels - * @memberof google.cloud.dataproc.v1.NodeGroup - * @instance - */ - NodeGroup.prototype.labels = $util.emptyObject; - - /** - * Creates a new NodeGroup instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.NodeGroup - * @static - * @param {google.cloud.dataproc.v1.INodeGroup=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.NodeGroup} NodeGroup instance - */ - NodeGroup.create = function create(properties) { - return new NodeGroup(properties); - }; - - /** - * Encodes the specified NodeGroup message. Does not implicitly {@link google.cloud.dataproc.v1.NodeGroup.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.NodeGroup - * @static - * @param {google.cloud.dataproc.v1.INodeGroup} message NodeGroup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeGroup.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.roles != null && message.roles.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.roles.length; ++i) - writer.int32(message.roles[i]); - writer.ldelim(); - } - if (message.nodeGroupConfig != null && Object.hasOwnProperty.call(message, "nodeGroupConfig")) - $root.google.cloud.dataproc.v1.InstanceGroupConfig.encode(message.nodeGroupConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - return writer; - }; - - /** - * Encodes the specified NodeGroup message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.NodeGroup.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.NodeGroup - * @static - * @param {google.cloud.dataproc.v1.INodeGroup} message NodeGroup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeGroup.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NodeGroup message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.NodeGroup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.NodeGroup} NodeGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeGroup.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.NodeGroup(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.roles && message.roles.length)) - message.roles = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.roles.push(reader.int32()); - } else - message.roles.push(reader.int32()); - break; - } - case 3: { - message.nodeGroupConfig = $root.google.cloud.dataproc.v1.InstanceGroupConfig.decode(reader, reader.uint32()); - break; - } - case 4: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NodeGroup message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.NodeGroup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.NodeGroup} NodeGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeGroup.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NodeGroup message. - * @function verify - * @memberof google.cloud.dataproc.v1.NodeGroup - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NodeGroup.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.roles != null && message.hasOwnProperty("roles")) { - if (!Array.isArray(message.roles)) - return "roles: array expected"; - for (var i = 0; i < message.roles.length; ++i) - switch (message.roles[i]) { - default: - return "roles: enum value[] expected"; - case 0: - case 1: - break; - } - } - if (message.nodeGroupConfig != null && message.hasOwnProperty("nodeGroupConfig")) { - var error = $root.google.cloud.dataproc.v1.InstanceGroupConfig.verify(message.nodeGroupConfig); - if (error) - return "nodeGroupConfig." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - return null; - }; - - /** - * Creates a NodeGroup message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.NodeGroup - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.NodeGroup} NodeGroup - */ - NodeGroup.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.NodeGroup) - return object; - var message = new $root.google.cloud.dataproc.v1.NodeGroup(); - if (object.name != null) - message.name = String(object.name); - if (object.roles) { - if (!Array.isArray(object.roles)) - throw TypeError(".google.cloud.dataproc.v1.NodeGroup.roles: array expected"); - message.roles = []; - for (var i = 0; i < object.roles.length; ++i) - switch (object.roles[i]) { - default: - if (typeof object.roles[i] === "number") { - message.roles[i] = object.roles[i]; - break; - } - case "ROLE_UNSPECIFIED": - case 0: - message.roles[i] = 0; - break; - case "DRIVER": - case 1: - message.roles[i] = 1; - break; - } - } - if (object.nodeGroupConfig != null) { - if (typeof object.nodeGroupConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.NodeGroup.nodeGroupConfig: object expected"); - message.nodeGroupConfig = $root.google.cloud.dataproc.v1.InstanceGroupConfig.fromObject(object.nodeGroupConfig); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.dataproc.v1.NodeGroup.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - return message; - }; - - /** - * Creates a plain object from a NodeGroup message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.NodeGroup - * @static - * @param {google.cloud.dataproc.v1.NodeGroup} message NodeGroup - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NodeGroup.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.roles = []; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.nodeGroupConfig = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.roles && message.roles.length) { - object.roles = []; - for (var j = 0; j < message.roles.length; ++j) - object.roles[j] = options.enums === String ? $root.google.cloud.dataproc.v1.NodeGroup.Role[message.roles[j]] === undefined ? message.roles[j] : $root.google.cloud.dataproc.v1.NodeGroup.Role[message.roles[j]] : message.roles[j]; - } - if (message.nodeGroupConfig != null && message.hasOwnProperty("nodeGroupConfig")) - object.nodeGroupConfig = $root.google.cloud.dataproc.v1.InstanceGroupConfig.toObject(message.nodeGroupConfig, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - return object; - }; - - /** - * Converts this NodeGroup to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.NodeGroup - * @instance - * @returns {Object.} JSON object - */ - NodeGroup.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NodeGroup - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.NodeGroup - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NodeGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.NodeGroup"; - }; - - /** - * Role enum. - * @name google.cloud.dataproc.v1.NodeGroup.Role - * @enum {number} - * @property {number} ROLE_UNSPECIFIED=0 ROLE_UNSPECIFIED value - * @property {number} DRIVER=1 DRIVER value - */ - NodeGroup.Role = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ROLE_UNSPECIFIED"] = 0; - values[valuesById[1] = "DRIVER"] = 1; - return values; - })(); - - return NodeGroup; - })(); - - v1.NodeInitializationAction = (function() { - - /** - * Properties of a NodeInitializationAction. - * @memberof google.cloud.dataproc.v1 - * @interface INodeInitializationAction - * @property {string|null} [executableFile] NodeInitializationAction executableFile - * @property {google.protobuf.IDuration|null} [executionTimeout] NodeInitializationAction executionTimeout - */ - - /** - * Constructs a new NodeInitializationAction. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a NodeInitializationAction. - * @implements INodeInitializationAction - * @constructor - * @param {google.cloud.dataproc.v1.INodeInitializationAction=} [properties] Properties to set - */ - function NodeInitializationAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NodeInitializationAction executableFile. - * @member {string} executableFile - * @memberof google.cloud.dataproc.v1.NodeInitializationAction - * @instance - */ - NodeInitializationAction.prototype.executableFile = ""; - - /** - * NodeInitializationAction executionTimeout. - * @member {google.protobuf.IDuration|null|undefined} executionTimeout - * @memberof google.cloud.dataproc.v1.NodeInitializationAction - * @instance - */ - NodeInitializationAction.prototype.executionTimeout = null; - - /** - * Creates a new NodeInitializationAction instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.NodeInitializationAction - * @static - * @param {google.cloud.dataproc.v1.INodeInitializationAction=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.NodeInitializationAction} NodeInitializationAction instance - */ - NodeInitializationAction.create = function create(properties) { - return new NodeInitializationAction(properties); - }; - - /** - * Encodes the specified NodeInitializationAction message. Does not implicitly {@link google.cloud.dataproc.v1.NodeInitializationAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.NodeInitializationAction - * @static - * @param {google.cloud.dataproc.v1.INodeInitializationAction} message NodeInitializationAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeInitializationAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.executableFile != null && Object.hasOwnProperty.call(message, "executableFile")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.executableFile); - if (message.executionTimeout != null && Object.hasOwnProperty.call(message, "executionTimeout")) - $root.google.protobuf.Duration.encode(message.executionTimeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified NodeInitializationAction message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.NodeInitializationAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.NodeInitializationAction - * @static - * @param {google.cloud.dataproc.v1.INodeInitializationAction} message NodeInitializationAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeInitializationAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NodeInitializationAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.NodeInitializationAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.NodeInitializationAction} NodeInitializationAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeInitializationAction.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.NodeInitializationAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.executableFile = reader.string(); - break; - } - case 2: { - message.executionTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NodeInitializationAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.NodeInitializationAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.NodeInitializationAction} NodeInitializationAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeInitializationAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NodeInitializationAction message. - * @function verify - * @memberof google.cloud.dataproc.v1.NodeInitializationAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NodeInitializationAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.executableFile != null && message.hasOwnProperty("executableFile")) - if (!$util.isString(message.executableFile)) - return "executableFile: string expected"; - if (message.executionTimeout != null && message.hasOwnProperty("executionTimeout")) { - var error = $root.google.protobuf.Duration.verify(message.executionTimeout); - if (error) - return "executionTimeout." + error; - } - return null; - }; - - /** - * Creates a NodeInitializationAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.NodeInitializationAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.NodeInitializationAction} NodeInitializationAction - */ - NodeInitializationAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.NodeInitializationAction) - return object; - var message = new $root.google.cloud.dataproc.v1.NodeInitializationAction(); - if (object.executableFile != null) - message.executableFile = String(object.executableFile); - if (object.executionTimeout != null) { - if (typeof object.executionTimeout !== "object") - throw TypeError(".google.cloud.dataproc.v1.NodeInitializationAction.executionTimeout: object expected"); - message.executionTimeout = $root.google.protobuf.Duration.fromObject(object.executionTimeout); - } - return message; - }; - - /** - * Creates a plain object from a NodeInitializationAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.NodeInitializationAction - * @static - * @param {google.cloud.dataproc.v1.NodeInitializationAction} message NodeInitializationAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NodeInitializationAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.executableFile = ""; - object.executionTimeout = null; - } - if (message.executableFile != null && message.hasOwnProperty("executableFile")) - object.executableFile = message.executableFile; - if (message.executionTimeout != null && message.hasOwnProperty("executionTimeout")) - object.executionTimeout = $root.google.protobuf.Duration.toObject(message.executionTimeout, options); - return object; - }; - - /** - * Converts this NodeInitializationAction to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.NodeInitializationAction - * @instance - * @returns {Object.} JSON object - */ - NodeInitializationAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NodeInitializationAction - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.NodeInitializationAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NodeInitializationAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.NodeInitializationAction"; - }; - - return NodeInitializationAction; - })(); - - v1.ClusterStatus = (function() { - - /** - * Properties of a ClusterStatus. - * @memberof google.cloud.dataproc.v1 - * @interface IClusterStatus - * @property {google.cloud.dataproc.v1.ClusterStatus.State|null} [state] ClusterStatus state - * @property {string|null} [detail] ClusterStatus detail - * @property {google.protobuf.ITimestamp|null} [stateStartTime] ClusterStatus stateStartTime - * @property {google.cloud.dataproc.v1.ClusterStatus.Substate|null} [substate] ClusterStatus substate - */ - - /** - * Constructs a new ClusterStatus. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a ClusterStatus. - * @implements IClusterStatus - * @constructor - * @param {google.cloud.dataproc.v1.IClusterStatus=} [properties] Properties to set - */ - function ClusterStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClusterStatus state. - * @member {google.cloud.dataproc.v1.ClusterStatus.State} state - * @memberof google.cloud.dataproc.v1.ClusterStatus - * @instance - */ - ClusterStatus.prototype.state = 0; - - /** - * ClusterStatus detail. - * @member {string} detail - * @memberof google.cloud.dataproc.v1.ClusterStatus - * @instance - */ - ClusterStatus.prototype.detail = ""; - - /** - * ClusterStatus stateStartTime. - * @member {google.protobuf.ITimestamp|null|undefined} stateStartTime - * @memberof google.cloud.dataproc.v1.ClusterStatus - * @instance - */ - ClusterStatus.prototype.stateStartTime = null; - - /** - * ClusterStatus substate. - * @member {google.cloud.dataproc.v1.ClusterStatus.Substate} substate - * @memberof google.cloud.dataproc.v1.ClusterStatus - * @instance - */ - ClusterStatus.prototype.substate = 0; - - /** - * Creates a new ClusterStatus instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.ClusterStatus - * @static - * @param {google.cloud.dataproc.v1.IClusterStatus=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.ClusterStatus} ClusterStatus instance - */ - ClusterStatus.create = function create(properties) { - return new ClusterStatus(properties); - }; - - /** - * Encodes the specified ClusterStatus message. Does not implicitly {@link google.cloud.dataproc.v1.ClusterStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.ClusterStatus - * @static - * @param {google.cloud.dataproc.v1.IClusterStatus} message ClusterStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClusterStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.detail != null && Object.hasOwnProperty.call(message, "detail")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.detail); - if (message.stateStartTime != null && Object.hasOwnProperty.call(message, "stateStartTime")) - $root.google.protobuf.Timestamp.encode(message.stateStartTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.substate != null && Object.hasOwnProperty.call(message, "substate")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.substate); - return writer; - }; - - /** - * Encodes the specified ClusterStatus message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ClusterStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.ClusterStatus - * @static - * @param {google.cloud.dataproc.v1.IClusterStatus} message ClusterStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClusterStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClusterStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.ClusterStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.ClusterStatus} ClusterStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClusterStatus.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ClusterStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.state = reader.int32(); - break; - } - case 2: { - message.detail = reader.string(); - break; - } - case 3: { - message.stateStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.substate = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClusterStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.ClusterStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.ClusterStatus} ClusterStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClusterStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClusterStatus message. - * @function verify - * @memberof google.cloud.dataproc.v1.ClusterStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClusterStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 9: - case 4: - case 5: - case 6: - case 7: - case 8: - case 10: - break; - } - if (message.detail != null && message.hasOwnProperty("detail")) - if (!$util.isString(message.detail)) - return "detail: string expected"; - if (message.stateStartTime != null && message.hasOwnProperty("stateStartTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.stateStartTime); - if (error) - return "stateStartTime." + error; - } - if (message.substate != null && message.hasOwnProperty("substate")) - switch (message.substate) { - default: - return "substate: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a ClusterStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.ClusterStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.ClusterStatus} ClusterStatus - */ - ClusterStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.ClusterStatus) - return object; - var message = new $root.google.cloud.dataproc.v1.ClusterStatus(); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "UNKNOWN": - case 0: - message.state = 0; - break; - case "CREATING": - case 1: - message.state = 1; - break; - case "RUNNING": - case 2: - message.state = 2; - break; - case "ERROR": - case 3: - message.state = 3; - break; - case "ERROR_DUE_TO_UPDATE": - case 9: - message.state = 9; - break; - case "DELETING": - case 4: - message.state = 4; - break; - case "UPDATING": - case 5: - message.state = 5; - break; - case "STOPPING": - case 6: - message.state = 6; - break; - case "STOPPED": - case 7: - message.state = 7; - break; - case "STARTING": - case 8: - message.state = 8; - break; - case "REPAIRING": - case 10: - message.state = 10; - break; - } - if (object.detail != null) - message.detail = String(object.detail); - if (object.stateStartTime != null) { - if (typeof object.stateStartTime !== "object") - throw TypeError(".google.cloud.dataproc.v1.ClusterStatus.stateStartTime: object expected"); - message.stateStartTime = $root.google.protobuf.Timestamp.fromObject(object.stateStartTime); - } - switch (object.substate) { - default: - if (typeof object.substate === "number") { - message.substate = object.substate; - break; - } - break; - case "UNSPECIFIED": - case 0: - message.substate = 0; - break; - case "UNHEALTHY": - case 1: - message.substate = 1; - break; - case "STALE_STATUS": - case 2: - message.substate = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a ClusterStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.ClusterStatus - * @static - * @param {google.cloud.dataproc.v1.ClusterStatus} message ClusterStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClusterStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.state = options.enums === String ? "UNKNOWN" : 0; - object.detail = ""; - object.stateStartTime = null; - object.substate = options.enums === String ? "UNSPECIFIED" : 0; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.dataproc.v1.ClusterStatus.State[message.state] === undefined ? message.state : $root.google.cloud.dataproc.v1.ClusterStatus.State[message.state] : message.state; - if (message.detail != null && message.hasOwnProperty("detail")) - object.detail = message.detail; - if (message.stateStartTime != null && message.hasOwnProperty("stateStartTime")) - object.stateStartTime = $root.google.protobuf.Timestamp.toObject(message.stateStartTime, options); - if (message.substate != null && message.hasOwnProperty("substate")) - object.substate = options.enums === String ? $root.google.cloud.dataproc.v1.ClusterStatus.Substate[message.substate] === undefined ? message.substate : $root.google.cloud.dataproc.v1.ClusterStatus.Substate[message.substate] : message.substate; - return object; - }; - - /** - * Converts this ClusterStatus to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.ClusterStatus - * @instance - * @returns {Object.} JSON object - */ - ClusterStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClusterStatus - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.ClusterStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClusterStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.ClusterStatus"; - }; - - /** - * State enum. - * @name google.cloud.dataproc.v1.ClusterStatus.State - * @enum {number} - * @property {number} UNKNOWN=0 UNKNOWN value - * @property {number} CREATING=1 CREATING value - * @property {number} RUNNING=2 RUNNING value - * @property {number} ERROR=3 ERROR value - * @property {number} ERROR_DUE_TO_UPDATE=9 ERROR_DUE_TO_UPDATE value - * @property {number} DELETING=4 DELETING value - * @property {number} UPDATING=5 UPDATING value - * @property {number} STOPPING=6 STOPPING value - * @property {number} STOPPED=7 STOPPED value - * @property {number} STARTING=8 STARTING value - * @property {number} REPAIRING=10 REPAIRING value - */ - ClusterStatus.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNKNOWN"] = 0; - values[valuesById[1] = "CREATING"] = 1; - values[valuesById[2] = "RUNNING"] = 2; - values[valuesById[3] = "ERROR"] = 3; - values[valuesById[9] = "ERROR_DUE_TO_UPDATE"] = 9; - values[valuesById[4] = "DELETING"] = 4; - values[valuesById[5] = "UPDATING"] = 5; - values[valuesById[6] = "STOPPING"] = 6; - values[valuesById[7] = "STOPPED"] = 7; - values[valuesById[8] = "STARTING"] = 8; - values[valuesById[10] = "REPAIRING"] = 10; - return values; - })(); - - /** - * Substate enum. - * @name google.cloud.dataproc.v1.ClusterStatus.Substate - * @enum {number} - * @property {number} UNSPECIFIED=0 UNSPECIFIED value - * @property {number} UNHEALTHY=1 UNHEALTHY value - * @property {number} STALE_STATUS=2 STALE_STATUS value - */ - ClusterStatus.Substate = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNSPECIFIED"] = 0; - values[valuesById[1] = "UNHEALTHY"] = 1; - values[valuesById[2] = "STALE_STATUS"] = 2; - return values; - })(); - - return ClusterStatus; - })(); - - v1.SecurityConfig = (function() { - - /** - * Properties of a SecurityConfig. - * @memberof google.cloud.dataproc.v1 - * @interface ISecurityConfig - * @property {google.cloud.dataproc.v1.IKerberosConfig|null} [kerberosConfig] SecurityConfig kerberosConfig - * @property {google.cloud.dataproc.v1.IIdentityConfig|null} [identityConfig] SecurityConfig identityConfig - */ - - /** - * Constructs a new SecurityConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a SecurityConfig. - * @implements ISecurityConfig - * @constructor - * @param {google.cloud.dataproc.v1.ISecurityConfig=} [properties] Properties to set - */ - function SecurityConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SecurityConfig kerberosConfig. - * @member {google.cloud.dataproc.v1.IKerberosConfig|null|undefined} kerberosConfig - * @memberof google.cloud.dataproc.v1.SecurityConfig - * @instance - */ - SecurityConfig.prototype.kerberosConfig = null; - - /** - * SecurityConfig identityConfig. - * @member {google.cloud.dataproc.v1.IIdentityConfig|null|undefined} identityConfig - * @memberof google.cloud.dataproc.v1.SecurityConfig - * @instance - */ - SecurityConfig.prototype.identityConfig = null; - - /** - * Creates a new SecurityConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.SecurityConfig - * @static - * @param {google.cloud.dataproc.v1.ISecurityConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.SecurityConfig} SecurityConfig instance - */ - SecurityConfig.create = function create(properties) { - return new SecurityConfig(properties); - }; - - /** - * Encodes the specified SecurityConfig message. Does not implicitly {@link google.cloud.dataproc.v1.SecurityConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.SecurityConfig - * @static - * @param {google.cloud.dataproc.v1.ISecurityConfig} message SecurityConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecurityConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kerberosConfig != null && Object.hasOwnProperty.call(message, "kerberosConfig")) - $root.google.cloud.dataproc.v1.KerberosConfig.encode(message.kerberosConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.identityConfig != null && Object.hasOwnProperty.call(message, "identityConfig")) - $root.google.cloud.dataproc.v1.IdentityConfig.encode(message.identityConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SecurityConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SecurityConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.SecurityConfig - * @static - * @param {google.cloud.dataproc.v1.ISecurityConfig} message SecurityConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SecurityConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SecurityConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.SecurityConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.SecurityConfig} SecurityConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecurityConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.SecurityConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.kerberosConfig = $root.google.cloud.dataproc.v1.KerberosConfig.decode(reader, reader.uint32()); - break; - } - case 2: { - message.identityConfig = $root.google.cloud.dataproc.v1.IdentityConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SecurityConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.SecurityConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.SecurityConfig} SecurityConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SecurityConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SecurityConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.SecurityConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SecurityConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kerberosConfig != null && message.hasOwnProperty("kerberosConfig")) { - var error = $root.google.cloud.dataproc.v1.KerberosConfig.verify(message.kerberosConfig); - if (error) - return "kerberosConfig." + error; - } - if (message.identityConfig != null && message.hasOwnProperty("identityConfig")) { - var error = $root.google.cloud.dataproc.v1.IdentityConfig.verify(message.identityConfig); - if (error) - return "identityConfig." + error; - } - return null; - }; - - /** - * Creates a SecurityConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.SecurityConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.SecurityConfig} SecurityConfig - */ - SecurityConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.SecurityConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.SecurityConfig(); - if (object.kerberosConfig != null) { - if (typeof object.kerberosConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.SecurityConfig.kerberosConfig: object expected"); - message.kerberosConfig = $root.google.cloud.dataproc.v1.KerberosConfig.fromObject(object.kerberosConfig); - } - if (object.identityConfig != null) { - if (typeof object.identityConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.SecurityConfig.identityConfig: object expected"); - message.identityConfig = $root.google.cloud.dataproc.v1.IdentityConfig.fromObject(object.identityConfig); - } - return message; - }; - - /** - * Creates a plain object from a SecurityConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.SecurityConfig - * @static - * @param {google.cloud.dataproc.v1.SecurityConfig} message SecurityConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SecurityConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.kerberosConfig = null; - object.identityConfig = null; - } - if (message.kerberosConfig != null && message.hasOwnProperty("kerberosConfig")) - object.kerberosConfig = $root.google.cloud.dataproc.v1.KerberosConfig.toObject(message.kerberosConfig, options); - if (message.identityConfig != null && message.hasOwnProperty("identityConfig")) - object.identityConfig = $root.google.cloud.dataproc.v1.IdentityConfig.toObject(message.identityConfig, options); - return object; - }; - - /** - * Converts this SecurityConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.SecurityConfig - * @instance - * @returns {Object.} JSON object - */ - SecurityConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SecurityConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.SecurityConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SecurityConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.SecurityConfig"; - }; - - return SecurityConfig; - })(); - - v1.KerberosConfig = (function() { - - /** - * Properties of a KerberosConfig. - * @memberof google.cloud.dataproc.v1 - * @interface IKerberosConfig - * @property {boolean|null} [enableKerberos] KerberosConfig enableKerberos - * @property {string|null} [rootPrincipalPasswordUri] KerberosConfig rootPrincipalPasswordUri - * @property {string|null} [kmsKeyUri] KerberosConfig kmsKeyUri - * @property {string|null} [keystoreUri] KerberosConfig keystoreUri - * @property {string|null} [truststoreUri] KerberosConfig truststoreUri - * @property {string|null} [keystorePasswordUri] KerberosConfig keystorePasswordUri - * @property {string|null} [keyPasswordUri] KerberosConfig keyPasswordUri - * @property {string|null} [truststorePasswordUri] KerberosConfig truststorePasswordUri - * @property {string|null} [crossRealmTrustRealm] KerberosConfig crossRealmTrustRealm - * @property {string|null} [crossRealmTrustKdc] KerberosConfig crossRealmTrustKdc - * @property {string|null} [crossRealmTrustAdminServer] KerberosConfig crossRealmTrustAdminServer - * @property {string|null} [crossRealmTrustSharedPasswordUri] KerberosConfig crossRealmTrustSharedPasswordUri - * @property {string|null} [kdcDbKeyUri] KerberosConfig kdcDbKeyUri - * @property {number|null} [tgtLifetimeHours] KerberosConfig tgtLifetimeHours - * @property {string|null} [realm] KerberosConfig realm - */ - - /** - * Constructs a new KerberosConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a KerberosConfig. - * @implements IKerberosConfig - * @constructor - * @param {google.cloud.dataproc.v1.IKerberosConfig=} [properties] Properties to set - */ - function KerberosConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * KerberosConfig enableKerberos. - * @member {boolean} enableKerberos - * @memberof google.cloud.dataproc.v1.KerberosConfig - * @instance - */ - KerberosConfig.prototype.enableKerberos = false; - - /** - * KerberosConfig rootPrincipalPasswordUri. - * @member {string} rootPrincipalPasswordUri - * @memberof google.cloud.dataproc.v1.KerberosConfig - * @instance - */ - KerberosConfig.prototype.rootPrincipalPasswordUri = ""; - - /** - * KerberosConfig kmsKeyUri. - * @member {string} kmsKeyUri - * @memberof google.cloud.dataproc.v1.KerberosConfig - * @instance - */ - KerberosConfig.prototype.kmsKeyUri = ""; - - /** - * KerberosConfig keystoreUri. - * @member {string} keystoreUri - * @memberof google.cloud.dataproc.v1.KerberosConfig - * @instance - */ - KerberosConfig.prototype.keystoreUri = ""; - - /** - * KerberosConfig truststoreUri. - * @member {string} truststoreUri - * @memberof google.cloud.dataproc.v1.KerberosConfig - * @instance - */ - KerberosConfig.prototype.truststoreUri = ""; - - /** - * KerberosConfig keystorePasswordUri. - * @member {string} keystorePasswordUri - * @memberof google.cloud.dataproc.v1.KerberosConfig - * @instance - */ - KerberosConfig.prototype.keystorePasswordUri = ""; - - /** - * KerberosConfig keyPasswordUri. - * @member {string} keyPasswordUri - * @memberof google.cloud.dataproc.v1.KerberosConfig - * @instance - */ - KerberosConfig.prototype.keyPasswordUri = ""; - - /** - * KerberosConfig truststorePasswordUri. - * @member {string} truststorePasswordUri - * @memberof google.cloud.dataproc.v1.KerberosConfig - * @instance - */ - KerberosConfig.prototype.truststorePasswordUri = ""; - - /** - * KerberosConfig crossRealmTrustRealm. - * @member {string} crossRealmTrustRealm - * @memberof google.cloud.dataproc.v1.KerberosConfig - * @instance - */ - KerberosConfig.prototype.crossRealmTrustRealm = ""; - - /** - * KerberosConfig crossRealmTrustKdc. - * @member {string} crossRealmTrustKdc - * @memberof google.cloud.dataproc.v1.KerberosConfig - * @instance - */ - KerberosConfig.prototype.crossRealmTrustKdc = ""; - - /** - * KerberosConfig crossRealmTrustAdminServer. - * @member {string} crossRealmTrustAdminServer - * @memberof google.cloud.dataproc.v1.KerberosConfig - * @instance - */ - KerberosConfig.prototype.crossRealmTrustAdminServer = ""; - - /** - * KerberosConfig crossRealmTrustSharedPasswordUri. - * @member {string} crossRealmTrustSharedPasswordUri - * @memberof google.cloud.dataproc.v1.KerberosConfig - * @instance - */ - KerberosConfig.prototype.crossRealmTrustSharedPasswordUri = ""; - - /** - * KerberosConfig kdcDbKeyUri. - * @member {string} kdcDbKeyUri - * @memberof google.cloud.dataproc.v1.KerberosConfig - * @instance - */ - KerberosConfig.prototype.kdcDbKeyUri = ""; - - /** - * KerberosConfig tgtLifetimeHours. - * @member {number} tgtLifetimeHours - * @memberof google.cloud.dataproc.v1.KerberosConfig - * @instance - */ - KerberosConfig.prototype.tgtLifetimeHours = 0; - - /** - * KerberosConfig realm. - * @member {string} realm - * @memberof google.cloud.dataproc.v1.KerberosConfig - * @instance - */ - KerberosConfig.prototype.realm = ""; - - /** - * Creates a new KerberosConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.KerberosConfig - * @static - * @param {google.cloud.dataproc.v1.IKerberosConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.KerberosConfig} KerberosConfig instance - */ - KerberosConfig.create = function create(properties) { - return new KerberosConfig(properties); - }; - - /** - * Encodes the specified KerberosConfig message. Does not implicitly {@link google.cloud.dataproc.v1.KerberosConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.KerberosConfig - * @static - * @param {google.cloud.dataproc.v1.IKerberosConfig} message KerberosConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KerberosConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.enableKerberos != null && Object.hasOwnProperty.call(message, "enableKerberos")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableKerberos); - if (message.rootPrincipalPasswordUri != null && Object.hasOwnProperty.call(message, "rootPrincipalPasswordUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.rootPrincipalPasswordUri); - if (message.kmsKeyUri != null && Object.hasOwnProperty.call(message, "kmsKeyUri")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.kmsKeyUri); - if (message.keystoreUri != null && Object.hasOwnProperty.call(message, "keystoreUri")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.keystoreUri); - if (message.truststoreUri != null && Object.hasOwnProperty.call(message, "truststoreUri")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.truststoreUri); - if (message.keystorePasswordUri != null && Object.hasOwnProperty.call(message, "keystorePasswordUri")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.keystorePasswordUri); - if (message.keyPasswordUri != null && Object.hasOwnProperty.call(message, "keyPasswordUri")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.keyPasswordUri); - if (message.truststorePasswordUri != null && Object.hasOwnProperty.call(message, "truststorePasswordUri")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.truststorePasswordUri); - if (message.crossRealmTrustRealm != null && Object.hasOwnProperty.call(message, "crossRealmTrustRealm")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.crossRealmTrustRealm); - if (message.crossRealmTrustKdc != null && Object.hasOwnProperty.call(message, "crossRealmTrustKdc")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.crossRealmTrustKdc); - if (message.crossRealmTrustAdminServer != null && Object.hasOwnProperty.call(message, "crossRealmTrustAdminServer")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.crossRealmTrustAdminServer); - if (message.crossRealmTrustSharedPasswordUri != null && Object.hasOwnProperty.call(message, "crossRealmTrustSharedPasswordUri")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.crossRealmTrustSharedPasswordUri); - if (message.kdcDbKeyUri != null && Object.hasOwnProperty.call(message, "kdcDbKeyUri")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.kdcDbKeyUri); - if (message.tgtLifetimeHours != null && Object.hasOwnProperty.call(message, "tgtLifetimeHours")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.tgtLifetimeHours); - if (message.realm != null && Object.hasOwnProperty.call(message, "realm")) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.realm); - return writer; - }; - - /** - * Encodes the specified KerberosConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.KerberosConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.KerberosConfig - * @static - * @param {google.cloud.dataproc.v1.IKerberosConfig} message KerberosConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KerberosConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a KerberosConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.KerberosConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.KerberosConfig} KerberosConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KerberosConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.KerberosConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.enableKerberos = reader.bool(); - break; - } - case 2: { - message.rootPrincipalPasswordUri = reader.string(); - break; - } - case 3: { - message.kmsKeyUri = reader.string(); - break; - } - case 4: { - message.keystoreUri = reader.string(); - break; - } - case 5: { - message.truststoreUri = reader.string(); - break; - } - case 6: { - message.keystorePasswordUri = reader.string(); - break; - } - case 7: { - message.keyPasswordUri = reader.string(); - break; - } - case 8: { - message.truststorePasswordUri = reader.string(); - break; - } - case 9: { - message.crossRealmTrustRealm = reader.string(); - break; - } - case 10: { - message.crossRealmTrustKdc = reader.string(); - break; - } - case 11: { - message.crossRealmTrustAdminServer = reader.string(); - break; - } - case 12: { - message.crossRealmTrustSharedPasswordUri = reader.string(); - break; - } - case 13: { - message.kdcDbKeyUri = reader.string(); - break; - } - case 14: { - message.tgtLifetimeHours = reader.int32(); - break; - } - case 15: { - message.realm = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a KerberosConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.KerberosConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.KerberosConfig} KerberosConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KerberosConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a KerberosConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.KerberosConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KerberosConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.enableKerberos != null && message.hasOwnProperty("enableKerberos")) - if (typeof message.enableKerberos !== "boolean") - return "enableKerberos: boolean expected"; - if (message.rootPrincipalPasswordUri != null && message.hasOwnProperty("rootPrincipalPasswordUri")) - if (!$util.isString(message.rootPrincipalPasswordUri)) - return "rootPrincipalPasswordUri: string expected"; - if (message.kmsKeyUri != null && message.hasOwnProperty("kmsKeyUri")) - if (!$util.isString(message.kmsKeyUri)) - return "kmsKeyUri: string expected"; - if (message.keystoreUri != null && message.hasOwnProperty("keystoreUri")) - if (!$util.isString(message.keystoreUri)) - return "keystoreUri: string expected"; - if (message.truststoreUri != null && message.hasOwnProperty("truststoreUri")) - if (!$util.isString(message.truststoreUri)) - return "truststoreUri: string expected"; - if (message.keystorePasswordUri != null && message.hasOwnProperty("keystorePasswordUri")) - if (!$util.isString(message.keystorePasswordUri)) - return "keystorePasswordUri: string expected"; - if (message.keyPasswordUri != null && message.hasOwnProperty("keyPasswordUri")) - if (!$util.isString(message.keyPasswordUri)) - return "keyPasswordUri: string expected"; - if (message.truststorePasswordUri != null && message.hasOwnProperty("truststorePasswordUri")) - if (!$util.isString(message.truststorePasswordUri)) - return "truststorePasswordUri: string expected"; - if (message.crossRealmTrustRealm != null && message.hasOwnProperty("crossRealmTrustRealm")) - if (!$util.isString(message.crossRealmTrustRealm)) - return "crossRealmTrustRealm: string expected"; - if (message.crossRealmTrustKdc != null && message.hasOwnProperty("crossRealmTrustKdc")) - if (!$util.isString(message.crossRealmTrustKdc)) - return "crossRealmTrustKdc: string expected"; - if (message.crossRealmTrustAdminServer != null && message.hasOwnProperty("crossRealmTrustAdminServer")) - if (!$util.isString(message.crossRealmTrustAdminServer)) - return "crossRealmTrustAdminServer: string expected"; - if (message.crossRealmTrustSharedPasswordUri != null && message.hasOwnProperty("crossRealmTrustSharedPasswordUri")) - if (!$util.isString(message.crossRealmTrustSharedPasswordUri)) - return "crossRealmTrustSharedPasswordUri: string expected"; - if (message.kdcDbKeyUri != null && message.hasOwnProperty("kdcDbKeyUri")) - if (!$util.isString(message.kdcDbKeyUri)) - return "kdcDbKeyUri: string expected"; - if (message.tgtLifetimeHours != null && message.hasOwnProperty("tgtLifetimeHours")) - if (!$util.isInteger(message.tgtLifetimeHours)) - return "tgtLifetimeHours: integer expected"; - if (message.realm != null && message.hasOwnProperty("realm")) - if (!$util.isString(message.realm)) - return "realm: string expected"; - return null; - }; - - /** - * Creates a KerberosConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.KerberosConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.KerberosConfig} KerberosConfig - */ - KerberosConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.KerberosConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.KerberosConfig(); - if (object.enableKerberos != null) - message.enableKerberos = Boolean(object.enableKerberos); - if (object.rootPrincipalPasswordUri != null) - message.rootPrincipalPasswordUri = String(object.rootPrincipalPasswordUri); - if (object.kmsKeyUri != null) - message.kmsKeyUri = String(object.kmsKeyUri); - if (object.keystoreUri != null) - message.keystoreUri = String(object.keystoreUri); - if (object.truststoreUri != null) - message.truststoreUri = String(object.truststoreUri); - if (object.keystorePasswordUri != null) - message.keystorePasswordUri = String(object.keystorePasswordUri); - if (object.keyPasswordUri != null) - message.keyPasswordUri = String(object.keyPasswordUri); - if (object.truststorePasswordUri != null) - message.truststorePasswordUri = String(object.truststorePasswordUri); - if (object.crossRealmTrustRealm != null) - message.crossRealmTrustRealm = String(object.crossRealmTrustRealm); - if (object.crossRealmTrustKdc != null) - message.crossRealmTrustKdc = String(object.crossRealmTrustKdc); - if (object.crossRealmTrustAdminServer != null) - message.crossRealmTrustAdminServer = String(object.crossRealmTrustAdminServer); - if (object.crossRealmTrustSharedPasswordUri != null) - message.crossRealmTrustSharedPasswordUri = String(object.crossRealmTrustSharedPasswordUri); - if (object.kdcDbKeyUri != null) - message.kdcDbKeyUri = String(object.kdcDbKeyUri); - if (object.tgtLifetimeHours != null) - message.tgtLifetimeHours = object.tgtLifetimeHours | 0; - if (object.realm != null) - message.realm = String(object.realm); - return message; - }; - - /** - * Creates a plain object from a KerberosConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.KerberosConfig - * @static - * @param {google.cloud.dataproc.v1.KerberosConfig} message KerberosConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KerberosConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.enableKerberos = false; - object.rootPrincipalPasswordUri = ""; - object.kmsKeyUri = ""; - object.keystoreUri = ""; - object.truststoreUri = ""; - object.keystorePasswordUri = ""; - object.keyPasswordUri = ""; - object.truststorePasswordUri = ""; - object.crossRealmTrustRealm = ""; - object.crossRealmTrustKdc = ""; - object.crossRealmTrustAdminServer = ""; - object.crossRealmTrustSharedPasswordUri = ""; - object.kdcDbKeyUri = ""; - object.tgtLifetimeHours = 0; - object.realm = ""; - } - if (message.enableKerberos != null && message.hasOwnProperty("enableKerberos")) - object.enableKerberos = message.enableKerberos; - if (message.rootPrincipalPasswordUri != null && message.hasOwnProperty("rootPrincipalPasswordUri")) - object.rootPrincipalPasswordUri = message.rootPrincipalPasswordUri; - if (message.kmsKeyUri != null && message.hasOwnProperty("kmsKeyUri")) - object.kmsKeyUri = message.kmsKeyUri; - if (message.keystoreUri != null && message.hasOwnProperty("keystoreUri")) - object.keystoreUri = message.keystoreUri; - if (message.truststoreUri != null && message.hasOwnProperty("truststoreUri")) - object.truststoreUri = message.truststoreUri; - if (message.keystorePasswordUri != null && message.hasOwnProperty("keystorePasswordUri")) - object.keystorePasswordUri = message.keystorePasswordUri; - if (message.keyPasswordUri != null && message.hasOwnProperty("keyPasswordUri")) - object.keyPasswordUri = message.keyPasswordUri; - if (message.truststorePasswordUri != null && message.hasOwnProperty("truststorePasswordUri")) - object.truststorePasswordUri = message.truststorePasswordUri; - if (message.crossRealmTrustRealm != null && message.hasOwnProperty("crossRealmTrustRealm")) - object.crossRealmTrustRealm = message.crossRealmTrustRealm; - if (message.crossRealmTrustKdc != null && message.hasOwnProperty("crossRealmTrustKdc")) - object.crossRealmTrustKdc = message.crossRealmTrustKdc; - if (message.crossRealmTrustAdminServer != null && message.hasOwnProperty("crossRealmTrustAdminServer")) - object.crossRealmTrustAdminServer = message.crossRealmTrustAdminServer; - if (message.crossRealmTrustSharedPasswordUri != null && message.hasOwnProperty("crossRealmTrustSharedPasswordUri")) - object.crossRealmTrustSharedPasswordUri = message.crossRealmTrustSharedPasswordUri; - if (message.kdcDbKeyUri != null && message.hasOwnProperty("kdcDbKeyUri")) - object.kdcDbKeyUri = message.kdcDbKeyUri; - if (message.tgtLifetimeHours != null && message.hasOwnProperty("tgtLifetimeHours")) - object.tgtLifetimeHours = message.tgtLifetimeHours; - if (message.realm != null && message.hasOwnProperty("realm")) - object.realm = message.realm; - return object; - }; - - /** - * Converts this KerberosConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.KerberosConfig - * @instance - * @returns {Object.} JSON object - */ - KerberosConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for KerberosConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.KerberosConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - KerberosConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.KerberosConfig"; - }; - - return KerberosConfig; - })(); - - v1.IdentityConfig = (function() { - - /** - * Properties of an IdentityConfig. - * @memberof google.cloud.dataproc.v1 - * @interface IIdentityConfig - * @property {Object.|null} [userServiceAccountMapping] IdentityConfig userServiceAccountMapping - */ - - /** - * Constructs a new IdentityConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents an IdentityConfig. - * @implements IIdentityConfig - * @constructor - * @param {google.cloud.dataproc.v1.IIdentityConfig=} [properties] Properties to set - */ - function IdentityConfig(properties) { - this.userServiceAccountMapping = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IdentityConfig userServiceAccountMapping. - * @member {Object.} userServiceAccountMapping - * @memberof google.cloud.dataproc.v1.IdentityConfig - * @instance - */ - IdentityConfig.prototype.userServiceAccountMapping = $util.emptyObject; - - /** - * Creates a new IdentityConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.IdentityConfig - * @static - * @param {google.cloud.dataproc.v1.IIdentityConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.IdentityConfig} IdentityConfig instance - */ - IdentityConfig.create = function create(properties) { - return new IdentityConfig(properties); - }; - - /** - * Encodes the specified IdentityConfig message. Does not implicitly {@link google.cloud.dataproc.v1.IdentityConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.IdentityConfig - * @static - * @param {google.cloud.dataproc.v1.IIdentityConfig} message IdentityConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentityConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.userServiceAccountMapping != null && Object.hasOwnProperty.call(message, "userServiceAccountMapping")) - for (var keys = Object.keys(message.userServiceAccountMapping), 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.userServiceAccountMapping[keys[i]]).ldelim(); - return writer; - }; - - /** - * Encodes the specified IdentityConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.IdentityConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.IdentityConfig - * @static - * @param {google.cloud.dataproc.v1.IIdentityConfig} message IdentityConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IdentityConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IdentityConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.IdentityConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.IdentityConfig} IdentityConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentityConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.IdentityConfig(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (message.userServiceAccountMapping === $util.emptyObject) - message.userServiceAccountMapping = {}; - 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.userServiceAccountMapping[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IdentityConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.IdentityConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.IdentityConfig} IdentityConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IdentityConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IdentityConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.IdentityConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IdentityConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.userServiceAccountMapping != null && message.hasOwnProperty("userServiceAccountMapping")) { - if (!$util.isObject(message.userServiceAccountMapping)) - return "userServiceAccountMapping: object expected"; - var key = Object.keys(message.userServiceAccountMapping); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.userServiceAccountMapping[key[i]])) - return "userServiceAccountMapping: string{k:string} expected"; - } - return null; - }; - - /** - * Creates an IdentityConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.IdentityConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.IdentityConfig} IdentityConfig - */ - IdentityConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.IdentityConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.IdentityConfig(); - if (object.userServiceAccountMapping) { - if (typeof object.userServiceAccountMapping !== "object") - throw TypeError(".google.cloud.dataproc.v1.IdentityConfig.userServiceAccountMapping: object expected"); - message.userServiceAccountMapping = {}; - for (var keys = Object.keys(object.userServiceAccountMapping), i = 0; i < keys.length; ++i) - message.userServiceAccountMapping[keys[i]] = String(object.userServiceAccountMapping[keys[i]]); - } - return message; - }; - - /** - * Creates a plain object from an IdentityConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.IdentityConfig - * @static - * @param {google.cloud.dataproc.v1.IdentityConfig} message IdentityConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IdentityConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.userServiceAccountMapping = {}; - var keys2; - if (message.userServiceAccountMapping && (keys2 = Object.keys(message.userServiceAccountMapping)).length) { - object.userServiceAccountMapping = {}; - for (var j = 0; j < keys2.length; ++j) - object.userServiceAccountMapping[keys2[j]] = message.userServiceAccountMapping[keys2[j]]; - } - return object; - }; - - /** - * Converts this IdentityConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.IdentityConfig - * @instance - * @returns {Object.} JSON object - */ - IdentityConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for IdentityConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.IdentityConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - IdentityConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.IdentityConfig"; - }; - - return IdentityConfig; - })(); - - v1.SoftwareConfig = (function() { - - /** - * Properties of a SoftwareConfig. - * @memberof google.cloud.dataproc.v1 - * @interface ISoftwareConfig - * @property {string|null} [imageVersion] SoftwareConfig imageVersion - * @property {Object.|null} [properties] SoftwareConfig properties - * @property {Array.|null} [optionalComponents] SoftwareConfig optionalComponents - */ - - /** - * Constructs a new SoftwareConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a SoftwareConfig. - * @implements ISoftwareConfig - * @constructor - * @param {google.cloud.dataproc.v1.ISoftwareConfig=} [properties] Properties to set - */ - function SoftwareConfig(properties) { - this.properties = {}; - this.optionalComponents = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SoftwareConfig imageVersion. - * @member {string} imageVersion - * @memberof google.cloud.dataproc.v1.SoftwareConfig - * @instance - */ - SoftwareConfig.prototype.imageVersion = ""; - - /** - * SoftwareConfig properties. - * @member {Object.} properties - * @memberof google.cloud.dataproc.v1.SoftwareConfig - * @instance - */ - SoftwareConfig.prototype.properties = $util.emptyObject; - - /** - * SoftwareConfig optionalComponents. - * @member {Array.} optionalComponents - * @memberof google.cloud.dataproc.v1.SoftwareConfig - * @instance - */ - SoftwareConfig.prototype.optionalComponents = $util.emptyArray; - - /** - * Creates a new SoftwareConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.SoftwareConfig - * @static - * @param {google.cloud.dataproc.v1.ISoftwareConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.SoftwareConfig} SoftwareConfig instance - */ - SoftwareConfig.create = function create(properties) { - return new SoftwareConfig(properties); - }; - - /** - * Encodes the specified SoftwareConfig message. Does not implicitly {@link google.cloud.dataproc.v1.SoftwareConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.SoftwareConfig - * @static - * @param {google.cloud.dataproc.v1.ISoftwareConfig} message SoftwareConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SoftwareConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.imageVersion != null && Object.hasOwnProperty.call(message, "imageVersion")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.imageVersion); - if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) - for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.properties[keys[i]]).ldelim(); - if (message.optionalComponents != null && message.optionalComponents.length) { - writer.uint32(/* id 3, wireType 2 =*/26).fork(); - for (var i = 0; i < message.optionalComponents.length; ++i) - writer.int32(message.optionalComponents[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified SoftwareConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SoftwareConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.SoftwareConfig - * @static - * @param {google.cloud.dataproc.v1.ISoftwareConfig} message SoftwareConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SoftwareConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SoftwareConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.SoftwareConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.SoftwareConfig} SoftwareConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SoftwareConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.SoftwareConfig(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.imageVersion = reader.string(); - break; - } - case 2: { - if (message.properties === $util.emptyObject) - message.properties = {}; - 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.properties[key] = value; - break; - } - case 3: { - if (!(message.optionalComponents && message.optionalComponents.length)) - message.optionalComponents = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.optionalComponents.push(reader.int32()); - } else - message.optionalComponents.push(reader.int32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SoftwareConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.SoftwareConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.SoftwareConfig} SoftwareConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SoftwareConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SoftwareConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.SoftwareConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SoftwareConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.imageVersion != null && message.hasOwnProperty("imageVersion")) - if (!$util.isString(message.imageVersion)) - return "imageVersion: string expected"; - if (message.properties != null && message.hasOwnProperty("properties")) { - if (!$util.isObject(message.properties)) - return "properties: object expected"; - var key = Object.keys(message.properties); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.properties[key[i]])) - return "properties: string{k:string} expected"; - } - if (message.optionalComponents != null && message.hasOwnProperty("optionalComponents")) { - if (!Array.isArray(message.optionalComponents)) - return "optionalComponents: array expected"; - for (var i = 0; i < message.optionalComponents.length; ++i) - switch (message.optionalComponents[i]) { - default: - return "optionalComponents: enum value[] expected"; - case 0: - case 5: - case 20: - case 13: - case 9: - case 14: - case 11: - case 3: - case 18: - case 19: - case 1: - case 22: - case 21: - case 6: - case 17: - case 12: - case 10: - case 4: - case 8: - break; - } - } - return null; - }; - - /** - * Creates a SoftwareConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.SoftwareConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.SoftwareConfig} SoftwareConfig - */ - SoftwareConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.SoftwareConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.SoftwareConfig(); - if (object.imageVersion != null) - message.imageVersion = String(object.imageVersion); - if (object.properties) { - if (typeof object.properties !== "object") - throw TypeError(".google.cloud.dataproc.v1.SoftwareConfig.properties: object expected"); - message.properties = {}; - for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) - message.properties[keys[i]] = String(object.properties[keys[i]]); - } - if (object.optionalComponents) { - if (!Array.isArray(object.optionalComponents)) - throw TypeError(".google.cloud.dataproc.v1.SoftwareConfig.optionalComponents: array expected"); - message.optionalComponents = []; - for (var i = 0; i < object.optionalComponents.length; ++i) - switch (object.optionalComponents[i]) { - default: - if (typeof object.optionalComponents[i] === "number") { - message.optionalComponents[i] = object.optionalComponents[i]; - break; - } - case "COMPONENT_UNSPECIFIED": - case 0: - message.optionalComponents[i] = 0; - break; - case "ANACONDA": - case 5: - message.optionalComponents[i] = 5; - break; - case "DELTA": - case 20: - message.optionalComponents[i] = 20; - break; - case "DOCKER": - case 13: - message.optionalComponents[i] = 13; - break; - case "DRUID": - case 9: - message.optionalComponents[i] = 9; - break; - case "FLINK": - case 14: - message.optionalComponents[i] = 14; - break; - case "HBASE": - case 11: - message.optionalComponents[i] = 11; - break; - case "HIVE_WEBHCAT": - case 3: - message.optionalComponents[i] = 3; - break; - case "HUDI": - case 18: - message.optionalComponents[i] = 18; - break; - case "ICEBERG": - case 19: - message.optionalComponents[i] = 19; - break; - case "JUPYTER": - case 1: - message.optionalComponents[i] = 1; - break; - case "JUPYTER_KERNEL_GATEWAY": - case 22: - message.optionalComponents[i] = 22; - break; - case "PIG": - case 21: - message.optionalComponents[i] = 21; - break; - case "PRESTO": - case 6: - message.optionalComponents[i] = 6; - break; - case "TRINO": - case 17: - message.optionalComponents[i] = 17; - break; - case "RANGER": - case 12: - message.optionalComponents[i] = 12; - break; - case "SOLR": - case 10: - message.optionalComponents[i] = 10; - break; - case "ZEPPELIN": - case 4: - message.optionalComponents[i] = 4; - break; - case "ZOOKEEPER": - case 8: - message.optionalComponents[i] = 8; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a SoftwareConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.SoftwareConfig - * @static - * @param {google.cloud.dataproc.v1.SoftwareConfig} message SoftwareConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SoftwareConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.optionalComponents = []; - if (options.objects || options.defaults) - object.properties = {}; - if (options.defaults) - object.imageVersion = ""; - if (message.imageVersion != null && message.hasOwnProperty("imageVersion")) - object.imageVersion = message.imageVersion; - var keys2; - if (message.properties && (keys2 = Object.keys(message.properties)).length) { - object.properties = {}; - for (var j = 0; j < keys2.length; ++j) - object.properties[keys2[j]] = message.properties[keys2[j]]; - } - if (message.optionalComponents && message.optionalComponents.length) { - object.optionalComponents = []; - for (var j = 0; j < message.optionalComponents.length; ++j) - object.optionalComponents[j] = options.enums === String ? $root.google.cloud.dataproc.v1.Component[message.optionalComponents[j]] === undefined ? message.optionalComponents[j] : $root.google.cloud.dataproc.v1.Component[message.optionalComponents[j]] : message.optionalComponents[j]; - } - return object; - }; - - /** - * Converts this SoftwareConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.SoftwareConfig - * @instance - * @returns {Object.} JSON object - */ - SoftwareConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SoftwareConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.SoftwareConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SoftwareConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.SoftwareConfig"; - }; - - return SoftwareConfig; - })(); - - v1.LifecycleConfig = (function() { - - /** - * Properties of a LifecycleConfig. - * @memberof google.cloud.dataproc.v1 - * @interface ILifecycleConfig - * @property {google.protobuf.IDuration|null} [idleDeleteTtl] LifecycleConfig idleDeleteTtl - * @property {google.protobuf.ITimestamp|null} [autoDeleteTime] LifecycleConfig autoDeleteTime - * @property {google.protobuf.IDuration|null} [autoDeleteTtl] LifecycleConfig autoDeleteTtl - * @property {google.protobuf.IDuration|null} [idleStopTtl] LifecycleConfig idleStopTtl - * @property {google.protobuf.ITimestamp|null} [autoStopTime] LifecycleConfig autoStopTime - * @property {google.protobuf.IDuration|null} [autoStopTtl] LifecycleConfig autoStopTtl - * @property {google.protobuf.ITimestamp|null} [idleStartTime] LifecycleConfig idleStartTime - */ - - /** - * Constructs a new LifecycleConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a LifecycleConfig. - * @implements ILifecycleConfig - * @constructor - * @param {google.cloud.dataproc.v1.ILifecycleConfig=} [properties] Properties to set - */ - function LifecycleConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LifecycleConfig idleDeleteTtl. - * @member {google.protobuf.IDuration|null|undefined} idleDeleteTtl - * @memberof google.cloud.dataproc.v1.LifecycleConfig - * @instance - */ - LifecycleConfig.prototype.idleDeleteTtl = null; - - /** - * LifecycleConfig autoDeleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} autoDeleteTime - * @memberof google.cloud.dataproc.v1.LifecycleConfig - * @instance - */ - LifecycleConfig.prototype.autoDeleteTime = null; - - /** - * LifecycleConfig autoDeleteTtl. - * @member {google.protobuf.IDuration|null|undefined} autoDeleteTtl - * @memberof google.cloud.dataproc.v1.LifecycleConfig - * @instance - */ - LifecycleConfig.prototype.autoDeleteTtl = null; - - /** - * LifecycleConfig idleStopTtl. - * @member {google.protobuf.IDuration|null|undefined} idleStopTtl - * @memberof google.cloud.dataproc.v1.LifecycleConfig - * @instance - */ - LifecycleConfig.prototype.idleStopTtl = null; - - /** - * LifecycleConfig autoStopTime. - * @member {google.protobuf.ITimestamp|null|undefined} autoStopTime - * @memberof google.cloud.dataproc.v1.LifecycleConfig - * @instance - */ - LifecycleConfig.prototype.autoStopTime = null; - - /** - * LifecycleConfig autoStopTtl. - * @member {google.protobuf.IDuration|null|undefined} autoStopTtl - * @memberof google.cloud.dataproc.v1.LifecycleConfig - * @instance - */ - LifecycleConfig.prototype.autoStopTtl = null; - - /** - * LifecycleConfig idleStartTime. - * @member {google.protobuf.ITimestamp|null|undefined} idleStartTime - * @memberof google.cloud.dataproc.v1.LifecycleConfig - * @instance - */ - LifecycleConfig.prototype.idleStartTime = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * LifecycleConfig ttl. - * @member {"autoDeleteTime"|"autoDeleteTtl"|undefined} ttl - * @memberof google.cloud.dataproc.v1.LifecycleConfig - * @instance - */ - Object.defineProperty(LifecycleConfig.prototype, "ttl", { - get: $util.oneOfGetter($oneOfFields = ["autoDeleteTime", "autoDeleteTtl"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * LifecycleConfig stopTtl. - * @member {"autoStopTime"|"autoStopTtl"|undefined} stopTtl - * @memberof google.cloud.dataproc.v1.LifecycleConfig - * @instance - */ - Object.defineProperty(LifecycleConfig.prototype, "stopTtl", { - get: $util.oneOfGetter($oneOfFields = ["autoStopTime", "autoStopTtl"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new LifecycleConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.LifecycleConfig - * @static - * @param {google.cloud.dataproc.v1.ILifecycleConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.LifecycleConfig} LifecycleConfig instance - */ - LifecycleConfig.create = function create(properties) { - return new LifecycleConfig(properties); - }; - - /** - * Encodes the specified LifecycleConfig message. Does not implicitly {@link google.cloud.dataproc.v1.LifecycleConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.LifecycleConfig - * @static - * @param {google.cloud.dataproc.v1.ILifecycleConfig} message LifecycleConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LifecycleConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.idleDeleteTtl != null && Object.hasOwnProperty.call(message, "idleDeleteTtl")) - $root.google.protobuf.Duration.encode(message.idleDeleteTtl, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.autoDeleteTime != null && Object.hasOwnProperty.call(message, "autoDeleteTime")) - $root.google.protobuf.Timestamp.encode(message.autoDeleteTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.autoDeleteTtl != null && Object.hasOwnProperty.call(message, "autoDeleteTtl")) - $root.google.protobuf.Duration.encode(message.autoDeleteTtl, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.idleStartTime != null && Object.hasOwnProperty.call(message, "idleStartTime")) - $root.google.protobuf.Timestamp.encode(message.idleStartTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.idleStopTtl != null && Object.hasOwnProperty.call(message, "idleStopTtl")) - $root.google.protobuf.Duration.encode(message.idleStopTtl, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.autoStopTime != null && Object.hasOwnProperty.call(message, "autoStopTime")) - $root.google.protobuf.Timestamp.encode(message.autoStopTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.autoStopTtl != null && Object.hasOwnProperty.call(message, "autoStopTtl")) - $root.google.protobuf.Duration.encode(message.autoStopTtl, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LifecycleConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.LifecycleConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.LifecycleConfig - * @static - * @param {google.cloud.dataproc.v1.ILifecycleConfig} message LifecycleConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LifecycleConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LifecycleConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.LifecycleConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.LifecycleConfig} LifecycleConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LifecycleConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.LifecycleConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.idleDeleteTtl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 2: { - message.autoDeleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.autoDeleteTtl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 5: { - message.idleStopTtl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 6: { - message.autoStopTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - message.autoStopTtl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.idleStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LifecycleConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.LifecycleConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.LifecycleConfig} LifecycleConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LifecycleConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LifecycleConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.LifecycleConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LifecycleConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.idleDeleteTtl != null && message.hasOwnProperty("idleDeleteTtl")) { - var error = $root.google.protobuf.Duration.verify(message.idleDeleteTtl); - if (error) - return "idleDeleteTtl." + error; - } - if (message.autoDeleteTime != null && message.hasOwnProperty("autoDeleteTime")) { - properties.ttl = 1; - { - var error = $root.google.protobuf.Timestamp.verify(message.autoDeleteTime); - if (error) - return "autoDeleteTime." + error; - } - } - if (message.autoDeleteTtl != null && message.hasOwnProperty("autoDeleteTtl")) { - if (properties.ttl === 1) - return "ttl: multiple values"; - properties.ttl = 1; - { - var error = $root.google.protobuf.Duration.verify(message.autoDeleteTtl); - if (error) - return "autoDeleteTtl." + error; - } - } - if (message.idleStopTtl != null && message.hasOwnProperty("idleStopTtl")) { - var error = $root.google.protobuf.Duration.verify(message.idleStopTtl); - if (error) - return "idleStopTtl." + error; - } - if (message.autoStopTime != null && message.hasOwnProperty("autoStopTime")) { - properties.stopTtl = 1; - { - var error = $root.google.protobuf.Timestamp.verify(message.autoStopTime); - if (error) - return "autoStopTime." + error; - } - } - if (message.autoStopTtl != null && message.hasOwnProperty("autoStopTtl")) { - if (properties.stopTtl === 1) - return "stopTtl: multiple values"; - properties.stopTtl = 1; - { - var error = $root.google.protobuf.Duration.verify(message.autoStopTtl); - if (error) - return "autoStopTtl." + error; - } - } - if (message.idleStartTime != null && message.hasOwnProperty("idleStartTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.idleStartTime); - if (error) - return "idleStartTime." + error; - } - return null; - }; - - /** - * Creates a LifecycleConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.LifecycleConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.LifecycleConfig} LifecycleConfig - */ - LifecycleConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.LifecycleConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.LifecycleConfig(); - if (object.idleDeleteTtl != null) { - if (typeof object.idleDeleteTtl !== "object") - throw TypeError(".google.cloud.dataproc.v1.LifecycleConfig.idleDeleteTtl: object expected"); - message.idleDeleteTtl = $root.google.protobuf.Duration.fromObject(object.idleDeleteTtl); - } - if (object.autoDeleteTime != null) { - if (typeof object.autoDeleteTime !== "object") - throw TypeError(".google.cloud.dataproc.v1.LifecycleConfig.autoDeleteTime: object expected"); - message.autoDeleteTime = $root.google.protobuf.Timestamp.fromObject(object.autoDeleteTime); - } - if (object.autoDeleteTtl != null) { - if (typeof object.autoDeleteTtl !== "object") - throw TypeError(".google.cloud.dataproc.v1.LifecycleConfig.autoDeleteTtl: object expected"); - message.autoDeleteTtl = $root.google.protobuf.Duration.fromObject(object.autoDeleteTtl); - } - if (object.idleStopTtl != null) { - if (typeof object.idleStopTtl !== "object") - throw TypeError(".google.cloud.dataproc.v1.LifecycleConfig.idleStopTtl: object expected"); - message.idleStopTtl = $root.google.protobuf.Duration.fromObject(object.idleStopTtl); - } - if (object.autoStopTime != null) { - if (typeof object.autoStopTime !== "object") - throw TypeError(".google.cloud.dataproc.v1.LifecycleConfig.autoStopTime: object expected"); - message.autoStopTime = $root.google.protobuf.Timestamp.fromObject(object.autoStopTime); - } - if (object.autoStopTtl != null) { - if (typeof object.autoStopTtl !== "object") - throw TypeError(".google.cloud.dataproc.v1.LifecycleConfig.autoStopTtl: object expected"); - message.autoStopTtl = $root.google.protobuf.Duration.fromObject(object.autoStopTtl); - } - if (object.idleStartTime != null) { - if (typeof object.idleStartTime !== "object") - throw TypeError(".google.cloud.dataproc.v1.LifecycleConfig.idleStartTime: object expected"); - message.idleStartTime = $root.google.protobuf.Timestamp.fromObject(object.idleStartTime); - } - return message; - }; - - /** - * Creates a plain object from a LifecycleConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.LifecycleConfig - * @static - * @param {google.cloud.dataproc.v1.LifecycleConfig} message LifecycleConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LifecycleConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.idleDeleteTtl = null; - object.idleStartTime = null; - object.idleStopTtl = null; - } - if (message.idleDeleteTtl != null && message.hasOwnProperty("idleDeleteTtl")) - object.idleDeleteTtl = $root.google.protobuf.Duration.toObject(message.idleDeleteTtl, options); - if (message.autoDeleteTime != null && message.hasOwnProperty("autoDeleteTime")) { - object.autoDeleteTime = $root.google.protobuf.Timestamp.toObject(message.autoDeleteTime, options); - if (options.oneofs) - object.ttl = "autoDeleteTime"; - } - if (message.autoDeleteTtl != null && message.hasOwnProperty("autoDeleteTtl")) { - object.autoDeleteTtl = $root.google.protobuf.Duration.toObject(message.autoDeleteTtl, options); - if (options.oneofs) - object.ttl = "autoDeleteTtl"; - } - if (message.idleStartTime != null && message.hasOwnProperty("idleStartTime")) - object.idleStartTime = $root.google.protobuf.Timestamp.toObject(message.idleStartTime, options); - if (message.idleStopTtl != null && message.hasOwnProperty("idleStopTtl")) - object.idleStopTtl = $root.google.protobuf.Duration.toObject(message.idleStopTtl, options); - if (message.autoStopTime != null && message.hasOwnProperty("autoStopTime")) { - object.autoStopTime = $root.google.protobuf.Timestamp.toObject(message.autoStopTime, options); - if (options.oneofs) - object.stopTtl = "autoStopTime"; - } - if (message.autoStopTtl != null && message.hasOwnProperty("autoStopTtl")) { - object.autoStopTtl = $root.google.protobuf.Duration.toObject(message.autoStopTtl, options); - if (options.oneofs) - object.stopTtl = "autoStopTtl"; - } - return object; - }; - - /** - * Converts this LifecycleConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.LifecycleConfig - * @instance - * @returns {Object.} JSON object - */ - LifecycleConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LifecycleConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.LifecycleConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LifecycleConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.LifecycleConfig"; - }; - - return LifecycleConfig; - })(); - - v1.MetastoreConfig = (function() { - - /** - * Properties of a MetastoreConfig. - * @memberof google.cloud.dataproc.v1 - * @interface IMetastoreConfig - * @property {string|null} [dataprocMetastoreService] MetastoreConfig dataprocMetastoreService - */ - - /** - * Constructs a new MetastoreConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a MetastoreConfig. - * @implements IMetastoreConfig - * @constructor - * @param {google.cloud.dataproc.v1.IMetastoreConfig=} [properties] Properties to set - */ - function MetastoreConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MetastoreConfig dataprocMetastoreService. - * @member {string} dataprocMetastoreService - * @memberof google.cloud.dataproc.v1.MetastoreConfig - * @instance - */ - MetastoreConfig.prototype.dataprocMetastoreService = ""; - - /** - * Creates a new MetastoreConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.MetastoreConfig - * @static - * @param {google.cloud.dataproc.v1.IMetastoreConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.MetastoreConfig} MetastoreConfig instance - */ - MetastoreConfig.create = function create(properties) { - return new MetastoreConfig(properties); - }; - - /** - * Encodes the specified MetastoreConfig message. Does not implicitly {@link google.cloud.dataproc.v1.MetastoreConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.MetastoreConfig - * @static - * @param {google.cloud.dataproc.v1.IMetastoreConfig} message MetastoreConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MetastoreConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dataprocMetastoreService != null && Object.hasOwnProperty.call(message, "dataprocMetastoreService")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataprocMetastoreService); - return writer; - }; - - /** - * Encodes the specified MetastoreConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.MetastoreConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.MetastoreConfig - * @static - * @param {google.cloud.dataproc.v1.IMetastoreConfig} message MetastoreConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MetastoreConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MetastoreConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.MetastoreConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.MetastoreConfig} MetastoreConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MetastoreConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.MetastoreConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.dataprocMetastoreService = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MetastoreConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.MetastoreConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.MetastoreConfig} MetastoreConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MetastoreConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MetastoreConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.MetastoreConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MetastoreConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.dataprocMetastoreService != null && message.hasOwnProperty("dataprocMetastoreService")) - if (!$util.isString(message.dataprocMetastoreService)) - return "dataprocMetastoreService: string expected"; - return null; - }; - - /** - * Creates a MetastoreConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.MetastoreConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.MetastoreConfig} MetastoreConfig - */ - MetastoreConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.MetastoreConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.MetastoreConfig(); - if (object.dataprocMetastoreService != null) - message.dataprocMetastoreService = String(object.dataprocMetastoreService); - return message; - }; - - /** - * Creates a plain object from a MetastoreConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.MetastoreConfig - * @static - * @param {google.cloud.dataproc.v1.MetastoreConfig} message MetastoreConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MetastoreConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.dataprocMetastoreService = ""; - if (message.dataprocMetastoreService != null && message.hasOwnProperty("dataprocMetastoreService")) - object.dataprocMetastoreService = message.dataprocMetastoreService; - return object; - }; - - /** - * Converts this MetastoreConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.MetastoreConfig - * @instance - * @returns {Object.} JSON object - */ - MetastoreConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MetastoreConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.MetastoreConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MetastoreConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.MetastoreConfig"; - }; - - return MetastoreConfig; - })(); - - v1.ClusterMetrics = (function() { - - /** - * Properties of a ClusterMetrics. - * @memberof google.cloud.dataproc.v1 - * @interface IClusterMetrics - * @property {Object.|null} [hdfsMetrics] ClusterMetrics hdfsMetrics - * @property {Object.|null} [yarnMetrics] ClusterMetrics yarnMetrics - */ - - /** - * Constructs a new ClusterMetrics. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a ClusterMetrics. - * @implements IClusterMetrics - * @constructor - * @param {google.cloud.dataproc.v1.IClusterMetrics=} [properties] Properties to set - */ - function ClusterMetrics(properties) { - this.hdfsMetrics = {}; - this.yarnMetrics = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClusterMetrics hdfsMetrics. - * @member {Object.} hdfsMetrics - * @memberof google.cloud.dataproc.v1.ClusterMetrics - * @instance - */ - ClusterMetrics.prototype.hdfsMetrics = $util.emptyObject; - - /** - * ClusterMetrics yarnMetrics. - * @member {Object.} yarnMetrics - * @memberof google.cloud.dataproc.v1.ClusterMetrics - * @instance - */ - ClusterMetrics.prototype.yarnMetrics = $util.emptyObject; - - /** - * Creates a new ClusterMetrics instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.ClusterMetrics - * @static - * @param {google.cloud.dataproc.v1.IClusterMetrics=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.ClusterMetrics} ClusterMetrics instance - */ - ClusterMetrics.create = function create(properties) { - return new ClusterMetrics(properties); - }; - - /** - * Encodes the specified ClusterMetrics message. Does not implicitly {@link google.cloud.dataproc.v1.ClusterMetrics.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.ClusterMetrics - * @static - * @param {google.cloud.dataproc.v1.IClusterMetrics} message ClusterMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClusterMetrics.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.hdfsMetrics != null && Object.hasOwnProperty.call(message, "hdfsMetrics")) - for (var keys = Object.keys(message.hdfsMetrics), i = 0; i < keys.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int64(message.hdfsMetrics[keys[i]]).ldelim(); - if (message.yarnMetrics != null && Object.hasOwnProperty.call(message, "yarnMetrics")) - for (var keys = Object.keys(message.yarnMetrics), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int64(message.yarnMetrics[keys[i]]).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClusterMetrics message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ClusterMetrics.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.ClusterMetrics - * @static - * @param {google.cloud.dataproc.v1.IClusterMetrics} message ClusterMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClusterMetrics.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClusterMetrics message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.ClusterMetrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.ClusterMetrics} ClusterMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClusterMetrics.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ClusterMetrics(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (message.hdfsMetrics === $util.emptyObject) - message.hdfsMetrics = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = 0; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.int64(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.hdfsMetrics[key] = value; - break; - } - case 2: { - if (message.yarnMetrics === $util.emptyObject) - message.yarnMetrics = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = 0; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.int64(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.yarnMetrics[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClusterMetrics message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.ClusterMetrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.ClusterMetrics} ClusterMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClusterMetrics.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClusterMetrics message. - * @function verify - * @memberof google.cloud.dataproc.v1.ClusterMetrics - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClusterMetrics.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.hdfsMetrics != null && message.hasOwnProperty("hdfsMetrics")) { - if (!$util.isObject(message.hdfsMetrics)) - return "hdfsMetrics: object expected"; - var key = Object.keys(message.hdfsMetrics); - for (var i = 0; i < key.length; ++i) - if (!$util.isInteger(message.hdfsMetrics[key[i]]) && !(message.hdfsMetrics[key[i]] && $util.isInteger(message.hdfsMetrics[key[i]].low) && $util.isInteger(message.hdfsMetrics[key[i]].high))) - return "hdfsMetrics: integer|Long{k:string} expected"; - } - if (message.yarnMetrics != null && message.hasOwnProperty("yarnMetrics")) { - if (!$util.isObject(message.yarnMetrics)) - return "yarnMetrics: object expected"; - var key = Object.keys(message.yarnMetrics); - for (var i = 0; i < key.length; ++i) - if (!$util.isInteger(message.yarnMetrics[key[i]]) && !(message.yarnMetrics[key[i]] && $util.isInteger(message.yarnMetrics[key[i]].low) && $util.isInteger(message.yarnMetrics[key[i]].high))) - return "yarnMetrics: integer|Long{k:string} expected"; - } - return null; - }; - - /** - * Creates a ClusterMetrics message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.ClusterMetrics - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.ClusterMetrics} ClusterMetrics - */ - ClusterMetrics.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.ClusterMetrics) - return object; - var message = new $root.google.cloud.dataproc.v1.ClusterMetrics(); - if (object.hdfsMetrics) { - if (typeof object.hdfsMetrics !== "object") - throw TypeError(".google.cloud.dataproc.v1.ClusterMetrics.hdfsMetrics: object expected"); - message.hdfsMetrics = {}; - for (var keys = Object.keys(object.hdfsMetrics), i = 0; i < keys.length; ++i) - if ($util.Long) - (message.hdfsMetrics[keys[i]] = $util.Long.fromValue(object.hdfsMetrics[keys[i]])).unsigned = false; - else if (typeof object.hdfsMetrics[keys[i]] === "string") - message.hdfsMetrics[keys[i]] = parseInt(object.hdfsMetrics[keys[i]], 10); - else if (typeof object.hdfsMetrics[keys[i]] === "number") - message.hdfsMetrics[keys[i]] = object.hdfsMetrics[keys[i]]; - else if (typeof object.hdfsMetrics[keys[i]] === "object") - message.hdfsMetrics[keys[i]] = new $util.LongBits(object.hdfsMetrics[keys[i]].low >>> 0, object.hdfsMetrics[keys[i]].high >>> 0).toNumber(); - } - if (object.yarnMetrics) { - if (typeof object.yarnMetrics !== "object") - throw TypeError(".google.cloud.dataproc.v1.ClusterMetrics.yarnMetrics: object expected"); - message.yarnMetrics = {}; - for (var keys = Object.keys(object.yarnMetrics), i = 0; i < keys.length; ++i) - if ($util.Long) - (message.yarnMetrics[keys[i]] = $util.Long.fromValue(object.yarnMetrics[keys[i]])).unsigned = false; - else if (typeof object.yarnMetrics[keys[i]] === "string") - message.yarnMetrics[keys[i]] = parseInt(object.yarnMetrics[keys[i]], 10); - else if (typeof object.yarnMetrics[keys[i]] === "number") - message.yarnMetrics[keys[i]] = object.yarnMetrics[keys[i]]; - else if (typeof object.yarnMetrics[keys[i]] === "object") - message.yarnMetrics[keys[i]] = new $util.LongBits(object.yarnMetrics[keys[i]].low >>> 0, object.yarnMetrics[keys[i]].high >>> 0).toNumber(); - } - return message; - }; - - /** - * Creates a plain object from a ClusterMetrics message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.ClusterMetrics - * @static - * @param {google.cloud.dataproc.v1.ClusterMetrics} message ClusterMetrics - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClusterMetrics.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) { - object.hdfsMetrics = {}; - object.yarnMetrics = {}; - } - var keys2; - if (message.hdfsMetrics && (keys2 = Object.keys(message.hdfsMetrics)).length) { - object.hdfsMetrics = {}; - for (var j = 0; j < keys2.length; ++j) - if (typeof message.hdfsMetrics[keys2[j]] === "number") - object.hdfsMetrics[keys2[j]] = options.longs === String ? String(message.hdfsMetrics[keys2[j]]) : message.hdfsMetrics[keys2[j]]; - else - object.hdfsMetrics[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.hdfsMetrics[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.hdfsMetrics[keys2[j]].low >>> 0, message.hdfsMetrics[keys2[j]].high >>> 0).toNumber() : message.hdfsMetrics[keys2[j]]; - } - if (message.yarnMetrics && (keys2 = Object.keys(message.yarnMetrics)).length) { - object.yarnMetrics = {}; - for (var j = 0; j < keys2.length; ++j) - if (typeof message.yarnMetrics[keys2[j]] === "number") - object.yarnMetrics[keys2[j]] = options.longs === String ? String(message.yarnMetrics[keys2[j]]) : message.yarnMetrics[keys2[j]]; - else - object.yarnMetrics[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.yarnMetrics[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.yarnMetrics[keys2[j]].low >>> 0, message.yarnMetrics[keys2[j]].high >>> 0).toNumber() : message.yarnMetrics[keys2[j]]; - } - return object; - }; - - /** - * Converts this ClusterMetrics to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.ClusterMetrics - * @instance - * @returns {Object.} JSON object - */ - ClusterMetrics.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClusterMetrics - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.ClusterMetrics - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClusterMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.ClusterMetrics"; - }; - - return ClusterMetrics; - })(); - - v1.DataprocMetricConfig = (function() { - - /** - * Properties of a DataprocMetricConfig. - * @memberof google.cloud.dataproc.v1 - * @interface IDataprocMetricConfig - * @property {Array.|null} [metrics] DataprocMetricConfig metrics - */ - - /** - * Constructs a new DataprocMetricConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a DataprocMetricConfig. - * @implements IDataprocMetricConfig - * @constructor - * @param {google.cloud.dataproc.v1.IDataprocMetricConfig=} [properties] Properties to set - */ - function DataprocMetricConfig(properties) { - this.metrics = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DataprocMetricConfig metrics. - * @member {Array.} metrics - * @memberof google.cloud.dataproc.v1.DataprocMetricConfig - * @instance - */ - DataprocMetricConfig.prototype.metrics = $util.emptyArray; - - /** - * Creates a new DataprocMetricConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.DataprocMetricConfig - * @static - * @param {google.cloud.dataproc.v1.IDataprocMetricConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.DataprocMetricConfig} DataprocMetricConfig instance - */ - DataprocMetricConfig.create = function create(properties) { - return new DataprocMetricConfig(properties); - }; - - /** - * Encodes the specified DataprocMetricConfig message. Does not implicitly {@link google.cloud.dataproc.v1.DataprocMetricConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.DataprocMetricConfig - * @static - * @param {google.cloud.dataproc.v1.IDataprocMetricConfig} message DataprocMetricConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataprocMetricConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.metrics != null && message.metrics.length) - for (var i = 0; i < message.metrics.length; ++i) - $root.google.cloud.dataproc.v1.DataprocMetricConfig.Metric.encode(message.metrics[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DataprocMetricConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DataprocMetricConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.DataprocMetricConfig - * @static - * @param {google.cloud.dataproc.v1.IDataprocMetricConfig} message DataprocMetricConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataprocMetricConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DataprocMetricConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.DataprocMetricConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.DataprocMetricConfig} DataprocMetricConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataprocMetricConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.DataprocMetricConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.metrics && message.metrics.length)) - message.metrics = []; - message.metrics.push($root.google.cloud.dataproc.v1.DataprocMetricConfig.Metric.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DataprocMetricConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.DataprocMetricConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.DataprocMetricConfig} DataprocMetricConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataprocMetricConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DataprocMetricConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.DataprocMetricConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DataprocMetricConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.metrics != null && message.hasOwnProperty("metrics")) { - if (!Array.isArray(message.metrics)) - return "metrics: array expected"; - for (var i = 0; i < message.metrics.length; ++i) { - var error = $root.google.cloud.dataproc.v1.DataprocMetricConfig.Metric.verify(message.metrics[i]); - if (error) - return "metrics." + error; - } - } - return null; - }; - - /** - * Creates a DataprocMetricConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.DataprocMetricConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.DataprocMetricConfig} DataprocMetricConfig - */ - DataprocMetricConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.DataprocMetricConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.DataprocMetricConfig(); - if (object.metrics) { - if (!Array.isArray(object.metrics)) - throw TypeError(".google.cloud.dataproc.v1.DataprocMetricConfig.metrics: array expected"); - message.metrics = []; - for (var i = 0; i < object.metrics.length; ++i) { - if (typeof object.metrics[i] !== "object") - throw TypeError(".google.cloud.dataproc.v1.DataprocMetricConfig.metrics: object expected"); - message.metrics[i] = $root.google.cloud.dataproc.v1.DataprocMetricConfig.Metric.fromObject(object.metrics[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a DataprocMetricConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.DataprocMetricConfig - * @static - * @param {google.cloud.dataproc.v1.DataprocMetricConfig} message DataprocMetricConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DataprocMetricConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.metrics = []; - if (message.metrics && message.metrics.length) { - object.metrics = []; - for (var j = 0; j < message.metrics.length; ++j) - object.metrics[j] = $root.google.cloud.dataproc.v1.DataprocMetricConfig.Metric.toObject(message.metrics[j], options); - } - return object; - }; - - /** - * Converts this DataprocMetricConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.DataprocMetricConfig - * @instance - * @returns {Object.} JSON object - */ - DataprocMetricConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DataprocMetricConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.DataprocMetricConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DataprocMetricConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.DataprocMetricConfig"; - }; - - /** - * MetricSource enum. - * @name google.cloud.dataproc.v1.DataprocMetricConfig.MetricSource - * @enum {number} - * @property {number} METRIC_SOURCE_UNSPECIFIED=0 METRIC_SOURCE_UNSPECIFIED value - * @property {number} MONITORING_AGENT_DEFAULTS=1 MONITORING_AGENT_DEFAULTS value - * @property {number} HDFS=2 HDFS value - * @property {number} SPARK=3 SPARK value - * @property {number} YARN=4 YARN value - * @property {number} SPARK_HISTORY_SERVER=5 SPARK_HISTORY_SERVER value - * @property {number} HIVESERVER2=6 HIVESERVER2 value - * @property {number} HIVEMETASTORE=7 HIVEMETASTORE value - * @property {number} FLINK=8 FLINK value - */ - DataprocMetricConfig.MetricSource = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "METRIC_SOURCE_UNSPECIFIED"] = 0; - values[valuesById[1] = "MONITORING_AGENT_DEFAULTS"] = 1; - values[valuesById[2] = "HDFS"] = 2; - values[valuesById[3] = "SPARK"] = 3; - values[valuesById[4] = "YARN"] = 4; - values[valuesById[5] = "SPARK_HISTORY_SERVER"] = 5; - values[valuesById[6] = "HIVESERVER2"] = 6; - values[valuesById[7] = "HIVEMETASTORE"] = 7; - values[valuesById[8] = "FLINK"] = 8; - return values; - })(); - - DataprocMetricConfig.Metric = (function() { - - /** - * Properties of a Metric. - * @memberof google.cloud.dataproc.v1.DataprocMetricConfig - * @interface IMetric - * @property {google.cloud.dataproc.v1.DataprocMetricConfig.MetricSource|null} [metricSource] Metric metricSource - * @property {Array.|null} [metricOverrides] Metric metricOverrides - */ - - /** - * Constructs a new Metric. - * @memberof google.cloud.dataproc.v1.DataprocMetricConfig - * @classdesc Represents a Metric. - * @implements IMetric - * @constructor - * @param {google.cloud.dataproc.v1.DataprocMetricConfig.IMetric=} [properties] Properties to set - */ - function Metric(properties) { - this.metricOverrides = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Metric metricSource. - * @member {google.cloud.dataproc.v1.DataprocMetricConfig.MetricSource} metricSource - * @memberof google.cloud.dataproc.v1.DataprocMetricConfig.Metric - * @instance - */ - Metric.prototype.metricSource = 0; - - /** - * Metric metricOverrides. - * @member {Array.} metricOverrides - * @memberof google.cloud.dataproc.v1.DataprocMetricConfig.Metric - * @instance - */ - Metric.prototype.metricOverrides = $util.emptyArray; - - /** - * Creates a new Metric instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.DataprocMetricConfig.Metric - * @static - * @param {google.cloud.dataproc.v1.DataprocMetricConfig.IMetric=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.DataprocMetricConfig.Metric} Metric instance - */ - Metric.create = function create(properties) { - return new Metric(properties); - }; - - /** - * Encodes the specified Metric message. Does not implicitly {@link google.cloud.dataproc.v1.DataprocMetricConfig.Metric.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.DataprocMetricConfig.Metric - * @static - * @param {google.cloud.dataproc.v1.DataprocMetricConfig.IMetric} message Metric message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Metric.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.metricSource != null && Object.hasOwnProperty.call(message, "metricSource")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.metricSource); - if (message.metricOverrides != null && message.metricOverrides.length) - for (var i = 0; i < message.metricOverrides.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.metricOverrides[i]); - return writer; - }; - - /** - * Encodes the specified Metric message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DataprocMetricConfig.Metric.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.DataprocMetricConfig.Metric - * @static - * @param {google.cloud.dataproc.v1.DataprocMetricConfig.IMetric} message Metric message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Metric.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Metric message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.DataprocMetricConfig.Metric - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.DataprocMetricConfig.Metric} Metric - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Metric.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.DataprocMetricConfig.Metric(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.metricSource = reader.int32(); - break; - } - case 2: { - if (!(message.metricOverrides && message.metricOverrides.length)) - message.metricOverrides = []; - message.metricOverrides.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Metric message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.DataprocMetricConfig.Metric - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.DataprocMetricConfig.Metric} Metric - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Metric.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Metric message. - * @function verify - * @memberof google.cloud.dataproc.v1.DataprocMetricConfig.Metric - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Metric.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.metricSource != null && message.hasOwnProperty("metricSource")) - switch (message.metricSource) { - default: - return "metricSource: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - if (message.metricOverrides != null && message.hasOwnProperty("metricOverrides")) { - if (!Array.isArray(message.metricOverrides)) - return "metricOverrides: array expected"; - for (var i = 0; i < message.metricOverrides.length; ++i) - if (!$util.isString(message.metricOverrides[i])) - return "metricOverrides: string[] expected"; - } - return null; - }; - - /** - * Creates a Metric message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.DataprocMetricConfig.Metric - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.DataprocMetricConfig.Metric} Metric - */ - Metric.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.DataprocMetricConfig.Metric) - return object; - var message = new $root.google.cloud.dataproc.v1.DataprocMetricConfig.Metric(); - switch (object.metricSource) { - default: - if (typeof object.metricSource === "number") { - message.metricSource = object.metricSource; - break; - } - break; - case "METRIC_SOURCE_UNSPECIFIED": - case 0: - message.metricSource = 0; - break; - case "MONITORING_AGENT_DEFAULTS": - case 1: - message.metricSource = 1; - break; - case "HDFS": - case 2: - message.metricSource = 2; - break; - case "SPARK": - case 3: - message.metricSource = 3; - break; - case "YARN": - case 4: - message.metricSource = 4; - break; - case "SPARK_HISTORY_SERVER": - case 5: - message.metricSource = 5; - break; - case "HIVESERVER2": - case 6: - message.metricSource = 6; - break; - case "HIVEMETASTORE": - case 7: - message.metricSource = 7; - break; - case "FLINK": - case 8: - message.metricSource = 8; - break; - } - if (object.metricOverrides) { - if (!Array.isArray(object.metricOverrides)) - throw TypeError(".google.cloud.dataproc.v1.DataprocMetricConfig.Metric.metricOverrides: array expected"); - message.metricOverrides = []; - for (var i = 0; i < object.metricOverrides.length; ++i) - message.metricOverrides[i] = String(object.metricOverrides[i]); - } - return message; - }; - - /** - * Creates a plain object from a Metric message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.DataprocMetricConfig.Metric - * @static - * @param {google.cloud.dataproc.v1.DataprocMetricConfig.Metric} message Metric - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Metric.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.metricOverrides = []; - if (options.defaults) - object.metricSource = options.enums === String ? "METRIC_SOURCE_UNSPECIFIED" : 0; - if (message.metricSource != null && message.hasOwnProperty("metricSource")) - object.metricSource = options.enums === String ? $root.google.cloud.dataproc.v1.DataprocMetricConfig.MetricSource[message.metricSource] === undefined ? message.metricSource : $root.google.cloud.dataproc.v1.DataprocMetricConfig.MetricSource[message.metricSource] : message.metricSource; - if (message.metricOverrides && message.metricOverrides.length) { - object.metricOverrides = []; - for (var j = 0; j < message.metricOverrides.length; ++j) - object.metricOverrides[j] = message.metricOverrides[j]; - } - return object; - }; - - /** - * Converts this Metric to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.DataprocMetricConfig.Metric - * @instance - * @returns {Object.} JSON object - */ - Metric.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Metric - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.DataprocMetricConfig.Metric - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Metric.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.DataprocMetricConfig.Metric"; - }; - - return Metric; - })(); - - return DataprocMetricConfig; - })(); - - v1.CreateClusterRequest = (function() { - - /** - * Properties of a CreateClusterRequest. - * @memberof google.cloud.dataproc.v1 - * @interface ICreateClusterRequest - * @property {string|null} [projectId] CreateClusterRequest projectId - * @property {string|null} [region] CreateClusterRequest region - * @property {google.cloud.dataproc.v1.ICluster|null} [cluster] CreateClusterRequest cluster - * @property {string|null} [requestId] CreateClusterRequest requestId - * @property {google.cloud.dataproc.v1.FailureAction|null} [actionOnFailedPrimaryWorkers] CreateClusterRequest actionOnFailedPrimaryWorkers - */ - - /** - * Constructs a new CreateClusterRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a CreateClusterRequest. - * @implements ICreateClusterRequest - * @constructor - * @param {google.cloud.dataproc.v1.ICreateClusterRequest=} [properties] Properties to set - */ - function CreateClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateClusterRequest projectId. - * @member {string} projectId - * @memberof google.cloud.dataproc.v1.CreateClusterRequest - * @instance - */ - CreateClusterRequest.prototype.projectId = ""; - - /** - * CreateClusterRequest region. - * @member {string} region - * @memberof google.cloud.dataproc.v1.CreateClusterRequest - * @instance - */ - CreateClusterRequest.prototype.region = ""; - - /** - * CreateClusterRequest cluster. - * @member {google.cloud.dataproc.v1.ICluster|null|undefined} cluster - * @memberof google.cloud.dataproc.v1.CreateClusterRequest - * @instance - */ - CreateClusterRequest.prototype.cluster = null; - - /** - * CreateClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.dataproc.v1.CreateClusterRequest - * @instance - */ - CreateClusterRequest.prototype.requestId = ""; - - /** - * CreateClusterRequest actionOnFailedPrimaryWorkers. - * @member {google.cloud.dataproc.v1.FailureAction} actionOnFailedPrimaryWorkers - * @memberof google.cloud.dataproc.v1.CreateClusterRequest - * @instance - */ - CreateClusterRequest.prototype.actionOnFailedPrimaryWorkers = 0; - - /** - * Creates a new CreateClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.CreateClusterRequest - * @static - * @param {google.cloud.dataproc.v1.ICreateClusterRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.CreateClusterRequest} CreateClusterRequest instance - */ - CreateClusterRequest.create = function create(properties) { - return new CreateClusterRequest(properties); - }; - - /** - * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.cloud.dataproc.v1.CreateClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.CreateClusterRequest - * @static - * @param {google.cloud.dataproc.v1.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) - $root.google.cloud.dataproc.v1.Cluster.encode(message.cluster, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.region != null && Object.hasOwnProperty.call(message, "region")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.region); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - if (message.actionOnFailedPrimaryWorkers != null && Object.hasOwnProperty.call(message, "actionOnFailedPrimaryWorkers")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.actionOnFailedPrimaryWorkers); - return writer; - }; - - /** - * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.CreateClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.CreateClusterRequest - * @static - * @param {google.cloud.dataproc.v1.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.CreateClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.CreateClusterRequest} CreateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.CreateClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.projectId = reader.string(); - break; - } - case 3: { - message.region = reader.string(); - break; - } - case 2: { - message.cluster = $root.google.cloud.dataproc.v1.Cluster.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - case 5: { - message.actionOnFailedPrimaryWorkers = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.CreateClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.CreateClusterRequest} CreateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateClusterRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.CreateClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.region != null && message.hasOwnProperty("region")) - if (!$util.isString(message.region)) - return "region: string expected"; - if (message.cluster != null && message.hasOwnProperty("cluster")) { - var error = $root.google.cloud.dataproc.v1.Cluster.verify(message.cluster); - if (error) - return "cluster." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.actionOnFailedPrimaryWorkers != null && message.hasOwnProperty("actionOnFailedPrimaryWorkers")) - switch (message.actionOnFailedPrimaryWorkers) { - default: - return "actionOnFailedPrimaryWorkers: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.CreateClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.CreateClusterRequest} CreateClusterRequest - */ - CreateClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.CreateClusterRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.CreateClusterRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.region != null) - message.region = String(object.region); - if (object.cluster != null) { - if (typeof object.cluster !== "object") - throw TypeError(".google.cloud.dataproc.v1.CreateClusterRequest.cluster: object expected"); - message.cluster = $root.google.cloud.dataproc.v1.Cluster.fromObject(object.cluster); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - switch (object.actionOnFailedPrimaryWorkers) { - default: - if (typeof object.actionOnFailedPrimaryWorkers === "number") { - message.actionOnFailedPrimaryWorkers = object.actionOnFailedPrimaryWorkers; - break; - } - break; - case "FAILURE_ACTION_UNSPECIFIED": - case 0: - message.actionOnFailedPrimaryWorkers = 0; - break; - case "NO_ACTION": - case 1: - message.actionOnFailedPrimaryWorkers = 1; - break; - case "DELETE": - case 2: - message.actionOnFailedPrimaryWorkers = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.CreateClusterRequest - * @static - * @param {google.cloud.dataproc.v1.CreateClusterRequest} message CreateClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.projectId = ""; - object.cluster = null; - object.region = ""; - object.requestId = ""; - object.actionOnFailedPrimaryWorkers = options.enums === String ? "FAILURE_ACTION_UNSPECIFIED" : 0; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.cluster != null && message.hasOwnProperty("cluster")) - object.cluster = $root.google.cloud.dataproc.v1.Cluster.toObject(message.cluster, options); - if (message.region != null && message.hasOwnProperty("region")) - object.region = message.region; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.actionOnFailedPrimaryWorkers != null && message.hasOwnProperty("actionOnFailedPrimaryWorkers")) - object.actionOnFailedPrimaryWorkers = options.enums === String ? $root.google.cloud.dataproc.v1.FailureAction[message.actionOnFailedPrimaryWorkers] === undefined ? message.actionOnFailedPrimaryWorkers : $root.google.cloud.dataproc.v1.FailureAction[message.actionOnFailedPrimaryWorkers] : message.actionOnFailedPrimaryWorkers; - return object; - }; - - /** - * Converts this CreateClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.CreateClusterRequest - * @instance - * @returns {Object.} JSON object - */ - CreateClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateClusterRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.CreateClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.CreateClusterRequest"; - }; - - return CreateClusterRequest; - })(); - - v1.UpdateClusterRequest = (function() { - - /** - * Properties of an UpdateClusterRequest. - * @memberof google.cloud.dataproc.v1 - * @interface IUpdateClusterRequest - * @property {string|null} [projectId] UpdateClusterRequest projectId - * @property {string|null} [region] UpdateClusterRequest region - * @property {string|null} [clusterName] UpdateClusterRequest clusterName - * @property {google.cloud.dataproc.v1.ICluster|null} [cluster] UpdateClusterRequest cluster - * @property {google.protobuf.IDuration|null} [gracefulDecommissionTimeout] UpdateClusterRequest gracefulDecommissionTimeout - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateClusterRequest updateMask - * @property {string|null} [requestId] UpdateClusterRequest requestId - */ - - /** - * Constructs a new UpdateClusterRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents an UpdateClusterRequest. - * @implements IUpdateClusterRequest - * @constructor - * @param {google.cloud.dataproc.v1.IUpdateClusterRequest=} [properties] Properties to set - */ - function UpdateClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateClusterRequest projectId. - * @member {string} projectId - * @memberof google.cloud.dataproc.v1.UpdateClusterRequest - * @instance - */ - UpdateClusterRequest.prototype.projectId = ""; - - /** - * UpdateClusterRequest region. - * @member {string} region - * @memberof google.cloud.dataproc.v1.UpdateClusterRequest - * @instance - */ - UpdateClusterRequest.prototype.region = ""; - - /** - * UpdateClusterRequest clusterName. - * @member {string} clusterName - * @memberof google.cloud.dataproc.v1.UpdateClusterRequest - * @instance - */ - UpdateClusterRequest.prototype.clusterName = ""; - - /** - * UpdateClusterRequest cluster. - * @member {google.cloud.dataproc.v1.ICluster|null|undefined} cluster - * @memberof google.cloud.dataproc.v1.UpdateClusterRequest - * @instance - */ - UpdateClusterRequest.prototype.cluster = null; - - /** - * UpdateClusterRequest gracefulDecommissionTimeout. - * @member {google.protobuf.IDuration|null|undefined} gracefulDecommissionTimeout - * @memberof google.cloud.dataproc.v1.UpdateClusterRequest - * @instance - */ - UpdateClusterRequest.prototype.gracefulDecommissionTimeout = null; - - /** - * UpdateClusterRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.dataproc.v1.UpdateClusterRequest - * @instance - */ - UpdateClusterRequest.prototype.updateMask = null; - - /** - * UpdateClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.dataproc.v1.UpdateClusterRequest - * @instance - */ - UpdateClusterRequest.prototype.requestId = ""; - - /** - * Creates a new UpdateClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.UpdateClusterRequest - * @static - * @param {google.cloud.dataproc.v1.IUpdateClusterRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.UpdateClusterRequest} UpdateClusterRequest instance - */ - UpdateClusterRequest.create = function create(properties) { - return new UpdateClusterRequest(properties); - }; - - /** - * Encodes the specified UpdateClusterRequest message. Does not implicitly {@link google.cloud.dataproc.v1.UpdateClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.UpdateClusterRequest - * @static - * @param {google.cloud.dataproc.v1.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterName); - if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) - $root.google.cloud.dataproc.v1.Cluster.encode(message.cluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.region != null && Object.hasOwnProperty.call(message, "region")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.region); - if (message.gracefulDecommissionTimeout != null && Object.hasOwnProperty.call(message, "gracefulDecommissionTimeout")) - $root.google.protobuf.Duration.encode(message.gracefulDecommissionTimeout, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified UpdateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.UpdateClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.UpdateClusterRequest - * @static - * @param {google.cloud.dataproc.v1.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.UpdateClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.UpdateClusterRequest} UpdateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.UpdateClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.projectId = reader.string(); - break; - } - case 5: { - message.region = reader.string(); - break; - } - case 2: { - message.clusterName = reader.string(); - break; - } - case 3: { - message.cluster = $root.google.cloud.dataproc.v1.Cluster.decode(reader, reader.uint32()); - break; - } - case 6: { - message.gracefulDecommissionTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 4: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 7: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.UpdateClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.UpdateClusterRequest} UpdateClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateClusterRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.UpdateClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.region != null && message.hasOwnProperty("region")) - if (!$util.isString(message.region)) - return "region: string expected"; - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - if (!$util.isString(message.clusterName)) - return "clusterName: string expected"; - if (message.cluster != null && message.hasOwnProperty("cluster")) { - var error = $root.google.cloud.dataproc.v1.Cluster.verify(message.cluster); - if (error) - return "cluster." + error; - } - if (message.gracefulDecommissionTimeout != null && message.hasOwnProperty("gracefulDecommissionTimeout")) { - var error = $root.google.protobuf.Duration.verify(message.gracefulDecommissionTimeout); - if (error) - return "gracefulDecommissionTimeout." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates an UpdateClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.UpdateClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.UpdateClusterRequest} UpdateClusterRequest - */ - UpdateClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.UpdateClusterRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.UpdateClusterRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.region != null) - message.region = String(object.region); - if (object.clusterName != null) - message.clusterName = String(object.clusterName); - if (object.cluster != null) { - if (typeof object.cluster !== "object") - throw TypeError(".google.cloud.dataproc.v1.UpdateClusterRequest.cluster: object expected"); - message.cluster = $root.google.cloud.dataproc.v1.Cluster.fromObject(object.cluster); - } - if (object.gracefulDecommissionTimeout != null) { - if (typeof object.gracefulDecommissionTimeout !== "object") - throw TypeError(".google.cloud.dataproc.v1.UpdateClusterRequest.gracefulDecommissionTimeout: object expected"); - message.gracefulDecommissionTimeout = $root.google.protobuf.Duration.fromObject(object.gracefulDecommissionTimeout); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.dataproc.v1.UpdateClusterRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from an UpdateClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.UpdateClusterRequest - * @static - * @param {google.cloud.dataproc.v1.UpdateClusterRequest} message UpdateClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.projectId = ""; - object.clusterName = ""; - object.cluster = null; - object.updateMask = null; - object.region = ""; - object.gracefulDecommissionTimeout = null; - object.requestId = ""; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - object.clusterName = message.clusterName; - if (message.cluster != null && message.hasOwnProperty("cluster")) - object.cluster = $root.google.cloud.dataproc.v1.Cluster.toObject(message.cluster, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.region != null && message.hasOwnProperty("region")) - object.region = message.region; - if (message.gracefulDecommissionTimeout != null && message.hasOwnProperty("gracefulDecommissionTimeout")) - object.gracefulDecommissionTimeout = $root.google.protobuf.Duration.toObject(message.gracefulDecommissionTimeout, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this UpdateClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.UpdateClusterRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateClusterRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.UpdateClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.UpdateClusterRequest"; - }; - - return UpdateClusterRequest; - })(); - - v1.StopClusterRequest = (function() { - - /** - * Properties of a StopClusterRequest. - * @memberof google.cloud.dataproc.v1 - * @interface IStopClusterRequest - * @property {string|null} [projectId] StopClusterRequest projectId - * @property {string|null} [region] StopClusterRequest region - * @property {string|null} [clusterName] StopClusterRequest clusterName - * @property {string|null} [clusterUuid] StopClusterRequest clusterUuid - * @property {string|null} [requestId] StopClusterRequest requestId - */ - - /** - * Constructs a new StopClusterRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a StopClusterRequest. - * @implements IStopClusterRequest - * @constructor - * @param {google.cloud.dataproc.v1.IStopClusterRequest=} [properties] Properties to set - */ - function StopClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StopClusterRequest projectId. - * @member {string} projectId - * @memberof google.cloud.dataproc.v1.StopClusterRequest - * @instance - */ - StopClusterRequest.prototype.projectId = ""; - - /** - * StopClusterRequest region. - * @member {string} region - * @memberof google.cloud.dataproc.v1.StopClusterRequest - * @instance - */ - StopClusterRequest.prototype.region = ""; - - /** - * StopClusterRequest clusterName. - * @member {string} clusterName - * @memberof google.cloud.dataproc.v1.StopClusterRequest - * @instance - */ - StopClusterRequest.prototype.clusterName = ""; - - /** - * StopClusterRequest clusterUuid. - * @member {string} clusterUuid - * @memberof google.cloud.dataproc.v1.StopClusterRequest - * @instance - */ - StopClusterRequest.prototype.clusterUuid = ""; - - /** - * StopClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.dataproc.v1.StopClusterRequest - * @instance - */ - StopClusterRequest.prototype.requestId = ""; - - /** - * Creates a new StopClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.StopClusterRequest - * @static - * @param {google.cloud.dataproc.v1.IStopClusterRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.StopClusterRequest} StopClusterRequest instance - */ - StopClusterRequest.create = function create(properties) { - return new StopClusterRequest(properties); - }; - - /** - * Encodes the specified StopClusterRequest message. Does not implicitly {@link google.cloud.dataproc.v1.StopClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.StopClusterRequest - * @static - * @param {google.cloud.dataproc.v1.IStopClusterRequest} message StopClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StopClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.region != null && Object.hasOwnProperty.call(message, "region")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.region); - if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.clusterName); - if (message.clusterUuid != null && Object.hasOwnProperty.call(message, "clusterUuid")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.clusterUuid); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified StopClusterRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.StopClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.StopClusterRequest - * @static - * @param {google.cloud.dataproc.v1.IStopClusterRequest} message StopClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StopClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StopClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.StopClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.StopClusterRequest} StopClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StopClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.StopClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.projectId = reader.string(); - break; - } - case 2: { - message.region = reader.string(); - break; - } - case 3: { - message.clusterName = reader.string(); - break; - } - case 4: { - message.clusterUuid = reader.string(); - break; - } - case 5: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StopClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.StopClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.StopClusterRequest} StopClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StopClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StopClusterRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.StopClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StopClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.region != null && message.hasOwnProperty("region")) - if (!$util.isString(message.region)) - return "region: string expected"; - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - if (!$util.isString(message.clusterName)) - return "clusterName: string expected"; - if (message.clusterUuid != null && message.hasOwnProperty("clusterUuid")) - if (!$util.isString(message.clusterUuid)) - return "clusterUuid: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a StopClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.StopClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.StopClusterRequest} StopClusterRequest - */ - StopClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.StopClusterRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.StopClusterRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.region != null) - message.region = String(object.region); - if (object.clusterName != null) - message.clusterName = String(object.clusterName); - if (object.clusterUuid != null) - message.clusterUuid = String(object.clusterUuid); - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a StopClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.StopClusterRequest - * @static - * @param {google.cloud.dataproc.v1.StopClusterRequest} message StopClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StopClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.projectId = ""; - object.region = ""; - object.clusterName = ""; - object.clusterUuid = ""; - object.requestId = ""; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.region != null && message.hasOwnProperty("region")) - object.region = message.region; - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - object.clusterName = message.clusterName; - if (message.clusterUuid != null && message.hasOwnProperty("clusterUuid")) - object.clusterUuid = message.clusterUuid; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this StopClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.StopClusterRequest - * @instance - * @returns {Object.} JSON object - */ - StopClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StopClusterRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.StopClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StopClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.StopClusterRequest"; - }; - - return StopClusterRequest; - })(); - - v1.StartClusterRequest = (function() { - - /** - * Properties of a StartClusterRequest. - * @memberof google.cloud.dataproc.v1 - * @interface IStartClusterRequest - * @property {string|null} [projectId] StartClusterRequest projectId - * @property {string|null} [region] StartClusterRequest region - * @property {string|null} [clusterName] StartClusterRequest clusterName - * @property {string|null} [clusterUuid] StartClusterRequest clusterUuid - * @property {string|null} [requestId] StartClusterRequest requestId - */ - - /** - * Constructs a new StartClusterRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a StartClusterRequest. - * @implements IStartClusterRequest - * @constructor - * @param {google.cloud.dataproc.v1.IStartClusterRequest=} [properties] Properties to set - */ - function StartClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StartClusterRequest projectId. - * @member {string} projectId - * @memberof google.cloud.dataproc.v1.StartClusterRequest - * @instance - */ - StartClusterRequest.prototype.projectId = ""; - - /** - * StartClusterRequest region. - * @member {string} region - * @memberof google.cloud.dataproc.v1.StartClusterRequest - * @instance - */ - StartClusterRequest.prototype.region = ""; - - /** - * StartClusterRequest clusterName. - * @member {string} clusterName - * @memberof google.cloud.dataproc.v1.StartClusterRequest - * @instance - */ - StartClusterRequest.prototype.clusterName = ""; - - /** - * StartClusterRequest clusterUuid. - * @member {string} clusterUuid - * @memberof google.cloud.dataproc.v1.StartClusterRequest - * @instance - */ - StartClusterRequest.prototype.clusterUuid = ""; - - /** - * StartClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.dataproc.v1.StartClusterRequest - * @instance - */ - StartClusterRequest.prototype.requestId = ""; - - /** - * Creates a new StartClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.StartClusterRequest - * @static - * @param {google.cloud.dataproc.v1.IStartClusterRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.StartClusterRequest} StartClusterRequest instance - */ - StartClusterRequest.create = function create(properties) { - return new StartClusterRequest(properties); - }; - - /** - * Encodes the specified StartClusterRequest message. Does not implicitly {@link google.cloud.dataproc.v1.StartClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.StartClusterRequest - * @static - * @param {google.cloud.dataproc.v1.IStartClusterRequest} message StartClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.region != null && Object.hasOwnProperty.call(message, "region")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.region); - if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.clusterName); - if (message.clusterUuid != null && Object.hasOwnProperty.call(message, "clusterUuid")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.clusterUuid); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified StartClusterRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.StartClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.StartClusterRequest - * @static - * @param {google.cloud.dataproc.v1.IStartClusterRequest} message StartClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StartClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StartClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.StartClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.StartClusterRequest} StartClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.StartClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.projectId = reader.string(); - break; - } - case 2: { - message.region = reader.string(); - break; - } - case 3: { - message.clusterName = reader.string(); - break; - } - case 4: { - message.clusterUuid = reader.string(); - break; - } - case 5: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StartClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.StartClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.StartClusterRequest} StartClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StartClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StartClusterRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.StartClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StartClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.region != null && message.hasOwnProperty("region")) - if (!$util.isString(message.region)) - return "region: string expected"; - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - if (!$util.isString(message.clusterName)) - return "clusterName: string expected"; - if (message.clusterUuid != null && message.hasOwnProperty("clusterUuid")) - if (!$util.isString(message.clusterUuid)) - return "clusterUuid: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a StartClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.StartClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.StartClusterRequest} StartClusterRequest - */ - StartClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.StartClusterRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.StartClusterRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.region != null) - message.region = String(object.region); - if (object.clusterName != null) - message.clusterName = String(object.clusterName); - if (object.clusterUuid != null) - message.clusterUuid = String(object.clusterUuid); - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a StartClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.StartClusterRequest - * @static - * @param {google.cloud.dataproc.v1.StartClusterRequest} message StartClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StartClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.projectId = ""; - object.region = ""; - object.clusterName = ""; - object.clusterUuid = ""; - object.requestId = ""; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.region != null && message.hasOwnProperty("region")) - object.region = message.region; - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - object.clusterName = message.clusterName; - if (message.clusterUuid != null && message.hasOwnProperty("clusterUuid")) - object.clusterUuid = message.clusterUuid; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this StartClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.StartClusterRequest - * @instance - * @returns {Object.} JSON object - */ - StartClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StartClusterRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.StartClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StartClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.StartClusterRequest"; - }; - - return StartClusterRequest; - })(); - - v1.DeleteClusterRequest = (function() { - - /** - * Properties of a DeleteClusterRequest. - * @memberof google.cloud.dataproc.v1 - * @interface IDeleteClusterRequest - * @property {string|null} [projectId] DeleteClusterRequest projectId - * @property {string|null} [region] DeleteClusterRequest region - * @property {string|null} [clusterName] DeleteClusterRequest clusterName - * @property {string|null} [clusterUuid] DeleteClusterRequest clusterUuid - * @property {string|null} [requestId] DeleteClusterRequest requestId - */ - - /** - * Constructs a new DeleteClusterRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a DeleteClusterRequest. - * @implements IDeleteClusterRequest - * @constructor - * @param {google.cloud.dataproc.v1.IDeleteClusterRequest=} [properties] Properties to set - */ - function DeleteClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteClusterRequest projectId. - * @member {string} projectId - * @memberof google.cloud.dataproc.v1.DeleteClusterRequest - * @instance - */ - DeleteClusterRequest.prototype.projectId = ""; - - /** - * DeleteClusterRequest region. - * @member {string} region - * @memberof google.cloud.dataproc.v1.DeleteClusterRequest - * @instance - */ - DeleteClusterRequest.prototype.region = ""; - - /** - * DeleteClusterRequest clusterName. - * @member {string} clusterName - * @memberof google.cloud.dataproc.v1.DeleteClusterRequest - * @instance - */ - DeleteClusterRequest.prototype.clusterName = ""; - - /** - * DeleteClusterRequest clusterUuid. - * @member {string} clusterUuid - * @memberof google.cloud.dataproc.v1.DeleteClusterRequest - * @instance - */ - DeleteClusterRequest.prototype.clusterUuid = ""; - - /** - * DeleteClusterRequest requestId. - * @member {string} requestId - * @memberof google.cloud.dataproc.v1.DeleteClusterRequest - * @instance - */ - DeleteClusterRequest.prototype.requestId = ""; - - /** - * Creates a new DeleteClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.DeleteClusterRequest - * @static - * @param {google.cloud.dataproc.v1.IDeleteClusterRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.DeleteClusterRequest} DeleteClusterRequest instance - */ - DeleteClusterRequest.create = function create(properties) { - return new DeleteClusterRequest(properties); - }; - - /** - * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.cloud.dataproc.v1.DeleteClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.DeleteClusterRequest - * @static - * @param {google.cloud.dataproc.v1.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterName); - if (message.region != null && Object.hasOwnProperty.call(message, "region")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.region); - if (message.clusterUuid != null && Object.hasOwnProperty.call(message, "clusterUuid")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.clusterUuid); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DeleteClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.DeleteClusterRequest - * @static - * @param {google.cloud.dataproc.v1.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.DeleteClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.DeleteClusterRequest} DeleteClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.DeleteClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.projectId = reader.string(); - break; - } - case 3: { - message.region = reader.string(); - break; - } - case 2: { - message.clusterName = reader.string(); - break; - } - case 4: { - message.clusterUuid = reader.string(); - break; - } - case 5: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.DeleteClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.DeleteClusterRequest} DeleteClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteClusterRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.DeleteClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.region != null && message.hasOwnProperty("region")) - if (!$util.isString(message.region)) - return "region: string expected"; - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - if (!$util.isString(message.clusterName)) - return "clusterName: string expected"; - if (message.clusterUuid != null && message.hasOwnProperty("clusterUuid")) - if (!$util.isString(message.clusterUuid)) - return "clusterUuid: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.DeleteClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.DeleteClusterRequest} DeleteClusterRequest - */ - DeleteClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.DeleteClusterRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.DeleteClusterRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.region != null) - message.region = String(object.region); - if (object.clusterName != null) - message.clusterName = String(object.clusterName); - if (object.clusterUuid != null) - message.clusterUuid = String(object.clusterUuid); - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.DeleteClusterRequest - * @static - * @param {google.cloud.dataproc.v1.DeleteClusterRequest} message DeleteClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.projectId = ""; - object.clusterName = ""; - object.region = ""; - object.clusterUuid = ""; - object.requestId = ""; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - object.clusterName = message.clusterName; - if (message.region != null && message.hasOwnProperty("region")) - object.region = message.region; - if (message.clusterUuid != null && message.hasOwnProperty("clusterUuid")) - object.clusterUuid = message.clusterUuid; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this DeleteClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.DeleteClusterRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteClusterRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.DeleteClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.DeleteClusterRequest"; - }; - - return DeleteClusterRequest; - })(); - - v1.GetClusterRequest = (function() { - - /** - * Properties of a GetClusterRequest. - * @memberof google.cloud.dataproc.v1 - * @interface IGetClusterRequest - * @property {string|null} [projectId] GetClusterRequest projectId - * @property {string|null} [region] GetClusterRequest region - * @property {string|null} [clusterName] GetClusterRequest clusterName - */ - - /** - * Constructs a new GetClusterRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a GetClusterRequest. - * @implements IGetClusterRequest - * @constructor - * @param {google.cloud.dataproc.v1.IGetClusterRequest=} [properties] Properties to set - */ - function GetClusterRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetClusterRequest projectId. - * @member {string} projectId - * @memberof google.cloud.dataproc.v1.GetClusterRequest - * @instance - */ - GetClusterRequest.prototype.projectId = ""; - - /** - * GetClusterRequest region. - * @member {string} region - * @memberof google.cloud.dataproc.v1.GetClusterRequest - * @instance - */ - GetClusterRequest.prototype.region = ""; - - /** - * GetClusterRequest clusterName. - * @member {string} clusterName - * @memberof google.cloud.dataproc.v1.GetClusterRequest - * @instance - */ - GetClusterRequest.prototype.clusterName = ""; - - /** - * Creates a new GetClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.GetClusterRequest - * @static - * @param {google.cloud.dataproc.v1.IGetClusterRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.GetClusterRequest} GetClusterRequest instance - */ - GetClusterRequest.create = function create(properties) { - return new GetClusterRequest(properties); - }; - - /** - * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.cloud.dataproc.v1.GetClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.GetClusterRequest - * @static - * @param {google.cloud.dataproc.v1.IGetClusterRequest} message GetClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterName); - if (message.region != null && Object.hasOwnProperty.call(message, "region")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.region); - return writer; - }; - - /** - * Encodes the specified GetClusterRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GetClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.GetClusterRequest - * @static - * @param {google.cloud.dataproc.v1.IGetClusterRequest} message GetClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.GetClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.GetClusterRequest} GetClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.GetClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.projectId = reader.string(); - break; - } - case 3: { - message.region = reader.string(); - break; - } - case 2: { - message.clusterName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.GetClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.GetClusterRequest} GetClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetClusterRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.GetClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.region != null && message.hasOwnProperty("region")) - if (!$util.isString(message.region)) - return "region: string expected"; - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - if (!$util.isString(message.clusterName)) - return "clusterName: string expected"; - return null; - }; - - /** - * Creates a GetClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.GetClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.GetClusterRequest} GetClusterRequest - */ - GetClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.GetClusterRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.GetClusterRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.region != null) - message.region = String(object.region); - if (object.clusterName != null) - message.clusterName = String(object.clusterName); - return message; - }; - - /** - * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.GetClusterRequest - * @static - * @param {google.cloud.dataproc.v1.GetClusterRequest} message GetClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.projectId = ""; - object.clusterName = ""; - object.region = ""; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - object.clusterName = message.clusterName; - if (message.region != null && message.hasOwnProperty("region")) - object.region = message.region; - return object; - }; - - /** - * Converts this GetClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.GetClusterRequest - * @instance - * @returns {Object.} JSON object - */ - GetClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetClusterRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.GetClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.GetClusterRequest"; - }; - - return GetClusterRequest; - })(); - - v1.ListClustersRequest = (function() { - - /** - * Properties of a ListClustersRequest. - * @memberof google.cloud.dataproc.v1 - * @interface IListClustersRequest - * @property {string|null} [projectId] ListClustersRequest projectId - * @property {string|null} [region] ListClustersRequest region - * @property {string|null} [filter] ListClustersRequest filter - * @property {number|null} [pageSize] ListClustersRequest pageSize - * @property {string|null} [pageToken] ListClustersRequest pageToken - */ - - /** - * Constructs a new ListClustersRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a ListClustersRequest. - * @implements IListClustersRequest - * @constructor - * @param {google.cloud.dataproc.v1.IListClustersRequest=} [properties] Properties to set - */ - function ListClustersRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListClustersRequest projectId. - * @member {string} projectId - * @memberof google.cloud.dataproc.v1.ListClustersRequest - * @instance - */ - ListClustersRequest.prototype.projectId = ""; - - /** - * ListClustersRequest region. - * @member {string} region - * @memberof google.cloud.dataproc.v1.ListClustersRequest - * @instance - */ - ListClustersRequest.prototype.region = ""; - - /** - * ListClustersRequest filter. - * @member {string} filter - * @memberof google.cloud.dataproc.v1.ListClustersRequest - * @instance - */ - ListClustersRequest.prototype.filter = ""; - - /** - * ListClustersRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.dataproc.v1.ListClustersRequest - * @instance - */ - ListClustersRequest.prototype.pageSize = 0; - - /** - * ListClustersRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.dataproc.v1.ListClustersRequest - * @instance - */ - ListClustersRequest.prototype.pageToken = ""; - - /** - * Creates a new ListClustersRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.ListClustersRequest - * @static - * @param {google.cloud.dataproc.v1.IListClustersRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.ListClustersRequest} ListClustersRequest instance - */ - ListClustersRequest.create = function create(properties) { - return new ListClustersRequest(properties); - }; - - /** - * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.cloud.dataproc.v1.ListClustersRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.ListClustersRequest - * @static - * @param {google.cloud.dataproc.v1.IListClustersRequest} message ListClustersRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListClustersRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.region != null && Object.hasOwnProperty.call(message, "region")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.region); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); - return writer; - }; - - /** - * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListClustersRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.ListClustersRequest - * @static - * @param {google.cloud.dataproc.v1.IListClustersRequest} message ListClustersRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListClustersRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListClustersRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.ListClustersRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.ListClustersRequest} ListClustersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListClustersRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ListClustersRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.projectId = reader.string(); - break; - } - case 4: { - message.region = reader.string(); - break; - } - case 5: { - 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 ListClustersRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.ListClustersRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.ListClustersRequest} ListClustersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListClustersRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListClustersRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.ListClustersRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListClustersRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.region != null && message.hasOwnProperty("region")) - if (!$util.isString(message.region)) - return "region: 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 ListClustersRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.ListClustersRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.ListClustersRequest} ListClustersRequest - */ - ListClustersRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.ListClustersRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.ListClustersRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.region != null) - message.region = String(object.region); - 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 ListClustersRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.ListClustersRequest - * @static - * @param {google.cloud.dataproc.v1.ListClustersRequest} message ListClustersRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListClustersRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.projectId = ""; - object.pageSize = 0; - object.pageToken = ""; - object.region = ""; - object.filter = ""; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.region != null && message.hasOwnProperty("region")) - object.region = message.region; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - return object; - }; - - /** - * Converts this ListClustersRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.ListClustersRequest - * @instance - * @returns {Object.} JSON object - */ - ListClustersRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListClustersRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.ListClustersRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListClustersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.ListClustersRequest"; - }; - - return ListClustersRequest; - })(); - - v1.ListClustersResponse = (function() { - - /** - * Properties of a ListClustersResponse. - * @memberof google.cloud.dataproc.v1 - * @interface IListClustersResponse - * @property {Array.|null} [clusters] ListClustersResponse clusters - * @property {string|null} [nextPageToken] ListClustersResponse nextPageToken - */ - - /** - * Constructs a new ListClustersResponse. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a ListClustersResponse. - * @implements IListClustersResponse - * @constructor - * @param {google.cloud.dataproc.v1.IListClustersResponse=} [properties] Properties to set - */ - function ListClustersResponse(properties) { - this.clusters = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListClustersResponse clusters. - * @member {Array.} clusters - * @memberof google.cloud.dataproc.v1.ListClustersResponse - * @instance - */ - ListClustersResponse.prototype.clusters = $util.emptyArray; - - /** - * ListClustersResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.dataproc.v1.ListClustersResponse - * @instance - */ - ListClustersResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListClustersResponse instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.ListClustersResponse - * @static - * @param {google.cloud.dataproc.v1.IListClustersResponse=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.ListClustersResponse} ListClustersResponse instance - */ - ListClustersResponse.create = function create(properties) { - return new ListClustersResponse(properties); - }; - - /** - * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.cloud.dataproc.v1.ListClustersResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.ListClustersResponse - * @static - * @param {google.cloud.dataproc.v1.IListClustersResponse} message ListClustersResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListClustersResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.clusters != null && message.clusters.length) - for (var i = 0; i < message.clusters.length; ++i) - $root.google.cloud.dataproc.v1.Cluster.encode(message.clusters[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 ListClustersResponse message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListClustersResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.ListClustersResponse - * @static - * @param {google.cloud.dataproc.v1.IListClustersResponse} message ListClustersResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListClustersResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListClustersResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.ListClustersResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.ListClustersResponse} ListClustersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListClustersResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ListClustersResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.clusters && message.clusters.length)) - message.clusters = []; - message.clusters.push($root.google.cloud.dataproc.v1.Cluster.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.ListClustersResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.ListClustersResponse} ListClustersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListClustersResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListClustersResponse message. - * @function verify - * @memberof google.cloud.dataproc.v1.ListClustersResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListClustersResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.clusters != null && message.hasOwnProperty("clusters")) { - if (!Array.isArray(message.clusters)) - return "clusters: array expected"; - for (var i = 0; i < message.clusters.length; ++i) { - var error = $root.google.cloud.dataproc.v1.Cluster.verify(message.clusters[i]); - if (error) - return "clusters." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.ListClustersResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.ListClustersResponse} ListClustersResponse - */ - ListClustersResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.ListClustersResponse) - return object; - var message = new $root.google.cloud.dataproc.v1.ListClustersResponse(); - if (object.clusters) { - if (!Array.isArray(object.clusters)) - throw TypeError(".google.cloud.dataproc.v1.ListClustersResponse.clusters: array expected"); - message.clusters = []; - for (var i = 0; i < object.clusters.length; ++i) { - if (typeof object.clusters[i] !== "object") - throw TypeError(".google.cloud.dataproc.v1.ListClustersResponse.clusters: object expected"); - message.clusters[i] = $root.google.cloud.dataproc.v1.Cluster.fromObject(object.clusters[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.ListClustersResponse - * @static - * @param {google.cloud.dataproc.v1.ListClustersResponse} message ListClustersResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListClustersResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.clusters = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.clusters && message.clusters.length) { - object.clusters = []; - for (var j = 0; j < message.clusters.length; ++j) - object.clusters[j] = $root.google.cloud.dataproc.v1.Cluster.toObject(message.clusters[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListClustersResponse to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.ListClustersResponse - * @instance - * @returns {Object.} JSON object - */ - ListClustersResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListClustersResponse - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.ListClustersResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListClustersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.ListClustersResponse"; - }; - - return ListClustersResponse; - })(); - - v1.DiagnoseClusterRequest = (function() { - - /** - * Properties of a DiagnoseClusterRequest. - * @memberof google.cloud.dataproc.v1 - * @interface IDiagnoseClusterRequest - * @property {string|null} [projectId] DiagnoseClusterRequest projectId - * @property {string|null} [region] DiagnoseClusterRequest region - * @property {string|null} [clusterName] DiagnoseClusterRequest clusterName - * @property {string|null} [tarballGcsDir] DiagnoseClusterRequest tarballGcsDir - * @property {google.cloud.dataproc.v1.DiagnoseClusterRequest.TarballAccess|null} [tarballAccess] DiagnoseClusterRequest tarballAccess - * @property {google.type.IInterval|null} [diagnosisInterval] DiagnoseClusterRequest diagnosisInterval - * @property {Array.|null} [jobs] DiagnoseClusterRequest jobs - * @property {Array.|null} [yarnApplicationIds] DiagnoseClusterRequest yarnApplicationIds - */ - - /** - * Constructs a new DiagnoseClusterRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a DiagnoseClusterRequest. - * @implements IDiagnoseClusterRequest - * @constructor - * @param {google.cloud.dataproc.v1.IDiagnoseClusterRequest=} [properties] Properties to set - */ - function DiagnoseClusterRequest(properties) { - this.jobs = []; - this.yarnApplicationIds = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DiagnoseClusterRequest projectId. - * @member {string} projectId - * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest - * @instance - */ - DiagnoseClusterRequest.prototype.projectId = ""; - - /** - * DiagnoseClusterRequest region. - * @member {string} region - * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest - * @instance - */ - DiagnoseClusterRequest.prototype.region = ""; - - /** - * DiagnoseClusterRequest clusterName. - * @member {string} clusterName - * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest - * @instance - */ - DiagnoseClusterRequest.prototype.clusterName = ""; - - /** - * DiagnoseClusterRequest tarballGcsDir. - * @member {string} tarballGcsDir - * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest - * @instance - */ - DiagnoseClusterRequest.prototype.tarballGcsDir = ""; - - /** - * DiagnoseClusterRequest tarballAccess. - * @member {google.cloud.dataproc.v1.DiagnoseClusterRequest.TarballAccess} tarballAccess - * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest - * @instance - */ - DiagnoseClusterRequest.prototype.tarballAccess = 0; - - /** - * DiagnoseClusterRequest diagnosisInterval. - * @member {google.type.IInterval|null|undefined} diagnosisInterval - * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest - * @instance - */ - DiagnoseClusterRequest.prototype.diagnosisInterval = null; - - /** - * DiagnoseClusterRequest jobs. - * @member {Array.} jobs - * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest - * @instance - */ - DiagnoseClusterRequest.prototype.jobs = $util.emptyArray; - - /** - * DiagnoseClusterRequest yarnApplicationIds. - * @member {Array.} yarnApplicationIds - * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest - * @instance - */ - DiagnoseClusterRequest.prototype.yarnApplicationIds = $util.emptyArray; - - /** - * Creates a new DiagnoseClusterRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest - * @static - * @param {google.cloud.dataproc.v1.IDiagnoseClusterRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.DiagnoseClusterRequest} DiagnoseClusterRequest instance - */ - DiagnoseClusterRequest.create = function create(properties) { - return new DiagnoseClusterRequest(properties); - }; - - /** - * Encodes the specified DiagnoseClusterRequest message. Does not implicitly {@link google.cloud.dataproc.v1.DiagnoseClusterRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest - * @static - * @param {google.cloud.dataproc.v1.IDiagnoseClusterRequest} message DiagnoseClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DiagnoseClusterRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterName); - if (message.region != null && Object.hasOwnProperty.call(message, "region")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.region); - if (message.tarballGcsDir != null && Object.hasOwnProperty.call(message, "tarballGcsDir")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.tarballGcsDir); - if (message.tarballAccess != null && Object.hasOwnProperty.call(message, "tarballAccess")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.tarballAccess); - if (message.diagnosisInterval != null && Object.hasOwnProperty.call(message, "diagnosisInterval")) - $root.google.type.Interval.encode(message.diagnosisInterval, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.jobs != null && message.jobs.length) - for (var i = 0; i < message.jobs.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.jobs[i]); - if (message.yarnApplicationIds != null && message.yarnApplicationIds.length) - for (var i = 0; i < message.yarnApplicationIds.length; ++i) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.yarnApplicationIds[i]); - return writer; - }; - - /** - * Encodes the specified DiagnoseClusterRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DiagnoseClusterRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest - * @static - * @param {google.cloud.dataproc.v1.IDiagnoseClusterRequest} message DiagnoseClusterRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DiagnoseClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DiagnoseClusterRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.DiagnoseClusterRequest} DiagnoseClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DiagnoseClusterRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.DiagnoseClusterRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.projectId = reader.string(); - break; - } - case 3: { - message.region = reader.string(); - break; - } - case 2: { - message.clusterName = reader.string(); - break; - } - case 4: { - message.tarballGcsDir = reader.string(); - break; - } - case 5: { - message.tarballAccess = reader.int32(); - break; - } - case 6: { - message.diagnosisInterval = $root.google.type.Interval.decode(reader, reader.uint32()); - break; - } - case 10: { - if (!(message.jobs && message.jobs.length)) - message.jobs = []; - message.jobs.push(reader.string()); - break; - } - case 11: { - if (!(message.yarnApplicationIds && message.yarnApplicationIds.length)) - message.yarnApplicationIds = []; - message.yarnApplicationIds.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DiagnoseClusterRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.DiagnoseClusterRequest} DiagnoseClusterRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DiagnoseClusterRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DiagnoseClusterRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DiagnoseClusterRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.region != null && message.hasOwnProperty("region")) - if (!$util.isString(message.region)) - return "region: string expected"; - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - if (!$util.isString(message.clusterName)) - return "clusterName: string expected"; - if (message.tarballGcsDir != null && message.hasOwnProperty("tarballGcsDir")) - if (!$util.isString(message.tarballGcsDir)) - return "tarballGcsDir: string expected"; - if (message.tarballAccess != null && message.hasOwnProperty("tarballAccess")) - switch (message.tarballAccess) { - default: - return "tarballAccess: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.diagnosisInterval != null && message.hasOwnProperty("diagnosisInterval")) { - var error = $root.google.type.Interval.verify(message.diagnosisInterval); - if (error) - return "diagnosisInterval." + error; - } - 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) - if (!$util.isString(message.jobs[i])) - return "jobs: string[] expected"; - } - if (message.yarnApplicationIds != null && message.hasOwnProperty("yarnApplicationIds")) { - if (!Array.isArray(message.yarnApplicationIds)) - return "yarnApplicationIds: array expected"; - for (var i = 0; i < message.yarnApplicationIds.length; ++i) - if (!$util.isString(message.yarnApplicationIds[i])) - return "yarnApplicationIds: string[] expected"; - } - return null; - }; - - /** - * Creates a DiagnoseClusterRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.DiagnoseClusterRequest} DiagnoseClusterRequest - */ - DiagnoseClusterRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.DiagnoseClusterRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.DiagnoseClusterRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.region != null) - message.region = String(object.region); - if (object.clusterName != null) - message.clusterName = String(object.clusterName); - if (object.tarballGcsDir != null) - message.tarballGcsDir = String(object.tarballGcsDir); - switch (object.tarballAccess) { - default: - if (typeof object.tarballAccess === "number") { - message.tarballAccess = object.tarballAccess; - break; - } - break; - case "TARBALL_ACCESS_UNSPECIFIED": - case 0: - message.tarballAccess = 0; - break; - case "GOOGLE_CLOUD_SUPPORT": - case 1: - message.tarballAccess = 1; - break; - case "GOOGLE_DATAPROC_DIAGNOSE": - case 2: - message.tarballAccess = 2; - break; - } - if (object.diagnosisInterval != null) { - if (typeof object.diagnosisInterval !== "object") - throw TypeError(".google.cloud.dataproc.v1.DiagnoseClusterRequest.diagnosisInterval: object expected"); - message.diagnosisInterval = $root.google.type.Interval.fromObject(object.diagnosisInterval); - } - if (object.jobs) { - if (!Array.isArray(object.jobs)) - throw TypeError(".google.cloud.dataproc.v1.DiagnoseClusterRequest.jobs: array expected"); - message.jobs = []; - for (var i = 0; i < object.jobs.length; ++i) - message.jobs[i] = String(object.jobs[i]); - } - if (object.yarnApplicationIds) { - if (!Array.isArray(object.yarnApplicationIds)) - throw TypeError(".google.cloud.dataproc.v1.DiagnoseClusterRequest.yarnApplicationIds: array expected"); - message.yarnApplicationIds = []; - for (var i = 0; i < object.yarnApplicationIds.length; ++i) - message.yarnApplicationIds[i] = String(object.yarnApplicationIds[i]); - } - return message; - }; - - /** - * Creates a plain object from a DiagnoseClusterRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest - * @static - * @param {google.cloud.dataproc.v1.DiagnoseClusterRequest} message DiagnoseClusterRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DiagnoseClusterRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.jobs = []; - object.yarnApplicationIds = []; - } - if (options.defaults) { - object.projectId = ""; - object.clusterName = ""; - object.region = ""; - object.tarballGcsDir = ""; - object.tarballAccess = options.enums === String ? "TARBALL_ACCESS_UNSPECIFIED" : 0; - object.diagnosisInterval = null; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - object.clusterName = message.clusterName; - if (message.region != null && message.hasOwnProperty("region")) - object.region = message.region; - if (message.tarballGcsDir != null && message.hasOwnProperty("tarballGcsDir")) - object.tarballGcsDir = message.tarballGcsDir; - if (message.tarballAccess != null && message.hasOwnProperty("tarballAccess")) - object.tarballAccess = options.enums === String ? $root.google.cloud.dataproc.v1.DiagnoseClusterRequest.TarballAccess[message.tarballAccess] === undefined ? message.tarballAccess : $root.google.cloud.dataproc.v1.DiagnoseClusterRequest.TarballAccess[message.tarballAccess] : message.tarballAccess; - if (message.diagnosisInterval != null && message.hasOwnProperty("diagnosisInterval")) - object.diagnosisInterval = $root.google.type.Interval.toObject(message.diagnosisInterval, options); - if (message.jobs && message.jobs.length) { - object.jobs = []; - for (var j = 0; j < message.jobs.length; ++j) - object.jobs[j] = message.jobs[j]; - } - if (message.yarnApplicationIds && message.yarnApplicationIds.length) { - object.yarnApplicationIds = []; - for (var j = 0; j < message.yarnApplicationIds.length; ++j) - object.yarnApplicationIds[j] = message.yarnApplicationIds[j]; - } - return object; - }; - - /** - * Converts this DiagnoseClusterRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest - * @instance - * @returns {Object.} JSON object - */ - DiagnoseClusterRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DiagnoseClusterRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.DiagnoseClusterRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DiagnoseClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.DiagnoseClusterRequest"; - }; - - /** - * TarballAccess enum. - * @name google.cloud.dataproc.v1.DiagnoseClusterRequest.TarballAccess - * @enum {number} - * @property {number} TARBALL_ACCESS_UNSPECIFIED=0 TARBALL_ACCESS_UNSPECIFIED value - * @property {number} GOOGLE_CLOUD_SUPPORT=1 GOOGLE_CLOUD_SUPPORT value - * @property {number} GOOGLE_DATAPROC_DIAGNOSE=2 GOOGLE_DATAPROC_DIAGNOSE value - */ - DiagnoseClusterRequest.TarballAccess = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TARBALL_ACCESS_UNSPECIFIED"] = 0; - values[valuesById[1] = "GOOGLE_CLOUD_SUPPORT"] = 1; - values[valuesById[2] = "GOOGLE_DATAPROC_DIAGNOSE"] = 2; - return values; - })(); - - return DiagnoseClusterRequest; - })(); - - v1.DiagnoseClusterResults = (function() { - - /** - * Properties of a DiagnoseClusterResults. - * @memberof google.cloud.dataproc.v1 - * @interface IDiagnoseClusterResults - * @property {string|null} [outputUri] DiagnoseClusterResults outputUri - */ - - /** - * Constructs a new DiagnoseClusterResults. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a DiagnoseClusterResults. - * @implements IDiagnoseClusterResults - * @constructor - * @param {google.cloud.dataproc.v1.IDiagnoseClusterResults=} [properties] Properties to set - */ - function DiagnoseClusterResults(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DiagnoseClusterResults outputUri. - * @member {string} outputUri - * @memberof google.cloud.dataproc.v1.DiagnoseClusterResults - * @instance - */ - DiagnoseClusterResults.prototype.outputUri = ""; - - /** - * Creates a new DiagnoseClusterResults instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.DiagnoseClusterResults - * @static - * @param {google.cloud.dataproc.v1.IDiagnoseClusterResults=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.DiagnoseClusterResults} DiagnoseClusterResults instance - */ - DiagnoseClusterResults.create = function create(properties) { - return new DiagnoseClusterResults(properties); - }; - - /** - * Encodes the specified DiagnoseClusterResults message. Does not implicitly {@link google.cloud.dataproc.v1.DiagnoseClusterResults.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.DiagnoseClusterResults - * @static - * @param {google.cloud.dataproc.v1.IDiagnoseClusterResults} message DiagnoseClusterResults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DiagnoseClusterResults.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.outputUri != null && Object.hasOwnProperty.call(message, "outputUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.outputUri); - return writer; - }; - - /** - * Encodes the specified DiagnoseClusterResults message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DiagnoseClusterResults.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.DiagnoseClusterResults - * @static - * @param {google.cloud.dataproc.v1.IDiagnoseClusterResults} message DiagnoseClusterResults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DiagnoseClusterResults.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DiagnoseClusterResults message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.DiagnoseClusterResults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.DiagnoseClusterResults} DiagnoseClusterResults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DiagnoseClusterResults.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.DiagnoseClusterResults(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.outputUri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DiagnoseClusterResults message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.DiagnoseClusterResults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.DiagnoseClusterResults} DiagnoseClusterResults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DiagnoseClusterResults.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DiagnoseClusterResults message. - * @function verify - * @memberof google.cloud.dataproc.v1.DiagnoseClusterResults - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DiagnoseClusterResults.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.outputUri != null && message.hasOwnProperty("outputUri")) - if (!$util.isString(message.outputUri)) - return "outputUri: string expected"; - return null; - }; - - /** - * Creates a DiagnoseClusterResults message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.DiagnoseClusterResults - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.DiagnoseClusterResults} DiagnoseClusterResults - */ - DiagnoseClusterResults.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.DiagnoseClusterResults) - return object; - var message = new $root.google.cloud.dataproc.v1.DiagnoseClusterResults(); - if (object.outputUri != null) - message.outputUri = String(object.outputUri); - return message; - }; - - /** - * Creates a plain object from a DiagnoseClusterResults message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.DiagnoseClusterResults - * @static - * @param {google.cloud.dataproc.v1.DiagnoseClusterResults} message DiagnoseClusterResults - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DiagnoseClusterResults.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.outputUri = ""; - if (message.outputUri != null && message.hasOwnProperty("outputUri")) - object.outputUri = message.outputUri; - return object; - }; - - /** - * Converts this DiagnoseClusterResults to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.DiagnoseClusterResults - * @instance - * @returns {Object.} JSON object - */ - DiagnoseClusterResults.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DiagnoseClusterResults - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.DiagnoseClusterResults - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DiagnoseClusterResults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.DiagnoseClusterResults"; - }; - - return DiagnoseClusterResults; - })(); - - v1.ReservationAffinity = (function() { - - /** - * Properties of a ReservationAffinity. - * @memberof google.cloud.dataproc.v1 - * @interface IReservationAffinity - * @property {google.cloud.dataproc.v1.ReservationAffinity.Type|null} [consumeReservationType] ReservationAffinity consumeReservationType - * @property {string|null} [key] ReservationAffinity key - * @property {Array.|null} [values] ReservationAffinity values - */ - - /** - * Constructs a new ReservationAffinity. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a ReservationAffinity. - * @implements IReservationAffinity - * @constructor - * @param {google.cloud.dataproc.v1.IReservationAffinity=} [properties] Properties to set - */ - function ReservationAffinity(properties) { - this.values = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReservationAffinity consumeReservationType. - * @member {google.cloud.dataproc.v1.ReservationAffinity.Type} consumeReservationType - * @memberof google.cloud.dataproc.v1.ReservationAffinity - * @instance - */ - ReservationAffinity.prototype.consumeReservationType = 0; - - /** - * ReservationAffinity key. - * @member {string} key - * @memberof google.cloud.dataproc.v1.ReservationAffinity - * @instance - */ - ReservationAffinity.prototype.key = ""; - - /** - * ReservationAffinity values. - * @member {Array.} values - * @memberof google.cloud.dataproc.v1.ReservationAffinity - * @instance - */ - ReservationAffinity.prototype.values = $util.emptyArray; - - /** - * Creates a new ReservationAffinity instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.ReservationAffinity - * @static - * @param {google.cloud.dataproc.v1.IReservationAffinity=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.ReservationAffinity} ReservationAffinity instance - */ - ReservationAffinity.create = function create(properties) { - return new ReservationAffinity(properties); - }; - - /** - * Encodes the specified ReservationAffinity message. Does not implicitly {@link google.cloud.dataproc.v1.ReservationAffinity.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.ReservationAffinity - * @static - * @param {google.cloud.dataproc.v1.IReservationAffinity} message ReservationAffinity message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservationAffinity.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.consumeReservationType != null && Object.hasOwnProperty.call(message, "consumeReservationType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.consumeReservationType); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.key); - if (message.values != null && message.values.length) - for (var i = 0; i < message.values.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.values[i]); - return writer; - }; - - /** - * Encodes the specified ReservationAffinity message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ReservationAffinity.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.ReservationAffinity - * @static - * @param {google.cloud.dataproc.v1.IReservationAffinity} message ReservationAffinity message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservationAffinity.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReservationAffinity message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.ReservationAffinity - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.ReservationAffinity} ReservationAffinity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservationAffinity.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ReservationAffinity(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.consumeReservationType = reader.int32(); - break; - } - case 2: { - message.key = reader.string(); - break; - } - case 3: { - if (!(message.values && message.values.length)) - message.values = []; - message.values.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReservationAffinity message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.ReservationAffinity - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.ReservationAffinity} ReservationAffinity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservationAffinity.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReservationAffinity message. - * @function verify - * @memberof google.cloud.dataproc.v1.ReservationAffinity - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReservationAffinity.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.consumeReservationType != null && message.hasOwnProperty("consumeReservationType")) - switch (message.consumeReservationType) { - default: - return "consumeReservationType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.key != null && message.hasOwnProperty("key")) - if (!$util.isString(message.key)) - return "key: string expected"; - if (message.values != null && message.hasOwnProperty("values")) { - if (!Array.isArray(message.values)) - return "values: array expected"; - for (var i = 0; i < message.values.length; ++i) - if (!$util.isString(message.values[i])) - return "values: string[] expected"; - } - return null; - }; - - /** - * Creates a ReservationAffinity message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.ReservationAffinity - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.ReservationAffinity} ReservationAffinity - */ - ReservationAffinity.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.ReservationAffinity) - return object; - var message = new $root.google.cloud.dataproc.v1.ReservationAffinity(); - switch (object.consumeReservationType) { - default: - if (typeof object.consumeReservationType === "number") { - message.consumeReservationType = object.consumeReservationType; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.consumeReservationType = 0; - break; - case "NO_RESERVATION": - case 1: - message.consumeReservationType = 1; - break; - case "ANY_RESERVATION": - case 2: - message.consumeReservationType = 2; - break; - case "SPECIFIC_RESERVATION": - case 3: - message.consumeReservationType = 3; - break; - } - if (object.key != null) - message.key = String(object.key); - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.cloud.dataproc.v1.ReservationAffinity.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) - message.values[i] = String(object.values[i]); - } - return message; - }; - - /** - * Creates a plain object from a ReservationAffinity message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.ReservationAffinity - * @static - * @param {google.cloud.dataproc.v1.ReservationAffinity} message ReservationAffinity - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReservationAffinity.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.values = []; - if (options.defaults) { - object.consumeReservationType = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.key = ""; - } - if (message.consumeReservationType != null && message.hasOwnProperty("consumeReservationType")) - object.consumeReservationType = options.enums === String ? $root.google.cloud.dataproc.v1.ReservationAffinity.Type[message.consumeReservationType] === undefined ? message.consumeReservationType : $root.google.cloud.dataproc.v1.ReservationAffinity.Type[message.consumeReservationType] : message.consumeReservationType; - if (message.key != null && message.hasOwnProperty("key")) - object.key = message.key; - if (message.values && message.values.length) { - object.values = []; - for (var j = 0; j < message.values.length; ++j) - object.values[j] = message.values[j]; - } - return object; - }; - - /** - * Converts this ReservationAffinity to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.ReservationAffinity - * @instance - * @returns {Object.} JSON object - */ - ReservationAffinity.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReservationAffinity - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.ReservationAffinity - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReservationAffinity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.ReservationAffinity"; - }; - - /** - * Type enum. - * @name google.cloud.dataproc.v1.ReservationAffinity.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} NO_RESERVATION=1 NO_RESERVATION value - * @property {number} ANY_RESERVATION=2 ANY_RESERVATION value - * @property {number} SPECIFIC_RESERVATION=3 SPECIFIC_RESERVATION value - */ - ReservationAffinity.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "NO_RESERVATION"] = 1; - values[valuesById[2] = "ANY_RESERVATION"] = 2; - values[valuesById[3] = "SPECIFIC_RESERVATION"] = 3; - return values; - })(); - - return ReservationAffinity; - })(); - - v1.BatchOperationMetadata = (function() { - - /** - * Properties of a BatchOperationMetadata. - * @memberof google.cloud.dataproc.v1 - * @interface IBatchOperationMetadata - * @property {string|null} [batch] BatchOperationMetadata batch - * @property {string|null} [batchUuid] BatchOperationMetadata batchUuid - * @property {google.protobuf.ITimestamp|null} [createTime] BatchOperationMetadata createTime - * @property {google.protobuf.ITimestamp|null} [doneTime] BatchOperationMetadata doneTime - * @property {google.cloud.dataproc.v1.BatchOperationMetadata.BatchOperationType|null} [operationType] BatchOperationMetadata operationType - * @property {string|null} [description] BatchOperationMetadata description - * @property {Object.|null} [labels] BatchOperationMetadata labels - * @property {Array.|null} [warnings] BatchOperationMetadata warnings - */ - - /** - * Constructs a new BatchOperationMetadata. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a BatchOperationMetadata. - * @implements IBatchOperationMetadata - * @constructor - * @param {google.cloud.dataproc.v1.IBatchOperationMetadata=} [properties] Properties to set - */ - function BatchOperationMetadata(properties) { - this.labels = {}; - this.warnings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchOperationMetadata batch. - * @member {string} batch - * @memberof google.cloud.dataproc.v1.BatchOperationMetadata - * @instance - */ - BatchOperationMetadata.prototype.batch = ""; - - /** - * BatchOperationMetadata batchUuid. - * @member {string} batchUuid - * @memberof google.cloud.dataproc.v1.BatchOperationMetadata - * @instance - */ - BatchOperationMetadata.prototype.batchUuid = ""; - - /** - * BatchOperationMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.dataproc.v1.BatchOperationMetadata - * @instance - */ - BatchOperationMetadata.prototype.createTime = null; - - /** - * BatchOperationMetadata doneTime. - * @member {google.protobuf.ITimestamp|null|undefined} doneTime - * @memberof google.cloud.dataproc.v1.BatchOperationMetadata - * @instance - */ - BatchOperationMetadata.prototype.doneTime = null; - - /** - * BatchOperationMetadata operationType. - * @member {google.cloud.dataproc.v1.BatchOperationMetadata.BatchOperationType} operationType - * @memberof google.cloud.dataproc.v1.BatchOperationMetadata - * @instance - */ - BatchOperationMetadata.prototype.operationType = 0; - - /** - * BatchOperationMetadata description. - * @member {string} description - * @memberof google.cloud.dataproc.v1.BatchOperationMetadata - * @instance - */ - BatchOperationMetadata.prototype.description = ""; - - /** - * BatchOperationMetadata labels. - * @member {Object.} labels - * @memberof google.cloud.dataproc.v1.BatchOperationMetadata - * @instance - */ - BatchOperationMetadata.prototype.labels = $util.emptyObject; - - /** - * BatchOperationMetadata warnings. - * @member {Array.} warnings - * @memberof google.cloud.dataproc.v1.BatchOperationMetadata - * @instance - */ - BatchOperationMetadata.prototype.warnings = $util.emptyArray; - - /** - * Creates a new BatchOperationMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.BatchOperationMetadata - * @static - * @param {google.cloud.dataproc.v1.IBatchOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.BatchOperationMetadata} BatchOperationMetadata instance - */ - BatchOperationMetadata.create = function create(properties) { - return new BatchOperationMetadata(properties); - }; - - /** - * Encodes the specified BatchOperationMetadata message. Does not implicitly {@link google.cloud.dataproc.v1.BatchOperationMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.BatchOperationMetadata - * @static - * @param {google.cloud.dataproc.v1.IBatchOperationMetadata} message BatchOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchOperationMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.batch != null && Object.hasOwnProperty.call(message, "batch")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.batch); - if (message.batchUuid != null && Object.hasOwnProperty.call(message, "batchUuid")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.batchUuid); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.doneTime != null && Object.hasOwnProperty.call(message, "doneTime")) - $root.google.protobuf.Timestamp.encode(message.doneTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.operationType != null && Object.hasOwnProperty.call(message, "operationType")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.operationType); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.description); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.warnings != null && message.warnings.length) - for (var i = 0; i < message.warnings.length; ++i) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.warnings[i]); - return writer; - }; - - /** - * Encodes the specified BatchOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.BatchOperationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.BatchOperationMetadata - * @static - * @param {google.cloud.dataproc.v1.IBatchOperationMetadata} message BatchOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BatchOperationMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.BatchOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.BatchOperationMetadata} BatchOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchOperationMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.BatchOperationMetadata(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.batch = reader.string(); - break; - } - case 2: { - message.batchUuid = reader.string(); - break; - } - case 3: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.doneTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.operationType = reader.int32(); - break; - } - case 7: { - message.description = reader.string(); - break; - } - case 8: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 9: { - if (!(message.warnings && message.warnings.length)) - message.warnings = []; - message.warnings.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BatchOperationMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.BatchOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.BatchOperationMetadata} BatchOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchOperationMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchOperationMetadata message. - * @function verify - * @memberof google.cloud.dataproc.v1.BatchOperationMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchOperationMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.batch != null && message.hasOwnProperty("batch")) - if (!$util.isString(message.batch)) - return "batch: string expected"; - if (message.batchUuid != null && message.hasOwnProperty("batchUuid")) - if (!$util.isString(message.batchUuid)) - return "batchUuid: 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.doneTime != null && message.hasOwnProperty("doneTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.doneTime); - if (error) - return "doneTime." + error; - } - if (message.operationType != null && message.hasOwnProperty("operationType")) - switch (message.operationType) { - default: - return "operationType: enum value expected"; - case 0: - case 1: - break; - } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: 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.warnings != null && message.hasOwnProperty("warnings")) { - if (!Array.isArray(message.warnings)) - return "warnings: array expected"; - for (var i = 0; i < message.warnings.length; ++i) - if (!$util.isString(message.warnings[i])) - return "warnings: string[] expected"; - } - return null; - }; - - /** - * Creates a BatchOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.BatchOperationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.BatchOperationMetadata} BatchOperationMetadata - */ - BatchOperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.BatchOperationMetadata) - return object; - var message = new $root.google.cloud.dataproc.v1.BatchOperationMetadata(); - if (object.batch != null) - message.batch = String(object.batch); - if (object.batchUuid != null) - message.batchUuid = String(object.batchUuid); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.dataproc.v1.BatchOperationMetadata.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.doneTime != null) { - if (typeof object.doneTime !== "object") - throw TypeError(".google.cloud.dataproc.v1.BatchOperationMetadata.doneTime: object expected"); - message.doneTime = $root.google.protobuf.Timestamp.fromObject(object.doneTime); - } - switch (object.operationType) { - default: - if (typeof object.operationType === "number") { - message.operationType = object.operationType; - break; - } - break; - case "BATCH_OPERATION_TYPE_UNSPECIFIED": - case 0: - message.operationType = 0; - break; - case "BATCH": - case 1: - message.operationType = 1; - break; - } - if (object.description != null) - message.description = String(object.description); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.dataproc.v1.BatchOperationMetadata.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.warnings) { - if (!Array.isArray(object.warnings)) - throw TypeError(".google.cloud.dataproc.v1.BatchOperationMetadata.warnings: array expected"); - message.warnings = []; - for (var i = 0; i < object.warnings.length; ++i) - message.warnings[i] = String(object.warnings[i]); - } - return message; - }; - - /** - * Creates a plain object from a BatchOperationMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.BatchOperationMetadata - * @static - * @param {google.cloud.dataproc.v1.BatchOperationMetadata} message BatchOperationMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchOperationMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.warnings = []; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.batch = ""; - object.batchUuid = ""; - object.createTime = null; - object.doneTime = null; - object.operationType = options.enums === String ? "BATCH_OPERATION_TYPE_UNSPECIFIED" : 0; - object.description = ""; - } - if (message.batch != null && message.hasOwnProperty("batch")) - object.batch = message.batch; - if (message.batchUuid != null && message.hasOwnProperty("batchUuid")) - object.batchUuid = message.batchUuid; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.doneTime != null && message.hasOwnProperty("doneTime")) - object.doneTime = $root.google.protobuf.Timestamp.toObject(message.doneTime, options); - if (message.operationType != null && message.hasOwnProperty("operationType")) - object.operationType = options.enums === String ? $root.google.cloud.dataproc.v1.BatchOperationMetadata.BatchOperationType[message.operationType] === undefined ? message.operationType : $root.google.cloud.dataproc.v1.BatchOperationMetadata.BatchOperationType[message.operationType] : message.operationType; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - 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.warnings && message.warnings.length) { - object.warnings = []; - for (var j = 0; j < message.warnings.length; ++j) - object.warnings[j] = message.warnings[j]; - } - return object; - }; - - /** - * Converts this BatchOperationMetadata to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.BatchOperationMetadata - * @instance - * @returns {Object.} JSON object - */ - BatchOperationMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BatchOperationMetadata - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.BatchOperationMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BatchOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.BatchOperationMetadata"; - }; - - /** - * BatchOperationType enum. - * @name google.cloud.dataproc.v1.BatchOperationMetadata.BatchOperationType - * @enum {number} - * @property {number} BATCH_OPERATION_TYPE_UNSPECIFIED=0 BATCH_OPERATION_TYPE_UNSPECIFIED value - * @property {number} BATCH=1 BATCH value - */ - BatchOperationMetadata.BatchOperationType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "BATCH_OPERATION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "BATCH"] = 1; - return values; - })(); - - return BatchOperationMetadata; - })(); - - v1.SessionOperationMetadata = (function() { - - /** - * Properties of a SessionOperationMetadata. - * @memberof google.cloud.dataproc.v1 - * @interface ISessionOperationMetadata - * @property {string|null} [session] SessionOperationMetadata session - * @property {string|null} [sessionUuid] SessionOperationMetadata sessionUuid - * @property {google.protobuf.ITimestamp|null} [createTime] SessionOperationMetadata createTime - * @property {google.protobuf.ITimestamp|null} [doneTime] SessionOperationMetadata doneTime - * @property {google.cloud.dataproc.v1.SessionOperationMetadata.SessionOperationType|null} [operationType] SessionOperationMetadata operationType - * @property {string|null} [description] SessionOperationMetadata description - * @property {Object.|null} [labels] SessionOperationMetadata labels - * @property {Array.|null} [warnings] SessionOperationMetadata warnings - */ - - /** - * Constructs a new SessionOperationMetadata. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a SessionOperationMetadata. - * @implements ISessionOperationMetadata - * @constructor - * @param {google.cloud.dataproc.v1.ISessionOperationMetadata=} [properties] Properties to set - */ - function SessionOperationMetadata(properties) { - this.labels = {}; - this.warnings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SessionOperationMetadata session. - * @member {string} session - * @memberof google.cloud.dataproc.v1.SessionOperationMetadata - * @instance - */ - SessionOperationMetadata.prototype.session = ""; - - /** - * SessionOperationMetadata sessionUuid. - * @member {string} sessionUuid - * @memberof google.cloud.dataproc.v1.SessionOperationMetadata - * @instance - */ - SessionOperationMetadata.prototype.sessionUuid = ""; - - /** - * SessionOperationMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.dataproc.v1.SessionOperationMetadata - * @instance - */ - SessionOperationMetadata.prototype.createTime = null; - - /** - * SessionOperationMetadata doneTime. - * @member {google.protobuf.ITimestamp|null|undefined} doneTime - * @memberof google.cloud.dataproc.v1.SessionOperationMetadata - * @instance - */ - SessionOperationMetadata.prototype.doneTime = null; - - /** - * SessionOperationMetadata operationType. - * @member {google.cloud.dataproc.v1.SessionOperationMetadata.SessionOperationType} operationType - * @memberof google.cloud.dataproc.v1.SessionOperationMetadata - * @instance - */ - SessionOperationMetadata.prototype.operationType = 0; - - /** - * SessionOperationMetadata description. - * @member {string} description - * @memberof google.cloud.dataproc.v1.SessionOperationMetadata - * @instance - */ - SessionOperationMetadata.prototype.description = ""; - - /** - * SessionOperationMetadata labels. - * @member {Object.} labels - * @memberof google.cloud.dataproc.v1.SessionOperationMetadata - * @instance - */ - SessionOperationMetadata.prototype.labels = $util.emptyObject; - - /** - * SessionOperationMetadata warnings. - * @member {Array.} warnings - * @memberof google.cloud.dataproc.v1.SessionOperationMetadata - * @instance - */ - SessionOperationMetadata.prototype.warnings = $util.emptyArray; - - /** - * Creates a new SessionOperationMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.SessionOperationMetadata - * @static - * @param {google.cloud.dataproc.v1.ISessionOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.SessionOperationMetadata} SessionOperationMetadata instance - */ - SessionOperationMetadata.create = function create(properties) { - return new SessionOperationMetadata(properties); - }; - - /** - * Encodes the specified SessionOperationMetadata message. Does not implicitly {@link google.cloud.dataproc.v1.SessionOperationMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.SessionOperationMetadata - * @static - * @param {google.cloud.dataproc.v1.ISessionOperationMetadata} message SessionOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SessionOperationMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.session != null && Object.hasOwnProperty.call(message, "session")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); - if (message.sessionUuid != null && Object.hasOwnProperty.call(message, "sessionUuid")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sessionUuid); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.doneTime != null && Object.hasOwnProperty.call(message, "doneTime")) - $root.google.protobuf.Timestamp.encode(message.doneTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.operationType != null && Object.hasOwnProperty.call(message, "operationType")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.operationType); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.description); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.warnings != null && message.warnings.length) - for (var i = 0; i < message.warnings.length; ++i) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.warnings[i]); - return writer; - }; - - /** - * Encodes the specified SessionOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SessionOperationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.SessionOperationMetadata - * @static - * @param {google.cloud.dataproc.v1.ISessionOperationMetadata} message SessionOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SessionOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SessionOperationMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.SessionOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.SessionOperationMetadata} SessionOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SessionOperationMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.SessionOperationMetadata(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.session = reader.string(); - break; - } - case 2: { - message.sessionUuid = reader.string(); - break; - } - case 3: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.doneTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.operationType = reader.int32(); - break; - } - case 7: { - message.description = reader.string(); - break; - } - case 8: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 9: { - if (!(message.warnings && message.warnings.length)) - message.warnings = []; - message.warnings.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SessionOperationMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.SessionOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.SessionOperationMetadata} SessionOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SessionOperationMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SessionOperationMetadata message. - * @function verify - * @memberof google.cloud.dataproc.v1.SessionOperationMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SessionOperationMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.session != null && message.hasOwnProperty("session")) - if (!$util.isString(message.session)) - return "session: string expected"; - if (message.sessionUuid != null && message.hasOwnProperty("sessionUuid")) - if (!$util.isString(message.sessionUuid)) - return "sessionUuid: 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.doneTime != null && message.hasOwnProperty("doneTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.doneTime); - if (error) - return "doneTime." + error; - } - if (message.operationType != null && message.hasOwnProperty("operationType")) - switch (message.operationType) { - default: - return "operationType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: 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.warnings != null && message.hasOwnProperty("warnings")) { - if (!Array.isArray(message.warnings)) - return "warnings: array expected"; - for (var i = 0; i < message.warnings.length; ++i) - if (!$util.isString(message.warnings[i])) - return "warnings: string[] expected"; - } - return null; - }; - - /** - * Creates a SessionOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.SessionOperationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.SessionOperationMetadata} SessionOperationMetadata - */ - SessionOperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.SessionOperationMetadata) - return object; - var message = new $root.google.cloud.dataproc.v1.SessionOperationMetadata(); - if (object.session != null) - message.session = String(object.session); - if (object.sessionUuid != null) - message.sessionUuid = String(object.sessionUuid); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.dataproc.v1.SessionOperationMetadata.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.doneTime != null) { - if (typeof object.doneTime !== "object") - throw TypeError(".google.cloud.dataproc.v1.SessionOperationMetadata.doneTime: object expected"); - message.doneTime = $root.google.protobuf.Timestamp.fromObject(object.doneTime); - } - switch (object.operationType) { - default: - if (typeof object.operationType === "number") { - message.operationType = object.operationType; - break; - } - break; - case "SESSION_OPERATION_TYPE_UNSPECIFIED": - case 0: - message.operationType = 0; - break; - case "CREATE": - case 1: - message.operationType = 1; - break; - case "TERMINATE": - case 2: - message.operationType = 2; - break; - case "DELETE": - case 3: - message.operationType = 3; - break; - } - if (object.description != null) - message.description = String(object.description); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.dataproc.v1.SessionOperationMetadata.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.warnings) { - if (!Array.isArray(object.warnings)) - throw TypeError(".google.cloud.dataproc.v1.SessionOperationMetadata.warnings: array expected"); - message.warnings = []; - for (var i = 0; i < object.warnings.length; ++i) - message.warnings[i] = String(object.warnings[i]); - } - return message; - }; - - /** - * Creates a plain object from a SessionOperationMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.SessionOperationMetadata - * @static - * @param {google.cloud.dataproc.v1.SessionOperationMetadata} message SessionOperationMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SessionOperationMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.warnings = []; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.session = ""; - object.sessionUuid = ""; - object.createTime = null; - object.doneTime = null; - object.operationType = options.enums === String ? "SESSION_OPERATION_TYPE_UNSPECIFIED" : 0; - object.description = ""; - } - if (message.session != null && message.hasOwnProperty("session")) - object.session = message.session; - if (message.sessionUuid != null && message.hasOwnProperty("sessionUuid")) - object.sessionUuid = message.sessionUuid; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.doneTime != null && message.hasOwnProperty("doneTime")) - object.doneTime = $root.google.protobuf.Timestamp.toObject(message.doneTime, options); - if (message.operationType != null && message.hasOwnProperty("operationType")) - object.operationType = options.enums === String ? $root.google.cloud.dataproc.v1.SessionOperationMetadata.SessionOperationType[message.operationType] === undefined ? message.operationType : $root.google.cloud.dataproc.v1.SessionOperationMetadata.SessionOperationType[message.operationType] : message.operationType; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - 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.warnings && message.warnings.length) { - object.warnings = []; - for (var j = 0; j < message.warnings.length; ++j) - object.warnings[j] = message.warnings[j]; - } - return object; - }; - - /** - * Converts this SessionOperationMetadata to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.SessionOperationMetadata - * @instance - * @returns {Object.} JSON object - */ - SessionOperationMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SessionOperationMetadata - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.SessionOperationMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SessionOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.SessionOperationMetadata"; - }; - - /** - * SessionOperationType enum. - * @name google.cloud.dataproc.v1.SessionOperationMetadata.SessionOperationType - * @enum {number} - * @property {number} SESSION_OPERATION_TYPE_UNSPECIFIED=0 SESSION_OPERATION_TYPE_UNSPECIFIED value - * @property {number} CREATE=1 CREATE value - * @property {number} TERMINATE=2 TERMINATE value - * @property {number} DELETE=3 DELETE value - */ - SessionOperationMetadata.SessionOperationType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SESSION_OPERATION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CREATE"] = 1; - values[valuesById[2] = "TERMINATE"] = 2; - values[valuesById[3] = "DELETE"] = 3; - return values; - })(); - - return SessionOperationMetadata; - })(); - - v1.ClusterOperationStatus = (function() { - - /** - * Properties of a ClusterOperationStatus. - * @memberof google.cloud.dataproc.v1 - * @interface IClusterOperationStatus - * @property {google.cloud.dataproc.v1.ClusterOperationStatus.State|null} [state] ClusterOperationStatus state - * @property {string|null} [innerState] ClusterOperationStatus innerState - * @property {string|null} [details] ClusterOperationStatus details - * @property {google.protobuf.ITimestamp|null} [stateStartTime] ClusterOperationStatus stateStartTime - */ - - /** - * Constructs a new ClusterOperationStatus. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a ClusterOperationStatus. - * @implements IClusterOperationStatus - * @constructor - * @param {google.cloud.dataproc.v1.IClusterOperationStatus=} [properties] Properties to set - */ - function ClusterOperationStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClusterOperationStatus state. - * @member {google.cloud.dataproc.v1.ClusterOperationStatus.State} state - * @memberof google.cloud.dataproc.v1.ClusterOperationStatus - * @instance - */ - ClusterOperationStatus.prototype.state = 0; - - /** - * ClusterOperationStatus innerState. - * @member {string} innerState - * @memberof google.cloud.dataproc.v1.ClusterOperationStatus - * @instance - */ - ClusterOperationStatus.prototype.innerState = ""; - - /** - * ClusterOperationStatus details. - * @member {string} details - * @memberof google.cloud.dataproc.v1.ClusterOperationStatus - * @instance - */ - ClusterOperationStatus.prototype.details = ""; - - /** - * ClusterOperationStatus stateStartTime. - * @member {google.protobuf.ITimestamp|null|undefined} stateStartTime - * @memberof google.cloud.dataproc.v1.ClusterOperationStatus - * @instance - */ - ClusterOperationStatus.prototype.stateStartTime = null; - - /** - * Creates a new ClusterOperationStatus instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.ClusterOperationStatus - * @static - * @param {google.cloud.dataproc.v1.IClusterOperationStatus=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.ClusterOperationStatus} ClusterOperationStatus instance - */ - ClusterOperationStatus.create = function create(properties) { - return new ClusterOperationStatus(properties); - }; - - /** - * Encodes the specified ClusterOperationStatus message. Does not implicitly {@link google.cloud.dataproc.v1.ClusterOperationStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.ClusterOperationStatus - * @static - * @param {google.cloud.dataproc.v1.IClusterOperationStatus} message ClusterOperationStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClusterOperationStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.innerState != null && Object.hasOwnProperty.call(message, "innerState")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.innerState); - if (message.details != null && Object.hasOwnProperty.call(message, "details")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.details); - if (message.stateStartTime != null && Object.hasOwnProperty.call(message, "stateStartTime")) - $root.google.protobuf.Timestamp.encode(message.stateStartTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClusterOperationStatus message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ClusterOperationStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.ClusterOperationStatus - * @static - * @param {google.cloud.dataproc.v1.IClusterOperationStatus} message ClusterOperationStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClusterOperationStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClusterOperationStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.ClusterOperationStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.ClusterOperationStatus} ClusterOperationStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClusterOperationStatus.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ClusterOperationStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.state = reader.int32(); - break; - } - case 2: { - message.innerState = reader.string(); - break; - } - case 3: { - message.details = reader.string(); - break; - } - case 4: { - message.stateStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClusterOperationStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.ClusterOperationStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.ClusterOperationStatus} ClusterOperationStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClusterOperationStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClusterOperationStatus message. - * @function verify - * @memberof google.cloud.dataproc.v1.ClusterOperationStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClusterOperationStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.innerState != null && message.hasOwnProperty("innerState")) - if (!$util.isString(message.innerState)) - return "innerState: string expected"; - if (message.details != null && message.hasOwnProperty("details")) - if (!$util.isString(message.details)) - return "details: string expected"; - if (message.stateStartTime != null && message.hasOwnProperty("stateStartTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.stateStartTime); - if (error) - return "stateStartTime." + error; - } - return null; - }; - - /** - * Creates a ClusterOperationStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.ClusterOperationStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.ClusterOperationStatus} ClusterOperationStatus - */ - ClusterOperationStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.ClusterOperationStatus) - return object; - var message = new $root.google.cloud.dataproc.v1.ClusterOperationStatus(); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "UNKNOWN": - case 0: - message.state = 0; - break; - case "PENDING": - case 1: - message.state = 1; - break; - case "RUNNING": - case 2: - message.state = 2; - break; - case "DONE": - case 3: - message.state = 3; - break; - } - if (object.innerState != null) - message.innerState = String(object.innerState); - if (object.details != null) - message.details = String(object.details); - if (object.stateStartTime != null) { - if (typeof object.stateStartTime !== "object") - throw TypeError(".google.cloud.dataproc.v1.ClusterOperationStatus.stateStartTime: object expected"); - message.stateStartTime = $root.google.protobuf.Timestamp.fromObject(object.stateStartTime); - } - return message; - }; - - /** - * Creates a plain object from a ClusterOperationStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.ClusterOperationStatus - * @static - * @param {google.cloud.dataproc.v1.ClusterOperationStatus} message ClusterOperationStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClusterOperationStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.state = options.enums === String ? "UNKNOWN" : 0; - object.innerState = ""; - object.details = ""; - object.stateStartTime = null; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.dataproc.v1.ClusterOperationStatus.State[message.state] === undefined ? message.state : $root.google.cloud.dataproc.v1.ClusterOperationStatus.State[message.state] : message.state; - if (message.innerState != null && message.hasOwnProperty("innerState")) - object.innerState = message.innerState; - if (message.details != null && message.hasOwnProperty("details")) - object.details = message.details; - if (message.stateStartTime != null && message.hasOwnProperty("stateStartTime")) - object.stateStartTime = $root.google.protobuf.Timestamp.toObject(message.stateStartTime, options); - return object; - }; - - /** - * Converts this ClusterOperationStatus to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.ClusterOperationStatus - * @instance - * @returns {Object.} JSON object - */ - ClusterOperationStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClusterOperationStatus - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.ClusterOperationStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClusterOperationStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.ClusterOperationStatus"; - }; - - /** - * State enum. - * @name google.cloud.dataproc.v1.ClusterOperationStatus.State - * @enum {number} - * @property {number} UNKNOWN=0 UNKNOWN value - * @property {number} PENDING=1 PENDING value - * @property {number} RUNNING=2 RUNNING value - * @property {number} DONE=3 DONE value - */ - ClusterOperationStatus.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNKNOWN"] = 0; - values[valuesById[1] = "PENDING"] = 1; - values[valuesById[2] = "RUNNING"] = 2; - values[valuesById[3] = "DONE"] = 3; - return values; - })(); - - return ClusterOperationStatus; - })(); - - v1.ClusterOperationMetadata = (function() { - - /** - * Properties of a ClusterOperationMetadata. - * @memberof google.cloud.dataproc.v1 - * @interface IClusterOperationMetadata - * @property {string|null} [clusterName] ClusterOperationMetadata clusterName - * @property {string|null} [clusterUuid] ClusterOperationMetadata clusterUuid - * @property {google.cloud.dataproc.v1.IClusterOperationStatus|null} [status] ClusterOperationMetadata status - * @property {Array.|null} [statusHistory] ClusterOperationMetadata statusHistory - * @property {string|null} [operationType] ClusterOperationMetadata operationType - * @property {string|null} [description] ClusterOperationMetadata description - * @property {Object.|null} [labels] ClusterOperationMetadata labels - * @property {Array.|null} [warnings] ClusterOperationMetadata warnings - * @property {Array.|null} [childOperationIds] ClusterOperationMetadata childOperationIds - */ - - /** - * Constructs a new ClusterOperationMetadata. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a ClusterOperationMetadata. - * @implements IClusterOperationMetadata - * @constructor - * @param {google.cloud.dataproc.v1.IClusterOperationMetadata=} [properties] Properties to set - */ - function ClusterOperationMetadata(properties) { - this.statusHistory = []; - this.labels = {}; - this.warnings = []; - this.childOperationIds = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClusterOperationMetadata clusterName. - * @member {string} clusterName - * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata - * @instance - */ - ClusterOperationMetadata.prototype.clusterName = ""; - - /** - * ClusterOperationMetadata clusterUuid. - * @member {string} clusterUuid - * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata - * @instance - */ - ClusterOperationMetadata.prototype.clusterUuid = ""; - - /** - * ClusterOperationMetadata status. - * @member {google.cloud.dataproc.v1.IClusterOperationStatus|null|undefined} status - * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata - * @instance - */ - ClusterOperationMetadata.prototype.status = null; - - /** - * ClusterOperationMetadata statusHistory. - * @member {Array.} statusHistory - * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata - * @instance - */ - ClusterOperationMetadata.prototype.statusHistory = $util.emptyArray; - - /** - * ClusterOperationMetadata operationType. - * @member {string} operationType - * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata - * @instance - */ - ClusterOperationMetadata.prototype.operationType = ""; - - /** - * ClusterOperationMetadata description. - * @member {string} description - * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata - * @instance - */ - ClusterOperationMetadata.prototype.description = ""; - - /** - * ClusterOperationMetadata labels. - * @member {Object.} labels - * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata - * @instance - */ - ClusterOperationMetadata.prototype.labels = $util.emptyObject; - - /** - * ClusterOperationMetadata warnings. - * @member {Array.} warnings - * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata - * @instance - */ - ClusterOperationMetadata.prototype.warnings = $util.emptyArray; - - /** - * ClusterOperationMetadata childOperationIds. - * @member {Array.} childOperationIds - * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata - * @instance - */ - ClusterOperationMetadata.prototype.childOperationIds = $util.emptyArray; - - /** - * Creates a new ClusterOperationMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata - * @static - * @param {google.cloud.dataproc.v1.IClusterOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.ClusterOperationMetadata} ClusterOperationMetadata instance - */ - ClusterOperationMetadata.create = function create(properties) { - return new ClusterOperationMetadata(properties); - }; - - /** - * Encodes the specified ClusterOperationMetadata message. Does not implicitly {@link google.cloud.dataproc.v1.ClusterOperationMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata - * @static - * @param {google.cloud.dataproc.v1.IClusterOperationMetadata} message ClusterOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClusterOperationMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.clusterName); - if (message.clusterUuid != null && Object.hasOwnProperty.call(message, "clusterUuid")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.clusterUuid); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.cloud.dataproc.v1.ClusterOperationStatus.encode(message.status, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.statusHistory != null && message.statusHistory.length) - for (var i = 0; i < message.statusHistory.length; ++i) - $root.google.cloud.dataproc.v1.ClusterOperationStatus.encode(message.statusHistory[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.operationType != null && Object.hasOwnProperty.call(message, "operationType")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.operationType); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.description); - 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 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.warnings != null && message.warnings.length) - for (var i = 0; i < message.warnings.length; ++i) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.warnings[i]); - if (message.childOperationIds != null && message.childOperationIds.length) - for (var i = 0; i < message.childOperationIds.length; ++i) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.childOperationIds[i]); - return writer; - }; - - /** - * Encodes the specified ClusterOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ClusterOperationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata - * @static - * @param {google.cloud.dataproc.v1.IClusterOperationMetadata} message ClusterOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClusterOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClusterOperationMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.ClusterOperationMetadata} ClusterOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClusterOperationMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ClusterOperationMetadata(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 7: { - message.clusterName = reader.string(); - break; - } - case 8: { - message.clusterUuid = reader.string(); - break; - } - case 9: { - message.status = $root.google.cloud.dataproc.v1.ClusterOperationStatus.decode(reader, reader.uint32()); - break; - } - case 10: { - if (!(message.statusHistory && message.statusHistory.length)) - message.statusHistory = []; - message.statusHistory.push($root.google.cloud.dataproc.v1.ClusterOperationStatus.decode(reader, reader.uint32())); - break; - } - case 11: { - message.operationType = reader.string(); - break; - } - case 12: { - message.description = reader.string(); - break; - } - case 13: { - 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 14: { - if (!(message.warnings && message.warnings.length)) - message.warnings = []; - message.warnings.push(reader.string()); - break; - } - case 15: { - if (!(message.childOperationIds && message.childOperationIds.length)) - message.childOperationIds = []; - message.childOperationIds.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClusterOperationMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.ClusterOperationMetadata} ClusterOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClusterOperationMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClusterOperationMetadata message. - * @function verify - * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClusterOperationMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - if (!$util.isString(message.clusterName)) - return "clusterName: string expected"; - if (message.clusterUuid != null && message.hasOwnProperty("clusterUuid")) - if (!$util.isString(message.clusterUuid)) - return "clusterUuid: string expected"; - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.google.cloud.dataproc.v1.ClusterOperationStatus.verify(message.status); - if (error) - return "status." + error; - } - if (message.statusHistory != null && message.hasOwnProperty("statusHistory")) { - if (!Array.isArray(message.statusHistory)) - return "statusHistory: array expected"; - for (var i = 0; i < message.statusHistory.length; ++i) { - var error = $root.google.cloud.dataproc.v1.ClusterOperationStatus.verify(message.statusHistory[i]); - if (error) - return "statusHistory." + error; - } - } - if (message.operationType != null && message.hasOwnProperty("operationType")) - if (!$util.isString(message.operationType)) - return "operationType: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: 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.warnings != null && message.hasOwnProperty("warnings")) { - if (!Array.isArray(message.warnings)) - return "warnings: array expected"; - for (var i = 0; i < message.warnings.length; ++i) - if (!$util.isString(message.warnings[i])) - return "warnings: string[] expected"; - } - if (message.childOperationIds != null && message.hasOwnProperty("childOperationIds")) { - if (!Array.isArray(message.childOperationIds)) - return "childOperationIds: array expected"; - for (var i = 0; i < message.childOperationIds.length; ++i) - if (!$util.isString(message.childOperationIds[i])) - return "childOperationIds: string[] expected"; - } - return null; - }; - - /** - * Creates a ClusterOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.ClusterOperationMetadata} ClusterOperationMetadata - */ - ClusterOperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.ClusterOperationMetadata) - return object; - var message = new $root.google.cloud.dataproc.v1.ClusterOperationMetadata(); - if (object.clusterName != null) - message.clusterName = String(object.clusterName); - if (object.clusterUuid != null) - message.clusterUuid = String(object.clusterUuid); - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.cloud.dataproc.v1.ClusterOperationMetadata.status: object expected"); - message.status = $root.google.cloud.dataproc.v1.ClusterOperationStatus.fromObject(object.status); - } - if (object.statusHistory) { - if (!Array.isArray(object.statusHistory)) - throw TypeError(".google.cloud.dataproc.v1.ClusterOperationMetadata.statusHistory: array expected"); - message.statusHistory = []; - for (var i = 0; i < object.statusHistory.length; ++i) { - if (typeof object.statusHistory[i] !== "object") - throw TypeError(".google.cloud.dataproc.v1.ClusterOperationMetadata.statusHistory: object expected"); - message.statusHistory[i] = $root.google.cloud.dataproc.v1.ClusterOperationStatus.fromObject(object.statusHistory[i]); - } - } - if (object.operationType != null) - message.operationType = String(object.operationType); - if (object.description != null) - message.description = String(object.description); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.dataproc.v1.ClusterOperationMetadata.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.warnings) { - if (!Array.isArray(object.warnings)) - throw TypeError(".google.cloud.dataproc.v1.ClusterOperationMetadata.warnings: array expected"); - message.warnings = []; - for (var i = 0; i < object.warnings.length; ++i) - message.warnings[i] = String(object.warnings[i]); - } - if (object.childOperationIds) { - if (!Array.isArray(object.childOperationIds)) - throw TypeError(".google.cloud.dataproc.v1.ClusterOperationMetadata.childOperationIds: array expected"); - message.childOperationIds = []; - for (var i = 0; i < object.childOperationIds.length; ++i) - message.childOperationIds[i] = String(object.childOperationIds[i]); - } - return message; - }; - - /** - * Creates a plain object from a ClusterOperationMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata - * @static - * @param {google.cloud.dataproc.v1.ClusterOperationMetadata} message ClusterOperationMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClusterOperationMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.statusHistory = []; - object.warnings = []; - object.childOperationIds = []; - } - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.clusterName = ""; - object.clusterUuid = ""; - object.status = null; - object.operationType = ""; - object.description = ""; - } - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - object.clusterName = message.clusterName; - if (message.clusterUuid != null && message.hasOwnProperty("clusterUuid")) - object.clusterUuid = message.clusterUuid; - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.cloud.dataproc.v1.ClusterOperationStatus.toObject(message.status, options); - if (message.statusHistory && message.statusHistory.length) { - object.statusHistory = []; - for (var j = 0; j < message.statusHistory.length; ++j) - object.statusHistory[j] = $root.google.cloud.dataproc.v1.ClusterOperationStatus.toObject(message.statusHistory[j], options); - } - if (message.operationType != null && message.hasOwnProperty("operationType")) - object.operationType = message.operationType; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - 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.warnings && message.warnings.length) { - object.warnings = []; - for (var j = 0; j < message.warnings.length; ++j) - object.warnings[j] = message.warnings[j]; - } - if (message.childOperationIds && message.childOperationIds.length) { - object.childOperationIds = []; - for (var j = 0; j < message.childOperationIds.length; ++j) - object.childOperationIds[j] = message.childOperationIds[j]; - } - return object; - }; - - /** - * Converts this ClusterOperationMetadata to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata - * @instance - * @returns {Object.} JSON object - */ - ClusterOperationMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClusterOperationMetadata - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.ClusterOperationMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClusterOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.ClusterOperationMetadata"; - }; - - return ClusterOperationMetadata; - })(); - - v1.NodeGroupOperationMetadata = (function() { - - /** - * Properties of a NodeGroupOperationMetadata. - * @memberof google.cloud.dataproc.v1 - * @interface INodeGroupOperationMetadata - * @property {string|null} [nodeGroupId] NodeGroupOperationMetadata nodeGroupId - * @property {string|null} [clusterUuid] NodeGroupOperationMetadata clusterUuid - * @property {google.cloud.dataproc.v1.IClusterOperationStatus|null} [status] NodeGroupOperationMetadata status - * @property {Array.|null} [statusHistory] NodeGroupOperationMetadata statusHistory - * @property {google.cloud.dataproc.v1.NodeGroupOperationMetadata.NodeGroupOperationType|null} [operationType] NodeGroupOperationMetadata operationType - * @property {string|null} [description] NodeGroupOperationMetadata description - * @property {Object.|null} [labels] NodeGroupOperationMetadata labels - * @property {Array.|null} [warnings] NodeGroupOperationMetadata warnings - */ - - /** - * Constructs a new NodeGroupOperationMetadata. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a NodeGroupOperationMetadata. - * @implements INodeGroupOperationMetadata - * @constructor - * @param {google.cloud.dataproc.v1.INodeGroupOperationMetadata=} [properties] Properties to set - */ - function NodeGroupOperationMetadata(properties) { - this.statusHistory = []; - this.labels = {}; - this.warnings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NodeGroupOperationMetadata nodeGroupId. - * @member {string} nodeGroupId - * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata - * @instance - */ - NodeGroupOperationMetadata.prototype.nodeGroupId = ""; - - /** - * NodeGroupOperationMetadata clusterUuid. - * @member {string} clusterUuid - * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata - * @instance - */ - NodeGroupOperationMetadata.prototype.clusterUuid = ""; - - /** - * NodeGroupOperationMetadata status. - * @member {google.cloud.dataproc.v1.IClusterOperationStatus|null|undefined} status - * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata - * @instance - */ - NodeGroupOperationMetadata.prototype.status = null; - - /** - * NodeGroupOperationMetadata statusHistory. - * @member {Array.} statusHistory - * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata - * @instance - */ - NodeGroupOperationMetadata.prototype.statusHistory = $util.emptyArray; - - /** - * NodeGroupOperationMetadata operationType. - * @member {google.cloud.dataproc.v1.NodeGroupOperationMetadata.NodeGroupOperationType} operationType - * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata - * @instance - */ - NodeGroupOperationMetadata.prototype.operationType = 0; - - /** - * NodeGroupOperationMetadata description. - * @member {string} description - * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata - * @instance - */ - NodeGroupOperationMetadata.prototype.description = ""; - - /** - * NodeGroupOperationMetadata labels. - * @member {Object.} labels - * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata - * @instance - */ - NodeGroupOperationMetadata.prototype.labels = $util.emptyObject; - - /** - * NodeGroupOperationMetadata warnings. - * @member {Array.} warnings - * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata - * @instance - */ - NodeGroupOperationMetadata.prototype.warnings = $util.emptyArray; - - /** - * Creates a new NodeGroupOperationMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata - * @static - * @param {google.cloud.dataproc.v1.INodeGroupOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.NodeGroupOperationMetadata} NodeGroupOperationMetadata instance - */ - NodeGroupOperationMetadata.create = function create(properties) { - return new NodeGroupOperationMetadata(properties); - }; - - /** - * Encodes the specified NodeGroupOperationMetadata message. Does not implicitly {@link google.cloud.dataproc.v1.NodeGroupOperationMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata - * @static - * @param {google.cloud.dataproc.v1.INodeGroupOperationMetadata} message NodeGroupOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeGroupOperationMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nodeGroupId != null && Object.hasOwnProperty.call(message, "nodeGroupId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.nodeGroupId); - if (message.clusterUuid != null && Object.hasOwnProperty.call(message, "clusterUuid")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterUuid); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.cloud.dataproc.v1.ClusterOperationStatus.encode(message.status, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.statusHistory != null && message.statusHistory.length) - for (var i = 0; i < message.statusHistory.length; ++i) - $root.google.cloud.dataproc.v1.ClusterOperationStatus.encode(message.statusHistory[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.operationType != null && Object.hasOwnProperty.call(message, "operationType")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.operationType); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.warnings != null && message.warnings.length) - for (var i = 0; i < message.warnings.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.warnings[i]); - return writer; - }; - - /** - * Encodes the specified NodeGroupOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.NodeGroupOperationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata - * @static - * @param {google.cloud.dataproc.v1.INodeGroupOperationMetadata} message NodeGroupOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeGroupOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NodeGroupOperationMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.NodeGroupOperationMetadata} NodeGroupOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeGroupOperationMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.NodeGroupOperationMetadata(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.nodeGroupId = reader.string(); - break; - } - case 2: { - message.clusterUuid = reader.string(); - break; - } - case 3: { - message.status = $root.google.cloud.dataproc.v1.ClusterOperationStatus.decode(reader, reader.uint32()); - break; - } - case 4: { - if (!(message.statusHistory && message.statusHistory.length)) - message.statusHistory = []; - message.statusHistory.push($root.google.cloud.dataproc.v1.ClusterOperationStatus.decode(reader, reader.uint32())); - break; - } - case 5: { - message.operationType = reader.int32(); - break; - } - case 6: { - message.description = reader.string(); - break; - } - case 7: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 8: { - if (!(message.warnings && message.warnings.length)) - message.warnings = []; - message.warnings.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NodeGroupOperationMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.NodeGroupOperationMetadata} NodeGroupOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeGroupOperationMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NodeGroupOperationMetadata message. - * @function verify - * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NodeGroupOperationMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.nodeGroupId != null && message.hasOwnProperty("nodeGroupId")) - if (!$util.isString(message.nodeGroupId)) - return "nodeGroupId: string expected"; - if (message.clusterUuid != null && message.hasOwnProperty("clusterUuid")) - if (!$util.isString(message.clusterUuid)) - return "clusterUuid: string expected"; - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.google.cloud.dataproc.v1.ClusterOperationStatus.verify(message.status); - if (error) - return "status." + error; - } - if (message.statusHistory != null && message.hasOwnProperty("statusHistory")) { - if (!Array.isArray(message.statusHistory)) - return "statusHistory: array expected"; - for (var i = 0; i < message.statusHistory.length; ++i) { - var error = $root.google.cloud.dataproc.v1.ClusterOperationStatus.verify(message.statusHistory[i]); - if (error) - return "statusHistory." + error; - } - } - if (message.operationType != null && message.hasOwnProperty("operationType")) - switch (message.operationType) { - default: - return "operationType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: 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.warnings != null && message.hasOwnProperty("warnings")) { - if (!Array.isArray(message.warnings)) - return "warnings: array expected"; - for (var i = 0; i < message.warnings.length; ++i) - if (!$util.isString(message.warnings[i])) - return "warnings: string[] expected"; - } - return null; - }; - - /** - * Creates a NodeGroupOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.NodeGroupOperationMetadata} NodeGroupOperationMetadata - */ - NodeGroupOperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.NodeGroupOperationMetadata) - return object; - var message = new $root.google.cloud.dataproc.v1.NodeGroupOperationMetadata(); - if (object.nodeGroupId != null) - message.nodeGroupId = String(object.nodeGroupId); - if (object.clusterUuid != null) - message.clusterUuid = String(object.clusterUuid); - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.cloud.dataproc.v1.NodeGroupOperationMetadata.status: object expected"); - message.status = $root.google.cloud.dataproc.v1.ClusterOperationStatus.fromObject(object.status); - } - if (object.statusHistory) { - if (!Array.isArray(object.statusHistory)) - throw TypeError(".google.cloud.dataproc.v1.NodeGroupOperationMetadata.statusHistory: array expected"); - message.statusHistory = []; - for (var i = 0; i < object.statusHistory.length; ++i) { - if (typeof object.statusHistory[i] !== "object") - throw TypeError(".google.cloud.dataproc.v1.NodeGroupOperationMetadata.statusHistory: object expected"); - message.statusHistory[i] = $root.google.cloud.dataproc.v1.ClusterOperationStatus.fromObject(object.statusHistory[i]); - } - } - switch (object.operationType) { - default: - if (typeof object.operationType === "number") { - message.operationType = object.operationType; - break; - } - break; - case "NODE_GROUP_OPERATION_TYPE_UNSPECIFIED": - case 0: - message.operationType = 0; - break; - case "CREATE": - case 1: - message.operationType = 1; - break; - case "UPDATE": - case 2: - message.operationType = 2; - break; - case "DELETE": - case 3: - message.operationType = 3; - break; - case "RESIZE": - case 4: - message.operationType = 4; - break; - } - if (object.description != null) - message.description = String(object.description); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.dataproc.v1.NodeGroupOperationMetadata.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.warnings) { - if (!Array.isArray(object.warnings)) - throw TypeError(".google.cloud.dataproc.v1.NodeGroupOperationMetadata.warnings: array expected"); - message.warnings = []; - for (var i = 0; i < object.warnings.length; ++i) - message.warnings[i] = String(object.warnings[i]); - } - return message; - }; - - /** - * Creates a plain object from a NodeGroupOperationMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata - * @static - * @param {google.cloud.dataproc.v1.NodeGroupOperationMetadata} message NodeGroupOperationMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NodeGroupOperationMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.statusHistory = []; - object.warnings = []; - } - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.nodeGroupId = ""; - object.clusterUuid = ""; - object.status = null; - object.operationType = options.enums === String ? "NODE_GROUP_OPERATION_TYPE_UNSPECIFIED" : 0; - object.description = ""; - } - if (message.nodeGroupId != null && message.hasOwnProperty("nodeGroupId")) - object.nodeGroupId = message.nodeGroupId; - if (message.clusterUuid != null && message.hasOwnProperty("clusterUuid")) - object.clusterUuid = message.clusterUuid; - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.cloud.dataproc.v1.ClusterOperationStatus.toObject(message.status, options); - if (message.statusHistory && message.statusHistory.length) { - object.statusHistory = []; - for (var j = 0; j < message.statusHistory.length; ++j) - object.statusHistory[j] = $root.google.cloud.dataproc.v1.ClusterOperationStatus.toObject(message.statusHistory[j], options); - } - if (message.operationType != null && message.hasOwnProperty("operationType")) - object.operationType = options.enums === String ? $root.google.cloud.dataproc.v1.NodeGroupOperationMetadata.NodeGroupOperationType[message.operationType] === undefined ? message.operationType : $root.google.cloud.dataproc.v1.NodeGroupOperationMetadata.NodeGroupOperationType[message.operationType] : message.operationType; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - 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.warnings && message.warnings.length) { - object.warnings = []; - for (var j = 0; j < message.warnings.length; ++j) - object.warnings[j] = message.warnings[j]; - } - return object; - }; - - /** - * Converts this NodeGroupOperationMetadata to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata - * @instance - * @returns {Object.} JSON object - */ - NodeGroupOperationMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NodeGroupOperationMetadata - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.NodeGroupOperationMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NodeGroupOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.NodeGroupOperationMetadata"; - }; - - /** - * NodeGroupOperationType enum. - * @name google.cloud.dataproc.v1.NodeGroupOperationMetadata.NodeGroupOperationType - * @enum {number} - * @property {number} NODE_GROUP_OPERATION_TYPE_UNSPECIFIED=0 NODE_GROUP_OPERATION_TYPE_UNSPECIFIED value - * @property {number} CREATE=1 CREATE value - * @property {number} UPDATE=2 UPDATE value - * @property {number} DELETE=3 DELETE value - * @property {number} RESIZE=4 RESIZE value - */ - NodeGroupOperationMetadata.NodeGroupOperationType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NODE_GROUP_OPERATION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CREATE"] = 1; - values[valuesById[2] = "UPDATE"] = 2; - values[valuesById[3] = "DELETE"] = 3; - values[valuesById[4] = "RESIZE"] = 4; - return values; - })(); - - return NodeGroupOperationMetadata; - })(); - - v1.JobController = (function() { - - /** - * Constructs a new JobController service. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a JobController - * @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 JobController(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (JobController.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = JobController; - - /** - * Creates new JobController service using the specified rpc implementation. - * @function create - * @memberof google.cloud.dataproc.v1.JobController - * @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 {JobController} RPC service. Useful where requests and/or responses are streamed. - */ - JobController.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.JobController|submitJob}. - * @memberof google.cloud.dataproc.v1.JobController - * @typedef SubmitJobCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dataproc.v1.Job} [response] Job - */ - - /** - * Calls SubmitJob. - * @function submitJob - * @memberof google.cloud.dataproc.v1.JobController - * @instance - * @param {google.cloud.dataproc.v1.ISubmitJobRequest} request SubmitJobRequest message or plain object - * @param {google.cloud.dataproc.v1.JobController.SubmitJobCallback} callback Node-style callback called with the error, if any, and Job - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(JobController.prototype.submitJob = function submitJob(request, callback) { - return this.rpcCall(submitJob, $root.google.cloud.dataproc.v1.SubmitJobRequest, $root.google.cloud.dataproc.v1.Job, request, callback); - }, "name", { value: "SubmitJob" }); - - /** - * Calls SubmitJob. - * @function submitJob - * @memberof google.cloud.dataproc.v1.JobController - * @instance - * @param {google.cloud.dataproc.v1.ISubmitJobRequest} request SubmitJobRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.JobController|submitJobAsOperation}. - * @memberof google.cloud.dataproc.v1.JobController - * @typedef SubmitJobAsOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls SubmitJobAsOperation. - * @function submitJobAsOperation - * @memberof google.cloud.dataproc.v1.JobController - * @instance - * @param {google.cloud.dataproc.v1.ISubmitJobRequest} request SubmitJobRequest message or plain object - * @param {google.cloud.dataproc.v1.JobController.SubmitJobAsOperationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(JobController.prototype.submitJobAsOperation = function submitJobAsOperation(request, callback) { - return this.rpcCall(submitJobAsOperation, $root.google.cloud.dataproc.v1.SubmitJobRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "SubmitJobAsOperation" }); - - /** - * Calls SubmitJobAsOperation. - * @function submitJobAsOperation - * @memberof google.cloud.dataproc.v1.JobController - * @instance - * @param {google.cloud.dataproc.v1.ISubmitJobRequest} request SubmitJobRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.JobController|getJob}. - * @memberof google.cloud.dataproc.v1.JobController - * @typedef GetJobCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dataproc.v1.Job} [response] Job - */ - - /** - * Calls GetJob. - * @function getJob - * @memberof google.cloud.dataproc.v1.JobController - * @instance - * @param {google.cloud.dataproc.v1.IGetJobRequest} request GetJobRequest message or plain object - * @param {google.cloud.dataproc.v1.JobController.GetJobCallback} callback Node-style callback called with the error, if any, and Job - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(JobController.prototype.getJob = function getJob(request, callback) { - return this.rpcCall(getJob, $root.google.cloud.dataproc.v1.GetJobRequest, $root.google.cloud.dataproc.v1.Job, request, callback); - }, "name", { value: "GetJob" }); - - /** - * Calls GetJob. - * @function getJob - * @memberof google.cloud.dataproc.v1.JobController - * @instance - * @param {google.cloud.dataproc.v1.IGetJobRequest} request GetJobRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.JobController|listJobs}. - * @memberof google.cloud.dataproc.v1.JobController - * @typedef ListJobsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dataproc.v1.ListJobsResponse} [response] ListJobsResponse - */ - - /** - * Calls ListJobs. - * @function listJobs - * @memberof google.cloud.dataproc.v1.JobController - * @instance - * @param {google.cloud.dataproc.v1.IListJobsRequest} request ListJobsRequest message or plain object - * @param {google.cloud.dataproc.v1.JobController.ListJobsCallback} callback Node-style callback called with the error, if any, and ListJobsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(JobController.prototype.listJobs = function listJobs(request, callback) { - return this.rpcCall(listJobs, $root.google.cloud.dataproc.v1.ListJobsRequest, $root.google.cloud.dataproc.v1.ListJobsResponse, request, callback); - }, "name", { value: "ListJobs" }); - - /** - * Calls ListJobs. - * @function listJobs - * @memberof google.cloud.dataproc.v1.JobController - * @instance - * @param {google.cloud.dataproc.v1.IListJobsRequest} request ListJobsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.JobController|updateJob}. - * @memberof google.cloud.dataproc.v1.JobController - * @typedef UpdateJobCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dataproc.v1.Job} [response] Job - */ - - /** - * Calls UpdateJob. - * @function updateJob - * @memberof google.cloud.dataproc.v1.JobController - * @instance - * @param {google.cloud.dataproc.v1.IUpdateJobRequest} request UpdateJobRequest message or plain object - * @param {google.cloud.dataproc.v1.JobController.UpdateJobCallback} callback Node-style callback called with the error, if any, and Job - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(JobController.prototype.updateJob = function updateJob(request, callback) { - return this.rpcCall(updateJob, $root.google.cloud.dataproc.v1.UpdateJobRequest, $root.google.cloud.dataproc.v1.Job, request, callback); - }, "name", { value: "UpdateJob" }); - - /** - * Calls UpdateJob. - * @function updateJob - * @memberof google.cloud.dataproc.v1.JobController - * @instance - * @param {google.cloud.dataproc.v1.IUpdateJobRequest} request UpdateJobRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.JobController|cancelJob}. - * @memberof google.cloud.dataproc.v1.JobController - * @typedef CancelJobCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dataproc.v1.Job} [response] Job - */ - - /** - * Calls CancelJob. - * @function cancelJob - * @memberof google.cloud.dataproc.v1.JobController - * @instance - * @param {google.cloud.dataproc.v1.ICancelJobRequest} request CancelJobRequest message or plain object - * @param {google.cloud.dataproc.v1.JobController.CancelJobCallback} callback Node-style callback called with the error, if any, and Job - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(JobController.prototype.cancelJob = function cancelJob(request, callback) { - return this.rpcCall(cancelJob, $root.google.cloud.dataproc.v1.CancelJobRequest, $root.google.cloud.dataproc.v1.Job, request, callback); - }, "name", { value: "CancelJob" }); - - /** - * Calls CancelJob. - * @function cancelJob - * @memberof google.cloud.dataproc.v1.JobController - * @instance - * @param {google.cloud.dataproc.v1.ICancelJobRequest} request CancelJobRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.JobController|deleteJob}. - * @memberof google.cloud.dataproc.v1.JobController - * @typedef DeleteJobCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteJob. - * @function deleteJob - * @memberof google.cloud.dataproc.v1.JobController - * @instance - * @param {google.cloud.dataproc.v1.IDeleteJobRequest} request DeleteJobRequest message or plain object - * @param {google.cloud.dataproc.v1.JobController.DeleteJobCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(JobController.prototype.deleteJob = function deleteJob(request, callback) { - return this.rpcCall(deleteJob, $root.google.cloud.dataproc.v1.DeleteJobRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteJob" }); - - /** - * Calls DeleteJob. - * @function deleteJob - * @memberof google.cloud.dataproc.v1.JobController - * @instance - * @param {google.cloud.dataproc.v1.IDeleteJobRequest} request DeleteJobRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return JobController; - })(); - - v1.LoggingConfig = (function() { - - /** - * Properties of a LoggingConfig. - * @memberof google.cloud.dataproc.v1 - * @interface ILoggingConfig - * @property {Object.|null} [driverLogLevels] LoggingConfig driverLogLevels - */ - - /** - * Constructs a new LoggingConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a LoggingConfig. - * @implements ILoggingConfig - * @constructor - * @param {google.cloud.dataproc.v1.ILoggingConfig=} [properties] Properties to set - */ - function LoggingConfig(properties) { - this.driverLogLevels = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LoggingConfig driverLogLevels. - * @member {Object.} driverLogLevels - * @memberof google.cloud.dataproc.v1.LoggingConfig - * @instance - */ - LoggingConfig.prototype.driverLogLevels = $util.emptyObject; - - /** - * Creates a new LoggingConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.LoggingConfig - * @static - * @param {google.cloud.dataproc.v1.ILoggingConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.LoggingConfig} LoggingConfig instance - */ - LoggingConfig.create = function create(properties) { - return new LoggingConfig(properties); - }; - - /** - * Encodes the specified LoggingConfig message. Does not implicitly {@link google.cloud.dataproc.v1.LoggingConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.LoggingConfig - * @static - * @param {google.cloud.dataproc.v1.ILoggingConfig} message LoggingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LoggingConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.driverLogLevels != null && Object.hasOwnProperty.call(message, "driverLogLevels")) - for (var keys = Object.keys(message.driverLogLevels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.driverLogLevels[keys[i]]).ldelim(); - return writer; - }; - - /** - * Encodes the specified LoggingConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.LoggingConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.LoggingConfig - * @static - * @param {google.cloud.dataproc.v1.ILoggingConfig} message LoggingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LoggingConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LoggingConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.LoggingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.LoggingConfig} LoggingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LoggingConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.LoggingConfig(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - if (message.driverLogLevels === $util.emptyObject) - message.driverLogLevels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = 0; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.int32(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.driverLogLevels[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LoggingConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.LoggingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.LoggingConfig} LoggingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LoggingConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LoggingConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.LoggingConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LoggingConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.driverLogLevels != null && message.hasOwnProperty("driverLogLevels")) { - if (!$util.isObject(message.driverLogLevels)) - return "driverLogLevels: object expected"; - var key = Object.keys(message.driverLogLevels); - for (var i = 0; i < key.length; ++i) - switch (message.driverLogLevels[key[i]]) { - default: - return "driverLogLevels: enum value{k:string} expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - } - return null; - }; - - /** - * Creates a LoggingConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.LoggingConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.LoggingConfig} LoggingConfig - */ - LoggingConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.LoggingConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.LoggingConfig(); - if (object.driverLogLevels) { - if (typeof object.driverLogLevels !== "object") - throw TypeError(".google.cloud.dataproc.v1.LoggingConfig.driverLogLevels: object expected"); - message.driverLogLevels = {}; - for (var keys = Object.keys(object.driverLogLevels), i = 0; i < keys.length; ++i) - switch (object.driverLogLevels[keys[i]]) { - default: - if (typeof object.driverLogLevels[keys[i]] === "number") { - message.driverLogLevels[keys[i]] = object.driverLogLevels[keys[i]]; - break; - } - break; - case "LEVEL_UNSPECIFIED": - case 0: - message.driverLogLevels[keys[i]] = 0; - break; - case "ALL": - case 1: - message.driverLogLevels[keys[i]] = 1; - break; - case "TRACE": - case 2: - message.driverLogLevels[keys[i]] = 2; - break; - case "DEBUG": - case 3: - message.driverLogLevels[keys[i]] = 3; - break; - case "INFO": - case 4: - message.driverLogLevels[keys[i]] = 4; - break; - case "WARN": - case 5: - message.driverLogLevels[keys[i]] = 5; - break; - case "ERROR": - case 6: - message.driverLogLevels[keys[i]] = 6; - break; - case "FATAL": - case 7: - message.driverLogLevels[keys[i]] = 7; - break; - case "OFF": - case 8: - message.driverLogLevels[keys[i]] = 8; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a LoggingConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.LoggingConfig - * @static - * @param {google.cloud.dataproc.v1.LoggingConfig} message LoggingConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LoggingConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.driverLogLevels = {}; - var keys2; - if (message.driverLogLevels && (keys2 = Object.keys(message.driverLogLevels)).length) { - object.driverLogLevels = {}; - for (var j = 0; j < keys2.length; ++j) - object.driverLogLevels[keys2[j]] = options.enums === String ? $root.google.cloud.dataproc.v1.LoggingConfig.Level[message.driverLogLevels[keys2[j]]] === undefined ? message.driverLogLevels[keys2[j]] : $root.google.cloud.dataproc.v1.LoggingConfig.Level[message.driverLogLevels[keys2[j]]] : message.driverLogLevels[keys2[j]]; - } - return object; - }; - - /** - * Converts this LoggingConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.LoggingConfig - * @instance - * @returns {Object.} JSON object - */ - LoggingConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LoggingConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.LoggingConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LoggingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.LoggingConfig"; - }; - - /** - * Level enum. - * @name google.cloud.dataproc.v1.LoggingConfig.Level - * @enum {number} - * @property {number} LEVEL_UNSPECIFIED=0 LEVEL_UNSPECIFIED value - * @property {number} ALL=1 ALL value - * @property {number} TRACE=2 TRACE value - * @property {number} DEBUG=3 DEBUG value - * @property {number} INFO=4 INFO value - * @property {number} WARN=5 WARN value - * @property {number} ERROR=6 ERROR value - * @property {number} FATAL=7 FATAL value - * @property {number} OFF=8 OFF value - */ - LoggingConfig.Level = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LEVEL_UNSPECIFIED"] = 0; - values[valuesById[1] = "ALL"] = 1; - values[valuesById[2] = "TRACE"] = 2; - values[valuesById[3] = "DEBUG"] = 3; - values[valuesById[4] = "INFO"] = 4; - values[valuesById[5] = "WARN"] = 5; - values[valuesById[6] = "ERROR"] = 6; - values[valuesById[7] = "FATAL"] = 7; - values[valuesById[8] = "OFF"] = 8; - return values; - })(); - - return LoggingConfig; - })(); - - v1.HadoopJob = (function() { - - /** - * Properties of a HadoopJob. - * @memberof google.cloud.dataproc.v1 - * @interface IHadoopJob - * @property {string|null} [mainJarFileUri] HadoopJob mainJarFileUri - * @property {string|null} [mainClass] HadoopJob mainClass - * @property {Array.|null} [args] HadoopJob args - * @property {Array.|null} [jarFileUris] HadoopJob jarFileUris - * @property {Array.|null} [fileUris] HadoopJob fileUris - * @property {Array.|null} [archiveUris] HadoopJob archiveUris - * @property {Object.|null} [properties] HadoopJob properties - * @property {google.cloud.dataproc.v1.ILoggingConfig|null} [loggingConfig] HadoopJob loggingConfig - */ - - /** - * Constructs a new HadoopJob. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a HadoopJob. - * @implements IHadoopJob - * @constructor - * @param {google.cloud.dataproc.v1.IHadoopJob=} [properties] Properties to set - */ - function HadoopJob(properties) { - this.args = []; - this.jarFileUris = []; - this.fileUris = []; - this.archiveUris = []; - this.properties = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HadoopJob mainJarFileUri. - * @member {string|null|undefined} mainJarFileUri - * @memberof google.cloud.dataproc.v1.HadoopJob - * @instance - */ - HadoopJob.prototype.mainJarFileUri = null; - - /** - * HadoopJob mainClass. - * @member {string|null|undefined} mainClass - * @memberof google.cloud.dataproc.v1.HadoopJob - * @instance - */ - HadoopJob.prototype.mainClass = null; - - /** - * HadoopJob args. - * @member {Array.} args - * @memberof google.cloud.dataproc.v1.HadoopJob - * @instance - */ - HadoopJob.prototype.args = $util.emptyArray; - - /** - * HadoopJob jarFileUris. - * @member {Array.} jarFileUris - * @memberof google.cloud.dataproc.v1.HadoopJob - * @instance - */ - HadoopJob.prototype.jarFileUris = $util.emptyArray; - - /** - * HadoopJob fileUris. - * @member {Array.} fileUris - * @memberof google.cloud.dataproc.v1.HadoopJob - * @instance - */ - HadoopJob.prototype.fileUris = $util.emptyArray; - - /** - * HadoopJob archiveUris. - * @member {Array.} archiveUris - * @memberof google.cloud.dataproc.v1.HadoopJob - * @instance - */ - HadoopJob.prototype.archiveUris = $util.emptyArray; - - /** - * HadoopJob properties. - * @member {Object.} properties - * @memberof google.cloud.dataproc.v1.HadoopJob - * @instance - */ - HadoopJob.prototype.properties = $util.emptyObject; - - /** - * HadoopJob loggingConfig. - * @member {google.cloud.dataproc.v1.ILoggingConfig|null|undefined} loggingConfig - * @memberof google.cloud.dataproc.v1.HadoopJob - * @instance - */ - HadoopJob.prototype.loggingConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * HadoopJob driver. - * @member {"mainJarFileUri"|"mainClass"|undefined} driver - * @memberof google.cloud.dataproc.v1.HadoopJob - * @instance - */ - Object.defineProperty(HadoopJob.prototype, "driver", { - get: $util.oneOfGetter($oneOfFields = ["mainJarFileUri", "mainClass"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new HadoopJob instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.HadoopJob - * @static - * @param {google.cloud.dataproc.v1.IHadoopJob=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.HadoopJob} HadoopJob instance - */ - HadoopJob.create = function create(properties) { - return new HadoopJob(properties); - }; - - /** - * Encodes the specified HadoopJob message. Does not implicitly {@link google.cloud.dataproc.v1.HadoopJob.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.HadoopJob - * @static - * @param {google.cloud.dataproc.v1.IHadoopJob} message HadoopJob message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HadoopJob.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.mainJarFileUri != null && Object.hasOwnProperty.call(message, "mainJarFileUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.mainJarFileUri); - if (message.mainClass != null && Object.hasOwnProperty.call(message, "mainClass")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.mainClass); - if (message.args != null && message.args.length) - for (var i = 0; i < message.args.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.args[i]); - if (message.jarFileUris != null && message.jarFileUris.length) - for (var i = 0; i < message.jarFileUris.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.jarFileUris[i]); - if (message.fileUris != null && message.fileUris.length) - for (var i = 0; i < message.fileUris.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.fileUris[i]); - if (message.archiveUris != null && message.archiveUris.length) - for (var i = 0; i < message.archiveUris.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.archiveUris[i]); - if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) - for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.properties[keys[i]]).ldelim(); - if (message.loggingConfig != null && Object.hasOwnProperty.call(message, "loggingConfig")) - $root.google.cloud.dataproc.v1.LoggingConfig.encode(message.loggingConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified HadoopJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.HadoopJob.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.HadoopJob - * @static - * @param {google.cloud.dataproc.v1.IHadoopJob} message HadoopJob message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HadoopJob.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HadoopJob message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.HadoopJob - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.HadoopJob} HadoopJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HadoopJob.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.HadoopJob(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.mainJarFileUri = reader.string(); - break; - } - case 2: { - message.mainClass = reader.string(); - break; - } - case 3: { - if (!(message.args && message.args.length)) - message.args = []; - message.args.push(reader.string()); - break; - } - case 4: { - if (!(message.jarFileUris && message.jarFileUris.length)) - message.jarFileUris = []; - message.jarFileUris.push(reader.string()); - break; - } - case 5: { - if (!(message.fileUris && message.fileUris.length)) - message.fileUris = []; - message.fileUris.push(reader.string()); - break; - } - case 6: { - if (!(message.archiveUris && message.archiveUris.length)) - message.archiveUris = []; - message.archiveUris.push(reader.string()); - break; - } - case 7: { - if (message.properties === $util.emptyObject) - message.properties = {}; - 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.properties[key] = value; - break; - } - case 8: { - message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HadoopJob message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.HadoopJob - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.HadoopJob} HadoopJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HadoopJob.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HadoopJob message. - * @function verify - * @memberof google.cloud.dataproc.v1.HadoopJob - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HadoopJob.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.mainJarFileUri != null && message.hasOwnProperty("mainJarFileUri")) { - properties.driver = 1; - if (!$util.isString(message.mainJarFileUri)) - return "mainJarFileUri: string expected"; - } - if (message.mainClass != null && message.hasOwnProperty("mainClass")) { - if (properties.driver === 1) - return "driver: multiple values"; - properties.driver = 1; - if (!$util.isString(message.mainClass)) - return "mainClass: 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.jarFileUris != null && message.hasOwnProperty("jarFileUris")) { - if (!Array.isArray(message.jarFileUris)) - return "jarFileUris: array expected"; - for (var i = 0; i < message.jarFileUris.length; ++i) - if (!$util.isString(message.jarFileUris[i])) - return "jarFileUris: string[] expected"; - } - if (message.fileUris != null && message.hasOwnProperty("fileUris")) { - if (!Array.isArray(message.fileUris)) - return "fileUris: array expected"; - for (var i = 0; i < message.fileUris.length; ++i) - if (!$util.isString(message.fileUris[i])) - return "fileUris: string[] expected"; - } - if (message.archiveUris != null && message.hasOwnProperty("archiveUris")) { - if (!Array.isArray(message.archiveUris)) - return "archiveUris: array expected"; - for (var i = 0; i < message.archiveUris.length; ++i) - if (!$util.isString(message.archiveUris[i])) - return "archiveUris: string[] expected"; - } - if (message.properties != null && message.hasOwnProperty("properties")) { - if (!$util.isObject(message.properties)) - return "properties: object expected"; - var key = Object.keys(message.properties); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.properties[key[i]])) - return "properties: string{k:string} expected"; - } - if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) { - var error = $root.google.cloud.dataproc.v1.LoggingConfig.verify(message.loggingConfig); - if (error) - return "loggingConfig." + error; - } - return null; - }; - - /** - * Creates a HadoopJob message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.HadoopJob - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.HadoopJob} HadoopJob - */ - HadoopJob.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.HadoopJob) - return object; - var message = new $root.google.cloud.dataproc.v1.HadoopJob(); - if (object.mainJarFileUri != null) - message.mainJarFileUri = String(object.mainJarFileUri); - if (object.mainClass != null) - message.mainClass = String(object.mainClass); - if (object.args) { - if (!Array.isArray(object.args)) - throw TypeError(".google.cloud.dataproc.v1.HadoopJob.args: array expected"); - message.args = []; - for (var i = 0; i < object.args.length; ++i) - message.args[i] = String(object.args[i]); - } - if (object.jarFileUris) { - if (!Array.isArray(object.jarFileUris)) - throw TypeError(".google.cloud.dataproc.v1.HadoopJob.jarFileUris: array expected"); - message.jarFileUris = []; - for (var i = 0; i < object.jarFileUris.length; ++i) - message.jarFileUris[i] = String(object.jarFileUris[i]); - } - if (object.fileUris) { - if (!Array.isArray(object.fileUris)) - throw TypeError(".google.cloud.dataproc.v1.HadoopJob.fileUris: array expected"); - message.fileUris = []; - for (var i = 0; i < object.fileUris.length; ++i) - message.fileUris[i] = String(object.fileUris[i]); - } - if (object.archiveUris) { - if (!Array.isArray(object.archiveUris)) - throw TypeError(".google.cloud.dataproc.v1.HadoopJob.archiveUris: array expected"); - message.archiveUris = []; - for (var i = 0; i < object.archiveUris.length; ++i) - message.archiveUris[i] = String(object.archiveUris[i]); - } - if (object.properties) { - if (typeof object.properties !== "object") - throw TypeError(".google.cloud.dataproc.v1.HadoopJob.properties: object expected"); - message.properties = {}; - for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) - message.properties[keys[i]] = String(object.properties[keys[i]]); - } - if (object.loggingConfig != null) { - if (typeof object.loggingConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.HadoopJob.loggingConfig: object expected"); - message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.fromObject(object.loggingConfig); - } - return message; - }; - - /** - * Creates a plain object from a HadoopJob message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.HadoopJob - * @static - * @param {google.cloud.dataproc.v1.HadoopJob} message HadoopJob - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HadoopJob.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.args = []; - object.jarFileUris = []; - object.fileUris = []; - object.archiveUris = []; - } - if (options.objects || options.defaults) - object.properties = {}; - if (options.defaults) - object.loggingConfig = null; - if (message.mainJarFileUri != null && message.hasOwnProperty("mainJarFileUri")) { - object.mainJarFileUri = message.mainJarFileUri; - if (options.oneofs) - object.driver = "mainJarFileUri"; - } - if (message.mainClass != null && message.hasOwnProperty("mainClass")) { - object.mainClass = message.mainClass; - if (options.oneofs) - object.driver = "mainClass"; - } - 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.jarFileUris && message.jarFileUris.length) { - object.jarFileUris = []; - for (var j = 0; j < message.jarFileUris.length; ++j) - object.jarFileUris[j] = message.jarFileUris[j]; - } - if (message.fileUris && message.fileUris.length) { - object.fileUris = []; - for (var j = 0; j < message.fileUris.length; ++j) - object.fileUris[j] = message.fileUris[j]; - } - if (message.archiveUris && message.archiveUris.length) { - object.archiveUris = []; - for (var j = 0; j < message.archiveUris.length; ++j) - object.archiveUris[j] = message.archiveUris[j]; - } - var keys2; - if (message.properties && (keys2 = Object.keys(message.properties)).length) { - object.properties = {}; - for (var j = 0; j < keys2.length; ++j) - object.properties[keys2[j]] = message.properties[keys2[j]]; - } - if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) - object.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.toObject(message.loggingConfig, options); - return object; - }; - - /** - * Converts this HadoopJob to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.HadoopJob - * @instance - * @returns {Object.} JSON object - */ - HadoopJob.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HadoopJob - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.HadoopJob - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HadoopJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.HadoopJob"; - }; - - return HadoopJob; - })(); - - v1.SparkJob = (function() { - - /** - * Properties of a SparkJob. - * @memberof google.cloud.dataproc.v1 - * @interface ISparkJob - * @property {string|null} [mainJarFileUri] SparkJob mainJarFileUri - * @property {string|null} [mainClass] SparkJob mainClass - * @property {Array.|null} [args] SparkJob args - * @property {Array.|null} [jarFileUris] SparkJob jarFileUris - * @property {Array.|null} [fileUris] SparkJob fileUris - * @property {Array.|null} [archiveUris] SparkJob archiveUris - * @property {Object.|null} [properties] SparkJob properties - * @property {google.cloud.dataproc.v1.ILoggingConfig|null} [loggingConfig] SparkJob loggingConfig - */ - - /** - * Constructs a new SparkJob. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a SparkJob. - * @implements ISparkJob - * @constructor - * @param {google.cloud.dataproc.v1.ISparkJob=} [properties] Properties to set - */ - function SparkJob(properties) { - this.args = []; - this.jarFileUris = []; - this.fileUris = []; - this.archiveUris = []; - this.properties = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SparkJob mainJarFileUri. - * @member {string|null|undefined} mainJarFileUri - * @memberof google.cloud.dataproc.v1.SparkJob - * @instance - */ - SparkJob.prototype.mainJarFileUri = null; - - /** - * SparkJob mainClass. - * @member {string|null|undefined} mainClass - * @memberof google.cloud.dataproc.v1.SparkJob - * @instance - */ - SparkJob.prototype.mainClass = null; - - /** - * SparkJob args. - * @member {Array.} args - * @memberof google.cloud.dataproc.v1.SparkJob - * @instance - */ - SparkJob.prototype.args = $util.emptyArray; - - /** - * SparkJob jarFileUris. - * @member {Array.} jarFileUris - * @memberof google.cloud.dataproc.v1.SparkJob - * @instance - */ - SparkJob.prototype.jarFileUris = $util.emptyArray; - - /** - * SparkJob fileUris. - * @member {Array.} fileUris - * @memberof google.cloud.dataproc.v1.SparkJob - * @instance - */ - SparkJob.prototype.fileUris = $util.emptyArray; - - /** - * SparkJob archiveUris. - * @member {Array.} archiveUris - * @memberof google.cloud.dataproc.v1.SparkJob - * @instance - */ - SparkJob.prototype.archiveUris = $util.emptyArray; - - /** - * SparkJob properties. - * @member {Object.} properties - * @memberof google.cloud.dataproc.v1.SparkJob - * @instance - */ - SparkJob.prototype.properties = $util.emptyObject; - - /** - * SparkJob loggingConfig. - * @member {google.cloud.dataproc.v1.ILoggingConfig|null|undefined} loggingConfig - * @memberof google.cloud.dataproc.v1.SparkJob - * @instance - */ - SparkJob.prototype.loggingConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * SparkJob driver. - * @member {"mainJarFileUri"|"mainClass"|undefined} driver - * @memberof google.cloud.dataproc.v1.SparkJob - * @instance - */ - Object.defineProperty(SparkJob.prototype, "driver", { - get: $util.oneOfGetter($oneOfFields = ["mainJarFileUri", "mainClass"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SparkJob instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.SparkJob - * @static - * @param {google.cloud.dataproc.v1.ISparkJob=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.SparkJob} SparkJob instance - */ - SparkJob.create = function create(properties) { - return new SparkJob(properties); - }; - - /** - * Encodes the specified SparkJob message. Does not implicitly {@link google.cloud.dataproc.v1.SparkJob.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.SparkJob - * @static - * @param {google.cloud.dataproc.v1.ISparkJob} message SparkJob message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SparkJob.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.mainJarFileUri != null && Object.hasOwnProperty.call(message, "mainJarFileUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.mainJarFileUri); - if (message.mainClass != null && Object.hasOwnProperty.call(message, "mainClass")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.mainClass); - if (message.args != null && message.args.length) - for (var i = 0; i < message.args.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.args[i]); - if (message.jarFileUris != null && message.jarFileUris.length) - for (var i = 0; i < message.jarFileUris.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.jarFileUris[i]); - if (message.fileUris != null && message.fileUris.length) - for (var i = 0; i < message.fileUris.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.fileUris[i]); - if (message.archiveUris != null && message.archiveUris.length) - for (var i = 0; i < message.archiveUris.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.archiveUris[i]); - if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) - for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.properties[keys[i]]).ldelim(); - if (message.loggingConfig != null && Object.hasOwnProperty.call(message, "loggingConfig")) - $root.google.cloud.dataproc.v1.LoggingConfig.encode(message.loggingConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SparkJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SparkJob.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.SparkJob - * @static - * @param {google.cloud.dataproc.v1.ISparkJob} message SparkJob message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SparkJob.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SparkJob message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.SparkJob - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.SparkJob} SparkJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SparkJob.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.SparkJob(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.mainJarFileUri = reader.string(); - break; - } - case 2: { - message.mainClass = reader.string(); - break; - } - case 3: { - if (!(message.args && message.args.length)) - message.args = []; - message.args.push(reader.string()); - break; - } - case 4: { - if (!(message.jarFileUris && message.jarFileUris.length)) - message.jarFileUris = []; - message.jarFileUris.push(reader.string()); - break; - } - case 5: { - if (!(message.fileUris && message.fileUris.length)) - message.fileUris = []; - message.fileUris.push(reader.string()); - break; - } - case 6: { - if (!(message.archiveUris && message.archiveUris.length)) - message.archiveUris = []; - message.archiveUris.push(reader.string()); - break; - } - case 7: { - if (message.properties === $util.emptyObject) - message.properties = {}; - 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.properties[key] = value; - break; - } - case 8: { - message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SparkJob message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.SparkJob - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.SparkJob} SparkJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SparkJob.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SparkJob message. - * @function verify - * @memberof google.cloud.dataproc.v1.SparkJob - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SparkJob.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.mainJarFileUri != null && message.hasOwnProperty("mainJarFileUri")) { - properties.driver = 1; - if (!$util.isString(message.mainJarFileUri)) - return "mainJarFileUri: string expected"; - } - if (message.mainClass != null && message.hasOwnProperty("mainClass")) { - if (properties.driver === 1) - return "driver: multiple values"; - properties.driver = 1; - if (!$util.isString(message.mainClass)) - return "mainClass: 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.jarFileUris != null && message.hasOwnProperty("jarFileUris")) { - if (!Array.isArray(message.jarFileUris)) - return "jarFileUris: array expected"; - for (var i = 0; i < message.jarFileUris.length; ++i) - if (!$util.isString(message.jarFileUris[i])) - return "jarFileUris: string[] expected"; - } - if (message.fileUris != null && message.hasOwnProperty("fileUris")) { - if (!Array.isArray(message.fileUris)) - return "fileUris: array expected"; - for (var i = 0; i < message.fileUris.length; ++i) - if (!$util.isString(message.fileUris[i])) - return "fileUris: string[] expected"; - } - if (message.archiveUris != null && message.hasOwnProperty("archiveUris")) { - if (!Array.isArray(message.archiveUris)) - return "archiveUris: array expected"; - for (var i = 0; i < message.archiveUris.length; ++i) - if (!$util.isString(message.archiveUris[i])) - return "archiveUris: string[] expected"; - } - if (message.properties != null && message.hasOwnProperty("properties")) { - if (!$util.isObject(message.properties)) - return "properties: object expected"; - var key = Object.keys(message.properties); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.properties[key[i]])) - return "properties: string{k:string} expected"; - } - if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) { - var error = $root.google.cloud.dataproc.v1.LoggingConfig.verify(message.loggingConfig); - if (error) - return "loggingConfig." + error; - } - return null; - }; - - /** - * Creates a SparkJob message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.SparkJob - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.SparkJob} SparkJob - */ - SparkJob.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.SparkJob) - return object; - var message = new $root.google.cloud.dataproc.v1.SparkJob(); - if (object.mainJarFileUri != null) - message.mainJarFileUri = String(object.mainJarFileUri); - if (object.mainClass != null) - message.mainClass = String(object.mainClass); - if (object.args) { - if (!Array.isArray(object.args)) - throw TypeError(".google.cloud.dataproc.v1.SparkJob.args: array expected"); - message.args = []; - for (var i = 0; i < object.args.length; ++i) - message.args[i] = String(object.args[i]); - } - if (object.jarFileUris) { - if (!Array.isArray(object.jarFileUris)) - throw TypeError(".google.cloud.dataproc.v1.SparkJob.jarFileUris: array expected"); - message.jarFileUris = []; - for (var i = 0; i < object.jarFileUris.length; ++i) - message.jarFileUris[i] = String(object.jarFileUris[i]); - } - if (object.fileUris) { - if (!Array.isArray(object.fileUris)) - throw TypeError(".google.cloud.dataproc.v1.SparkJob.fileUris: array expected"); - message.fileUris = []; - for (var i = 0; i < object.fileUris.length; ++i) - message.fileUris[i] = String(object.fileUris[i]); - } - if (object.archiveUris) { - if (!Array.isArray(object.archiveUris)) - throw TypeError(".google.cloud.dataproc.v1.SparkJob.archiveUris: array expected"); - message.archiveUris = []; - for (var i = 0; i < object.archiveUris.length; ++i) - message.archiveUris[i] = String(object.archiveUris[i]); - } - if (object.properties) { - if (typeof object.properties !== "object") - throw TypeError(".google.cloud.dataproc.v1.SparkJob.properties: object expected"); - message.properties = {}; - for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) - message.properties[keys[i]] = String(object.properties[keys[i]]); - } - if (object.loggingConfig != null) { - if (typeof object.loggingConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.SparkJob.loggingConfig: object expected"); - message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.fromObject(object.loggingConfig); - } - return message; - }; - - /** - * Creates a plain object from a SparkJob message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.SparkJob - * @static - * @param {google.cloud.dataproc.v1.SparkJob} message SparkJob - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SparkJob.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.args = []; - object.jarFileUris = []; - object.fileUris = []; - object.archiveUris = []; - } - if (options.objects || options.defaults) - object.properties = {}; - if (options.defaults) - object.loggingConfig = null; - if (message.mainJarFileUri != null && message.hasOwnProperty("mainJarFileUri")) { - object.mainJarFileUri = message.mainJarFileUri; - if (options.oneofs) - object.driver = "mainJarFileUri"; - } - if (message.mainClass != null && message.hasOwnProperty("mainClass")) { - object.mainClass = message.mainClass; - if (options.oneofs) - object.driver = "mainClass"; - } - 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.jarFileUris && message.jarFileUris.length) { - object.jarFileUris = []; - for (var j = 0; j < message.jarFileUris.length; ++j) - object.jarFileUris[j] = message.jarFileUris[j]; - } - if (message.fileUris && message.fileUris.length) { - object.fileUris = []; - for (var j = 0; j < message.fileUris.length; ++j) - object.fileUris[j] = message.fileUris[j]; - } - if (message.archiveUris && message.archiveUris.length) { - object.archiveUris = []; - for (var j = 0; j < message.archiveUris.length; ++j) - object.archiveUris[j] = message.archiveUris[j]; - } - var keys2; - if (message.properties && (keys2 = Object.keys(message.properties)).length) { - object.properties = {}; - for (var j = 0; j < keys2.length; ++j) - object.properties[keys2[j]] = message.properties[keys2[j]]; - } - if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) - object.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.toObject(message.loggingConfig, options); - return object; - }; - - /** - * Converts this SparkJob to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.SparkJob - * @instance - * @returns {Object.} JSON object - */ - SparkJob.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SparkJob - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.SparkJob - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SparkJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.SparkJob"; - }; - - return SparkJob; - })(); - - v1.PySparkJob = (function() { - - /** - * Properties of a PySparkJob. - * @memberof google.cloud.dataproc.v1 - * @interface IPySparkJob - * @property {string|null} [mainPythonFileUri] PySparkJob mainPythonFileUri - * @property {Array.|null} [args] PySparkJob args - * @property {Array.|null} [pythonFileUris] PySparkJob pythonFileUris - * @property {Array.|null} [jarFileUris] PySparkJob jarFileUris - * @property {Array.|null} [fileUris] PySparkJob fileUris - * @property {Array.|null} [archiveUris] PySparkJob archiveUris - * @property {Object.|null} [properties] PySparkJob properties - * @property {google.cloud.dataproc.v1.ILoggingConfig|null} [loggingConfig] PySparkJob loggingConfig - */ - - /** - * Constructs a new PySparkJob. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a PySparkJob. - * @implements IPySparkJob - * @constructor - * @param {google.cloud.dataproc.v1.IPySparkJob=} [properties] Properties to set - */ - function PySparkJob(properties) { - this.args = []; - this.pythonFileUris = []; - this.jarFileUris = []; - this.fileUris = []; - this.archiveUris = []; - this.properties = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PySparkJob mainPythonFileUri. - * @member {string} mainPythonFileUri - * @memberof google.cloud.dataproc.v1.PySparkJob - * @instance - */ - PySparkJob.prototype.mainPythonFileUri = ""; - - /** - * PySparkJob args. - * @member {Array.} args - * @memberof google.cloud.dataproc.v1.PySparkJob - * @instance - */ - PySparkJob.prototype.args = $util.emptyArray; - - /** - * PySparkJob pythonFileUris. - * @member {Array.} pythonFileUris - * @memberof google.cloud.dataproc.v1.PySparkJob - * @instance - */ - PySparkJob.prototype.pythonFileUris = $util.emptyArray; - - /** - * PySparkJob jarFileUris. - * @member {Array.} jarFileUris - * @memberof google.cloud.dataproc.v1.PySparkJob - * @instance - */ - PySparkJob.prototype.jarFileUris = $util.emptyArray; - - /** - * PySparkJob fileUris. - * @member {Array.} fileUris - * @memberof google.cloud.dataproc.v1.PySparkJob - * @instance - */ - PySparkJob.prototype.fileUris = $util.emptyArray; - - /** - * PySparkJob archiveUris. - * @member {Array.} archiveUris - * @memberof google.cloud.dataproc.v1.PySparkJob - * @instance - */ - PySparkJob.prototype.archiveUris = $util.emptyArray; - - /** - * PySparkJob properties. - * @member {Object.} properties - * @memberof google.cloud.dataproc.v1.PySparkJob - * @instance - */ - PySparkJob.prototype.properties = $util.emptyObject; - - /** - * PySparkJob loggingConfig. - * @member {google.cloud.dataproc.v1.ILoggingConfig|null|undefined} loggingConfig - * @memberof google.cloud.dataproc.v1.PySparkJob - * @instance - */ - PySparkJob.prototype.loggingConfig = null; - - /** - * Creates a new PySparkJob instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.PySparkJob - * @static - * @param {google.cloud.dataproc.v1.IPySparkJob=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.PySparkJob} PySparkJob instance - */ - PySparkJob.create = function create(properties) { - return new PySparkJob(properties); - }; - - /** - * Encodes the specified PySparkJob message. Does not implicitly {@link google.cloud.dataproc.v1.PySparkJob.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.PySparkJob - * @static - * @param {google.cloud.dataproc.v1.IPySparkJob} message PySparkJob message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PySparkJob.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.mainPythonFileUri != null && Object.hasOwnProperty.call(message, "mainPythonFileUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.mainPythonFileUri); - 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.pythonFileUris != null && message.pythonFileUris.length) - for (var i = 0; i < message.pythonFileUris.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pythonFileUris[i]); - if (message.jarFileUris != null && message.jarFileUris.length) - for (var i = 0; i < message.jarFileUris.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.jarFileUris[i]); - if (message.fileUris != null && message.fileUris.length) - for (var i = 0; i < message.fileUris.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.fileUris[i]); - if (message.archiveUris != null && message.archiveUris.length) - for (var i = 0; i < message.archiveUris.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.archiveUris[i]); - if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) - for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.properties[keys[i]]).ldelim(); - if (message.loggingConfig != null && Object.hasOwnProperty.call(message, "loggingConfig")) - $root.google.cloud.dataproc.v1.LoggingConfig.encode(message.loggingConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PySparkJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.PySparkJob.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.PySparkJob - * @static - * @param {google.cloud.dataproc.v1.IPySparkJob} message PySparkJob message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PySparkJob.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PySparkJob message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.PySparkJob - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.PySparkJob} PySparkJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PySparkJob.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.PySparkJob(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.mainPythonFileUri = reader.string(); - break; - } - case 2: { - if (!(message.args && message.args.length)) - message.args = []; - message.args.push(reader.string()); - break; - } - case 3: { - if (!(message.pythonFileUris && message.pythonFileUris.length)) - message.pythonFileUris = []; - message.pythonFileUris.push(reader.string()); - break; - } - case 4: { - if (!(message.jarFileUris && message.jarFileUris.length)) - message.jarFileUris = []; - message.jarFileUris.push(reader.string()); - break; - } - case 5: { - if (!(message.fileUris && message.fileUris.length)) - message.fileUris = []; - message.fileUris.push(reader.string()); - break; - } - case 6: { - if (!(message.archiveUris && message.archiveUris.length)) - message.archiveUris = []; - message.archiveUris.push(reader.string()); - break; - } - case 7: { - if (message.properties === $util.emptyObject) - message.properties = {}; - 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.properties[key] = value; - break; - } - case 8: { - message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PySparkJob message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.PySparkJob - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.PySparkJob} PySparkJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PySparkJob.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PySparkJob message. - * @function verify - * @memberof google.cloud.dataproc.v1.PySparkJob - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PySparkJob.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.mainPythonFileUri != null && message.hasOwnProperty("mainPythonFileUri")) - if (!$util.isString(message.mainPythonFileUri)) - return "mainPythonFileUri: 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.pythonFileUris != null && message.hasOwnProperty("pythonFileUris")) { - if (!Array.isArray(message.pythonFileUris)) - return "pythonFileUris: array expected"; - for (var i = 0; i < message.pythonFileUris.length; ++i) - if (!$util.isString(message.pythonFileUris[i])) - return "pythonFileUris: string[] expected"; - } - if (message.jarFileUris != null && message.hasOwnProperty("jarFileUris")) { - if (!Array.isArray(message.jarFileUris)) - return "jarFileUris: array expected"; - for (var i = 0; i < message.jarFileUris.length; ++i) - if (!$util.isString(message.jarFileUris[i])) - return "jarFileUris: string[] expected"; - } - if (message.fileUris != null && message.hasOwnProperty("fileUris")) { - if (!Array.isArray(message.fileUris)) - return "fileUris: array expected"; - for (var i = 0; i < message.fileUris.length; ++i) - if (!$util.isString(message.fileUris[i])) - return "fileUris: string[] expected"; - } - if (message.archiveUris != null && message.hasOwnProperty("archiveUris")) { - if (!Array.isArray(message.archiveUris)) - return "archiveUris: array expected"; - for (var i = 0; i < message.archiveUris.length; ++i) - if (!$util.isString(message.archiveUris[i])) - return "archiveUris: string[] expected"; - } - if (message.properties != null && message.hasOwnProperty("properties")) { - if (!$util.isObject(message.properties)) - return "properties: object expected"; - var key = Object.keys(message.properties); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.properties[key[i]])) - return "properties: string{k:string} expected"; - } - if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) { - var error = $root.google.cloud.dataproc.v1.LoggingConfig.verify(message.loggingConfig); - if (error) - return "loggingConfig." + error; - } - return null; - }; - - /** - * Creates a PySparkJob message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.PySparkJob - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.PySparkJob} PySparkJob - */ - PySparkJob.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.PySparkJob) - return object; - var message = new $root.google.cloud.dataproc.v1.PySparkJob(); - if (object.mainPythonFileUri != null) - message.mainPythonFileUri = String(object.mainPythonFileUri); - if (object.args) { - if (!Array.isArray(object.args)) - throw TypeError(".google.cloud.dataproc.v1.PySparkJob.args: array expected"); - message.args = []; - for (var i = 0; i < object.args.length; ++i) - message.args[i] = String(object.args[i]); - } - if (object.pythonFileUris) { - if (!Array.isArray(object.pythonFileUris)) - throw TypeError(".google.cloud.dataproc.v1.PySparkJob.pythonFileUris: array expected"); - message.pythonFileUris = []; - for (var i = 0; i < object.pythonFileUris.length; ++i) - message.pythonFileUris[i] = String(object.pythonFileUris[i]); - } - if (object.jarFileUris) { - if (!Array.isArray(object.jarFileUris)) - throw TypeError(".google.cloud.dataproc.v1.PySparkJob.jarFileUris: array expected"); - message.jarFileUris = []; - for (var i = 0; i < object.jarFileUris.length; ++i) - message.jarFileUris[i] = String(object.jarFileUris[i]); - } - if (object.fileUris) { - if (!Array.isArray(object.fileUris)) - throw TypeError(".google.cloud.dataproc.v1.PySparkJob.fileUris: array expected"); - message.fileUris = []; - for (var i = 0; i < object.fileUris.length; ++i) - message.fileUris[i] = String(object.fileUris[i]); - } - if (object.archiveUris) { - if (!Array.isArray(object.archiveUris)) - throw TypeError(".google.cloud.dataproc.v1.PySparkJob.archiveUris: array expected"); - message.archiveUris = []; - for (var i = 0; i < object.archiveUris.length; ++i) - message.archiveUris[i] = String(object.archiveUris[i]); - } - if (object.properties) { - if (typeof object.properties !== "object") - throw TypeError(".google.cloud.dataproc.v1.PySparkJob.properties: object expected"); - message.properties = {}; - for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) - message.properties[keys[i]] = String(object.properties[keys[i]]); - } - if (object.loggingConfig != null) { - if (typeof object.loggingConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.PySparkJob.loggingConfig: object expected"); - message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.fromObject(object.loggingConfig); - } - return message; - }; - - /** - * Creates a plain object from a PySparkJob message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.PySparkJob - * @static - * @param {google.cloud.dataproc.v1.PySparkJob} message PySparkJob - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PySparkJob.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.args = []; - object.pythonFileUris = []; - object.jarFileUris = []; - object.fileUris = []; - object.archiveUris = []; - } - if (options.objects || options.defaults) - object.properties = {}; - if (options.defaults) { - object.mainPythonFileUri = ""; - object.loggingConfig = null; - } - if (message.mainPythonFileUri != null && message.hasOwnProperty("mainPythonFileUri")) - object.mainPythonFileUri = message.mainPythonFileUri; - 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.pythonFileUris && message.pythonFileUris.length) { - object.pythonFileUris = []; - for (var j = 0; j < message.pythonFileUris.length; ++j) - object.pythonFileUris[j] = message.pythonFileUris[j]; - } - if (message.jarFileUris && message.jarFileUris.length) { - object.jarFileUris = []; - for (var j = 0; j < message.jarFileUris.length; ++j) - object.jarFileUris[j] = message.jarFileUris[j]; - } - if (message.fileUris && message.fileUris.length) { - object.fileUris = []; - for (var j = 0; j < message.fileUris.length; ++j) - object.fileUris[j] = message.fileUris[j]; - } - if (message.archiveUris && message.archiveUris.length) { - object.archiveUris = []; - for (var j = 0; j < message.archiveUris.length; ++j) - object.archiveUris[j] = message.archiveUris[j]; - } - var keys2; - if (message.properties && (keys2 = Object.keys(message.properties)).length) { - object.properties = {}; - for (var j = 0; j < keys2.length; ++j) - object.properties[keys2[j]] = message.properties[keys2[j]]; - } - if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) - object.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.toObject(message.loggingConfig, options); - return object; - }; - - /** - * Converts this PySparkJob to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.PySparkJob - * @instance - * @returns {Object.} JSON object - */ - PySparkJob.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PySparkJob - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.PySparkJob - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PySparkJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.PySparkJob"; - }; - - return PySparkJob; - })(); - - v1.QueryList = (function() { - - /** - * Properties of a QueryList. - * @memberof google.cloud.dataproc.v1 - * @interface IQueryList - * @property {Array.|null} [queries] QueryList queries - */ - - /** - * Constructs a new QueryList. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a QueryList. - * @implements IQueryList - * @constructor - * @param {google.cloud.dataproc.v1.IQueryList=} [properties] Properties to set - */ - function QueryList(properties) { - this.queries = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * QueryList queries. - * @member {Array.} queries - * @memberof google.cloud.dataproc.v1.QueryList - * @instance - */ - QueryList.prototype.queries = $util.emptyArray; - - /** - * Creates a new QueryList instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.QueryList - * @static - * @param {google.cloud.dataproc.v1.IQueryList=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.QueryList} QueryList instance - */ - QueryList.create = function create(properties) { - return new QueryList(properties); - }; - - /** - * Encodes the specified QueryList message. Does not implicitly {@link google.cloud.dataproc.v1.QueryList.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.QueryList - * @static - * @param {google.cloud.dataproc.v1.IQueryList} message QueryList message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryList.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.queries != null && message.queries.length) - for (var i = 0; i < message.queries.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.queries[i]); - return writer; - }; - - /** - * Encodes the specified QueryList message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.QueryList.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.QueryList - * @static - * @param {google.cloud.dataproc.v1.IQueryList} message QueryList message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryList.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryList message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.QueryList - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.QueryList} QueryList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryList.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.QueryList(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.queries && message.queries.length)) - message.queries = []; - message.queries.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QueryList message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.QueryList - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.QueryList} QueryList - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryList.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryList message. - * @function verify - * @memberof google.cloud.dataproc.v1.QueryList - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryList.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.queries != null && message.hasOwnProperty("queries")) { - if (!Array.isArray(message.queries)) - return "queries: array expected"; - for (var i = 0; i < message.queries.length; ++i) - if (!$util.isString(message.queries[i])) - return "queries: string[] expected"; - } - return null; - }; - - /** - * Creates a QueryList message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.QueryList - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.QueryList} QueryList - */ - QueryList.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.QueryList) - return object; - var message = new $root.google.cloud.dataproc.v1.QueryList(); - if (object.queries) { - if (!Array.isArray(object.queries)) - throw TypeError(".google.cloud.dataproc.v1.QueryList.queries: array expected"); - message.queries = []; - for (var i = 0; i < object.queries.length; ++i) - message.queries[i] = String(object.queries[i]); - } - return message; - }; - - /** - * Creates a plain object from a QueryList message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.QueryList - * @static - * @param {google.cloud.dataproc.v1.QueryList} message QueryList - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryList.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.queries = []; - if (message.queries && message.queries.length) { - object.queries = []; - for (var j = 0; j < message.queries.length; ++j) - object.queries[j] = message.queries[j]; - } - return object; - }; - - /** - * Converts this QueryList to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.QueryList - * @instance - * @returns {Object.} JSON object - */ - QueryList.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for QueryList - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.QueryList - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - QueryList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.QueryList"; - }; - - return QueryList; - })(); - - v1.HiveJob = (function() { - - /** - * Properties of a HiveJob. - * @memberof google.cloud.dataproc.v1 - * @interface IHiveJob - * @property {string|null} [queryFileUri] HiveJob queryFileUri - * @property {google.cloud.dataproc.v1.IQueryList|null} [queryList] HiveJob queryList - * @property {boolean|null} [continueOnFailure] HiveJob continueOnFailure - * @property {Object.|null} [scriptVariables] HiveJob scriptVariables - * @property {Object.|null} [properties] HiveJob properties - * @property {Array.|null} [jarFileUris] HiveJob jarFileUris - */ - - /** - * Constructs a new HiveJob. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a HiveJob. - * @implements IHiveJob - * @constructor - * @param {google.cloud.dataproc.v1.IHiveJob=} [properties] Properties to set - */ - function HiveJob(properties) { - this.scriptVariables = {}; - this.properties = {}; - this.jarFileUris = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HiveJob queryFileUri. - * @member {string|null|undefined} queryFileUri - * @memberof google.cloud.dataproc.v1.HiveJob - * @instance - */ - HiveJob.prototype.queryFileUri = null; - - /** - * HiveJob queryList. - * @member {google.cloud.dataproc.v1.IQueryList|null|undefined} queryList - * @memberof google.cloud.dataproc.v1.HiveJob - * @instance - */ - HiveJob.prototype.queryList = null; - - /** - * HiveJob continueOnFailure. - * @member {boolean} continueOnFailure - * @memberof google.cloud.dataproc.v1.HiveJob - * @instance - */ - HiveJob.prototype.continueOnFailure = false; - - /** - * HiveJob scriptVariables. - * @member {Object.} scriptVariables - * @memberof google.cloud.dataproc.v1.HiveJob - * @instance - */ - HiveJob.prototype.scriptVariables = $util.emptyObject; - - /** - * HiveJob properties. - * @member {Object.} properties - * @memberof google.cloud.dataproc.v1.HiveJob - * @instance - */ - HiveJob.prototype.properties = $util.emptyObject; - - /** - * HiveJob jarFileUris. - * @member {Array.} jarFileUris - * @memberof google.cloud.dataproc.v1.HiveJob - * @instance - */ - HiveJob.prototype.jarFileUris = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * HiveJob queries. - * @member {"queryFileUri"|"queryList"|undefined} queries - * @memberof google.cloud.dataproc.v1.HiveJob - * @instance - */ - Object.defineProperty(HiveJob.prototype, "queries", { - get: $util.oneOfGetter($oneOfFields = ["queryFileUri", "queryList"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new HiveJob instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.HiveJob - * @static - * @param {google.cloud.dataproc.v1.IHiveJob=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.HiveJob} HiveJob instance - */ - HiveJob.create = function create(properties) { - return new HiveJob(properties); - }; - - /** - * Encodes the specified HiveJob message. Does not implicitly {@link google.cloud.dataproc.v1.HiveJob.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.HiveJob - * @static - * @param {google.cloud.dataproc.v1.IHiveJob} message HiveJob message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HiveJob.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.queryFileUri != null && Object.hasOwnProperty.call(message, "queryFileUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.queryFileUri); - if (message.queryList != null && Object.hasOwnProperty.call(message, "queryList")) - $root.google.cloud.dataproc.v1.QueryList.encode(message.queryList, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.continueOnFailure != null && Object.hasOwnProperty.call(message, "continueOnFailure")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.continueOnFailure); - if (message.scriptVariables != null && Object.hasOwnProperty.call(message, "scriptVariables")) - for (var keys = Object.keys(message.scriptVariables), 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.scriptVariables[keys[i]]).ldelim(); - if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) - for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.properties[keys[i]]).ldelim(); - if (message.jarFileUris != null && message.jarFileUris.length) - for (var i = 0; i < message.jarFileUris.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.jarFileUris[i]); - return writer; - }; - - /** - * Encodes the specified HiveJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.HiveJob.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.HiveJob - * @static - * @param {google.cloud.dataproc.v1.IHiveJob} message HiveJob message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HiveJob.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HiveJob message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.HiveJob - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.HiveJob} HiveJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HiveJob.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.HiveJob(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.queryFileUri = reader.string(); - break; - } - case 2: { - message.queryList = $root.google.cloud.dataproc.v1.QueryList.decode(reader, reader.uint32()); - break; - } - case 3: { - message.continueOnFailure = reader.bool(); - break; - } - case 4: { - if (message.scriptVariables === $util.emptyObject) - message.scriptVariables = {}; - 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.scriptVariables[key] = value; - break; - } - case 5: { - if (message.properties === $util.emptyObject) - message.properties = {}; - 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.properties[key] = value; - break; - } - case 6: { - if (!(message.jarFileUris && message.jarFileUris.length)) - message.jarFileUris = []; - message.jarFileUris.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a HiveJob message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.HiveJob - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.HiveJob} HiveJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HiveJob.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HiveJob message. - * @function verify - * @memberof google.cloud.dataproc.v1.HiveJob - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HiveJob.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.queryFileUri != null && message.hasOwnProperty("queryFileUri")) { - properties.queries = 1; - if (!$util.isString(message.queryFileUri)) - return "queryFileUri: string expected"; - } - if (message.queryList != null && message.hasOwnProperty("queryList")) { - if (properties.queries === 1) - return "queries: multiple values"; - properties.queries = 1; - { - var error = $root.google.cloud.dataproc.v1.QueryList.verify(message.queryList); - if (error) - return "queryList." + error; - } - } - if (message.continueOnFailure != null && message.hasOwnProperty("continueOnFailure")) - if (typeof message.continueOnFailure !== "boolean") - return "continueOnFailure: boolean expected"; - if (message.scriptVariables != null && message.hasOwnProperty("scriptVariables")) { - if (!$util.isObject(message.scriptVariables)) - return "scriptVariables: object expected"; - var key = Object.keys(message.scriptVariables); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.scriptVariables[key[i]])) - return "scriptVariables: string{k:string} expected"; - } - if (message.properties != null && message.hasOwnProperty("properties")) { - if (!$util.isObject(message.properties)) - return "properties: object expected"; - var key = Object.keys(message.properties); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.properties[key[i]])) - return "properties: string{k:string} expected"; - } - if (message.jarFileUris != null && message.hasOwnProperty("jarFileUris")) { - if (!Array.isArray(message.jarFileUris)) - return "jarFileUris: array expected"; - for (var i = 0; i < message.jarFileUris.length; ++i) - if (!$util.isString(message.jarFileUris[i])) - return "jarFileUris: string[] expected"; - } - return null; - }; - - /** - * Creates a HiveJob message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.HiveJob - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.HiveJob} HiveJob - */ - HiveJob.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.HiveJob) - return object; - var message = new $root.google.cloud.dataproc.v1.HiveJob(); - if (object.queryFileUri != null) - message.queryFileUri = String(object.queryFileUri); - if (object.queryList != null) { - if (typeof object.queryList !== "object") - throw TypeError(".google.cloud.dataproc.v1.HiveJob.queryList: object expected"); - message.queryList = $root.google.cloud.dataproc.v1.QueryList.fromObject(object.queryList); - } - if (object.continueOnFailure != null) - message.continueOnFailure = Boolean(object.continueOnFailure); - if (object.scriptVariables) { - if (typeof object.scriptVariables !== "object") - throw TypeError(".google.cloud.dataproc.v1.HiveJob.scriptVariables: object expected"); - message.scriptVariables = {}; - for (var keys = Object.keys(object.scriptVariables), i = 0; i < keys.length; ++i) - message.scriptVariables[keys[i]] = String(object.scriptVariables[keys[i]]); - } - if (object.properties) { - if (typeof object.properties !== "object") - throw TypeError(".google.cloud.dataproc.v1.HiveJob.properties: object expected"); - message.properties = {}; - for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) - message.properties[keys[i]] = String(object.properties[keys[i]]); - } - if (object.jarFileUris) { - if (!Array.isArray(object.jarFileUris)) - throw TypeError(".google.cloud.dataproc.v1.HiveJob.jarFileUris: array expected"); - message.jarFileUris = []; - for (var i = 0; i < object.jarFileUris.length; ++i) - message.jarFileUris[i] = String(object.jarFileUris[i]); - } - return message; - }; - - /** - * Creates a plain object from a HiveJob message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.HiveJob - * @static - * @param {google.cloud.dataproc.v1.HiveJob} message HiveJob - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HiveJob.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.jarFileUris = []; - if (options.objects || options.defaults) { - object.scriptVariables = {}; - object.properties = {}; - } - if (options.defaults) - object.continueOnFailure = false; - if (message.queryFileUri != null && message.hasOwnProperty("queryFileUri")) { - object.queryFileUri = message.queryFileUri; - if (options.oneofs) - object.queries = "queryFileUri"; - } - if (message.queryList != null && message.hasOwnProperty("queryList")) { - object.queryList = $root.google.cloud.dataproc.v1.QueryList.toObject(message.queryList, options); - if (options.oneofs) - object.queries = "queryList"; - } - if (message.continueOnFailure != null && message.hasOwnProperty("continueOnFailure")) - object.continueOnFailure = message.continueOnFailure; - var keys2; - if (message.scriptVariables && (keys2 = Object.keys(message.scriptVariables)).length) { - object.scriptVariables = {}; - for (var j = 0; j < keys2.length; ++j) - object.scriptVariables[keys2[j]] = message.scriptVariables[keys2[j]]; - } - if (message.properties && (keys2 = Object.keys(message.properties)).length) { - object.properties = {}; - for (var j = 0; j < keys2.length; ++j) - object.properties[keys2[j]] = message.properties[keys2[j]]; - } - if (message.jarFileUris && message.jarFileUris.length) { - object.jarFileUris = []; - for (var j = 0; j < message.jarFileUris.length; ++j) - object.jarFileUris[j] = message.jarFileUris[j]; - } - return object; - }; - - /** - * Converts this HiveJob to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.HiveJob - * @instance - * @returns {Object.} JSON object - */ - HiveJob.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HiveJob - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.HiveJob - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HiveJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.HiveJob"; - }; - - return HiveJob; - })(); - - v1.SparkSqlJob = (function() { - - /** - * Properties of a SparkSqlJob. - * @memberof google.cloud.dataproc.v1 - * @interface ISparkSqlJob - * @property {string|null} [queryFileUri] SparkSqlJob queryFileUri - * @property {google.cloud.dataproc.v1.IQueryList|null} [queryList] SparkSqlJob queryList - * @property {Object.|null} [scriptVariables] SparkSqlJob scriptVariables - * @property {Object.|null} [properties] SparkSqlJob properties - * @property {Array.|null} [jarFileUris] SparkSqlJob jarFileUris - * @property {google.cloud.dataproc.v1.ILoggingConfig|null} [loggingConfig] SparkSqlJob loggingConfig - */ - - /** - * Constructs a new SparkSqlJob. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a SparkSqlJob. - * @implements ISparkSqlJob - * @constructor - * @param {google.cloud.dataproc.v1.ISparkSqlJob=} [properties] Properties to set - */ - function SparkSqlJob(properties) { - this.scriptVariables = {}; - this.properties = {}; - this.jarFileUris = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SparkSqlJob queryFileUri. - * @member {string|null|undefined} queryFileUri - * @memberof google.cloud.dataproc.v1.SparkSqlJob - * @instance - */ - SparkSqlJob.prototype.queryFileUri = null; - - /** - * SparkSqlJob queryList. - * @member {google.cloud.dataproc.v1.IQueryList|null|undefined} queryList - * @memberof google.cloud.dataproc.v1.SparkSqlJob - * @instance - */ - SparkSqlJob.prototype.queryList = null; - - /** - * SparkSqlJob scriptVariables. - * @member {Object.} scriptVariables - * @memberof google.cloud.dataproc.v1.SparkSqlJob - * @instance - */ - SparkSqlJob.prototype.scriptVariables = $util.emptyObject; - - /** - * SparkSqlJob properties. - * @member {Object.} properties - * @memberof google.cloud.dataproc.v1.SparkSqlJob - * @instance - */ - SparkSqlJob.prototype.properties = $util.emptyObject; - - /** - * SparkSqlJob jarFileUris. - * @member {Array.} jarFileUris - * @memberof google.cloud.dataproc.v1.SparkSqlJob - * @instance - */ - SparkSqlJob.prototype.jarFileUris = $util.emptyArray; - - /** - * SparkSqlJob loggingConfig. - * @member {google.cloud.dataproc.v1.ILoggingConfig|null|undefined} loggingConfig - * @memberof google.cloud.dataproc.v1.SparkSqlJob - * @instance - */ - SparkSqlJob.prototype.loggingConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * SparkSqlJob queries. - * @member {"queryFileUri"|"queryList"|undefined} queries - * @memberof google.cloud.dataproc.v1.SparkSqlJob - * @instance - */ - Object.defineProperty(SparkSqlJob.prototype, "queries", { - get: $util.oneOfGetter($oneOfFields = ["queryFileUri", "queryList"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SparkSqlJob instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.SparkSqlJob - * @static - * @param {google.cloud.dataproc.v1.ISparkSqlJob=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.SparkSqlJob} SparkSqlJob instance - */ - SparkSqlJob.create = function create(properties) { - return new SparkSqlJob(properties); - }; - - /** - * Encodes the specified SparkSqlJob message. Does not implicitly {@link google.cloud.dataproc.v1.SparkSqlJob.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.SparkSqlJob - * @static - * @param {google.cloud.dataproc.v1.ISparkSqlJob} message SparkSqlJob message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SparkSqlJob.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.queryFileUri != null && Object.hasOwnProperty.call(message, "queryFileUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.queryFileUri); - if (message.queryList != null && Object.hasOwnProperty.call(message, "queryList")) - $root.google.cloud.dataproc.v1.QueryList.encode(message.queryList, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.scriptVariables != null && Object.hasOwnProperty.call(message, "scriptVariables")) - for (var keys = Object.keys(message.scriptVariables), 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.scriptVariables[keys[i]]).ldelim(); - if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) - for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.properties[keys[i]]).ldelim(); - if (message.loggingConfig != null && Object.hasOwnProperty.call(message, "loggingConfig")) - $root.google.cloud.dataproc.v1.LoggingConfig.encode(message.loggingConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.jarFileUris != null && message.jarFileUris.length) - for (var i = 0; i < message.jarFileUris.length; ++i) - writer.uint32(/* id 56, wireType 2 =*/450).string(message.jarFileUris[i]); - return writer; - }; - - /** - * Encodes the specified SparkSqlJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SparkSqlJob.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.SparkSqlJob - * @static - * @param {google.cloud.dataproc.v1.ISparkSqlJob} message SparkSqlJob message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SparkSqlJob.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SparkSqlJob message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.SparkSqlJob - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.SparkSqlJob} SparkSqlJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SparkSqlJob.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.SparkSqlJob(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.queryFileUri = reader.string(); - break; - } - case 2: { - message.queryList = $root.google.cloud.dataproc.v1.QueryList.decode(reader, reader.uint32()); - break; - } - case 3: { - if (message.scriptVariables === $util.emptyObject) - message.scriptVariables = {}; - 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.scriptVariables[key] = value; - break; - } - case 4: { - if (message.properties === $util.emptyObject) - message.properties = {}; - 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.properties[key] = value; - break; - } - case 56: { - if (!(message.jarFileUris && message.jarFileUris.length)) - message.jarFileUris = []; - message.jarFileUris.push(reader.string()); - break; - } - case 6: { - message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SparkSqlJob message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.SparkSqlJob - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.SparkSqlJob} SparkSqlJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SparkSqlJob.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SparkSqlJob message. - * @function verify - * @memberof google.cloud.dataproc.v1.SparkSqlJob - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SparkSqlJob.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.queryFileUri != null && message.hasOwnProperty("queryFileUri")) { - properties.queries = 1; - if (!$util.isString(message.queryFileUri)) - return "queryFileUri: string expected"; - } - if (message.queryList != null && message.hasOwnProperty("queryList")) { - if (properties.queries === 1) - return "queries: multiple values"; - properties.queries = 1; - { - var error = $root.google.cloud.dataproc.v1.QueryList.verify(message.queryList); - if (error) - return "queryList." + error; - } - } - if (message.scriptVariables != null && message.hasOwnProperty("scriptVariables")) { - if (!$util.isObject(message.scriptVariables)) - return "scriptVariables: object expected"; - var key = Object.keys(message.scriptVariables); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.scriptVariables[key[i]])) - return "scriptVariables: string{k:string} expected"; - } - if (message.properties != null && message.hasOwnProperty("properties")) { - if (!$util.isObject(message.properties)) - return "properties: object expected"; - var key = Object.keys(message.properties); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.properties[key[i]])) - return "properties: string{k:string} expected"; - } - if (message.jarFileUris != null && message.hasOwnProperty("jarFileUris")) { - if (!Array.isArray(message.jarFileUris)) - return "jarFileUris: array expected"; - for (var i = 0; i < message.jarFileUris.length; ++i) - if (!$util.isString(message.jarFileUris[i])) - return "jarFileUris: string[] expected"; - } - if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) { - var error = $root.google.cloud.dataproc.v1.LoggingConfig.verify(message.loggingConfig); - if (error) - return "loggingConfig." + error; - } - return null; - }; - - /** - * Creates a SparkSqlJob message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.SparkSqlJob - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.SparkSqlJob} SparkSqlJob - */ - SparkSqlJob.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.SparkSqlJob) - return object; - var message = new $root.google.cloud.dataproc.v1.SparkSqlJob(); - if (object.queryFileUri != null) - message.queryFileUri = String(object.queryFileUri); - if (object.queryList != null) { - if (typeof object.queryList !== "object") - throw TypeError(".google.cloud.dataproc.v1.SparkSqlJob.queryList: object expected"); - message.queryList = $root.google.cloud.dataproc.v1.QueryList.fromObject(object.queryList); - } - if (object.scriptVariables) { - if (typeof object.scriptVariables !== "object") - throw TypeError(".google.cloud.dataproc.v1.SparkSqlJob.scriptVariables: object expected"); - message.scriptVariables = {}; - for (var keys = Object.keys(object.scriptVariables), i = 0; i < keys.length; ++i) - message.scriptVariables[keys[i]] = String(object.scriptVariables[keys[i]]); - } - if (object.properties) { - if (typeof object.properties !== "object") - throw TypeError(".google.cloud.dataproc.v1.SparkSqlJob.properties: object expected"); - message.properties = {}; - for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) - message.properties[keys[i]] = String(object.properties[keys[i]]); - } - if (object.jarFileUris) { - if (!Array.isArray(object.jarFileUris)) - throw TypeError(".google.cloud.dataproc.v1.SparkSqlJob.jarFileUris: array expected"); - message.jarFileUris = []; - for (var i = 0; i < object.jarFileUris.length; ++i) - message.jarFileUris[i] = String(object.jarFileUris[i]); - } - if (object.loggingConfig != null) { - if (typeof object.loggingConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.SparkSqlJob.loggingConfig: object expected"); - message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.fromObject(object.loggingConfig); - } - return message; - }; - - /** - * Creates a plain object from a SparkSqlJob message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.SparkSqlJob - * @static - * @param {google.cloud.dataproc.v1.SparkSqlJob} message SparkSqlJob - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SparkSqlJob.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.jarFileUris = []; - if (options.objects || options.defaults) { - object.scriptVariables = {}; - object.properties = {}; - } - if (options.defaults) - object.loggingConfig = null; - if (message.queryFileUri != null && message.hasOwnProperty("queryFileUri")) { - object.queryFileUri = message.queryFileUri; - if (options.oneofs) - object.queries = "queryFileUri"; - } - if (message.queryList != null && message.hasOwnProperty("queryList")) { - object.queryList = $root.google.cloud.dataproc.v1.QueryList.toObject(message.queryList, options); - if (options.oneofs) - object.queries = "queryList"; - } - var keys2; - if (message.scriptVariables && (keys2 = Object.keys(message.scriptVariables)).length) { - object.scriptVariables = {}; - for (var j = 0; j < keys2.length; ++j) - object.scriptVariables[keys2[j]] = message.scriptVariables[keys2[j]]; - } - if (message.properties && (keys2 = Object.keys(message.properties)).length) { - object.properties = {}; - for (var j = 0; j < keys2.length; ++j) - object.properties[keys2[j]] = message.properties[keys2[j]]; - } - if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) - object.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.toObject(message.loggingConfig, options); - if (message.jarFileUris && message.jarFileUris.length) { - object.jarFileUris = []; - for (var j = 0; j < message.jarFileUris.length; ++j) - object.jarFileUris[j] = message.jarFileUris[j]; - } - return object; - }; - - /** - * Converts this SparkSqlJob to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.SparkSqlJob - * @instance - * @returns {Object.} JSON object - */ - SparkSqlJob.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SparkSqlJob - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.SparkSqlJob - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SparkSqlJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.SparkSqlJob"; - }; - - return SparkSqlJob; - })(); - - v1.PigJob = (function() { - - /** - * Properties of a PigJob. - * @memberof google.cloud.dataproc.v1 - * @interface IPigJob - * @property {string|null} [queryFileUri] PigJob queryFileUri - * @property {google.cloud.dataproc.v1.IQueryList|null} [queryList] PigJob queryList - * @property {boolean|null} [continueOnFailure] PigJob continueOnFailure - * @property {Object.|null} [scriptVariables] PigJob scriptVariables - * @property {Object.|null} [properties] PigJob properties - * @property {Array.|null} [jarFileUris] PigJob jarFileUris - * @property {google.cloud.dataproc.v1.ILoggingConfig|null} [loggingConfig] PigJob loggingConfig - */ - - /** - * Constructs a new PigJob. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a PigJob. - * @implements IPigJob - * @constructor - * @param {google.cloud.dataproc.v1.IPigJob=} [properties] Properties to set - */ - function PigJob(properties) { - this.scriptVariables = {}; - this.properties = {}; - this.jarFileUris = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PigJob queryFileUri. - * @member {string|null|undefined} queryFileUri - * @memberof google.cloud.dataproc.v1.PigJob - * @instance - */ - PigJob.prototype.queryFileUri = null; - - /** - * PigJob queryList. - * @member {google.cloud.dataproc.v1.IQueryList|null|undefined} queryList - * @memberof google.cloud.dataproc.v1.PigJob - * @instance - */ - PigJob.prototype.queryList = null; - - /** - * PigJob continueOnFailure. - * @member {boolean} continueOnFailure - * @memberof google.cloud.dataproc.v1.PigJob - * @instance - */ - PigJob.prototype.continueOnFailure = false; - - /** - * PigJob scriptVariables. - * @member {Object.} scriptVariables - * @memberof google.cloud.dataproc.v1.PigJob - * @instance - */ - PigJob.prototype.scriptVariables = $util.emptyObject; - - /** - * PigJob properties. - * @member {Object.} properties - * @memberof google.cloud.dataproc.v1.PigJob - * @instance - */ - PigJob.prototype.properties = $util.emptyObject; - - /** - * PigJob jarFileUris. - * @member {Array.} jarFileUris - * @memberof google.cloud.dataproc.v1.PigJob - * @instance - */ - PigJob.prototype.jarFileUris = $util.emptyArray; - - /** - * PigJob loggingConfig. - * @member {google.cloud.dataproc.v1.ILoggingConfig|null|undefined} loggingConfig - * @memberof google.cloud.dataproc.v1.PigJob - * @instance - */ - PigJob.prototype.loggingConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * PigJob queries. - * @member {"queryFileUri"|"queryList"|undefined} queries - * @memberof google.cloud.dataproc.v1.PigJob - * @instance - */ - Object.defineProperty(PigJob.prototype, "queries", { - get: $util.oneOfGetter($oneOfFields = ["queryFileUri", "queryList"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new PigJob instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.PigJob - * @static - * @param {google.cloud.dataproc.v1.IPigJob=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.PigJob} PigJob instance - */ - PigJob.create = function create(properties) { - return new PigJob(properties); - }; - - /** - * Encodes the specified PigJob message. Does not implicitly {@link google.cloud.dataproc.v1.PigJob.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.PigJob - * @static - * @param {google.cloud.dataproc.v1.IPigJob} message PigJob message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PigJob.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.queryFileUri != null && Object.hasOwnProperty.call(message, "queryFileUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.queryFileUri); - if (message.queryList != null && Object.hasOwnProperty.call(message, "queryList")) - $root.google.cloud.dataproc.v1.QueryList.encode(message.queryList, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.continueOnFailure != null && Object.hasOwnProperty.call(message, "continueOnFailure")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.continueOnFailure); - if (message.scriptVariables != null && Object.hasOwnProperty.call(message, "scriptVariables")) - for (var keys = Object.keys(message.scriptVariables), 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.scriptVariables[keys[i]]).ldelim(); - if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) - for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.properties[keys[i]]).ldelim(); - if (message.jarFileUris != null && message.jarFileUris.length) - for (var i = 0; i < message.jarFileUris.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.jarFileUris[i]); - if (message.loggingConfig != null && Object.hasOwnProperty.call(message, "loggingConfig")) - $root.google.cloud.dataproc.v1.LoggingConfig.encode(message.loggingConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PigJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.PigJob.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.PigJob - * @static - * @param {google.cloud.dataproc.v1.IPigJob} message PigJob message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PigJob.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PigJob message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.PigJob - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.PigJob} PigJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PigJob.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.PigJob(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.queryFileUri = reader.string(); - break; - } - case 2: { - message.queryList = $root.google.cloud.dataproc.v1.QueryList.decode(reader, reader.uint32()); - break; - } - case 3: { - message.continueOnFailure = reader.bool(); - break; - } - case 4: { - if (message.scriptVariables === $util.emptyObject) - message.scriptVariables = {}; - 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.scriptVariables[key] = value; - break; - } - case 5: { - if (message.properties === $util.emptyObject) - message.properties = {}; - 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.properties[key] = value; - break; - } - case 6: { - if (!(message.jarFileUris && message.jarFileUris.length)) - message.jarFileUris = []; - message.jarFileUris.push(reader.string()); - break; - } - case 7: { - message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PigJob message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.PigJob - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.PigJob} PigJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PigJob.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PigJob message. - * @function verify - * @memberof google.cloud.dataproc.v1.PigJob - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PigJob.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.queryFileUri != null && message.hasOwnProperty("queryFileUri")) { - properties.queries = 1; - if (!$util.isString(message.queryFileUri)) - return "queryFileUri: string expected"; - } - if (message.queryList != null && message.hasOwnProperty("queryList")) { - if (properties.queries === 1) - return "queries: multiple values"; - properties.queries = 1; - { - var error = $root.google.cloud.dataproc.v1.QueryList.verify(message.queryList); - if (error) - return "queryList." + error; - } - } - if (message.continueOnFailure != null && message.hasOwnProperty("continueOnFailure")) - if (typeof message.continueOnFailure !== "boolean") - return "continueOnFailure: boolean expected"; - if (message.scriptVariables != null && message.hasOwnProperty("scriptVariables")) { - if (!$util.isObject(message.scriptVariables)) - return "scriptVariables: object expected"; - var key = Object.keys(message.scriptVariables); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.scriptVariables[key[i]])) - return "scriptVariables: string{k:string} expected"; - } - if (message.properties != null && message.hasOwnProperty("properties")) { - if (!$util.isObject(message.properties)) - return "properties: object expected"; - var key = Object.keys(message.properties); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.properties[key[i]])) - return "properties: string{k:string} expected"; - } - if (message.jarFileUris != null && message.hasOwnProperty("jarFileUris")) { - if (!Array.isArray(message.jarFileUris)) - return "jarFileUris: array expected"; - for (var i = 0; i < message.jarFileUris.length; ++i) - if (!$util.isString(message.jarFileUris[i])) - return "jarFileUris: string[] expected"; - } - if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) { - var error = $root.google.cloud.dataproc.v1.LoggingConfig.verify(message.loggingConfig); - if (error) - return "loggingConfig." + error; - } - return null; - }; - - /** - * Creates a PigJob message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.PigJob - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.PigJob} PigJob - */ - PigJob.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.PigJob) - return object; - var message = new $root.google.cloud.dataproc.v1.PigJob(); - if (object.queryFileUri != null) - message.queryFileUri = String(object.queryFileUri); - if (object.queryList != null) { - if (typeof object.queryList !== "object") - throw TypeError(".google.cloud.dataproc.v1.PigJob.queryList: object expected"); - message.queryList = $root.google.cloud.dataproc.v1.QueryList.fromObject(object.queryList); - } - if (object.continueOnFailure != null) - message.continueOnFailure = Boolean(object.continueOnFailure); - if (object.scriptVariables) { - if (typeof object.scriptVariables !== "object") - throw TypeError(".google.cloud.dataproc.v1.PigJob.scriptVariables: object expected"); - message.scriptVariables = {}; - for (var keys = Object.keys(object.scriptVariables), i = 0; i < keys.length; ++i) - message.scriptVariables[keys[i]] = String(object.scriptVariables[keys[i]]); - } - if (object.properties) { - if (typeof object.properties !== "object") - throw TypeError(".google.cloud.dataproc.v1.PigJob.properties: object expected"); - message.properties = {}; - for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) - message.properties[keys[i]] = String(object.properties[keys[i]]); - } - if (object.jarFileUris) { - if (!Array.isArray(object.jarFileUris)) - throw TypeError(".google.cloud.dataproc.v1.PigJob.jarFileUris: array expected"); - message.jarFileUris = []; - for (var i = 0; i < object.jarFileUris.length; ++i) - message.jarFileUris[i] = String(object.jarFileUris[i]); - } - if (object.loggingConfig != null) { - if (typeof object.loggingConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.PigJob.loggingConfig: object expected"); - message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.fromObject(object.loggingConfig); - } - return message; - }; - - /** - * Creates a plain object from a PigJob message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.PigJob - * @static - * @param {google.cloud.dataproc.v1.PigJob} message PigJob - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PigJob.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.jarFileUris = []; - if (options.objects || options.defaults) { - object.scriptVariables = {}; - object.properties = {}; - } - if (options.defaults) { - object.continueOnFailure = false; - object.loggingConfig = null; - } - if (message.queryFileUri != null && message.hasOwnProperty("queryFileUri")) { - object.queryFileUri = message.queryFileUri; - if (options.oneofs) - object.queries = "queryFileUri"; - } - if (message.queryList != null && message.hasOwnProperty("queryList")) { - object.queryList = $root.google.cloud.dataproc.v1.QueryList.toObject(message.queryList, options); - if (options.oneofs) - object.queries = "queryList"; - } - if (message.continueOnFailure != null && message.hasOwnProperty("continueOnFailure")) - object.continueOnFailure = message.continueOnFailure; - var keys2; - if (message.scriptVariables && (keys2 = Object.keys(message.scriptVariables)).length) { - object.scriptVariables = {}; - for (var j = 0; j < keys2.length; ++j) - object.scriptVariables[keys2[j]] = message.scriptVariables[keys2[j]]; - } - if (message.properties && (keys2 = Object.keys(message.properties)).length) { - object.properties = {}; - for (var j = 0; j < keys2.length; ++j) - object.properties[keys2[j]] = message.properties[keys2[j]]; - } - if (message.jarFileUris && message.jarFileUris.length) { - object.jarFileUris = []; - for (var j = 0; j < message.jarFileUris.length; ++j) - object.jarFileUris[j] = message.jarFileUris[j]; - } - if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) - object.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.toObject(message.loggingConfig, options); - return object; - }; - - /** - * Converts this PigJob to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.PigJob - * @instance - * @returns {Object.} JSON object - */ - PigJob.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PigJob - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.PigJob - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PigJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.PigJob"; - }; - - return PigJob; - })(); - - v1.SparkRJob = (function() { - - /** - * Properties of a SparkRJob. - * @memberof google.cloud.dataproc.v1 - * @interface ISparkRJob - * @property {string|null} [mainRFileUri] SparkRJob mainRFileUri - * @property {Array.|null} [args] SparkRJob args - * @property {Array.|null} [fileUris] SparkRJob fileUris - * @property {Array.|null} [archiveUris] SparkRJob archiveUris - * @property {Object.|null} [properties] SparkRJob properties - * @property {google.cloud.dataproc.v1.ILoggingConfig|null} [loggingConfig] SparkRJob loggingConfig - */ - - /** - * Constructs a new SparkRJob. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a SparkRJob. - * @implements ISparkRJob - * @constructor - * @param {google.cloud.dataproc.v1.ISparkRJob=} [properties] Properties to set - */ - function SparkRJob(properties) { - this.args = []; - this.fileUris = []; - this.archiveUris = []; - this.properties = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SparkRJob mainRFileUri. - * @member {string} mainRFileUri - * @memberof google.cloud.dataproc.v1.SparkRJob - * @instance - */ - SparkRJob.prototype.mainRFileUri = ""; - - /** - * SparkRJob args. - * @member {Array.} args - * @memberof google.cloud.dataproc.v1.SparkRJob - * @instance - */ - SparkRJob.prototype.args = $util.emptyArray; - - /** - * SparkRJob fileUris. - * @member {Array.} fileUris - * @memberof google.cloud.dataproc.v1.SparkRJob - * @instance - */ - SparkRJob.prototype.fileUris = $util.emptyArray; - - /** - * SparkRJob archiveUris. - * @member {Array.} archiveUris - * @memberof google.cloud.dataproc.v1.SparkRJob - * @instance - */ - SparkRJob.prototype.archiveUris = $util.emptyArray; - - /** - * SparkRJob properties. - * @member {Object.} properties - * @memberof google.cloud.dataproc.v1.SparkRJob - * @instance - */ - SparkRJob.prototype.properties = $util.emptyObject; - - /** - * SparkRJob loggingConfig. - * @member {google.cloud.dataproc.v1.ILoggingConfig|null|undefined} loggingConfig - * @memberof google.cloud.dataproc.v1.SparkRJob - * @instance - */ - SparkRJob.prototype.loggingConfig = null; - - /** - * Creates a new SparkRJob instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.SparkRJob - * @static - * @param {google.cloud.dataproc.v1.ISparkRJob=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.SparkRJob} SparkRJob instance - */ - SparkRJob.create = function create(properties) { - return new SparkRJob(properties); - }; - - /** - * Encodes the specified SparkRJob message. Does not implicitly {@link google.cloud.dataproc.v1.SparkRJob.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.SparkRJob - * @static - * @param {google.cloud.dataproc.v1.ISparkRJob} message SparkRJob message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SparkRJob.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.mainRFileUri != null && Object.hasOwnProperty.call(message, "mainRFileUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.mainRFileUri); - 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.fileUris != null && message.fileUris.length) - for (var i = 0; i < message.fileUris.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.fileUris[i]); - if (message.archiveUris != null && message.archiveUris.length) - for (var i = 0; i < message.archiveUris.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.archiveUris[i]); - if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) - for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.properties[keys[i]]).ldelim(); - if (message.loggingConfig != null && Object.hasOwnProperty.call(message, "loggingConfig")) - $root.google.cloud.dataproc.v1.LoggingConfig.encode(message.loggingConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SparkRJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SparkRJob.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.SparkRJob - * @static - * @param {google.cloud.dataproc.v1.ISparkRJob} message SparkRJob message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SparkRJob.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SparkRJob message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.SparkRJob - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.SparkRJob} SparkRJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SparkRJob.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.SparkRJob(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.mainRFileUri = reader.string(); - break; - } - case 2: { - if (!(message.args && message.args.length)) - message.args = []; - message.args.push(reader.string()); - break; - } - case 3: { - if (!(message.fileUris && message.fileUris.length)) - message.fileUris = []; - message.fileUris.push(reader.string()); - break; - } - case 4: { - if (!(message.archiveUris && message.archiveUris.length)) - message.archiveUris = []; - message.archiveUris.push(reader.string()); - break; - } - case 5: { - if (message.properties === $util.emptyObject) - message.properties = {}; - 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.properties[key] = value; - break; - } - case 6: { - message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SparkRJob message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.SparkRJob - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.SparkRJob} SparkRJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SparkRJob.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SparkRJob message. - * @function verify - * @memberof google.cloud.dataproc.v1.SparkRJob - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SparkRJob.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.mainRFileUri != null && message.hasOwnProperty("mainRFileUri")) - if (!$util.isString(message.mainRFileUri)) - return "mainRFileUri: 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.fileUris != null && message.hasOwnProperty("fileUris")) { - if (!Array.isArray(message.fileUris)) - return "fileUris: array expected"; - for (var i = 0; i < message.fileUris.length; ++i) - if (!$util.isString(message.fileUris[i])) - return "fileUris: string[] expected"; - } - if (message.archiveUris != null && message.hasOwnProperty("archiveUris")) { - if (!Array.isArray(message.archiveUris)) - return "archiveUris: array expected"; - for (var i = 0; i < message.archiveUris.length; ++i) - if (!$util.isString(message.archiveUris[i])) - return "archiveUris: string[] expected"; - } - if (message.properties != null && message.hasOwnProperty("properties")) { - if (!$util.isObject(message.properties)) - return "properties: object expected"; - var key = Object.keys(message.properties); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.properties[key[i]])) - return "properties: string{k:string} expected"; - } - if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) { - var error = $root.google.cloud.dataproc.v1.LoggingConfig.verify(message.loggingConfig); - if (error) - return "loggingConfig." + error; - } - return null; - }; - - /** - * Creates a SparkRJob message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.SparkRJob - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.SparkRJob} SparkRJob - */ - SparkRJob.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.SparkRJob) - return object; - var message = new $root.google.cloud.dataproc.v1.SparkRJob(); - if (object.mainRFileUri != null) - message.mainRFileUri = String(object.mainRFileUri); - if (object.args) { - if (!Array.isArray(object.args)) - throw TypeError(".google.cloud.dataproc.v1.SparkRJob.args: array expected"); - message.args = []; - for (var i = 0; i < object.args.length; ++i) - message.args[i] = String(object.args[i]); - } - if (object.fileUris) { - if (!Array.isArray(object.fileUris)) - throw TypeError(".google.cloud.dataproc.v1.SparkRJob.fileUris: array expected"); - message.fileUris = []; - for (var i = 0; i < object.fileUris.length; ++i) - message.fileUris[i] = String(object.fileUris[i]); - } - if (object.archiveUris) { - if (!Array.isArray(object.archiveUris)) - throw TypeError(".google.cloud.dataproc.v1.SparkRJob.archiveUris: array expected"); - message.archiveUris = []; - for (var i = 0; i < object.archiveUris.length; ++i) - message.archiveUris[i] = String(object.archiveUris[i]); - } - if (object.properties) { - if (typeof object.properties !== "object") - throw TypeError(".google.cloud.dataproc.v1.SparkRJob.properties: object expected"); - message.properties = {}; - for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) - message.properties[keys[i]] = String(object.properties[keys[i]]); - } - if (object.loggingConfig != null) { - if (typeof object.loggingConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.SparkRJob.loggingConfig: object expected"); - message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.fromObject(object.loggingConfig); - } - return message; - }; - - /** - * Creates a plain object from a SparkRJob message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.SparkRJob - * @static - * @param {google.cloud.dataproc.v1.SparkRJob} message SparkRJob - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SparkRJob.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.args = []; - object.fileUris = []; - object.archiveUris = []; - } - if (options.objects || options.defaults) - object.properties = {}; - if (options.defaults) { - object.mainRFileUri = ""; - object.loggingConfig = null; - } - if (message.mainRFileUri != null && message.hasOwnProperty("mainRFileUri")) - object.mainRFileUri = message.mainRFileUri; - 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.fileUris && message.fileUris.length) { - object.fileUris = []; - for (var j = 0; j < message.fileUris.length; ++j) - object.fileUris[j] = message.fileUris[j]; - } - if (message.archiveUris && message.archiveUris.length) { - object.archiveUris = []; - for (var j = 0; j < message.archiveUris.length; ++j) - object.archiveUris[j] = message.archiveUris[j]; - } - var keys2; - if (message.properties && (keys2 = Object.keys(message.properties)).length) { - object.properties = {}; - for (var j = 0; j < keys2.length; ++j) - object.properties[keys2[j]] = message.properties[keys2[j]]; - } - if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) - object.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.toObject(message.loggingConfig, options); - return object; - }; - - /** - * Converts this SparkRJob to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.SparkRJob - * @instance - * @returns {Object.} JSON object - */ - SparkRJob.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SparkRJob - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.SparkRJob - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SparkRJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.SparkRJob"; - }; - - return SparkRJob; - })(); - - v1.PrestoJob = (function() { - - /** - * Properties of a PrestoJob. - * @memberof google.cloud.dataproc.v1 - * @interface IPrestoJob - * @property {string|null} [queryFileUri] PrestoJob queryFileUri - * @property {google.cloud.dataproc.v1.IQueryList|null} [queryList] PrestoJob queryList - * @property {boolean|null} [continueOnFailure] PrestoJob continueOnFailure - * @property {string|null} [outputFormat] PrestoJob outputFormat - * @property {Array.|null} [clientTags] PrestoJob clientTags - * @property {Object.|null} [properties] PrestoJob properties - * @property {google.cloud.dataproc.v1.ILoggingConfig|null} [loggingConfig] PrestoJob loggingConfig - */ - - /** - * Constructs a new PrestoJob. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a PrestoJob. - * @implements IPrestoJob - * @constructor - * @param {google.cloud.dataproc.v1.IPrestoJob=} [properties] Properties to set - */ - function PrestoJob(properties) { - this.clientTags = []; - this.properties = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PrestoJob queryFileUri. - * @member {string|null|undefined} queryFileUri - * @memberof google.cloud.dataproc.v1.PrestoJob - * @instance - */ - PrestoJob.prototype.queryFileUri = null; - - /** - * PrestoJob queryList. - * @member {google.cloud.dataproc.v1.IQueryList|null|undefined} queryList - * @memberof google.cloud.dataproc.v1.PrestoJob - * @instance - */ - PrestoJob.prototype.queryList = null; - - /** - * PrestoJob continueOnFailure. - * @member {boolean} continueOnFailure - * @memberof google.cloud.dataproc.v1.PrestoJob - * @instance - */ - PrestoJob.prototype.continueOnFailure = false; - - /** - * PrestoJob outputFormat. - * @member {string} outputFormat - * @memberof google.cloud.dataproc.v1.PrestoJob - * @instance - */ - PrestoJob.prototype.outputFormat = ""; - - /** - * PrestoJob clientTags. - * @member {Array.} clientTags - * @memberof google.cloud.dataproc.v1.PrestoJob - * @instance - */ - PrestoJob.prototype.clientTags = $util.emptyArray; - - /** - * PrestoJob properties. - * @member {Object.} properties - * @memberof google.cloud.dataproc.v1.PrestoJob - * @instance - */ - PrestoJob.prototype.properties = $util.emptyObject; - - /** - * PrestoJob loggingConfig. - * @member {google.cloud.dataproc.v1.ILoggingConfig|null|undefined} loggingConfig - * @memberof google.cloud.dataproc.v1.PrestoJob - * @instance - */ - PrestoJob.prototype.loggingConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * PrestoJob queries. - * @member {"queryFileUri"|"queryList"|undefined} queries - * @memberof google.cloud.dataproc.v1.PrestoJob - * @instance - */ - Object.defineProperty(PrestoJob.prototype, "queries", { - get: $util.oneOfGetter($oneOfFields = ["queryFileUri", "queryList"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new PrestoJob instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.PrestoJob - * @static - * @param {google.cloud.dataproc.v1.IPrestoJob=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.PrestoJob} PrestoJob instance - */ - PrestoJob.create = function create(properties) { - return new PrestoJob(properties); - }; - - /** - * Encodes the specified PrestoJob message. Does not implicitly {@link google.cloud.dataproc.v1.PrestoJob.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.PrestoJob - * @static - * @param {google.cloud.dataproc.v1.IPrestoJob} message PrestoJob message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PrestoJob.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.queryFileUri != null && Object.hasOwnProperty.call(message, "queryFileUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.queryFileUri); - if (message.queryList != null && Object.hasOwnProperty.call(message, "queryList")) - $root.google.cloud.dataproc.v1.QueryList.encode(message.queryList, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.continueOnFailure != null && Object.hasOwnProperty.call(message, "continueOnFailure")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.continueOnFailure); - if (message.outputFormat != null && Object.hasOwnProperty.call(message, "outputFormat")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.outputFormat); - if (message.clientTags != null && message.clientTags.length) - for (var i = 0; i < message.clientTags.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.clientTags[i]); - if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) - for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.properties[keys[i]]).ldelim(); - if (message.loggingConfig != null && Object.hasOwnProperty.call(message, "loggingConfig")) - $root.google.cloud.dataproc.v1.LoggingConfig.encode(message.loggingConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PrestoJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.PrestoJob.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.PrestoJob - * @static - * @param {google.cloud.dataproc.v1.IPrestoJob} message PrestoJob message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PrestoJob.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PrestoJob message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.PrestoJob - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.PrestoJob} PrestoJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PrestoJob.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.PrestoJob(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.queryFileUri = reader.string(); - break; - } - case 2: { - message.queryList = $root.google.cloud.dataproc.v1.QueryList.decode(reader, reader.uint32()); - break; - } - case 3: { - message.continueOnFailure = reader.bool(); - break; - } - case 4: { - message.outputFormat = reader.string(); - break; - } - case 5: { - if (!(message.clientTags && message.clientTags.length)) - message.clientTags = []; - message.clientTags.push(reader.string()); - break; - } - case 6: { - if (message.properties === $util.emptyObject) - message.properties = {}; - 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.properties[key] = value; - break; - } - case 7: { - message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PrestoJob message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.PrestoJob - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.PrestoJob} PrestoJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PrestoJob.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PrestoJob message. - * @function verify - * @memberof google.cloud.dataproc.v1.PrestoJob - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PrestoJob.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.queryFileUri != null && message.hasOwnProperty("queryFileUri")) { - properties.queries = 1; - if (!$util.isString(message.queryFileUri)) - return "queryFileUri: string expected"; - } - if (message.queryList != null && message.hasOwnProperty("queryList")) { - if (properties.queries === 1) - return "queries: multiple values"; - properties.queries = 1; - { - var error = $root.google.cloud.dataproc.v1.QueryList.verify(message.queryList); - if (error) - return "queryList." + error; - } - } - if (message.continueOnFailure != null && message.hasOwnProperty("continueOnFailure")) - if (typeof message.continueOnFailure !== "boolean") - return "continueOnFailure: boolean expected"; - if (message.outputFormat != null && message.hasOwnProperty("outputFormat")) - if (!$util.isString(message.outputFormat)) - return "outputFormat: string expected"; - if (message.clientTags != null && message.hasOwnProperty("clientTags")) { - if (!Array.isArray(message.clientTags)) - return "clientTags: array expected"; - for (var i = 0; i < message.clientTags.length; ++i) - if (!$util.isString(message.clientTags[i])) - return "clientTags: string[] expected"; - } - if (message.properties != null && message.hasOwnProperty("properties")) { - if (!$util.isObject(message.properties)) - return "properties: object expected"; - var key = Object.keys(message.properties); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.properties[key[i]])) - return "properties: string{k:string} expected"; - } - if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) { - var error = $root.google.cloud.dataproc.v1.LoggingConfig.verify(message.loggingConfig); - if (error) - return "loggingConfig." + error; - } - return null; - }; - - /** - * Creates a PrestoJob message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.PrestoJob - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.PrestoJob} PrestoJob - */ - PrestoJob.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.PrestoJob) - return object; - var message = new $root.google.cloud.dataproc.v1.PrestoJob(); - if (object.queryFileUri != null) - message.queryFileUri = String(object.queryFileUri); - if (object.queryList != null) { - if (typeof object.queryList !== "object") - throw TypeError(".google.cloud.dataproc.v1.PrestoJob.queryList: object expected"); - message.queryList = $root.google.cloud.dataproc.v1.QueryList.fromObject(object.queryList); - } - if (object.continueOnFailure != null) - message.continueOnFailure = Boolean(object.continueOnFailure); - if (object.outputFormat != null) - message.outputFormat = String(object.outputFormat); - if (object.clientTags) { - if (!Array.isArray(object.clientTags)) - throw TypeError(".google.cloud.dataproc.v1.PrestoJob.clientTags: array expected"); - message.clientTags = []; - for (var i = 0; i < object.clientTags.length; ++i) - message.clientTags[i] = String(object.clientTags[i]); - } - if (object.properties) { - if (typeof object.properties !== "object") - throw TypeError(".google.cloud.dataproc.v1.PrestoJob.properties: object expected"); - message.properties = {}; - for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) - message.properties[keys[i]] = String(object.properties[keys[i]]); - } - if (object.loggingConfig != null) { - if (typeof object.loggingConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.PrestoJob.loggingConfig: object expected"); - message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.fromObject(object.loggingConfig); - } - return message; - }; - - /** - * Creates a plain object from a PrestoJob message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.PrestoJob - * @static - * @param {google.cloud.dataproc.v1.PrestoJob} message PrestoJob - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PrestoJob.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.clientTags = []; - if (options.objects || options.defaults) - object.properties = {}; - if (options.defaults) { - object.continueOnFailure = false; - object.outputFormat = ""; - object.loggingConfig = null; - } - if (message.queryFileUri != null && message.hasOwnProperty("queryFileUri")) { - object.queryFileUri = message.queryFileUri; - if (options.oneofs) - object.queries = "queryFileUri"; - } - if (message.queryList != null && message.hasOwnProperty("queryList")) { - object.queryList = $root.google.cloud.dataproc.v1.QueryList.toObject(message.queryList, options); - if (options.oneofs) - object.queries = "queryList"; - } - if (message.continueOnFailure != null && message.hasOwnProperty("continueOnFailure")) - object.continueOnFailure = message.continueOnFailure; - if (message.outputFormat != null && message.hasOwnProperty("outputFormat")) - object.outputFormat = message.outputFormat; - if (message.clientTags && message.clientTags.length) { - object.clientTags = []; - for (var j = 0; j < message.clientTags.length; ++j) - object.clientTags[j] = message.clientTags[j]; - } - var keys2; - if (message.properties && (keys2 = Object.keys(message.properties)).length) { - object.properties = {}; - for (var j = 0; j < keys2.length; ++j) - object.properties[keys2[j]] = message.properties[keys2[j]]; - } - if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) - object.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.toObject(message.loggingConfig, options); - return object; - }; - - /** - * Converts this PrestoJob to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.PrestoJob - * @instance - * @returns {Object.} JSON object - */ - PrestoJob.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PrestoJob - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.PrestoJob - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PrestoJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.PrestoJob"; - }; - - return PrestoJob; - })(); - - v1.TrinoJob = (function() { - - /** - * Properties of a TrinoJob. - * @memberof google.cloud.dataproc.v1 - * @interface ITrinoJob - * @property {string|null} [queryFileUri] TrinoJob queryFileUri - * @property {google.cloud.dataproc.v1.IQueryList|null} [queryList] TrinoJob queryList - * @property {boolean|null} [continueOnFailure] TrinoJob continueOnFailure - * @property {string|null} [outputFormat] TrinoJob outputFormat - * @property {Array.|null} [clientTags] TrinoJob clientTags - * @property {Object.|null} [properties] TrinoJob properties - * @property {google.cloud.dataproc.v1.ILoggingConfig|null} [loggingConfig] TrinoJob loggingConfig - */ - - /** - * Constructs a new TrinoJob. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a TrinoJob. - * @implements ITrinoJob - * @constructor - * @param {google.cloud.dataproc.v1.ITrinoJob=} [properties] Properties to set - */ - function TrinoJob(properties) { - this.clientTags = []; - this.properties = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TrinoJob queryFileUri. - * @member {string|null|undefined} queryFileUri - * @memberof google.cloud.dataproc.v1.TrinoJob - * @instance - */ - TrinoJob.prototype.queryFileUri = null; - - /** - * TrinoJob queryList. - * @member {google.cloud.dataproc.v1.IQueryList|null|undefined} queryList - * @memberof google.cloud.dataproc.v1.TrinoJob - * @instance - */ - TrinoJob.prototype.queryList = null; - - /** - * TrinoJob continueOnFailure. - * @member {boolean} continueOnFailure - * @memberof google.cloud.dataproc.v1.TrinoJob - * @instance - */ - TrinoJob.prototype.continueOnFailure = false; - - /** - * TrinoJob outputFormat. - * @member {string} outputFormat - * @memberof google.cloud.dataproc.v1.TrinoJob - * @instance - */ - TrinoJob.prototype.outputFormat = ""; - - /** - * TrinoJob clientTags. - * @member {Array.} clientTags - * @memberof google.cloud.dataproc.v1.TrinoJob - * @instance - */ - TrinoJob.prototype.clientTags = $util.emptyArray; - - /** - * TrinoJob properties. - * @member {Object.} properties - * @memberof google.cloud.dataproc.v1.TrinoJob - * @instance - */ - TrinoJob.prototype.properties = $util.emptyObject; - - /** - * TrinoJob loggingConfig. - * @member {google.cloud.dataproc.v1.ILoggingConfig|null|undefined} loggingConfig - * @memberof google.cloud.dataproc.v1.TrinoJob - * @instance - */ - TrinoJob.prototype.loggingConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * TrinoJob queries. - * @member {"queryFileUri"|"queryList"|undefined} queries - * @memberof google.cloud.dataproc.v1.TrinoJob - * @instance - */ - Object.defineProperty(TrinoJob.prototype, "queries", { - get: $util.oneOfGetter($oneOfFields = ["queryFileUri", "queryList"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new TrinoJob instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.TrinoJob - * @static - * @param {google.cloud.dataproc.v1.ITrinoJob=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.TrinoJob} TrinoJob instance - */ - TrinoJob.create = function create(properties) { - return new TrinoJob(properties); - }; - - /** - * Encodes the specified TrinoJob message. Does not implicitly {@link google.cloud.dataproc.v1.TrinoJob.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.TrinoJob - * @static - * @param {google.cloud.dataproc.v1.ITrinoJob} message TrinoJob message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TrinoJob.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.queryFileUri != null && Object.hasOwnProperty.call(message, "queryFileUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.queryFileUri); - if (message.queryList != null && Object.hasOwnProperty.call(message, "queryList")) - $root.google.cloud.dataproc.v1.QueryList.encode(message.queryList, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.continueOnFailure != null && Object.hasOwnProperty.call(message, "continueOnFailure")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.continueOnFailure); - if (message.outputFormat != null && Object.hasOwnProperty.call(message, "outputFormat")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.outputFormat); - if (message.clientTags != null && message.clientTags.length) - for (var i = 0; i < message.clientTags.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.clientTags[i]); - if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) - for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.properties[keys[i]]).ldelim(); - if (message.loggingConfig != null && Object.hasOwnProperty.call(message, "loggingConfig")) - $root.google.cloud.dataproc.v1.LoggingConfig.encode(message.loggingConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TrinoJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.TrinoJob.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.TrinoJob - * @static - * @param {google.cloud.dataproc.v1.ITrinoJob} message TrinoJob message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TrinoJob.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TrinoJob message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.TrinoJob - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.TrinoJob} TrinoJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TrinoJob.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.TrinoJob(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.queryFileUri = reader.string(); - break; - } - case 2: { - message.queryList = $root.google.cloud.dataproc.v1.QueryList.decode(reader, reader.uint32()); - break; - } - case 3: { - message.continueOnFailure = reader.bool(); - break; - } - case 4: { - message.outputFormat = reader.string(); - break; - } - case 5: { - if (!(message.clientTags && message.clientTags.length)) - message.clientTags = []; - message.clientTags.push(reader.string()); - break; - } - case 6: { - if (message.properties === $util.emptyObject) - message.properties = {}; - 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.properties[key] = value; - break; - } - case 7: { - message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TrinoJob message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.TrinoJob - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.TrinoJob} TrinoJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TrinoJob.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TrinoJob message. - * @function verify - * @memberof google.cloud.dataproc.v1.TrinoJob - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TrinoJob.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.queryFileUri != null && message.hasOwnProperty("queryFileUri")) { - properties.queries = 1; - if (!$util.isString(message.queryFileUri)) - return "queryFileUri: string expected"; - } - if (message.queryList != null && message.hasOwnProperty("queryList")) { - if (properties.queries === 1) - return "queries: multiple values"; - properties.queries = 1; - { - var error = $root.google.cloud.dataproc.v1.QueryList.verify(message.queryList); - if (error) - return "queryList." + error; - } - } - if (message.continueOnFailure != null && message.hasOwnProperty("continueOnFailure")) - if (typeof message.continueOnFailure !== "boolean") - return "continueOnFailure: boolean expected"; - if (message.outputFormat != null && message.hasOwnProperty("outputFormat")) - if (!$util.isString(message.outputFormat)) - return "outputFormat: string expected"; - if (message.clientTags != null && message.hasOwnProperty("clientTags")) { - if (!Array.isArray(message.clientTags)) - return "clientTags: array expected"; - for (var i = 0; i < message.clientTags.length; ++i) - if (!$util.isString(message.clientTags[i])) - return "clientTags: string[] expected"; - } - if (message.properties != null && message.hasOwnProperty("properties")) { - if (!$util.isObject(message.properties)) - return "properties: object expected"; - var key = Object.keys(message.properties); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.properties[key[i]])) - return "properties: string{k:string} expected"; - } - if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) { - var error = $root.google.cloud.dataproc.v1.LoggingConfig.verify(message.loggingConfig); - if (error) - return "loggingConfig." + error; - } - return null; - }; - - /** - * Creates a TrinoJob message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.TrinoJob - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.TrinoJob} TrinoJob - */ - TrinoJob.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.TrinoJob) - return object; - var message = new $root.google.cloud.dataproc.v1.TrinoJob(); - if (object.queryFileUri != null) - message.queryFileUri = String(object.queryFileUri); - if (object.queryList != null) { - if (typeof object.queryList !== "object") - throw TypeError(".google.cloud.dataproc.v1.TrinoJob.queryList: object expected"); - message.queryList = $root.google.cloud.dataproc.v1.QueryList.fromObject(object.queryList); - } - if (object.continueOnFailure != null) - message.continueOnFailure = Boolean(object.continueOnFailure); - if (object.outputFormat != null) - message.outputFormat = String(object.outputFormat); - if (object.clientTags) { - if (!Array.isArray(object.clientTags)) - throw TypeError(".google.cloud.dataproc.v1.TrinoJob.clientTags: array expected"); - message.clientTags = []; - for (var i = 0; i < object.clientTags.length; ++i) - message.clientTags[i] = String(object.clientTags[i]); - } - if (object.properties) { - if (typeof object.properties !== "object") - throw TypeError(".google.cloud.dataproc.v1.TrinoJob.properties: object expected"); - message.properties = {}; - for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) - message.properties[keys[i]] = String(object.properties[keys[i]]); - } - if (object.loggingConfig != null) { - if (typeof object.loggingConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.TrinoJob.loggingConfig: object expected"); - message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.fromObject(object.loggingConfig); - } - return message; - }; - - /** - * Creates a plain object from a TrinoJob message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.TrinoJob - * @static - * @param {google.cloud.dataproc.v1.TrinoJob} message TrinoJob - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TrinoJob.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.clientTags = []; - if (options.objects || options.defaults) - object.properties = {}; - if (options.defaults) { - object.continueOnFailure = false; - object.outputFormat = ""; - object.loggingConfig = null; - } - if (message.queryFileUri != null && message.hasOwnProperty("queryFileUri")) { - object.queryFileUri = message.queryFileUri; - if (options.oneofs) - object.queries = "queryFileUri"; - } - if (message.queryList != null && message.hasOwnProperty("queryList")) { - object.queryList = $root.google.cloud.dataproc.v1.QueryList.toObject(message.queryList, options); - if (options.oneofs) - object.queries = "queryList"; - } - if (message.continueOnFailure != null && message.hasOwnProperty("continueOnFailure")) - object.continueOnFailure = message.continueOnFailure; - if (message.outputFormat != null && message.hasOwnProperty("outputFormat")) - object.outputFormat = message.outputFormat; - if (message.clientTags && message.clientTags.length) { - object.clientTags = []; - for (var j = 0; j < message.clientTags.length; ++j) - object.clientTags[j] = message.clientTags[j]; - } - var keys2; - if (message.properties && (keys2 = Object.keys(message.properties)).length) { - object.properties = {}; - for (var j = 0; j < keys2.length; ++j) - object.properties[keys2[j]] = message.properties[keys2[j]]; - } - if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) - object.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.toObject(message.loggingConfig, options); - return object; - }; - - /** - * Converts this TrinoJob to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.TrinoJob - * @instance - * @returns {Object.} JSON object - */ - TrinoJob.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TrinoJob - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.TrinoJob - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TrinoJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.TrinoJob"; - }; - - return TrinoJob; - })(); - - v1.FlinkJob = (function() { - - /** - * Properties of a FlinkJob. - * @memberof google.cloud.dataproc.v1 - * @interface IFlinkJob - * @property {string|null} [mainJarFileUri] FlinkJob mainJarFileUri - * @property {string|null} [mainClass] FlinkJob mainClass - * @property {Array.|null} [args] FlinkJob args - * @property {Array.|null} [jarFileUris] FlinkJob jarFileUris - * @property {string|null} [savepointUri] FlinkJob savepointUri - * @property {Object.|null} [properties] FlinkJob properties - * @property {google.cloud.dataproc.v1.ILoggingConfig|null} [loggingConfig] FlinkJob loggingConfig - */ - - /** - * Constructs a new FlinkJob. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a FlinkJob. - * @implements IFlinkJob - * @constructor - * @param {google.cloud.dataproc.v1.IFlinkJob=} [properties] Properties to set - */ - function FlinkJob(properties) { - this.args = []; - this.jarFileUris = []; - this.properties = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FlinkJob mainJarFileUri. - * @member {string|null|undefined} mainJarFileUri - * @memberof google.cloud.dataproc.v1.FlinkJob - * @instance - */ - FlinkJob.prototype.mainJarFileUri = null; - - /** - * FlinkJob mainClass. - * @member {string|null|undefined} mainClass - * @memberof google.cloud.dataproc.v1.FlinkJob - * @instance - */ - FlinkJob.prototype.mainClass = null; - - /** - * FlinkJob args. - * @member {Array.} args - * @memberof google.cloud.dataproc.v1.FlinkJob - * @instance - */ - FlinkJob.prototype.args = $util.emptyArray; - - /** - * FlinkJob jarFileUris. - * @member {Array.} jarFileUris - * @memberof google.cloud.dataproc.v1.FlinkJob - * @instance - */ - FlinkJob.prototype.jarFileUris = $util.emptyArray; - - /** - * FlinkJob savepointUri. - * @member {string} savepointUri - * @memberof google.cloud.dataproc.v1.FlinkJob - * @instance - */ - FlinkJob.prototype.savepointUri = ""; - - /** - * FlinkJob properties. - * @member {Object.} properties - * @memberof google.cloud.dataproc.v1.FlinkJob - * @instance - */ - FlinkJob.prototype.properties = $util.emptyObject; - - /** - * FlinkJob loggingConfig. - * @member {google.cloud.dataproc.v1.ILoggingConfig|null|undefined} loggingConfig - * @memberof google.cloud.dataproc.v1.FlinkJob - * @instance - */ - FlinkJob.prototype.loggingConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * FlinkJob driver. - * @member {"mainJarFileUri"|"mainClass"|undefined} driver - * @memberof google.cloud.dataproc.v1.FlinkJob - * @instance - */ - Object.defineProperty(FlinkJob.prototype, "driver", { - get: $util.oneOfGetter($oneOfFields = ["mainJarFileUri", "mainClass"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new FlinkJob instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.FlinkJob - * @static - * @param {google.cloud.dataproc.v1.IFlinkJob=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.FlinkJob} FlinkJob instance - */ - FlinkJob.create = function create(properties) { - return new FlinkJob(properties); - }; - - /** - * Encodes the specified FlinkJob message. Does not implicitly {@link google.cloud.dataproc.v1.FlinkJob.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.FlinkJob - * @static - * @param {google.cloud.dataproc.v1.IFlinkJob} message FlinkJob message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FlinkJob.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.mainJarFileUri != null && Object.hasOwnProperty.call(message, "mainJarFileUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.mainJarFileUri); - if (message.mainClass != null && Object.hasOwnProperty.call(message, "mainClass")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.mainClass); - if (message.args != null && message.args.length) - for (var i = 0; i < message.args.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.args[i]); - if (message.jarFileUris != null && message.jarFileUris.length) - for (var i = 0; i < message.jarFileUris.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.jarFileUris[i]); - if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) - for (var keys = Object.keys(message.properties), i = 0; i < keys.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.properties[keys[i]]).ldelim(); - if (message.loggingConfig != null && Object.hasOwnProperty.call(message, "loggingConfig")) - $root.google.cloud.dataproc.v1.LoggingConfig.encode(message.loggingConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.savepointUri != null && Object.hasOwnProperty.call(message, "savepointUri")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.savepointUri); - return writer; - }; - - /** - * Encodes the specified FlinkJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.FlinkJob.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.FlinkJob - * @static - * @param {google.cloud.dataproc.v1.IFlinkJob} message FlinkJob message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FlinkJob.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FlinkJob message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.FlinkJob - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.FlinkJob} FlinkJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FlinkJob.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.FlinkJob(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.mainJarFileUri = reader.string(); - break; - } - case 2: { - message.mainClass = reader.string(); - break; - } - case 3: { - if (!(message.args && message.args.length)) - message.args = []; - message.args.push(reader.string()); - break; - } - case 4: { - if (!(message.jarFileUris && message.jarFileUris.length)) - message.jarFileUris = []; - message.jarFileUris.push(reader.string()); - break; - } - case 9: { - message.savepointUri = reader.string(); - break; - } - case 7: { - if (message.properties === $util.emptyObject) - message.properties = {}; - 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.properties[key] = value; - break; - } - case 8: { - message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FlinkJob message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.FlinkJob - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.FlinkJob} FlinkJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FlinkJob.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FlinkJob message. - * @function verify - * @memberof google.cloud.dataproc.v1.FlinkJob - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FlinkJob.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.mainJarFileUri != null && message.hasOwnProperty("mainJarFileUri")) { - properties.driver = 1; - if (!$util.isString(message.mainJarFileUri)) - return "mainJarFileUri: string expected"; - } - if (message.mainClass != null && message.hasOwnProperty("mainClass")) { - if (properties.driver === 1) - return "driver: multiple values"; - properties.driver = 1; - if (!$util.isString(message.mainClass)) - return "mainClass: 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.jarFileUris != null && message.hasOwnProperty("jarFileUris")) { - if (!Array.isArray(message.jarFileUris)) - return "jarFileUris: array expected"; - for (var i = 0; i < message.jarFileUris.length; ++i) - if (!$util.isString(message.jarFileUris[i])) - return "jarFileUris: string[] expected"; - } - if (message.savepointUri != null && message.hasOwnProperty("savepointUri")) - if (!$util.isString(message.savepointUri)) - return "savepointUri: string expected"; - if (message.properties != null && message.hasOwnProperty("properties")) { - if (!$util.isObject(message.properties)) - return "properties: object expected"; - var key = Object.keys(message.properties); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.properties[key[i]])) - return "properties: string{k:string} expected"; - } - if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) { - var error = $root.google.cloud.dataproc.v1.LoggingConfig.verify(message.loggingConfig); - if (error) - return "loggingConfig." + error; - } - return null; - }; - - /** - * Creates a FlinkJob message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.FlinkJob - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.FlinkJob} FlinkJob - */ - FlinkJob.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.FlinkJob) - return object; - var message = new $root.google.cloud.dataproc.v1.FlinkJob(); - if (object.mainJarFileUri != null) - message.mainJarFileUri = String(object.mainJarFileUri); - if (object.mainClass != null) - message.mainClass = String(object.mainClass); - if (object.args) { - if (!Array.isArray(object.args)) - throw TypeError(".google.cloud.dataproc.v1.FlinkJob.args: array expected"); - message.args = []; - for (var i = 0; i < object.args.length; ++i) - message.args[i] = String(object.args[i]); - } - if (object.jarFileUris) { - if (!Array.isArray(object.jarFileUris)) - throw TypeError(".google.cloud.dataproc.v1.FlinkJob.jarFileUris: array expected"); - message.jarFileUris = []; - for (var i = 0; i < object.jarFileUris.length; ++i) - message.jarFileUris[i] = String(object.jarFileUris[i]); - } - if (object.savepointUri != null) - message.savepointUri = String(object.savepointUri); - if (object.properties) { - if (typeof object.properties !== "object") - throw TypeError(".google.cloud.dataproc.v1.FlinkJob.properties: object expected"); - message.properties = {}; - for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) - message.properties[keys[i]] = String(object.properties[keys[i]]); - } - if (object.loggingConfig != null) { - if (typeof object.loggingConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.FlinkJob.loggingConfig: object expected"); - message.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.fromObject(object.loggingConfig); - } - return message; - }; - - /** - * Creates a plain object from a FlinkJob message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.FlinkJob - * @static - * @param {google.cloud.dataproc.v1.FlinkJob} message FlinkJob - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FlinkJob.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.args = []; - object.jarFileUris = []; - } - if (options.objects || options.defaults) - object.properties = {}; - if (options.defaults) { - object.loggingConfig = null; - object.savepointUri = ""; - } - if (message.mainJarFileUri != null && message.hasOwnProperty("mainJarFileUri")) { - object.mainJarFileUri = message.mainJarFileUri; - if (options.oneofs) - object.driver = "mainJarFileUri"; - } - if (message.mainClass != null && message.hasOwnProperty("mainClass")) { - object.mainClass = message.mainClass; - if (options.oneofs) - object.driver = "mainClass"; - } - 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.jarFileUris && message.jarFileUris.length) { - object.jarFileUris = []; - for (var j = 0; j < message.jarFileUris.length; ++j) - object.jarFileUris[j] = message.jarFileUris[j]; - } - var keys2; - if (message.properties && (keys2 = Object.keys(message.properties)).length) { - object.properties = {}; - for (var j = 0; j < keys2.length; ++j) - object.properties[keys2[j]] = message.properties[keys2[j]]; - } - if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) - object.loggingConfig = $root.google.cloud.dataproc.v1.LoggingConfig.toObject(message.loggingConfig, options); - if (message.savepointUri != null && message.hasOwnProperty("savepointUri")) - object.savepointUri = message.savepointUri; - return object; - }; - - /** - * Converts this FlinkJob to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.FlinkJob - * @instance - * @returns {Object.} JSON object - */ - FlinkJob.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FlinkJob - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.FlinkJob - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FlinkJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.FlinkJob"; - }; - - return FlinkJob; - })(); - - v1.JobPlacement = (function() { - - /** - * Properties of a JobPlacement. - * @memberof google.cloud.dataproc.v1 - * @interface IJobPlacement - * @property {string|null} [clusterName] JobPlacement clusterName - * @property {string|null} [clusterUuid] JobPlacement clusterUuid - * @property {Object.|null} [clusterLabels] JobPlacement clusterLabels - */ - - /** - * Constructs a new JobPlacement. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a JobPlacement. - * @implements IJobPlacement - * @constructor - * @param {google.cloud.dataproc.v1.IJobPlacement=} [properties] Properties to set - */ - function JobPlacement(properties) { - this.clusterLabels = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * JobPlacement clusterName. - * @member {string} clusterName - * @memberof google.cloud.dataproc.v1.JobPlacement - * @instance - */ - JobPlacement.prototype.clusterName = ""; - - /** - * JobPlacement clusterUuid. - * @member {string} clusterUuid - * @memberof google.cloud.dataproc.v1.JobPlacement - * @instance - */ - JobPlacement.prototype.clusterUuid = ""; - - /** - * JobPlacement clusterLabels. - * @member {Object.} clusterLabels - * @memberof google.cloud.dataproc.v1.JobPlacement - * @instance - */ - JobPlacement.prototype.clusterLabels = $util.emptyObject; - - /** - * Creates a new JobPlacement instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.JobPlacement - * @static - * @param {google.cloud.dataproc.v1.IJobPlacement=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.JobPlacement} JobPlacement instance - */ - JobPlacement.create = function create(properties) { - return new JobPlacement(properties); - }; - - /** - * Encodes the specified JobPlacement message. Does not implicitly {@link google.cloud.dataproc.v1.JobPlacement.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.JobPlacement - * @static - * @param {google.cloud.dataproc.v1.IJobPlacement} message JobPlacement message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JobPlacement.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.clusterName); - if (message.clusterUuid != null && Object.hasOwnProperty.call(message, "clusterUuid")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterUuid); - if (message.clusterLabels != null && Object.hasOwnProperty.call(message, "clusterLabels")) - for (var keys = Object.keys(message.clusterLabels), 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.clusterLabels[keys[i]]).ldelim(); - return writer; - }; - - /** - * Encodes the specified JobPlacement message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.JobPlacement.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.JobPlacement - * @static - * @param {google.cloud.dataproc.v1.IJobPlacement} message JobPlacement message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JobPlacement.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a JobPlacement message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.JobPlacement - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.JobPlacement} JobPlacement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JobPlacement.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.JobPlacement(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.clusterName = reader.string(); - break; - } - case 2: { - message.clusterUuid = reader.string(); - break; - } - case 3: { - if (message.clusterLabels === $util.emptyObject) - message.clusterLabels = {}; - 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.clusterLabels[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a JobPlacement message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.JobPlacement - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.JobPlacement} JobPlacement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JobPlacement.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a JobPlacement message. - * @function verify - * @memberof google.cloud.dataproc.v1.JobPlacement - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - JobPlacement.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - if (!$util.isString(message.clusterName)) - return "clusterName: string expected"; - if (message.clusterUuid != null && message.hasOwnProperty("clusterUuid")) - if (!$util.isString(message.clusterUuid)) - return "clusterUuid: string expected"; - if (message.clusterLabels != null && message.hasOwnProperty("clusterLabels")) { - if (!$util.isObject(message.clusterLabels)) - return "clusterLabels: object expected"; - var key = Object.keys(message.clusterLabels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.clusterLabels[key[i]])) - return "clusterLabels: string{k:string} expected"; - } - return null; - }; - - /** - * Creates a JobPlacement message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.JobPlacement - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.JobPlacement} JobPlacement - */ - JobPlacement.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.JobPlacement) - return object; - var message = new $root.google.cloud.dataproc.v1.JobPlacement(); - if (object.clusterName != null) - message.clusterName = String(object.clusterName); - if (object.clusterUuid != null) - message.clusterUuid = String(object.clusterUuid); - if (object.clusterLabels) { - if (typeof object.clusterLabels !== "object") - throw TypeError(".google.cloud.dataproc.v1.JobPlacement.clusterLabels: object expected"); - message.clusterLabels = {}; - for (var keys = Object.keys(object.clusterLabels), i = 0; i < keys.length; ++i) - message.clusterLabels[keys[i]] = String(object.clusterLabels[keys[i]]); - } - return message; - }; - - /** - * Creates a plain object from a JobPlacement message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.JobPlacement - * @static - * @param {google.cloud.dataproc.v1.JobPlacement} message JobPlacement - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - JobPlacement.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.clusterLabels = {}; - if (options.defaults) { - object.clusterName = ""; - object.clusterUuid = ""; - } - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - object.clusterName = message.clusterName; - if (message.clusterUuid != null && message.hasOwnProperty("clusterUuid")) - object.clusterUuid = message.clusterUuid; - var keys2; - if (message.clusterLabels && (keys2 = Object.keys(message.clusterLabels)).length) { - object.clusterLabels = {}; - for (var j = 0; j < keys2.length; ++j) - object.clusterLabels[keys2[j]] = message.clusterLabels[keys2[j]]; - } - return object; - }; - - /** - * Converts this JobPlacement to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.JobPlacement - * @instance - * @returns {Object.} JSON object - */ - JobPlacement.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for JobPlacement - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.JobPlacement - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - JobPlacement.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.JobPlacement"; - }; - - return JobPlacement; - })(); - - v1.JobStatus = (function() { - - /** - * Properties of a JobStatus. - * @memberof google.cloud.dataproc.v1 - * @interface IJobStatus - * @property {google.cloud.dataproc.v1.JobStatus.State|null} [state] JobStatus state - * @property {string|null} [details] JobStatus details - * @property {google.protobuf.ITimestamp|null} [stateStartTime] JobStatus stateStartTime - * @property {google.cloud.dataproc.v1.JobStatus.Substate|null} [substate] JobStatus substate - */ - - /** - * Constructs a new JobStatus. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a JobStatus. - * @implements IJobStatus - * @constructor - * @param {google.cloud.dataproc.v1.IJobStatus=} [properties] Properties to set - */ - function JobStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * JobStatus state. - * @member {google.cloud.dataproc.v1.JobStatus.State} state - * @memberof google.cloud.dataproc.v1.JobStatus - * @instance - */ - JobStatus.prototype.state = 0; - - /** - * JobStatus details. - * @member {string} details - * @memberof google.cloud.dataproc.v1.JobStatus - * @instance - */ - JobStatus.prototype.details = ""; - - /** - * JobStatus stateStartTime. - * @member {google.protobuf.ITimestamp|null|undefined} stateStartTime - * @memberof google.cloud.dataproc.v1.JobStatus - * @instance - */ - JobStatus.prototype.stateStartTime = null; - - /** - * JobStatus substate. - * @member {google.cloud.dataproc.v1.JobStatus.Substate} substate - * @memberof google.cloud.dataproc.v1.JobStatus - * @instance - */ - JobStatus.prototype.substate = 0; - - /** - * Creates a new JobStatus instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.JobStatus - * @static - * @param {google.cloud.dataproc.v1.IJobStatus=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.JobStatus} JobStatus instance - */ - JobStatus.create = function create(properties) { - return new JobStatus(properties); - }; - - /** - * Encodes the specified JobStatus message. Does not implicitly {@link google.cloud.dataproc.v1.JobStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.JobStatus - * @static - * @param {google.cloud.dataproc.v1.IJobStatus} message JobStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JobStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.details != null && Object.hasOwnProperty.call(message, "details")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.details); - if (message.stateStartTime != null && Object.hasOwnProperty.call(message, "stateStartTime")) - $root.google.protobuf.Timestamp.encode(message.stateStartTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.substate != null && Object.hasOwnProperty.call(message, "substate")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.substate); - return writer; - }; - - /** - * Encodes the specified JobStatus message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.JobStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.JobStatus - * @static - * @param {google.cloud.dataproc.v1.IJobStatus} message JobStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JobStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a JobStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.JobStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.JobStatus} JobStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JobStatus.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.JobStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.state = reader.int32(); - break; - } - case 2: { - message.details = reader.string(); - break; - } - case 6: { - message.stateStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - message.substate = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a JobStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.JobStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.JobStatus} JobStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JobStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a JobStatus message. - * @function verify - * @memberof google.cloud.dataproc.v1.JobStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - JobStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 8: - case 2: - case 3: - case 7: - case 4: - case 5: - case 6: - case 9: - break; - } - if (message.details != null && message.hasOwnProperty("details")) - if (!$util.isString(message.details)) - return "details: string expected"; - if (message.stateStartTime != null && message.hasOwnProperty("stateStartTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.stateStartTime); - if (error) - return "stateStartTime." + error; - } - if (message.substate != null && message.hasOwnProperty("substate")) - switch (message.substate) { - default: - return "substate: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; - - /** - * Creates a JobStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.JobStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.JobStatus} JobStatus - */ - JobStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.JobStatus) - return object; - var message = new $root.google.cloud.dataproc.v1.JobStatus(); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "PENDING": - case 1: - message.state = 1; - break; - case "SETUP_DONE": - case 8: - message.state = 8; - break; - case "RUNNING": - case 2: - message.state = 2; - break; - case "CANCEL_PENDING": - case 3: - message.state = 3; - break; - case "CANCEL_STARTED": - case 7: - message.state = 7; - break; - case "CANCELLED": - case 4: - message.state = 4; - break; - case "DONE": - case 5: - message.state = 5; - break; - case "ERROR": - case 6: - message.state = 6; - break; - case "ATTEMPT_FAILURE": - case 9: - message.state = 9; - break; - } - if (object.details != null) - message.details = String(object.details); - if (object.stateStartTime != null) { - if (typeof object.stateStartTime !== "object") - throw TypeError(".google.cloud.dataproc.v1.JobStatus.stateStartTime: object expected"); - message.stateStartTime = $root.google.protobuf.Timestamp.fromObject(object.stateStartTime); - } - switch (object.substate) { - default: - if (typeof object.substate === "number") { - message.substate = object.substate; - break; - } - break; - case "UNSPECIFIED": - case 0: - message.substate = 0; - break; - case "SUBMITTED": - case 1: - message.substate = 1; - break; - case "QUEUED": - case 2: - message.substate = 2; - break; - case "STALE_STATUS": - case 3: - message.substate = 3; - break; - } - return message; - }; - - /** - * Creates a plain object from a JobStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.JobStatus - * @static - * @param {google.cloud.dataproc.v1.JobStatus} message JobStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - JobStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.details = ""; - object.stateStartTime = null; - object.substate = options.enums === String ? "UNSPECIFIED" : 0; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.dataproc.v1.JobStatus.State[message.state] === undefined ? message.state : $root.google.cloud.dataproc.v1.JobStatus.State[message.state] : message.state; - if (message.details != null && message.hasOwnProperty("details")) - object.details = message.details; - if (message.stateStartTime != null && message.hasOwnProperty("stateStartTime")) - object.stateStartTime = $root.google.protobuf.Timestamp.toObject(message.stateStartTime, options); - if (message.substate != null && message.hasOwnProperty("substate")) - object.substate = options.enums === String ? $root.google.cloud.dataproc.v1.JobStatus.Substate[message.substate] === undefined ? message.substate : $root.google.cloud.dataproc.v1.JobStatus.Substate[message.substate] : message.substate; - return object; - }; - - /** - * Converts this JobStatus to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.JobStatus - * @instance - * @returns {Object.} JSON object - */ - JobStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for JobStatus - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.JobStatus - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - JobStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.JobStatus"; - }; - - /** - * State enum. - * @name google.cloud.dataproc.v1.JobStatus.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} PENDING=1 PENDING value - * @property {number} SETUP_DONE=8 SETUP_DONE value - * @property {number} RUNNING=2 RUNNING value - * @property {number} CANCEL_PENDING=3 CANCEL_PENDING value - * @property {number} CANCEL_STARTED=7 CANCEL_STARTED value - * @property {number} CANCELLED=4 CANCELLED value - * @property {number} DONE=5 DONE value - * @property {number} ERROR=6 ERROR value - * @property {number} ATTEMPT_FAILURE=9 ATTEMPT_FAILURE value - */ - JobStatus.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PENDING"] = 1; - values[valuesById[8] = "SETUP_DONE"] = 8; - values[valuesById[2] = "RUNNING"] = 2; - values[valuesById[3] = "CANCEL_PENDING"] = 3; - values[valuesById[7] = "CANCEL_STARTED"] = 7; - values[valuesById[4] = "CANCELLED"] = 4; - values[valuesById[5] = "DONE"] = 5; - values[valuesById[6] = "ERROR"] = 6; - values[valuesById[9] = "ATTEMPT_FAILURE"] = 9; - return values; - })(); - - /** - * Substate enum. - * @name google.cloud.dataproc.v1.JobStatus.Substate - * @enum {number} - * @property {number} UNSPECIFIED=0 UNSPECIFIED value - * @property {number} SUBMITTED=1 SUBMITTED value - * @property {number} QUEUED=2 QUEUED value - * @property {number} STALE_STATUS=3 STALE_STATUS value - */ - JobStatus.Substate = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNSPECIFIED"] = 0; - values[valuesById[1] = "SUBMITTED"] = 1; - values[valuesById[2] = "QUEUED"] = 2; - values[valuesById[3] = "STALE_STATUS"] = 3; - return values; - })(); - - return JobStatus; - })(); - - v1.JobReference = (function() { - - /** - * Properties of a JobReference. - * @memberof google.cloud.dataproc.v1 - * @interface IJobReference - * @property {string|null} [projectId] JobReference projectId - * @property {string|null} [jobId] JobReference jobId - */ - - /** - * Constructs a new JobReference. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a JobReference. - * @implements IJobReference - * @constructor - * @param {google.cloud.dataproc.v1.IJobReference=} [properties] Properties to set - */ - function JobReference(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * JobReference projectId. - * @member {string} projectId - * @memberof google.cloud.dataproc.v1.JobReference - * @instance - */ - JobReference.prototype.projectId = ""; - - /** - * JobReference jobId. - * @member {string} jobId - * @memberof google.cloud.dataproc.v1.JobReference - * @instance - */ - JobReference.prototype.jobId = ""; - - /** - * Creates a new JobReference instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.JobReference - * @static - * @param {google.cloud.dataproc.v1.IJobReference=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.JobReference} JobReference instance - */ - JobReference.create = function create(properties) { - return new JobReference(properties); - }; - - /** - * Encodes the specified JobReference message. Does not implicitly {@link google.cloud.dataproc.v1.JobReference.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.JobReference - * @static - * @param {google.cloud.dataproc.v1.IJobReference} message JobReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JobReference.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobId); - return writer; - }; - - /** - * Encodes the specified JobReference message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.JobReference.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.JobReference - * @static - * @param {google.cloud.dataproc.v1.IJobReference} message JobReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JobReference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a JobReference message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.JobReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.JobReference} JobReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JobReference.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.JobReference(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.projectId = reader.string(); - break; - } - case 2: { - message.jobId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a JobReference message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.JobReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.JobReference} JobReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JobReference.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a JobReference message. - * @function verify - * @memberof google.cloud.dataproc.v1.JobReference - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - JobReference.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.jobId != null && message.hasOwnProperty("jobId")) - if (!$util.isString(message.jobId)) - return "jobId: string expected"; - return null; - }; - - /** - * Creates a JobReference message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.JobReference - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.JobReference} JobReference - */ - JobReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.JobReference) - return object; - var message = new $root.google.cloud.dataproc.v1.JobReference(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.jobId != null) - message.jobId = String(object.jobId); - return message; - }; - - /** - * Creates a plain object from a JobReference message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.JobReference - * @static - * @param {google.cloud.dataproc.v1.JobReference} message JobReference - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - JobReference.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.projectId = ""; - object.jobId = ""; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.jobId != null && message.hasOwnProperty("jobId")) - object.jobId = message.jobId; - return object; - }; - - /** - * Converts this JobReference to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.JobReference - * @instance - * @returns {Object.} JSON object - */ - JobReference.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for JobReference - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.JobReference - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - JobReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.JobReference"; - }; - - return JobReference; - })(); - - v1.YarnApplication = (function() { - - /** - * Properties of a YarnApplication. - * @memberof google.cloud.dataproc.v1 - * @interface IYarnApplication - * @property {string|null} [name] YarnApplication name - * @property {google.cloud.dataproc.v1.YarnApplication.State|null} [state] YarnApplication state - * @property {number|null} [progress] YarnApplication progress - * @property {string|null} [trackingUrl] YarnApplication trackingUrl - */ - - /** - * Constructs a new YarnApplication. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a YarnApplication. - * @implements IYarnApplication - * @constructor - * @param {google.cloud.dataproc.v1.IYarnApplication=} [properties] Properties to set - */ - function YarnApplication(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * YarnApplication name. - * @member {string} name - * @memberof google.cloud.dataproc.v1.YarnApplication - * @instance - */ - YarnApplication.prototype.name = ""; - - /** - * YarnApplication state. - * @member {google.cloud.dataproc.v1.YarnApplication.State} state - * @memberof google.cloud.dataproc.v1.YarnApplication - * @instance - */ - YarnApplication.prototype.state = 0; - - /** - * YarnApplication progress. - * @member {number} progress - * @memberof google.cloud.dataproc.v1.YarnApplication - * @instance - */ - YarnApplication.prototype.progress = 0; - - /** - * YarnApplication trackingUrl. - * @member {string} trackingUrl - * @memberof google.cloud.dataproc.v1.YarnApplication - * @instance - */ - YarnApplication.prototype.trackingUrl = ""; - - /** - * Creates a new YarnApplication instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.YarnApplication - * @static - * @param {google.cloud.dataproc.v1.IYarnApplication=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.YarnApplication} YarnApplication instance - */ - YarnApplication.create = function create(properties) { - return new YarnApplication(properties); - }; - - /** - * Encodes the specified YarnApplication message. Does not implicitly {@link google.cloud.dataproc.v1.YarnApplication.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.YarnApplication - * @static - * @param {google.cloud.dataproc.v1.IYarnApplication} message YarnApplication message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - YarnApplication.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) - writer.uint32(/* id 3, wireType 5 =*/29).float(message.progress); - if (message.trackingUrl != null && Object.hasOwnProperty.call(message, "trackingUrl")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.trackingUrl); - return writer; - }; - - /** - * Encodes the specified YarnApplication message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.YarnApplication.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.YarnApplication - * @static - * @param {google.cloud.dataproc.v1.IYarnApplication} message YarnApplication message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - YarnApplication.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a YarnApplication message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.YarnApplication - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.YarnApplication} YarnApplication - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - YarnApplication.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.YarnApplication(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.state = reader.int32(); - break; - } - case 3: { - message.progress = reader.float(); - break; - } - case 4: { - message.trackingUrl = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a YarnApplication message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.YarnApplication - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.YarnApplication} YarnApplication - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - YarnApplication.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a YarnApplication message. - * @function verify - * @memberof google.cloud.dataproc.v1.YarnApplication - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - YarnApplication.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - if (message.progress != null && message.hasOwnProperty("progress")) - if (typeof message.progress !== "number") - return "progress: number expected"; - if (message.trackingUrl != null && message.hasOwnProperty("trackingUrl")) - if (!$util.isString(message.trackingUrl)) - return "trackingUrl: string expected"; - return null; - }; - - /** - * Creates a YarnApplication message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.YarnApplication - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.YarnApplication} YarnApplication - */ - YarnApplication.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.YarnApplication) - return object; - var message = new $root.google.cloud.dataproc.v1.YarnApplication(); - if (object.name != null) - message.name = String(object.name); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "NEW": - case 1: - message.state = 1; - break; - case "NEW_SAVING": - case 2: - message.state = 2; - break; - case "SUBMITTED": - case 3: - message.state = 3; - break; - case "ACCEPTED": - case 4: - message.state = 4; - break; - case "RUNNING": - case 5: - message.state = 5; - break; - case "FINISHED": - case 6: - message.state = 6; - break; - case "FAILED": - case 7: - message.state = 7; - break; - case "KILLED": - case 8: - message.state = 8; - break; - } - if (object.progress != null) - message.progress = Number(object.progress); - if (object.trackingUrl != null) - message.trackingUrl = String(object.trackingUrl); - return message; - }; - - /** - * Creates a plain object from a YarnApplication message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.YarnApplication - * @static - * @param {google.cloud.dataproc.v1.YarnApplication} message YarnApplication - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - YarnApplication.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.progress = 0; - object.trackingUrl = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.dataproc.v1.YarnApplication.State[message.state] === undefined ? message.state : $root.google.cloud.dataproc.v1.YarnApplication.State[message.state] : message.state; - if (message.progress != null && message.hasOwnProperty("progress")) - object.progress = options.json && !isFinite(message.progress) ? String(message.progress) : message.progress; - if (message.trackingUrl != null && message.hasOwnProperty("trackingUrl")) - object.trackingUrl = message.trackingUrl; - return object; - }; - - /** - * Converts this YarnApplication to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.YarnApplication - * @instance - * @returns {Object.} JSON object - */ - YarnApplication.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for YarnApplication - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.YarnApplication - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - YarnApplication.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.YarnApplication"; - }; - - /** - * State enum. - * @name google.cloud.dataproc.v1.YarnApplication.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} NEW=1 NEW value - * @property {number} NEW_SAVING=2 NEW_SAVING value - * @property {number} SUBMITTED=3 SUBMITTED value - * @property {number} ACCEPTED=4 ACCEPTED value - * @property {number} RUNNING=5 RUNNING value - * @property {number} FINISHED=6 FINISHED value - * @property {number} FAILED=7 FAILED value - * @property {number} KILLED=8 KILLED value - */ - YarnApplication.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "NEW"] = 1; - values[valuesById[2] = "NEW_SAVING"] = 2; - values[valuesById[3] = "SUBMITTED"] = 3; - values[valuesById[4] = "ACCEPTED"] = 4; - values[valuesById[5] = "RUNNING"] = 5; - values[valuesById[6] = "FINISHED"] = 6; - values[valuesById[7] = "FAILED"] = 7; - values[valuesById[8] = "KILLED"] = 8; - return values; - })(); - - return YarnApplication; - })(); - - v1.Job = (function() { - - /** - * Properties of a Job. - * @memberof google.cloud.dataproc.v1 - * @interface IJob - * @property {google.cloud.dataproc.v1.IJobReference|null} [reference] Job reference - * @property {google.cloud.dataproc.v1.IJobPlacement|null} [placement] Job placement - * @property {google.cloud.dataproc.v1.IHadoopJob|null} [hadoopJob] Job hadoopJob - * @property {google.cloud.dataproc.v1.ISparkJob|null} [sparkJob] Job sparkJob - * @property {google.cloud.dataproc.v1.IPySparkJob|null} [pysparkJob] Job pysparkJob - * @property {google.cloud.dataproc.v1.IHiveJob|null} [hiveJob] Job hiveJob - * @property {google.cloud.dataproc.v1.IPigJob|null} [pigJob] Job pigJob - * @property {google.cloud.dataproc.v1.ISparkRJob|null} [sparkRJob] Job sparkRJob - * @property {google.cloud.dataproc.v1.ISparkSqlJob|null} [sparkSqlJob] Job sparkSqlJob - * @property {google.cloud.dataproc.v1.IPrestoJob|null} [prestoJob] Job prestoJob - * @property {google.cloud.dataproc.v1.ITrinoJob|null} [trinoJob] Job trinoJob - * @property {google.cloud.dataproc.v1.IFlinkJob|null} [flinkJob] Job flinkJob - * @property {google.cloud.dataproc.v1.IJobStatus|null} [status] Job status - * @property {Array.|null} [statusHistory] Job statusHistory - * @property {Array.|null} [yarnApplications] Job yarnApplications - * @property {string|null} [driverOutputResourceUri] Job driverOutputResourceUri - * @property {string|null} [driverControlFilesUri] Job driverControlFilesUri - * @property {Object.|null} [labels] Job labels - * @property {google.cloud.dataproc.v1.IJobScheduling|null} [scheduling] Job scheduling - * @property {string|null} [jobUuid] Job jobUuid - * @property {boolean|null} [done] Job done - * @property {google.cloud.dataproc.v1.IDriverSchedulingConfig|null} [driverSchedulingConfig] Job driverSchedulingConfig - */ - - /** - * Constructs a new Job. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a Job. - * @implements IJob - * @constructor - * @param {google.cloud.dataproc.v1.IJob=} [properties] Properties to set - */ - function Job(properties) { - this.statusHistory = []; - this.yarnApplications = []; - this.labels = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Job reference. - * @member {google.cloud.dataproc.v1.IJobReference|null|undefined} reference - * @memberof google.cloud.dataproc.v1.Job - * @instance - */ - Job.prototype.reference = null; - - /** - * Job placement. - * @member {google.cloud.dataproc.v1.IJobPlacement|null|undefined} placement - * @memberof google.cloud.dataproc.v1.Job - * @instance - */ - Job.prototype.placement = null; - - /** - * Job hadoopJob. - * @member {google.cloud.dataproc.v1.IHadoopJob|null|undefined} hadoopJob - * @memberof google.cloud.dataproc.v1.Job - * @instance - */ - Job.prototype.hadoopJob = null; - - /** - * Job sparkJob. - * @member {google.cloud.dataproc.v1.ISparkJob|null|undefined} sparkJob - * @memberof google.cloud.dataproc.v1.Job - * @instance - */ - Job.prototype.sparkJob = null; - - /** - * Job pysparkJob. - * @member {google.cloud.dataproc.v1.IPySparkJob|null|undefined} pysparkJob - * @memberof google.cloud.dataproc.v1.Job - * @instance - */ - Job.prototype.pysparkJob = null; - - /** - * Job hiveJob. - * @member {google.cloud.dataproc.v1.IHiveJob|null|undefined} hiveJob - * @memberof google.cloud.dataproc.v1.Job - * @instance - */ - Job.prototype.hiveJob = null; - - /** - * Job pigJob. - * @member {google.cloud.dataproc.v1.IPigJob|null|undefined} pigJob - * @memberof google.cloud.dataproc.v1.Job - * @instance - */ - Job.prototype.pigJob = null; - - /** - * Job sparkRJob. - * @member {google.cloud.dataproc.v1.ISparkRJob|null|undefined} sparkRJob - * @memberof google.cloud.dataproc.v1.Job - * @instance - */ - Job.prototype.sparkRJob = null; - - /** - * Job sparkSqlJob. - * @member {google.cloud.dataproc.v1.ISparkSqlJob|null|undefined} sparkSqlJob - * @memberof google.cloud.dataproc.v1.Job - * @instance - */ - Job.prototype.sparkSqlJob = null; - - /** - * Job prestoJob. - * @member {google.cloud.dataproc.v1.IPrestoJob|null|undefined} prestoJob - * @memberof google.cloud.dataproc.v1.Job - * @instance - */ - Job.prototype.prestoJob = null; - - /** - * Job trinoJob. - * @member {google.cloud.dataproc.v1.ITrinoJob|null|undefined} trinoJob - * @memberof google.cloud.dataproc.v1.Job - * @instance - */ - Job.prototype.trinoJob = null; - - /** - * Job flinkJob. - * @member {google.cloud.dataproc.v1.IFlinkJob|null|undefined} flinkJob - * @memberof google.cloud.dataproc.v1.Job - * @instance - */ - Job.prototype.flinkJob = null; - - /** - * Job status. - * @member {google.cloud.dataproc.v1.IJobStatus|null|undefined} status - * @memberof google.cloud.dataproc.v1.Job - * @instance - */ - Job.prototype.status = null; - - /** - * Job statusHistory. - * @member {Array.} statusHistory - * @memberof google.cloud.dataproc.v1.Job - * @instance - */ - Job.prototype.statusHistory = $util.emptyArray; - - /** - * Job yarnApplications. - * @member {Array.} yarnApplications - * @memberof google.cloud.dataproc.v1.Job - * @instance - */ - Job.prototype.yarnApplications = $util.emptyArray; - - /** - * Job driverOutputResourceUri. - * @member {string} driverOutputResourceUri - * @memberof google.cloud.dataproc.v1.Job - * @instance - */ - Job.prototype.driverOutputResourceUri = ""; - - /** - * Job driverControlFilesUri. - * @member {string} driverControlFilesUri - * @memberof google.cloud.dataproc.v1.Job - * @instance - */ - Job.prototype.driverControlFilesUri = ""; - - /** - * Job labels. - * @member {Object.} labels - * @memberof google.cloud.dataproc.v1.Job - * @instance - */ - Job.prototype.labels = $util.emptyObject; - - /** - * Job scheduling. - * @member {google.cloud.dataproc.v1.IJobScheduling|null|undefined} scheduling - * @memberof google.cloud.dataproc.v1.Job - * @instance - */ - Job.prototype.scheduling = null; - - /** - * Job jobUuid. - * @member {string} jobUuid - * @memberof google.cloud.dataproc.v1.Job - * @instance - */ - Job.prototype.jobUuid = ""; - - /** - * Job done. - * @member {boolean} done - * @memberof google.cloud.dataproc.v1.Job - * @instance - */ - Job.prototype.done = false; - - /** - * Job driverSchedulingConfig. - * @member {google.cloud.dataproc.v1.IDriverSchedulingConfig|null|undefined} driverSchedulingConfig - * @memberof google.cloud.dataproc.v1.Job - * @instance - */ - Job.prototype.driverSchedulingConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Job typeJob. - * @member {"hadoopJob"|"sparkJob"|"pysparkJob"|"hiveJob"|"pigJob"|"sparkRJob"|"sparkSqlJob"|"prestoJob"|"trinoJob"|"flinkJob"|undefined} typeJob - * @memberof google.cloud.dataproc.v1.Job - * @instance - */ - Object.defineProperty(Job.prototype, "typeJob", { - get: $util.oneOfGetter($oneOfFields = ["hadoopJob", "sparkJob", "pysparkJob", "hiveJob", "pigJob", "sparkRJob", "sparkSqlJob", "prestoJob", "trinoJob", "flinkJob"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Job instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.Job - * @static - * @param {google.cloud.dataproc.v1.IJob=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.Job} Job instance - */ - Job.create = function create(properties) { - return new Job(properties); - }; - - /** - * Encodes the specified Job message. Does not implicitly {@link google.cloud.dataproc.v1.Job.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.Job - * @static - * @param {google.cloud.dataproc.v1.IJob} message Job message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Job.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.reference != null && Object.hasOwnProperty.call(message, "reference")) - $root.google.cloud.dataproc.v1.JobReference.encode(message.reference, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.placement != null && Object.hasOwnProperty.call(message, "placement")) - $root.google.cloud.dataproc.v1.JobPlacement.encode(message.placement, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.hadoopJob != null && Object.hasOwnProperty.call(message, "hadoopJob")) - $root.google.cloud.dataproc.v1.HadoopJob.encode(message.hadoopJob, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.sparkJob != null && Object.hasOwnProperty.call(message, "sparkJob")) - $root.google.cloud.dataproc.v1.SparkJob.encode(message.sparkJob, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.pysparkJob != null && Object.hasOwnProperty.call(message, "pysparkJob")) - $root.google.cloud.dataproc.v1.PySparkJob.encode(message.pysparkJob, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.hiveJob != null && Object.hasOwnProperty.call(message, "hiveJob")) - $root.google.cloud.dataproc.v1.HiveJob.encode(message.hiveJob, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.pigJob != null && Object.hasOwnProperty.call(message, "pigJob")) - $root.google.cloud.dataproc.v1.PigJob.encode(message.pigJob, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.cloud.dataproc.v1.JobStatus.encode(message.status, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.yarnApplications != null && message.yarnApplications.length) - for (var i = 0; i < message.yarnApplications.length; ++i) - $root.google.cloud.dataproc.v1.YarnApplication.encode(message.yarnApplications[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.sparkSqlJob != null && Object.hasOwnProperty.call(message, "sparkSqlJob")) - $root.google.cloud.dataproc.v1.SparkSqlJob.encode(message.sparkSqlJob, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.statusHistory != null && message.statusHistory.length) - for (var i = 0; i < message.statusHistory.length; ++i) - $root.google.cloud.dataproc.v1.JobStatus.encode(message.statusHistory[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.driverControlFilesUri != null && Object.hasOwnProperty.call(message, "driverControlFilesUri")) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.driverControlFilesUri); - if (message.driverOutputResourceUri != null && Object.hasOwnProperty.call(message, "driverOutputResourceUri")) - writer.uint32(/* id 17, wireType 2 =*/138).string(message.driverOutputResourceUri); - 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 18, wireType 2 =*/146).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.scheduling != null && Object.hasOwnProperty.call(message, "scheduling")) - $root.google.cloud.dataproc.v1.JobScheduling.encode(message.scheduling, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.sparkRJob != null && Object.hasOwnProperty.call(message, "sparkRJob")) - $root.google.cloud.dataproc.v1.SparkRJob.encode(message.sparkRJob, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.jobUuid != null && Object.hasOwnProperty.call(message, "jobUuid")) - writer.uint32(/* id 22, wireType 2 =*/178).string(message.jobUuid); - if (message.prestoJob != null && Object.hasOwnProperty.call(message, "prestoJob")) - $root.google.cloud.dataproc.v1.PrestoJob.encode(message.prestoJob, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.done != null && Object.hasOwnProperty.call(message, "done")) - writer.uint32(/* id 24, wireType 0 =*/192).bool(message.done); - if (message.driverSchedulingConfig != null && Object.hasOwnProperty.call(message, "driverSchedulingConfig")) - $root.google.cloud.dataproc.v1.DriverSchedulingConfig.encode(message.driverSchedulingConfig, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.trinoJob != null && Object.hasOwnProperty.call(message, "trinoJob")) - $root.google.cloud.dataproc.v1.TrinoJob.encode(message.trinoJob, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - if (message.flinkJob != null && Object.hasOwnProperty.call(message, "flinkJob")) - $root.google.cloud.dataproc.v1.FlinkJob.encode(message.flinkJob, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.Job.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.Job - * @static - * @param {google.cloud.dataproc.v1.IJob} message Job message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Job.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Job message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.Job - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.Job} Job - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Job.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.Job(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.reference = $root.google.cloud.dataproc.v1.JobReference.decode(reader, reader.uint32()); - break; - } - case 2: { - message.placement = $root.google.cloud.dataproc.v1.JobPlacement.decode(reader, reader.uint32()); - break; - } - case 3: { - message.hadoopJob = $root.google.cloud.dataproc.v1.HadoopJob.decode(reader, reader.uint32()); - break; - } - case 4: { - message.sparkJob = $root.google.cloud.dataproc.v1.SparkJob.decode(reader, reader.uint32()); - break; - } - case 5: { - message.pysparkJob = $root.google.cloud.dataproc.v1.PySparkJob.decode(reader, reader.uint32()); - break; - } - case 6: { - message.hiveJob = $root.google.cloud.dataproc.v1.HiveJob.decode(reader, reader.uint32()); - break; - } - case 7: { - message.pigJob = $root.google.cloud.dataproc.v1.PigJob.decode(reader, reader.uint32()); - break; - } - case 21: { - message.sparkRJob = $root.google.cloud.dataproc.v1.SparkRJob.decode(reader, reader.uint32()); - break; - } - case 12: { - message.sparkSqlJob = $root.google.cloud.dataproc.v1.SparkSqlJob.decode(reader, reader.uint32()); - break; - } - case 23: { - message.prestoJob = $root.google.cloud.dataproc.v1.PrestoJob.decode(reader, reader.uint32()); - break; - } - case 28: { - message.trinoJob = $root.google.cloud.dataproc.v1.TrinoJob.decode(reader, reader.uint32()); - break; - } - case 29: { - message.flinkJob = $root.google.cloud.dataproc.v1.FlinkJob.decode(reader, reader.uint32()); - break; - } - case 8: { - message.status = $root.google.cloud.dataproc.v1.JobStatus.decode(reader, reader.uint32()); - break; - } - case 13: { - if (!(message.statusHistory && message.statusHistory.length)) - message.statusHistory = []; - message.statusHistory.push($root.google.cloud.dataproc.v1.JobStatus.decode(reader, reader.uint32())); - break; - } - case 9: { - if (!(message.yarnApplications && message.yarnApplications.length)) - message.yarnApplications = []; - message.yarnApplications.push($root.google.cloud.dataproc.v1.YarnApplication.decode(reader, reader.uint32())); - break; - } - case 17: { - message.driverOutputResourceUri = reader.string(); - break; - } - case 15: { - message.driverControlFilesUri = reader.string(); - break; - } - case 18: { - 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 20: { - message.scheduling = $root.google.cloud.dataproc.v1.JobScheduling.decode(reader, reader.uint32()); - break; - } - case 22: { - message.jobUuid = reader.string(); - break; - } - case 24: { - message.done = reader.bool(); - break; - } - case 27: { - message.driverSchedulingConfig = $root.google.cloud.dataproc.v1.DriverSchedulingConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Job message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.Job - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.Job} Job - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Job.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Job message. - * @function verify - * @memberof google.cloud.dataproc.v1.Job - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Job.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.reference != null && message.hasOwnProperty("reference")) { - var error = $root.google.cloud.dataproc.v1.JobReference.verify(message.reference); - if (error) - return "reference." + error; - } - if (message.placement != null && message.hasOwnProperty("placement")) { - var error = $root.google.cloud.dataproc.v1.JobPlacement.verify(message.placement); - if (error) - return "placement." + error; - } - if (message.hadoopJob != null && message.hasOwnProperty("hadoopJob")) { - properties.typeJob = 1; - { - var error = $root.google.cloud.dataproc.v1.HadoopJob.verify(message.hadoopJob); - if (error) - return "hadoopJob." + error; - } - } - if (message.sparkJob != null && message.hasOwnProperty("sparkJob")) { - if (properties.typeJob === 1) - return "typeJob: multiple values"; - properties.typeJob = 1; - { - var error = $root.google.cloud.dataproc.v1.SparkJob.verify(message.sparkJob); - if (error) - return "sparkJob." + error; - } - } - if (message.pysparkJob != null && message.hasOwnProperty("pysparkJob")) { - if (properties.typeJob === 1) - return "typeJob: multiple values"; - properties.typeJob = 1; - { - var error = $root.google.cloud.dataproc.v1.PySparkJob.verify(message.pysparkJob); - if (error) - return "pysparkJob." + error; - } - } - if (message.hiveJob != null && message.hasOwnProperty("hiveJob")) { - if (properties.typeJob === 1) - return "typeJob: multiple values"; - properties.typeJob = 1; - { - var error = $root.google.cloud.dataproc.v1.HiveJob.verify(message.hiveJob); - if (error) - return "hiveJob." + error; - } - } - if (message.pigJob != null && message.hasOwnProperty("pigJob")) { - if (properties.typeJob === 1) - return "typeJob: multiple values"; - properties.typeJob = 1; - { - var error = $root.google.cloud.dataproc.v1.PigJob.verify(message.pigJob); - if (error) - return "pigJob." + error; - } - } - if (message.sparkRJob != null && message.hasOwnProperty("sparkRJob")) { - if (properties.typeJob === 1) - return "typeJob: multiple values"; - properties.typeJob = 1; - { - var error = $root.google.cloud.dataproc.v1.SparkRJob.verify(message.sparkRJob); - if (error) - return "sparkRJob." + error; - } - } - if (message.sparkSqlJob != null && message.hasOwnProperty("sparkSqlJob")) { - if (properties.typeJob === 1) - return "typeJob: multiple values"; - properties.typeJob = 1; - { - var error = $root.google.cloud.dataproc.v1.SparkSqlJob.verify(message.sparkSqlJob); - if (error) - return "sparkSqlJob." + error; - } - } - if (message.prestoJob != null && message.hasOwnProperty("prestoJob")) { - if (properties.typeJob === 1) - return "typeJob: multiple values"; - properties.typeJob = 1; - { - var error = $root.google.cloud.dataproc.v1.PrestoJob.verify(message.prestoJob); - if (error) - return "prestoJob." + error; - } - } - if (message.trinoJob != null && message.hasOwnProperty("trinoJob")) { - if (properties.typeJob === 1) - return "typeJob: multiple values"; - properties.typeJob = 1; - { - var error = $root.google.cloud.dataproc.v1.TrinoJob.verify(message.trinoJob); - if (error) - return "trinoJob." + error; - } - } - if (message.flinkJob != null && message.hasOwnProperty("flinkJob")) { - if (properties.typeJob === 1) - return "typeJob: multiple values"; - properties.typeJob = 1; - { - var error = $root.google.cloud.dataproc.v1.FlinkJob.verify(message.flinkJob); - if (error) - return "flinkJob." + error; - } - } - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.google.cloud.dataproc.v1.JobStatus.verify(message.status); - if (error) - return "status." + error; - } - if (message.statusHistory != null && message.hasOwnProperty("statusHistory")) { - if (!Array.isArray(message.statusHistory)) - return "statusHistory: array expected"; - for (var i = 0; i < message.statusHistory.length; ++i) { - var error = $root.google.cloud.dataproc.v1.JobStatus.verify(message.statusHistory[i]); - if (error) - return "statusHistory." + error; - } - } - if (message.yarnApplications != null && message.hasOwnProperty("yarnApplications")) { - if (!Array.isArray(message.yarnApplications)) - return "yarnApplications: array expected"; - for (var i = 0; i < message.yarnApplications.length; ++i) { - var error = $root.google.cloud.dataproc.v1.YarnApplication.verify(message.yarnApplications[i]); - if (error) - return "yarnApplications." + error; - } - } - if (message.driverOutputResourceUri != null && message.hasOwnProperty("driverOutputResourceUri")) - if (!$util.isString(message.driverOutputResourceUri)) - return "driverOutputResourceUri: string expected"; - if (message.driverControlFilesUri != null && message.hasOwnProperty("driverControlFilesUri")) - if (!$util.isString(message.driverControlFilesUri)) - return "driverControlFilesUri: 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.scheduling != null && message.hasOwnProperty("scheduling")) { - var error = $root.google.cloud.dataproc.v1.JobScheduling.verify(message.scheduling); - if (error) - return "scheduling." + error; - } - if (message.jobUuid != null && message.hasOwnProperty("jobUuid")) - if (!$util.isString(message.jobUuid)) - return "jobUuid: string expected"; - if (message.done != null && message.hasOwnProperty("done")) - if (typeof message.done !== "boolean") - return "done: boolean expected"; - if (message.driverSchedulingConfig != null && message.hasOwnProperty("driverSchedulingConfig")) { - var error = $root.google.cloud.dataproc.v1.DriverSchedulingConfig.verify(message.driverSchedulingConfig); - if (error) - return "driverSchedulingConfig." + error; - } - return null; - }; - - /** - * Creates a Job message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.Job - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.Job} Job - */ - Job.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.Job) - return object; - var message = new $root.google.cloud.dataproc.v1.Job(); - if (object.reference != null) { - if (typeof object.reference !== "object") - throw TypeError(".google.cloud.dataproc.v1.Job.reference: object expected"); - message.reference = $root.google.cloud.dataproc.v1.JobReference.fromObject(object.reference); - } - if (object.placement != null) { - if (typeof object.placement !== "object") - throw TypeError(".google.cloud.dataproc.v1.Job.placement: object expected"); - message.placement = $root.google.cloud.dataproc.v1.JobPlacement.fromObject(object.placement); - } - if (object.hadoopJob != null) { - if (typeof object.hadoopJob !== "object") - throw TypeError(".google.cloud.dataproc.v1.Job.hadoopJob: object expected"); - message.hadoopJob = $root.google.cloud.dataproc.v1.HadoopJob.fromObject(object.hadoopJob); - } - if (object.sparkJob != null) { - if (typeof object.sparkJob !== "object") - throw TypeError(".google.cloud.dataproc.v1.Job.sparkJob: object expected"); - message.sparkJob = $root.google.cloud.dataproc.v1.SparkJob.fromObject(object.sparkJob); - } - if (object.pysparkJob != null) { - if (typeof object.pysparkJob !== "object") - throw TypeError(".google.cloud.dataproc.v1.Job.pysparkJob: object expected"); - message.pysparkJob = $root.google.cloud.dataproc.v1.PySparkJob.fromObject(object.pysparkJob); - } - if (object.hiveJob != null) { - if (typeof object.hiveJob !== "object") - throw TypeError(".google.cloud.dataproc.v1.Job.hiveJob: object expected"); - message.hiveJob = $root.google.cloud.dataproc.v1.HiveJob.fromObject(object.hiveJob); - } - if (object.pigJob != null) { - if (typeof object.pigJob !== "object") - throw TypeError(".google.cloud.dataproc.v1.Job.pigJob: object expected"); - message.pigJob = $root.google.cloud.dataproc.v1.PigJob.fromObject(object.pigJob); - } - if (object.sparkRJob != null) { - if (typeof object.sparkRJob !== "object") - throw TypeError(".google.cloud.dataproc.v1.Job.sparkRJob: object expected"); - message.sparkRJob = $root.google.cloud.dataproc.v1.SparkRJob.fromObject(object.sparkRJob); - } - if (object.sparkSqlJob != null) { - if (typeof object.sparkSqlJob !== "object") - throw TypeError(".google.cloud.dataproc.v1.Job.sparkSqlJob: object expected"); - message.sparkSqlJob = $root.google.cloud.dataproc.v1.SparkSqlJob.fromObject(object.sparkSqlJob); - } - if (object.prestoJob != null) { - if (typeof object.prestoJob !== "object") - throw TypeError(".google.cloud.dataproc.v1.Job.prestoJob: object expected"); - message.prestoJob = $root.google.cloud.dataproc.v1.PrestoJob.fromObject(object.prestoJob); - } - if (object.trinoJob != null) { - if (typeof object.trinoJob !== "object") - throw TypeError(".google.cloud.dataproc.v1.Job.trinoJob: object expected"); - message.trinoJob = $root.google.cloud.dataproc.v1.TrinoJob.fromObject(object.trinoJob); - } - if (object.flinkJob != null) { - if (typeof object.flinkJob !== "object") - throw TypeError(".google.cloud.dataproc.v1.Job.flinkJob: object expected"); - message.flinkJob = $root.google.cloud.dataproc.v1.FlinkJob.fromObject(object.flinkJob); - } - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.cloud.dataproc.v1.Job.status: object expected"); - message.status = $root.google.cloud.dataproc.v1.JobStatus.fromObject(object.status); - } - if (object.statusHistory) { - if (!Array.isArray(object.statusHistory)) - throw TypeError(".google.cloud.dataproc.v1.Job.statusHistory: array expected"); - message.statusHistory = []; - for (var i = 0; i < object.statusHistory.length; ++i) { - if (typeof object.statusHistory[i] !== "object") - throw TypeError(".google.cloud.dataproc.v1.Job.statusHistory: object expected"); - message.statusHistory[i] = $root.google.cloud.dataproc.v1.JobStatus.fromObject(object.statusHistory[i]); - } - } - if (object.yarnApplications) { - if (!Array.isArray(object.yarnApplications)) - throw TypeError(".google.cloud.dataproc.v1.Job.yarnApplications: array expected"); - message.yarnApplications = []; - for (var i = 0; i < object.yarnApplications.length; ++i) { - if (typeof object.yarnApplications[i] !== "object") - throw TypeError(".google.cloud.dataproc.v1.Job.yarnApplications: object expected"); - message.yarnApplications[i] = $root.google.cloud.dataproc.v1.YarnApplication.fromObject(object.yarnApplications[i]); - } - } - if (object.driverOutputResourceUri != null) - message.driverOutputResourceUri = String(object.driverOutputResourceUri); - if (object.driverControlFilesUri != null) - message.driverControlFilesUri = String(object.driverControlFilesUri); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.dataproc.v1.Job.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - if (object.scheduling != null) { - if (typeof object.scheduling !== "object") - throw TypeError(".google.cloud.dataproc.v1.Job.scheduling: object expected"); - message.scheduling = $root.google.cloud.dataproc.v1.JobScheduling.fromObject(object.scheduling); - } - if (object.jobUuid != null) - message.jobUuid = String(object.jobUuid); - if (object.done != null) - message.done = Boolean(object.done); - if (object.driverSchedulingConfig != null) { - if (typeof object.driverSchedulingConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.Job.driverSchedulingConfig: object expected"); - message.driverSchedulingConfig = $root.google.cloud.dataproc.v1.DriverSchedulingConfig.fromObject(object.driverSchedulingConfig); - } - return message; - }; - - /** - * Creates a plain object from a Job message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.Job - * @static - * @param {google.cloud.dataproc.v1.Job} message Job - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Job.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.yarnApplications = []; - object.statusHistory = []; - } - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.reference = null; - object.placement = null; - object.status = null; - object.driverControlFilesUri = ""; - object.driverOutputResourceUri = ""; - object.scheduling = null; - object.jobUuid = ""; - object.done = false; - object.driverSchedulingConfig = null; - } - if (message.reference != null && message.hasOwnProperty("reference")) - object.reference = $root.google.cloud.dataproc.v1.JobReference.toObject(message.reference, options); - if (message.placement != null && message.hasOwnProperty("placement")) - object.placement = $root.google.cloud.dataproc.v1.JobPlacement.toObject(message.placement, options); - if (message.hadoopJob != null && message.hasOwnProperty("hadoopJob")) { - object.hadoopJob = $root.google.cloud.dataproc.v1.HadoopJob.toObject(message.hadoopJob, options); - if (options.oneofs) - object.typeJob = "hadoopJob"; - } - if (message.sparkJob != null && message.hasOwnProperty("sparkJob")) { - object.sparkJob = $root.google.cloud.dataproc.v1.SparkJob.toObject(message.sparkJob, options); - if (options.oneofs) - object.typeJob = "sparkJob"; - } - if (message.pysparkJob != null && message.hasOwnProperty("pysparkJob")) { - object.pysparkJob = $root.google.cloud.dataproc.v1.PySparkJob.toObject(message.pysparkJob, options); - if (options.oneofs) - object.typeJob = "pysparkJob"; - } - if (message.hiveJob != null && message.hasOwnProperty("hiveJob")) { - object.hiveJob = $root.google.cloud.dataproc.v1.HiveJob.toObject(message.hiveJob, options); - if (options.oneofs) - object.typeJob = "hiveJob"; - } - if (message.pigJob != null && message.hasOwnProperty("pigJob")) { - object.pigJob = $root.google.cloud.dataproc.v1.PigJob.toObject(message.pigJob, options); - if (options.oneofs) - object.typeJob = "pigJob"; - } - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.cloud.dataproc.v1.JobStatus.toObject(message.status, options); - if (message.yarnApplications && message.yarnApplications.length) { - object.yarnApplications = []; - for (var j = 0; j < message.yarnApplications.length; ++j) - object.yarnApplications[j] = $root.google.cloud.dataproc.v1.YarnApplication.toObject(message.yarnApplications[j], options); - } - if (message.sparkSqlJob != null && message.hasOwnProperty("sparkSqlJob")) { - object.sparkSqlJob = $root.google.cloud.dataproc.v1.SparkSqlJob.toObject(message.sparkSqlJob, options); - if (options.oneofs) - object.typeJob = "sparkSqlJob"; - } - if (message.statusHistory && message.statusHistory.length) { - object.statusHistory = []; - for (var j = 0; j < message.statusHistory.length; ++j) - object.statusHistory[j] = $root.google.cloud.dataproc.v1.JobStatus.toObject(message.statusHistory[j], options); - } - if (message.driverControlFilesUri != null && message.hasOwnProperty("driverControlFilesUri")) - object.driverControlFilesUri = message.driverControlFilesUri; - if (message.driverOutputResourceUri != null && message.hasOwnProperty("driverOutputResourceUri")) - object.driverOutputResourceUri = message.driverOutputResourceUri; - 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.scheduling != null && message.hasOwnProperty("scheduling")) - object.scheduling = $root.google.cloud.dataproc.v1.JobScheduling.toObject(message.scheduling, options); - if (message.sparkRJob != null && message.hasOwnProperty("sparkRJob")) { - object.sparkRJob = $root.google.cloud.dataproc.v1.SparkRJob.toObject(message.sparkRJob, options); - if (options.oneofs) - object.typeJob = "sparkRJob"; - } - if (message.jobUuid != null && message.hasOwnProperty("jobUuid")) - object.jobUuid = message.jobUuid; - if (message.prestoJob != null && message.hasOwnProperty("prestoJob")) { - object.prestoJob = $root.google.cloud.dataproc.v1.PrestoJob.toObject(message.prestoJob, options); - if (options.oneofs) - object.typeJob = "prestoJob"; - } - if (message.done != null && message.hasOwnProperty("done")) - object.done = message.done; - if (message.driverSchedulingConfig != null && message.hasOwnProperty("driverSchedulingConfig")) - object.driverSchedulingConfig = $root.google.cloud.dataproc.v1.DriverSchedulingConfig.toObject(message.driverSchedulingConfig, options); - if (message.trinoJob != null && message.hasOwnProperty("trinoJob")) { - object.trinoJob = $root.google.cloud.dataproc.v1.TrinoJob.toObject(message.trinoJob, options); - if (options.oneofs) - object.typeJob = "trinoJob"; - } - if (message.flinkJob != null && message.hasOwnProperty("flinkJob")) { - object.flinkJob = $root.google.cloud.dataproc.v1.FlinkJob.toObject(message.flinkJob, options); - if (options.oneofs) - object.typeJob = "flinkJob"; - } - return object; - }; - - /** - * Converts this Job to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.Job - * @instance - * @returns {Object.} JSON object - */ - Job.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Job - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.Job - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Job.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.Job"; - }; - - return Job; - })(); - - v1.DriverSchedulingConfig = (function() { - - /** - * Properties of a DriverSchedulingConfig. - * @memberof google.cloud.dataproc.v1 - * @interface IDriverSchedulingConfig - * @property {number|null} [memoryMb] DriverSchedulingConfig memoryMb - * @property {number|null} [vcores] DriverSchedulingConfig vcores - */ - - /** - * Constructs a new DriverSchedulingConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a DriverSchedulingConfig. - * @implements IDriverSchedulingConfig - * @constructor - * @param {google.cloud.dataproc.v1.IDriverSchedulingConfig=} [properties] Properties to set - */ - function DriverSchedulingConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DriverSchedulingConfig memoryMb. - * @member {number} memoryMb - * @memberof google.cloud.dataproc.v1.DriverSchedulingConfig - * @instance - */ - DriverSchedulingConfig.prototype.memoryMb = 0; - - /** - * DriverSchedulingConfig vcores. - * @member {number} vcores - * @memberof google.cloud.dataproc.v1.DriverSchedulingConfig - * @instance - */ - DriverSchedulingConfig.prototype.vcores = 0; - - /** - * Creates a new DriverSchedulingConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.DriverSchedulingConfig - * @static - * @param {google.cloud.dataproc.v1.IDriverSchedulingConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.DriverSchedulingConfig} DriverSchedulingConfig instance - */ - DriverSchedulingConfig.create = function create(properties) { - return new DriverSchedulingConfig(properties); - }; - - /** - * Encodes the specified DriverSchedulingConfig message. Does not implicitly {@link google.cloud.dataproc.v1.DriverSchedulingConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.DriverSchedulingConfig - * @static - * @param {google.cloud.dataproc.v1.IDriverSchedulingConfig} message DriverSchedulingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DriverSchedulingConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.memoryMb != null && Object.hasOwnProperty.call(message, "memoryMb")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.memoryMb); - if (message.vcores != null && Object.hasOwnProperty.call(message, "vcores")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.vcores); - return writer; - }; - - /** - * Encodes the specified DriverSchedulingConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DriverSchedulingConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.DriverSchedulingConfig - * @static - * @param {google.cloud.dataproc.v1.IDriverSchedulingConfig} message DriverSchedulingConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DriverSchedulingConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DriverSchedulingConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.DriverSchedulingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.DriverSchedulingConfig} DriverSchedulingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DriverSchedulingConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.DriverSchedulingConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.memoryMb = reader.int32(); - break; - } - case 2: { - message.vcores = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DriverSchedulingConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.DriverSchedulingConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.DriverSchedulingConfig} DriverSchedulingConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DriverSchedulingConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DriverSchedulingConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.DriverSchedulingConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DriverSchedulingConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.memoryMb != null && message.hasOwnProperty("memoryMb")) - if (!$util.isInteger(message.memoryMb)) - return "memoryMb: integer expected"; - if (message.vcores != null && message.hasOwnProperty("vcores")) - if (!$util.isInteger(message.vcores)) - return "vcores: integer expected"; - return null; - }; - - /** - * Creates a DriverSchedulingConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.DriverSchedulingConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.DriverSchedulingConfig} DriverSchedulingConfig - */ - DriverSchedulingConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.DriverSchedulingConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.DriverSchedulingConfig(); - if (object.memoryMb != null) - message.memoryMb = object.memoryMb | 0; - if (object.vcores != null) - message.vcores = object.vcores | 0; - return message; - }; - - /** - * Creates a plain object from a DriverSchedulingConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.DriverSchedulingConfig - * @static - * @param {google.cloud.dataproc.v1.DriverSchedulingConfig} message DriverSchedulingConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DriverSchedulingConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.memoryMb = 0; - object.vcores = 0; - } - if (message.memoryMb != null && message.hasOwnProperty("memoryMb")) - object.memoryMb = message.memoryMb; - if (message.vcores != null && message.hasOwnProperty("vcores")) - object.vcores = message.vcores; - return object; - }; - - /** - * Converts this DriverSchedulingConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.DriverSchedulingConfig - * @instance - * @returns {Object.} JSON object - */ - DriverSchedulingConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DriverSchedulingConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.DriverSchedulingConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DriverSchedulingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.DriverSchedulingConfig"; - }; - - return DriverSchedulingConfig; - })(); - - v1.JobScheduling = (function() { - - /** - * Properties of a JobScheduling. - * @memberof google.cloud.dataproc.v1 - * @interface IJobScheduling - * @property {number|null} [maxFailuresPerHour] JobScheduling maxFailuresPerHour - * @property {number|null} [maxFailuresTotal] JobScheduling maxFailuresTotal - */ - - /** - * Constructs a new JobScheduling. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a JobScheduling. - * @implements IJobScheduling - * @constructor - * @param {google.cloud.dataproc.v1.IJobScheduling=} [properties] Properties to set - */ - function JobScheduling(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * JobScheduling maxFailuresPerHour. - * @member {number} maxFailuresPerHour - * @memberof google.cloud.dataproc.v1.JobScheduling - * @instance - */ - JobScheduling.prototype.maxFailuresPerHour = 0; - - /** - * JobScheduling maxFailuresTotal. - * @member {number} maxFailuresTotal - * @memberof google.cloud.dataproc.v1.JobScheduling - * @instance - */ - JobScheduling.prototype.maxFailuresTotal = 0; - - /** - * Creates a new JobScheduling instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.JobScheduling - * @static - * @param {google.cloud.dataproc.v1.IJobScheduling=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.JobScheduling} JobScheduling instance - */ - JobScheduling.create = function create(properties) { - return new JobScheduling(properties); - }; - - /** - * Encodes the specified JobScheduling message. Does not implicitly {@link google.cloud.dataproc.v1.JobScheduling.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.JobScheduling - * @static - * @param {google.cloud.dataproc.v1.IJobScheduling} message JobScheduling message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JobScheduling.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.maxFailuresPerHour != null && Object.hasOwnProperty.call(message, "maxFailuresPerHour")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.maxFailuresPerHour); - if (message.maxFailuresTotal != null && Object.hasOwnProperty.call(message, "maxFailuresTotal")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxFailuresTotal); - return writer; - }; - - /** - * Encodes the specified JobScheduling message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.JobScheduling.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.JobScheduling - * @static - * @param {google.cloud.dataproc.v1.IJobScheduling} message JobScheduling message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JobScheduling.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a JobScheduling message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.JobScheduling - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.JobScheduling} JobScheduling - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JobScheduling.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.JobScheduling(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.maxFailuresPerHour = reader.int32(); - break; - } - case 2: { - message.maxFailuresTotal = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a JobScheduling message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.JobScheduling - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.JobScheduling} JobScheduling - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JobScheduling.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a JobScheduling message. - * @function verify - * @memberof google.cloud.dataproc.v1.JobScheduling - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - JobScheduling.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.maxFailuresPerHour != null && message.hasOwnProperty("maxFailuresPerHour")) - if (!$util.isInteger(message.maxFailuresPerHour)) - return "maxFailuresPerHour: integer expected"; - if (message.maxFailuresTotal != null && message.hasOwnProperty("maxFailuresTotal")) - if (!$util.isInteger(message.maxFailuresTotal)) - return "maxFailuresTotal: integer expected"; - return null; - }; - - /** - * Creates a JobScheduling message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.JobScheduling - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.JobScheduling} JobScheduling - */ - JobScheduling.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.JobScheduling) - return object; - var message = new $root.google.cloud.dataproc.v1.JobScheduling(); - if (object.maxFailuresPerHour != null) - message.maxFailuresPerHour = object.maxFailuresPerHour | 0; - if (object.maxFailuresTotal != null) - message.maxFailuresTotal = object.maxFailuresTotal | 0; - return message; - }; - - /** - * Creates a plain object from a JobScheduling message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.JobScheduling - * @static - * @param {google.cloud.dataproc.v1.JobScheduling} message JobScheduling - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - JobScheduling.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.maxFailuresPerHour = 0; - object.maxFailuresTotal = 0; - } - if (message.maxFailuresPerHour != null && message.hasOwnProperty("maxFailuresPerHour")) - object.maxFailuresPerHour = message.maxFailuresPerHour; - if (message.maxFailuresTotal != null && message.hasOwnProperty("maxFailuresTotal")) - object.maxFailuresTotal = message.maxFailuresTotal; - return object; - }; - - /** - * Converts this JobScheduling to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.JobScheduling - * @instance - * @returns {Object.} JSON object - */ - JobScheduling.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for JobScheduling - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.JobScheduling - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - JobScheduling.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.JobScheduling"; - }; - - return JobScheduling; - })(); - - v1.SubmitJobRequest = (function() { - - /** - * Properties of a SubmitJobRequest. - * @memberof google.cloud.dataproc.v1 - * @interface ISubmitJobRequest - * @property {string|null} [projectId] SubmitJobRequest projectId - * @property {string|null} [region] SubmitJobRequest region - * @property {google.cloud.dataproc.v1.IJob|null} [job] SubmitJobRequest job - * @property {string|null} [requestId] SubmitJobRequest requestId - */ - - /** - * Constructs a new SubmitJobRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a SubmitJobRequest. - * @implements ISubmitJobRequest - * @constructor - * @param {google.cloud.dataproc.v1.ISubmitJobRequest=} [properties] Properties to set - */ - function SubmitJobRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SubmitJobRequest projectId. - * @member {string} projectId - * @memberof google.cloud.dataproc.v1.SubmitJobRequest - * @instance - */ - SubmitJobRequest.prototype.projectId = ""; - - /** - * SubmitJobRequest region. - * @member {string} region - * @memberof google.cloud.dataproc.v1.SubmitJobRequest - * @instance - */ - SubmitJobRequest.prototype.region = ""; - - /** - * SubmitJobRequest job. - * @member {google.cloud.dataproc.v1.IJob|null|undefined} job - * @memberof google.cloud.dataproc.v1.SubmitJobRequest - * @instance - */ - SubmitJobRequest.prototype.job = null; - - /** - * SubmitJobRequest requestId. - * @member {string} requestId - * @memberof google.cloud.dataproc.v1.SubmitJobRequest - * @instance - */ - SubmitJobRequest.prototype.requestId = ""; - - /** - * Creates a new SubmitJobRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.SubmitJobRequest - * @static - * @param {google.cloud.dataproc.v1.ISubmitJobRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.SubmitJobRequest} SubmitJobRequest instance - */ - SubmitJobRequest.create = function create(properties) { - return new SubmitJobRequest(properties); - }; - - /** - * Encodes the specified SubmitJobRequest message. Does not implicitly {@link google.cloud.dataproc.v1.SubmitJobRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.SubmitJobRequest - * @static - * @param {google.cloud.dataproc.v1.ISubmitJobRequest} message SubmitJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubmitJobRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.job != null && Object.hasOwnProperty.call(message, "job")) - $root.google.cloud.dataproc.v1.Job.encode(message.job, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.region != null && Object.hasOwnProperty.call(message, "region")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.region); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified SubmitJobRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SubmitJobRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.SubmitJobRequest - * @static - * @param {google.cloud.dataproc.v1.ISubmitJobRequest} message SubmitJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SubmitJobRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SubmitJobRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.SubmitJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.SubmitJobRequest} SubmitJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubmitJobRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.SubmitJobRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.projectId = reader.string(); - break; - } - case 3: { - message.region = reader.string(); - break; - } - case 2: { - message.job = $root.google.cloud.dataproc.v1.Job.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SubmitJobRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.SubmitJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.SubmitJobRequest} SubmitJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SubmitJobRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SubmitJobRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.SubmitJobRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SubmitJobRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.region != null && message.hasOwnProperty("region")) - if (!$util.isString(message.region)) - return "region: string expected"; - if (message.job != null && message.hasOwnProperty("job")) { - var error = $root.google.cloud.dataproc.v1.Job.verify(message.job); - if (error) - return "job." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a SubmitJobRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.SubmitJobRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.SubmitJobRequest} SubmitJobRequest - */ - SubmitJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.SubmitJobRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.SubmitJobRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.region != null) - message.region = String(object.region); - if (object.job != null) { - if (typeof object.job !== "object") - throw TypeError(".google.cloud.dataproc.v1.SubmitJobRequest.job: object expected"); - message.job = $root.google.cloud.dataproc.v1.Job.fromObject(object.job); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a SubmitJobRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.SubmitJobRequest - * @static - * @param {google.cloud.dataproc.v1.SubmitJobRequest} message SubmitJobRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SubmitJobRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.projectId = ""; - object.job = null; - object.region = ""; - object.requestId = ""; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.job != null && message.hasOwnProperty("job")) - object.job = $root.google.cloud.dataproc.v1.Job.toObject(message.job, options); - if (message.region != null && message.hasOwnProperty("region")) - object.region = message.region; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this SubmitJobRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.SubmitJobRequest - * @instance - * @returns {Object.} JSON object - */ - SubmitJobRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SubmitJobRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.SubmitJobRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SubmitJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.SubmitJobRequest"; - }; - - return SubmitJobRequest; - })(); - - v1.JobMetadata = (function() { - - /** - * Properties of a JobMetadata. - * @memberof google.cloud.dataproc.v1 - * @interface IJobMetadata - * @property {string|null} [jobId] JobMetadata jobId - * @property {google.cloud.dataproc.v1.IJobStatus|null} [status] JobMetadata status - * @property {string|null} [operationType] JobMetadata operationType - * @property {google.protobuf.ITimestamp|null} [startTime] JobMetadata startTime - */ - - /** - * Constructs a new JobMetadata. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a JobMetadata. - * @implements IJobMetadata - * @constructor - * @param {google.cloud.dataproc.v1.IJobMetadata=} [properties] Properties to set - */ - function JobMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * JobMetadata jobId. - * @member {string} jobId - * @memberof google.cloud.dataproc.v1.JobMetadata - * @instance - */ - JobMetadata.prototype.jobId = ""; - - /** - * JobMetadata status. - * @member {google.cloud.dataproc.v1.IJobStatus|null|undefined} status - * @memberof google.cloud.dataproc.v1.JobMetadata - * @instance - */ - JobMetadata.prototype.status = null; - - /** - * JobMetadata operationType. - * @member {string} operationType - * @memberof google.cloud.dataproc.v1.JobMetadata - * @instance - */ - JobMetadata.prototype.operationType = ""; - - /** - * JobMetadata startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.dataproc.v1.JobMetadata - * @instance - */ - JobMetadata.prototype.startTime = null; - - /** - * Creates a new JobMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.JobMetadata - * @static - * @param {google.cloud.dataproc.v1.IJobMetadata=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.JobMetadata} JobMetadata instance - */ - JobMetadata.create = function create(properties) { - return new JobMetadata(properties); - }; - - /** - * Encodes the specified JobMetadata message. Does not implicitly {@link google.cloud.dataproc.v1.JobMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.JobMetadata - * @static - * @param {google.cloud.dataproc.v1.IJobMetadata} message JobMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JobMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.jobId); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.cloud.dataproc.v1.JobStatus.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.operationType != null && Object.hasOwnProperty.call(message, "operationType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.operationType); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified JobMetadata message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.JobMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.JobMetadata - * @static - * @param {google.cloud.dataproc.v1.IJobMetadata} message JobMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JobMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a JobMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.JobMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.JobMetadata} JobMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JobMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.JobMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.jobId = reader.string(); - break; - } - case 2: { - message.status = $root.google.cloud.dataproc.v1.JobStatus.decode(reader, reader.uint32()); - break; - } - case 3: { - message.operationType = reader.string(); - break; - } - case 4: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a JobMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.JobMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.JobMetadata} JobMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JobMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a JobMetadata message. - * @function verify - * @memberof google.cloud.dataproc.v1.JobMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - JobMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.jobId != null && message.hasOwnProperty("jobId")) - if (!$util.isString(message.jobId)) - return "jobId: string expected"; - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.google.cloud.dataproc.v1.JobStatus.verify(message.status); - if (error) - return "status." + error; - } - if (message.operationType != null && message.hasOwnProperty("operationType")) - if (!$util.isString(message.operationType)) - return "operationType: string expected"; - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - return null; - }; - - /** - * Creates a JobMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.JobMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.JobMetadata} JobMetadata - */ - JobMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.JobMetadata) - return object; - var message = new $root.google.cloud.dataproc.v1.JobMetadata(); - if (object.jobId != null) - message.jobId = String(object.jobId); - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.cloud.dataproc.v1.JobMetadata.status: object expected"); - message.status = $root.google.cloud.dataproc.v1.JobStatus.fromObject(object.status); - } - if (object.operationType != null) - message.operationType = String(object.operationType); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.dataproc.v1.JobMetadata.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - return message; - }; - - /** - * Creates a plain object from a JobMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.JobMetadata - * @static - * @param {google.cloud.dataproc.v1.JobMetadata} message JobMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - JobMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.jobId = ""; - object.status = null; - object.operationType = ""; - object.startTime = null; - } - if (message.jobId != null && message.hasOwnProperty("jobId")) - object.jobId = message.jobId; - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.cloud.dataproc.v1.JobStatus.toObject(message.status, options); - if (message.operationType != null && message.hasOwnProperty("operationType")) - object.operationType = message.operationType; - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - return object; - }; - - /** - * Converts this JobMetadata to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.JobMetadata - * @instance - * @returns {Object.} JSON object - */ - JobMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for JobMetadata - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.JobMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - JobMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.JobMetadata"; - }; - - return JobMetadata; - })(); - - v1.GetJobRequest = (function() { - - /** - * Properties of a GetJobRequest. - * @memberof google.cloud.dataproc.v1 - * @interface IGetJobRequest - * @property {string|null} [projectId] GetJobRequest projectId - * @property {string|null} [region] GetJobRequest region - * @property {string|null} [jobId] GetJobRequest jobId - */ - - /** - * Constructs a new GetJobRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a GetJobRequest. - * @implements IGetJobRequest - * @constructor - * @param {google.cloud.dataproc.v1.IGetJobRequest=} [properties] Properties to set - */ - function GetJobRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetJobRequest projectId. - * @member {string} projectId - * @memberof google.cloud.dataproc.v1.GetJobRequest - * @instance - */ - GetJobRequest.prototype.projectId = ""; - - /** - * GetJobRequest region. - * @member {string} region - * @memberof google.cloud.dataproc.v1.GetJobRequest - * @instance - */ - GetJobRequest.prototype.region = ""; - - /** - * GetJobRequest jobId. - * @member {string} jobId - * @memberof google.cloud.dataproc.v1.GetJobRequest - * @instance - */ - GetJobRequest.prototype.jobId = ""; - - /** - * Creates a new GetJobRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.GetJobRequest - * @static - * @param {google.cloud.dataproc.v1.IGetJobRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.GetJobRequest} GetJobRequest instance - */ - GetJobRequest.create = function create(properties) { - return new GetJobRequest(properties); - }; - - /** - * Encodes the specified GetJobRequest message. Does not implicitly {@link google.cloud.dataproc.v1.GetJobRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.GetJobRequest - * @static - * @param {google.cloud.dataproc.v1.IGetJobRequest} message GetJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetJobRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobId); - if (message.region != null && Object.hasOwnProperty.call(message, "region")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.region); - return writer; - }; - - /** - * Encodes the specified GetJobRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GetJobRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.GetJobRequest - * @static - * @param {google.cloud.dataproc.v1.IGetJobRequest} message GetJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetJobRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetJobRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.GetJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.GetJobRequest} GetJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetJobRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.GetJobRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.projectId = reader.string(); - break; - } - case 3: { - message.region = reader.string(); - break; - } - case 2: { - message.jobId = 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.dataproc.v1.GetJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.GetJobRequest} GetJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetJobRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetJobRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.GetJobRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetJobRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.region != null && message.hasOwnProperty("region")) - if (!$util.isString(message.region)) - return "region: string expected"; - if (message.jobId != null && message.hasOwnProperty("jobId")) - if (!$util.isString(message.jobId)) - return "jobId: 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.dataproc.v1.GetJobRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.GetJobRequest} GetJobRequest - */ - GetJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.GetJobRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.GetJobRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.region != null) - message.region = String(object.region); - if (object.jobId != null) - message.jobId = String(object.jobId); - return message; - }; - - /** - * Creates a plain object from a GetJobRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.GetJobRequest - * @static - * @param {google.cloud.dataproc.v1.GetJobRequest} message GetJobRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetJobRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.projectId = ""; - object.jobId = ""; - object.region = ""; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.jobId != null && message.hasOwnProperty("jobId")) - object.jobId = message.jobId; - if (message.region != null && message.hasOwnProperty("region")) - object.region = message.region; - return object; - }; - - /** - * Converts this GetJobRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.GetJobRequest - * @instance - * @returns {Object.} JSON object - */ - GetJobRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetJobRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.GetJobRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.GetJobRequest"; - }; - - return GetJobRequest; - })(); - - v1.ListJobsRequest = (function() { - - /** - * Properties of a ListJobsRequest. - * @memberof google.cloud.dataproc.v1 - * @interface IListJobsRequest - * @property {string|null} [projectId] ListJobsRequest projectId - * @property {string|null} [region] ListJobsRequest region - * @property {number|null} [pageSize] ListJobsRequest pageSize - * @property {string|null} [pageToken] ListJobsRequest pageToken - * @property {string|null} [clusterName] ListJobsRequest clusterName - * @property {google.cloud.dataproc.v1.ListJobsRequest.JobStateMatcher|null} [jobStateMatcher] ListJobsRequest jobStateMatcher - * @property {string|null} [filter] ListJobsRequest filter - */ - - /** - * Constructs a new ListJobsRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a ListJobsRequest. - * @implements IListJobsRequest - * @constructor - * @param {google.cloud.dataproc.v1.IListJobsRequest=} [properties] Properties to set - */ - function ListJobsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListJobsRequest projectId. - * @member {string} projectId - * @memberof google.cloud.dataproc.v1.ListJobsRequest - * @instance - */ - ListJobsRequest.prototype.projectId = ""; - - /** - * ListJobsRequest region. - * @member {string} region - * @memberof google.cloud.dataproc.v1.ListJobsRequest - * @instance - */ - ListJobsRequest.prototype.region = ""; - - /** - * ListJobsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.dataproc.v1.ListJobsRequest - * @instance - */ - ListJobsRequest.prototype.pageSize = 0; - - /** - * ListJobsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.dataproc.v1.ListJobsRequest - * @instance - */ - ListJobsRequest.prototype.pageToken = ""; - - /** - * ListJobsRequest clusterName. - * @member {string} clusterName - * @memberof google.cloud.dataproc.v1.ListJobsRequest - * @instance - */ - ListJobsRequest.prototype.clusterName = ""; - - /** - * ListJobsRequest jobStateMatcher. - * @member {google.cloud.dataproc.v1.ListJobsRequest.JobStateMatcher} jobStateMatcher - * @memberof google.cloud.dataproc.v1.ListJobsRequest - * @instance - */ - ListJobsRequest.prototype.jobStateMatcher = 0; - - /** - * ListJobsRequest filter. - * @member {string} filter - * @memberof google.cloud.dataproc.v1.ListJobsRequest - * @instance - */ - ListJobsRequest.prototype.filter = ""; - - /** - * Creates a new ListJobsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.ListJobsRequest - * @static - * @param {google.cloud.dataproc.v1.IListJobsRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.ListJobsRequest} ListJobsRequest instance - */ - ListJobsRequest.create = function create(properties) { - return new ListJobsRequest(properties); - }; - - /** - * Encodes the specified ListJobsRequest message. Does not implicitly {@link google.cloud.dataproc.v1.ListJobsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.ListJobsRequest - * @static - * @param {google.cloud.dataproc.v1.IListJobsRequest} message ListJobsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListJobsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.clusterName); - if (message.jobStateMatcher != null && Object.hasOwnProperty.call(message, "jobStateMatcher")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.jobStateMatcher); - if (message.region != null && Object.hasOwnProperty.call(message, "region")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.region); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.filter); - return writer; - }; - - /** - * Encodes the specified ListJobsRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListJobsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.ListJobsRequest - * @static - * @param {google.cloud.dataproc.v1.IListJobsRequest} message ListJobsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListJobsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListJobsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.ListJobsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.ListJobsRequest} ListJobsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListJobsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ListJobsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.projectId = reader.string(); - break; - } - case 6: { - message.region = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.clusterName = reader.string(); - break; - } - case 5: { - message.jobStateMatcher = reader.int32(); - break; - } - case 7: { - message.filter = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListJobsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.ListJobsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.ListJobsRequest} ListJobsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListJobsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListJobsRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.ListJobsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListJobsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.region != null && message.hasOwnProperty("region")) - if (!$util.isString(message.region)) - return "region: 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.clusterName != null && message.hasOwnProperty("clusterName")) - if (!$util.isString(message.clusterName)) - return "clusterName: string expected"; - if (message.jobStateMatcher != null && message.hasOwnProperty("jobStateMatcher")) - switch (message.jobStateMatcher) { - default: - return "jobStateMatcher: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - return null; - }; - - /** - * Creates a ListJobsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.ListJobsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.ListJobsRequest} ListJobsRequest - */ - ListJobsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.ListJobsRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.ListJobsRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.region != null) - message.region = String(object.region); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.clusterName != null) - message.clusterName = String(object.clusterName); - switch (object.jobStateMatcher) { - default: - if (typeof object.jobStateMatcher === "number") { - message.jobStateMatcher = object.jobStateMatcher; - break; - } - break; - case "ALL": - case 0: - message.jobStateMatcher = 0; - break; - case "ACTIVE": - case 1: - message.jobStateMatcher = 1; - break; - case "NON_ACTIVE": - case 2: - message.jobStateMatcher = 2; - break; - } - if (object.filter != null) - message.filter = String(object.filter); - return message; - }; - - /** - * Creates a plain object from a ListJobsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.ListJobsRequest - * @static - * @param {google.cloud.dataproc.v1.ListJobsRequest} message ListJobsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListJobsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.projectId = ""; - object.pageSize = 0; - object.pageToken = ""; - object.clusterName = ""; - object.jobStateMatcher = options.enums === String ? "ALL" : 0; - object.region = ""; - object.filter = ""; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - object.clusterName = message.clusterName; - if (message.jobStateMatcher != null && message.hasOwnProperty("jobStateMatcher")) - object.jobStateMatcher = options.enums === String ? $root.google.cloud.dataproc.v1.ListJobsRequest.JobStateMatcher[message.jobStateMatcher] === undefined ? message.jobStateMatcher : $root.google.cloud.dataproc.v1.ListJobsRequest.JobStateMatcher[message.jobStateMatcher] : message.jobStateMatcher; - if (message.region != null && message.hasOwnProperty("region")) - object.region = message.region; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - return object; - }; - - /** - * Converts this ListJobsRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.ListJobsRequest - * @instance - * @returns {Object.} JSON object - */ - ListJobsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListJobsRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.ListJobsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListJobsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.ListJobsRequest"; - }; - - /** - * JobStateMatcher enum. - * @name google.cloud.dataproc.v1.ListJobsRequest.JobStateMatcher - * @enum {number} - * @property {number} ALL=0 ALL value - * @property {number} ACTIVE=1 ACTIVE value - * @property {number} NON_ACTIVE=2 NON_ACTIVE value - */ - ListJobsRequest.JobStateMatcher = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ALL"] = 0; - values[valuesById[1] = "ACTIVE"] = 1; - values[valuesById[2] = "NON_ACTIVE"] = 2; - return values; - })(); - - return ListJobsRequest; - })(); - - v1.UpdateJobRequest = (function() { - - /** - * Properties of an UpdateJobRequest. - * @memberof google.cloud.dataproc.v1 - * @interface IUpdateJobRequest - * @property {string|null} [projectId] UpdateJobRequest projectId - * @property {string|null} [region] UpdateJobRequest region - * @property {string|null} [jobId] UpdateJobRequest jobId - * @property {google.cloud.dataproc.v1.IJob|null} [job] UpdateJobRequest job - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateJobRequest updateMask - */ - - /** - * Constructs a new UpdateJobRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents an UpdateJobRequest. - * @implements IUpdateJobRequest - * @constructor - * @param {google.cloud.dataproc.v1.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 projectId. - * @member {string} projectId - * @memberof google.cloud.dataproc.v1.UpdateJobRequest - * @instance - */ - UpdateJobRequest.prototype.projectId = ""; - - /** - * UpdateJobRequest region. - * @member {string} region - * @memberof google.cloud.dataproc.v1.UpdateJobRequest - * @instance - */ - UpdateJobRequest.prototype.region = ""; - - /** - * UpdateJobRequest jobId. - * @member {string} jobId - * @memberof google.cloud.dataproc.v1.UpdateJobRequest - * @instance - */ - UpdateJobRequest.prototype.jobId = ""; - - /** - * UpdateJobRequest job. - * @member {google.cloud.dataproc.v1.IJob|null|undefined} job - * @memberof google.cloud.dataproc.v1.UpdateJobRequest - * @instance - */ - UpdateJobRequest.prototype.job = null; - - /** - * UpdateJobRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.dataproc.v1.UpdateJobRequest - * @instance - */ - UpdateJobRequest.prototype.updateMask = null; - - /** - * Creates a new UpdateJobRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.UpdateJobRequest - * @static - * @param {google.cloud.dataproc.v1.IUpdateJobRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.UpdateJobRequest} UpdateJobRequest instance - */ - UpdateJobRequest.create = function create(properties) { - return new UpdateJobRequest(properties); - }; - - /** - * Encodes the specified UpdateJobRequest message. Does not implicitly {@link google.cloud.dataproc.v1.UpdateJobRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.UpdateJobRequest - * @static - * @param {google.cloud.dataproc.v1.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.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.region != null && Object.hasOwnProperty.call(message, "region")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.region); - if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.jobId); - if (message.job != null && Object.hasOwnProperty.call(message, "job")) - $root.google.cloud.dataproc.v1.Job.encode(message.job, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateJobRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.UpdateJobRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.UpdateJobRequest - * @static - * @param {google.cloud.dataproc.v1.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.dataproc.v1.UpdateJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.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.dataproc.v1.UpdateJobRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.projectId = reader.string(); - break; - } - case 2: { - message.region = reader.string(); - break; - } - case 3: { - message.jobId = reader.string(); - break; - } - case 4: { - message.job = $root.google.cloud.dataproc.v1.Job.decode(reader, reader.uint32()); - break; - } - case 5: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - 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.dataproc.v1.UpdateJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.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.dataproc.v1.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.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.region != null && message.hasOwnProperty("region")) - if (!$util.isString(message.region)) - return "region: string expected"; - if (message.jobId != null && message.hasOwnProperty("jobId")) - if (!$util.isString(message.jobId)) - return "jobId: string expected"; - if (message.job != null && message.hasOwnProperty("job")) { - var error = $root.google.cloud.dataproc.v1.Job.verify(message.job); - if (error) - return "job." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; - - /** - * Creates an UpdateJobRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.UpdateJobRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.UpdateJobRequest} UpdateJobRequest - */ - UpdateJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.UpdateJobRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.UpdateJobRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.region != null) - message.region = String(object.region); - if (object.jobId != null) - message.jobId = String(object.jobId); - if (object.job != null) { - if (typeof object.job !== "object") - throw TypeError(".google.cloud.dataproc.v1.UpdateJobRequest.job: object expected"); - message.job = $root.google.cloud.dataproc.v1.Job.fromObject(object.job); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.dataproc.v1.UpdateJobRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; - - /** - * Creates a plain object from an UpdateJobRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.UpdateJobRequest - * @static - * @param {google.cloud.dataproc.v1.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.projectId = ""; - object.region = ""; - object.jobId = ""; - object.job = null; - object.updateMask = null; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.region != null && message.hasOwnProperty("region")) - object.region = message.region; - if (message.jobId != null && message.hasOwnProperty("jobId")) - object.jobId = message.jobId; - if (message.job != null && message.hasOwnProperty("job")) - object.job = $root.google.cloud.dataproc.v1.Job.toObject(message.job, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateJobRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.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.dataproc.v1.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.dataproc.v1.UpdateJobRequest"; - }; - - return UpdateJobRequest; - })(); - - v1.ListJobsResponse = (function() { - - /** - * Properties of a ListJobsResponse. - * @memberof google.cloud.dataproc.v1 - * @interface IListJobsResponse - * @property {Array.|null} [jobs] ListJobsResponse jobs - * @property {string|null} [nextPageToken] ListJobsResponse nextPageToken - * @property {Array.|null} [unreachable] ListJobsResponse unreachable - */ - - /** - * Constructs a new ListJobsResponse. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a ListJobsResponse. - * @implements IListJobsResponse - * @constructor - * @param {google.cloud.dataproc.v1.IListJobsResponse=} [properties] Properties to set - */ - function ListJobsResponse(properties) { - this.jobs = []; - this.unreachable = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListJobsResponse jobs. - * @member {Array.} jobs - * @memberof google.cloud.dataproc.v1.ListJobsResponse - * @instance - */ - ListJobsResponse.prototype.jobs = $util.emptyArray; - - /** - * ListJobsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.dataproc.v1.ListJobsResponse - * @instance - */ - ListJobsResponse.prototype.nextPageToken = ""; - - /** - * ListJobsResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.dataproc.v1.ListJobsResponse - * @instance - */ - ListJobsResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListJobsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.ListJobsResponse - * @static - * @param {google.cloud.dataproc.v1.IListJobsResponse=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.ListJobsResponse} ListJobsResponse instance - */ - ListJobsResponse.create = function create(properties) { - return new ListJobsResponse(properties); - }; - - /** - * Encodes the specified ListJobsResponse message. Does not implicitly {@link google.cloud.dataproc.v1.ListJobsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.ListJobsResponse - * @static - * @param {google.cloud.dataproc.v1.IListJobsResponse} message ListJobsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListJobsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.jobs != null && message.jobs.length) - for (var i = 0; i < message.jobs.length; ++i) - $root.google.cloud.dataproc.v1.Job.encode(message.jobs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); - return writer; - }; - - /** - * Encodes the specified ListJobsResponse message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListJobsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.ListJobsResponse - * @static - * @param {google.cloud.dataproc.v1.IListJobsResponse} message ListJobsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListJobsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListJobsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.ListJobsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.ListJobsResponse} ListJobsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListJobsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.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.dataproc.v1.Job.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListJobsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.ListJobsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.ListJobsResponse} ListJobsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListJobsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListJobsResponse message. - * @function verify - * @memberof google.cloud.dataproc.v1.ListJobsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListJobsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.jobs != null && message.hasOwnProperty("jobs")) { - if (!Array.isArray(message.jobs)) - return "jobs: array expected"; - for (var i = 0; i < message.jobs.length; ++i) { - var error = $root.google.cloud.dataproc.v1.Job.verify(message.jobs[i]); - if (error) - return "jobs." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; - } - return null; - }; - - /** - * Creates a ListJobsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.ListJobsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.ListJobsResponse} ListJobsResponse - */ - ListJobsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.ListJobsResponse) - return object; - var message = new $root.google.cloud.dataproc.v1.ListJobsResponse(); - if (object.jobs) { - if (!Array.isArray(object.jobs)) - throw TypeError(".google.cloud.dataproc.v1.ListJobsResponse.jobs: array expected"); - message.jobs = []; - for (var i = 0; i < object.jobs.length; ++i) { - if (typeof object.jobs[i] !== "object") - throw TypeError(".google.cloud.dataproc.v1.ListJobsResponse.jobs: object expected"); - message.jobs[i] = $root.google.cloud.dataproc.v1.Job.fromObject(object.jobs[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.dataproc.v1.ListJobsResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); - } - return message; - }; - - /** - * Creates a plain object from a ListJobsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.ListJobsResponse - * @static - * @param {google.cloud.dataproc.v1.ListJobsResponse} message ListJobsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListJobsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.jobs = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.jobs && message.jobs.length) { - object.jobs = []; - for (var j = 0; j < message.jobs.length; ++j) - object.jobs[j] = $root.google.cloud.dataproc.v1.Job.toObject(message.jobs[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; - } - return object; - }; - - /** - * Converts this ListJobsResponse to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.ListJobsResponse - * @instance - * @returns {Object.} JSON object - */ - ListJobsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListJobsResponse - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.ListJobsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListJobsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.ListJobsResponse"; - }; - - return ListJobsResponse; - })(); - - v1.CancelJobRequest = (function() { - - /** - * Properties of a CancelJobRequest. - * @memberof google.cloud.dataproc.v1 - * @interface ICancelJobRequest - * @property {string|null} [projectId] CancelJobRequest projectId - * @property {string|null} [region] CancelJobRequest region - * @property {string|null} [jobId] CancelJobRequest jobId - */ - - /** - * Constructs a new CancelJobRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a CancelJobRequest. - * @implements ICancelJobRequest - * @constructor - * @param {google.cloud.dataproc.v1.ICancelJobRequest=} [properties] Properties to set - */ - function CancelJobRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CancelJobRequest projectId. - * @member {string} projectId - * @memberof google.cloud.dataproc.v1.CancelJobRequest - * @instance - */ - CancelJobRequest.prototype.projectId = ""; - - /** - * CancelJobRequest region. - * @member {string} region - * @memberof google.cloud.dataproc.v1.CancelJobRequest - * @instance - */ - CancelJobRequest.prototype.region = ""; - - /** - * CancelJobRequest jobId. - * @member {string} jobId - * @memberof google.cloud.dataproc.v1.CancelJobRequest - * @instance - */ - CancelJobRequest.prototype.jobId = ""; - - /** - * Creates a new CancelJobRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.CancelJobRequest - * @static - * @param {google.cloud.dataproc.v1.ICancelJobRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.CancelJobRequest} CancelJobRequest instance - */ - CancelJobRequest.create = function create(properties) { - return new CancelJobRequest(properties); - }; - - /** - * Encodes the specified CancelJobRequest message. Does not implicitly {@link google.cloud.dataproc.v1.CancelJobRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.CancelJobRequest - * @static - * @param {google.cloud.dataproc.v1.ICancelJobRequest} message CancelJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelJobRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobId); - if (message.region != null && Object.hasOwnProperty.call(message, "region")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.region); - return writer; - }; - - /** - * Encodes the specified CancelJobRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.CancelJobRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.CancelJobRequest - * @static - * @param {google.cloud.dataproc.v1.ICancelJobRequest} message CancelJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelJobRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CancelJobRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.CancelJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.CancelJobRequest} CancelJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelJobRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.CancelJobRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.projectId = reader.string(); - break; - } - case 3: { - message.region = reader.string(); - break; - } - case 2: { - message.jobId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CancelJobRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.CancelJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.CancelJobRequest} CancelJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelJobRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CancelJobRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.CancelJobRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CancelJobRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.region != null && message.hasOwnProperty("region")) - if (!$util.isString(message.region)) - return "region: string expected"; - if (message.jobId != null && message.hasOwnProperty("jobId")) - if (!$util.isString(message.jobId)) - return "jobId: string expected"; - return null; - }; - - /** - * Creates a CancelJobRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.CancelJobRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.CancelJobRequest} CancelJobRequest - */ - CancelJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.CancelJobRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.CancelJobRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.region != null) - message.region = String(object.region); - if (object.jobId != null) - message.jobId = String(object.jobId); - return message; - }; - - /** - * Creates a plain object from a CancelJobRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.CancelJobRequest - * @static - * @param {google.cloud.dataproc.v1.CancelJobRequest} message CancelJobRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CancelJobRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.projectId = ""; - object.jobId = ""; - object.region = ""; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.jobId != null && message.hasOwnProperty("jobId")) - object.jobId = message.jobId; - if (message.region != null && message.hasOwnProperty("region")) - object.region = message.region; - return object; - }; - - /** - * Converts this CancelJobRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.CancelJobRequest - * @instance - * @returns {Object.} JSON object - */ - CancelJobRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CancelJobRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.CancelJobRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CancelJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.CancelJobRequest"; - }; - - return CancelJobRequest; - })(); - - v1.DeleteJobRequest = (function() { - - /** - * Properties of a DeleteJobRequest. - * @memberof google.cloud.dataproc.v1 - * @interface IDeleteJobRequest - * @property {string|null} [projectId] DeleteJobRequest projectId - * @property {string|null} [region] DeleteJobRequest region - * @property {string|null} [jobId] DeleteJobRequest jobId - */ - - /** - * Constructs a new DeleteJobRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a DeleteJobRequest. - * @implements IDeleteJobRequest - * @constructor - * @param {google.cloud.dataproc.v1.IDeleteJobRequest=} [properties] Properties to set - */ - function DeleteJobRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteJobRequest projectId. - * @member {string} projectId - * @memberof google.cloud.dataproc.v1.DeleteJobRequest - * @instance - */ - DeleteJobRequest.prototype.projectId = ""; - - /** - * DeleteJobRequest region. - * @member {string} region - * @memberof google.cloud.dataproc.v1.DeleteJobRequest - * @instance - */ - DeleteJobRequest.prototype.region = ""; - - /** - * DeleteJobRequest jobId. - * @member {string} jobId - * @memberof google.cloud.dataproc.v1.DeleteJobRequest - * @instance - */ - DeleteJobRequest.prototype.jobId = ""; - - /** - * Creates a new DeleteJobRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.DeleteJobRequest - * @static - * @param {google.cloud.dataproc.v1.IDeleteJobRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.DeleteJobRequest} DeleteJobRequest instance - */ - DeleteJobRequest.create = function create(properties) { - return new DeleteJobRequest(properties); - }; - - /** - * Encodes the specified DeleteJobRequest message. Does not implicitly {@link google.cloud.dataproc.v1.DeleteJobRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.DeleteJobRequest - * @static - * @param {google.cloud.dataproc.v1.IDeleteJobRequest} message DeleteJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteJobRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.jobId); - if (message.region != null && Object.hasOwnProperty.call(message, "region")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.region); - return writer; - }; - - /** - * Encodes the specified DeleteJobRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DeleteJobRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.DeleteJobRequest - * @static - * @param {google.cloud.dataproc.v1.IDeleteJobRequest} message DeleteJobRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteJobRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteJobRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.DeleteJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.DeleteJobRequest} DeleteJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteJobRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.DeleteJobRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.projectId = reader.string(); - break; - } - case 3: { - message.region = reader.string(); - break; - } - case 2: { - message.jobId = 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.dataproc.v1.DeleteJobRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.DeleteJobRequest} DeleteJobRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteJobRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteJobRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.DeleteJobRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteJobRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.region != null && message.hasOwnProperty("region")) - if (!$util.isString(message.region)) - return "region: string expected"; - if (message.jobId != null && message.hasOwnProperty("jobId")) - if (!$util.isString(message.jobId)) - return "jobId: 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.dataproc.v1.DeleteJobRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.DeleteJobRequest} DeleteJobRequest - */ - DeleteJobRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.DeleteJobRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.DeleteJobRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.region != null) - message.region = String(object.region); - if (object.jobId != null) - message.jobId = String(object.jobId); - return message; - }; - - /** - * Creates a plain object from a DeleteJobRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.DeleteJobRequest - * @static - * @param {google.cloud.dataproc.v1.DeleteJobRequest} message DeleteJobRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteJobRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.projectId = ""; - object.jobId = ""; - object.region = ""; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.jobId != null && message.hasOwnProperty("jobId")) - object.jobId = message.jobId; - if (message.region != null && message.hasOwnProperty("region")) - object.region = message.region; - return object; - }; - - /** - * Converts this DeleteJobRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.DeleteJobRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteJobRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteJobRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.DeleteJobRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.DeleteJobRequest"; - }; - - return DeleteJobRequest; - })(); - - v1.NodeGroupController = (function() { - - /** - * Constructs a new NodeGroupController service. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a NodeGroupController - * @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 NodeGroupController(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (NodeGroupController.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = NodeGroupController; - - /** - * Creates new NodeGroupController service using the specified rpc implementation. - * @function create - * @memberof google.cloud.dataproc.v1.NodeGroupController - * @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 {NodeGroupController} RPC service. Useful where requests and/or responses are streamed. - */ - NodeGroupController.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.NodeGroupController|createNodeGroup}. - * @memberof google.cloud.dataproc.v1.NodeGroupController - * @typedef CreateNodeGroupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateNodeGroup. - * @function createNodeGroup - * @memberof google.cloud.dataproc.v1.NodeGroupController - * @instance - * @param {google.cloud.dataproc.v1.ICreateNodeGroupRequest} request CreateNodeGroupRequest message or plain object - * @param {google.cloud.dataproc.v1.NodeGroupController.CreateNodeGroupCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(NodeGroupController.prototype.createNodeGroup = function createNodeGroup(request, callback) { - return this.rpcCall(createNodeGroup, $root.google.cloud.dataproc.v1.CreateNodeGroupRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateNodeGroup" }); - - /** - * Calls CreateNodeGroup. - * @function createNodeGroup - * @memberof google.cloud.dataproc.v1.NodeGroupController - * @instance - * @param {google.cloud.dataproc.v1.ICreateNodeGroupRequest} request CreateNodeGroupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.NodeGroupController|resizeNodeGroup}. - * @memberof google.cloud.dataproc.v1.NodeGroupController - * @typedef ResizeNodeGroupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls ResizeNodeGroup. - * @function resizeNodeGroup - * @memberof google.cloud.dataproc.v1.NodeGroupController - * @instance - * @param {google.cloud.dataproc.v1.IResizeNodeGroupRequest} request ResizeNodeGroupRequest message or plain object - * @param {google.cloud.dataproc.v1.NodeGroupController.ResizeNodeGroupCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(NodeGroupController.prototype.resizeNodeGroup = function resizeNodeGroup(request, callback) { - return this.rpcCall(resizeNodeGroup, $root.google.cloud.dataproc.v1.ResizeNodeGroupRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ResizeNodeGroup" }); - - /** - * Calls ResizeNodeGroup. - * @function resizeNodeGroup - * @memberof google.cloud.dataproc.v1.NodeGroupController - * @instance - * @param {google.cloud.dataproc.v1.IResizeNodeGroupRequest} request ResizeNodeGroupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.NodeGroupController|getNodeGroup}. - * @memberof google.cloud.dataproc.v1.NodeGroupController - * @typedef GetNodeGroupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dataproc.v1.NodeGroup} [response] NodeGroup - */ - - /** - * Calls GetNodeGroup. - * @function getNodeGroup - * @memberof google.cloud.dataproc.v1.NodeGroupController - * @instance - * @param {google.cloud.dataproc.v1.IGetNodeGroupRequest} request GetNodeGroupRequest message or plain object - * @param {google.cloud.dataproc.v1.NodeGroupController.GetNodeGroupCallback} callback Node-style callback called with the error, if any, and NodeGroup - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(NodeGroupController.prototype.getNodeGroup = function getNodeGroup(request, callback) { - return this.rpcCall(getNodeGroup, $root.google.cloud.dataproc.v1.GetNodeGroupRequest, $root.google.cloud.dataproc.v1.NodeGroup, request, callback); - }, "name", { value: "GetNodeGroup" }); - - /** - * Calls GetNodeGroup. - * @function getNodeGroup - * @memberof google.cloud.dataproc.v1.NodeGroupController - * @instance - * @param {google.cloud.dataproc.v1.IGetNodeGroupRequest} request GetNodeGroupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return NodeGroupController; - })(); - - v1.CreateNodeGroupRequest = (function() { - - /** - * Properties of a CreateNodeGroupRequest. - * @memberof google.cloud.dataproc.v1 - * @interface ICreateNodeGroupRequest - * @property {string|null} [parent] CreateNodeGroupRequest parent - * @property {google.cloud.dataproc.v1.INodeGroup|null} [nodeGroup] CreateNodeGroupRequest nodeGroup - * @property {string|null} [nodeGroupId] CreateNodeGroupRequest nodeGroupId - * @property {string|null} [requestId] CreateNodeGroupRequest requestId - */ - - /** - * Constructs a new CreateNodeGroupRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a CreateNodeGroupRequest. - * @implements ICreateNodeGroupRequest - * @constructor - * @param {google.cloud.dataproc.v1.ICreateNodeGroupRequest=} [properties] Properties to set - */ - function CreateNodeGroupRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateNodeGroupRequest parent. - * @member {string} parent - * @memberof google.cloud.dataproc.v1.CreateNodeGroupRequest - * @instance - */ - CreateNodeGroupRequest.prototype.parent = ""; - - /** - * CreateNodeGroupRequest nodeGroup. - * @member {google.cloud.dataproc.v1.INodeGroup|null|undefined} nodeGroup - * @memberof google.cloud.dataproc.v1.CreateNodeGroupRequest - * @instance - */ - CreateNodeGroupRequest.prototype.nodeGroup = null; - - /** - * CreateNodeGroupRequest nodeGroupId. - * @member {string} nodeGroupId - * @memberof google.cloud.dataproc.v1.CreateNodeGroupRequest - * @instance - */ - CreateNodeGroupRequest.prototype.nodeGroupId = ""; - - /** - * CreateNodeGroupRequest requestId. - * @member {string} requestId - * @memberof google.cloud.dataproc.v1.CreateNodeGroupRequest - * @instance - */ - CreateNodeGroupRequest.prototype.requestId = ""; - - /** - * Creates a new CreateNodeGroupRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.CreateNodeGroupRequest - * @static - * @param {google.cloud.dataproc.v1.ICreateNodeGroupRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.CreateNodeGroupRequest} CreateNodeGroupRequest instance - */ - CreateNodeGroupRequest.create = function create(properties) { - return new CreateNodeGroupRequest(properties); - }; - - /** - * Encodes the specified CreateNodeGroupRequest message. Does not implicitly {@link google.cloud.dataproc.v1.CreateNodeGroupRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.CreateNodeGroupRequest - * @static - * @param {google.cloud.dataproc.v1.ICreateNodeGroupRequest} message CreateNodeGroupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateNodeGroupRequest.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.nodeGroup != null && Object.hasOwnProperty.call(message, "nodeGroup")) - $root.google.cloud.dataproc.v1.NodeGroup.encode(message.nodeGroup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - if (message.nodeGroupId != null && Object.hasOwnProperty.call(message, "nodeGroupId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.nodeGroupId); - return writer; - }; - - /** - * Encodes the specified CreateNodeGroupRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.CreateNodeGroupRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.CreateNodeGroupRequest - * @static - * @param {google.cloud.dataproc.v1.ICreateNodeGroupRequest} message CreateNodeGroupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateNodeGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateNodeGroupRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.CreateNodeGroupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.CreateNodeGroupRequest} CreateNodeGroupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateNodeGroupRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.CreateNodeGroupRequest(); - 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.nodeGroup = $root.google.cloud.dataproc.v1.NodeGroup.decode(reader, reader.uint32()); - break; - } - case 4: { - message.nodeGroupId = reader.string(); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateNodeGroupRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.CreateNodeGroupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.CreateNodeGroupRequest} CreateNodeGroupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateNodeGroupRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateNodeGroupRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.CreateNodeGroupRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateNodeGroupRequest.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.nodeGroup != null && message.hasOwnProperty("nodeGroup")) { - var error = $root.google.cloud.dataproc.v1.NodeGroup.verify(message.nodeGroup); - if (error) - return "nodeGroup." + error; - } - if (message.nodeGroupId != null && message.hasOwnProperty("nodeGroupId")) - if (!$util.isString(message.nodeGroupId)) - return "nodeGroupId: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a CreateNodeGroupRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.CreateNodeGroupRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.CreateNodeGroupRequest} CreateNodeGroupRequest - */ - CreateNodeGroupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.CreateNodeGroupRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.CreateNodeGroupRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.nodeGroup != null) { - if (typeof object.nodeGroup !== "object") - throw TypeError(".google.cloud.dataproc.v1.CreateNodeGroupRequest.nodeGroup: object expected"); - message.nodeGroup = $root.google.cloud.dataproc.v1.NodeGroup.fromObject(object.nodeGroup); - } - if (object.nodeGroupId != null) - message.nodeGroupId = String(object.nodeGroupId); - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a CreateNodeGroupRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.CreateNodeGroupRequest - * @static - * @param {google.cloud.dataproc.v1.CreateNodeGroupRequest} message CreateNodeGroupRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateNodeGroupRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.nodeGroup = null; - object.requestId = ""; - object.nodeGroupId = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.nodeGroup != null && message.hasOwnProperty("nodeGroup")) - object.nodeGroup = $root.google.cloud.dataproc.v1.NodeGroup.toObject(message.nodeGroup, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.nodeGroupId != null && message.hasOwnProperty("nodeGroupId")) - object.nodeGroupId = message.nodeGroupId; - return object; - }; - - /** - * Converts this CreateNodeGroupRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.CreateNodeGroupRequest - * @instance - * @returns {Object.} JSON object - */ - CreateNodeGroupRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateNodeGroupRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.CreateNodeGroupRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateNodeGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.CreateNodeGroupRequest"; - }; - - return CreateNodeGroupRequest; - })(); - - v1.ResizeNodeGroupRequest = (function() { - - /** - * Properties of a ResizeNodeGroupRequest. - * @memberof google.cloud.dataproc.v1 - * @interface IResizeNodeGroupRequest - * @property {string|null} [name] ResizeNodeGroupRequest name - * @property {number|null} [size] ResizeNodeGroupRequest size - * @property {string|null} [requestId] ResizeNodeGroupRequest requestId - * @property {google.protobuf.IDuration|null} [gracefulDecommissionTimeout] ResizeNodeGroupRequest gracefulDecommissionTimeout - */ - - /** - * Constructs a new ResizeNodeGroupRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a ResizeNodeGroupRequest. - * @implements IResizeNodeGroupRequest - * @constructor - * @param {google.cloud.dataproc.v1.IResizeNodeGroupRequest=} [properties] Properties to set - */ - function ResizeNodeGroupRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResizeNodeGroupRequest name. - * @member {string} name - * @memberof google.cloud.dataproc.v1.ResizeNodeGroupRequest - * @instance - */ - ResizeNodeGroupRequest.prototype.name = ""; - - /** - * ResizeNodeGroupRequest size. - * @member {number} size - * @memberof google.cloud.dataproc.v1.ResizeNodeGroupRequest - * @instance - */ - ResizeNodeGroupRequest.prototype.size = 0; - - /** - * ResizeNodeGroupRequest requestId. - * @member {string} requestId - * @memberof google.cloud.dataproc.v1.ResizeNodeGroupRequest - * @instance - */ - ResizeNodeGroupRequest.prototype.requestId = ""; - - /** - * ResizeNodeGroupRequest gracefulDecommissionTimeout. - * @member {google.protobuf.IDuration|null|undefined} gracefulDecommissionTimeout - * @memberof google.cloud.dataproc.v1.ResizeNodeGroupRequest - * @instance - */ - ResizeNodeGroupRequest.prototype.gracefulDecommissionTimeout = null; - - /** - * Creates a new ResizeNodeGroupRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.ResizeNodeGroupRequest - * @static - * @param {google.cloud.dataproc.v1.IResizeNodeGroupRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.ResizeNodeGroupRequest} ResizeNodeGroupRequest instance - */ - ResizeNodeGroupRequest.create = function create(properties) { - return new ResizeNodeGroupRequest(properties); - }; - - /** - * Encodes the specified ResizeNodeGroupRequest message. Does not implicitly {@link google.cloud.dataproc.v1.ResizeNodeGroupRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.ResizeNodeGroupRequest - * @static - * @param {google.cloud.dataproc.v1.IResizeNodeGroupRequest} message ResizeNodeGroupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResizeNodeGroupRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.size != null && Object.hasOwnProperty.call(message, "size")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.size); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - if (message.gracefulDecommissionTimeout != null && Object.hasOwnProperty.call(message, "gracefulDecommissionTimeout")) - $root.google.protobuf.Duration.encode(message.gracefulDecommissionTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ResizeNodeGroupRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ResizeNodeGroupRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.ResizeNodeGroupRequest - * @static - * @param {google.cloud.dataproc.v1.IResizeNodeGroupRequest} message ResizeNodeGroupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResizeNodeGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResizeNodeGroupRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.ResizeNodeGroupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.ResizeNodeGroupRequest} ResizeNodeGroupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResizeNodeGroupRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ResizeNodeGroupRequest(); - 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.size = reader.int32(); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - case 4: { - message.gracefulDecommissionTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResizeNodeGroupRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.ResizeNodeGroupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.ResizeNodeGroupRequest} ResizeNodeGroupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResizeNodeGroupRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResizeNodeGroupRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.ResizeNodeGroupRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResizeNodeGroupRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.size != null && message.hasOwnProperty("size")) - if (!$util.isInteger(message.size)) - return "size: integer expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.gracefulDecommissionTimeout != null && message.hasOwnProperty("gracefulDecommissionTimeout")) { - var error = $root.google.protobuf.Duration.verify(message.gracefulDecommissionTimeout); - if (error) - return "gracefulDecommissionTimeout." + error; - } - return null; - }; - - /** - * Creates a ResizeNodeGroupRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.ResizeNodeGroupRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.ResizeNodeGroupRequest} ResizeNodeGroupRequest - */ - ResizeNodeGroupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.ResizeNodeGroupRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.ResizeNodeGroupRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.size != null) - message.size = object.size | 0; - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.gracefulDecommissionTimeout != null) { - if (typeof object.gracefulDecommissionTimeout !== "object") - throw TypeError(".google.cloud.dataproc.v1.ResizeNodeGroupRequest.gracefulDecommissionTimeout: object expected"); - message.gracefulDecommissionTimeout = $root.google.protobuf.Duration.fromObject(object.gracefulDecommissionTimeout); - } - return message; - }; - - /** - * Creates a plain object from a ResizeNodeGroupRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.ResizeNodeGroupRequest - * @static - * @param {google.cloud.dataproc.v1.ResizeNodeGroupRequest} message ResizeNodeGroupRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResizeNodeGroupRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.size = 0; - object.requestId = ""; - object.gracefulDecommissionTimeout = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.size != null && message.hasOwnProperty("size")) - object.size = message.size; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.gracefulDecommissionTimeout != null && message.hasOwnProperty("gracefulDecommissionTimeout")) - object.gracefulDecommissionTimeout = $root.google.protobuf.Duration.toObject(message.gracefulDecommissionTimeout, options); - return object; - }; - - /** - * Converts this ResizeNodeGroupRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.ResizeNodeGroupRequest - * @instance - * @returns {Object.} JSON object - */ - ResizeNodeGroupRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResizeNodeGroupRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.ResizeNodeGroupRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResizeNodeGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.ResizeNodeGroupRequest"; - }; - - return ResizeNodeGroupRequest; - })(); - - v1.GetNodeGroupRequest = (function() { - - /** - * Properties of a GetNodeGroupRequest. - * @memberof google.cloud.dataproc.v1 - * @interface IGetNodeGroupRequest - * @property {string|null} [name] GetNodeGroupRequest name - */ - - /** - * Constructs a new GetNodeGroupRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a GetNodeGroupRequest. - * @implements IGetNodeGroupRequest - * @constructor - * @param {google.cloud.dataproc.v1.IGetNodeGroupRequest=} [properties] Properties to set - */ - function GetNodeGroupRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetNodeGroupRequest name. - * @member {string} name - * @memberof google.cloud.dataproc.v1.GetNodeGroupRequest - * @instance - */ - GetNodeGroupRequest.prototype.name = ""; - - /** - * Creates a new GetNodeGroupRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.GetNodeGroupRequest - * @static - * @param {google.cloud.dataproc.v1.IGetNodeGroupRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.GetNodeGroupRequest} GetNodeGroupRequest instance - */ - GetNodeGroupRequest.create = function create(properties) { - return new GetNodeGroupRequest(properties); - }; - - /** - * Encodes the specified GetNodeGroupRequest message. Does not implicitly {@link google.cloud.dataproc.v1.GetNodeGroupRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.GetNodeGroupRequest - * @static - * @param {google.cloud.dataproc.v1.IGetNodeGroupRequest} message GetNodeGroupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetNodeGroupRequest.encode = function encode(message, writer) { - 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 GetNodeGroupRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GetNodeGroupRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.GetNodeGroupRequest - * @static - * @param {google.cloud.dataproc.v1.IGetNodeGroupRequest} message GetNodeGroupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetNodeGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetNodeGroupRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.GetNodeGroupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.GetNodeGroupRequest} GetNodeGroupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetNodeGroupRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.GetNodeGroupRequest(); - 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 GetNodeGroupRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.GetNodeGroupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.GetNodeGroupRequest} GetNodeGroupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetNodeGroupRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetNodeGroupRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.GetNodeGroupRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetNodeGroupRequest.verify = function verify(message) { - if (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 GetNodeGroupRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.GetNodeGroupRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.GetNodeGroupRequest} GetNodeGroupRequest - */ - GetNodeGroupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.GetNodeGroupRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.GetNodeGroupRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetNodeGroupRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.GetNodeGroupRequest - * @static - * @param {google.cloud.dataproc.v1.GetNodeGroupRequest} message GetNodeGroupRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetNodeGroupRequest.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 GetNodeGroupRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.GetNodeGroupRequest - * @instance - * @returns {Object.} JSON object - */ - GetNodeGroupRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetNodeGroupRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.GetNodeGroupRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetNodeGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.GetNodeGroupRequest"; - }; - - return GetNodeGroupRequest; - })(); - - v1.SessionTemplateController = (function() { - - /** - * Constructs a new SessionTemplateController service. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a SessionTemplateController - * @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 SessionTemplateController(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (SessionTemplateController.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SessionTemplateController; - - /** - * Creates new SessionTemplateController service using the specified rpc implementation. - * @function create - * @memberof google.cloud.dataproc.v1.SessionTemplateController - * @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 {SessionTemplateController} RPC service. Useful where requests and/or responses are streamed. - */ - SessionTemplateController.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.SessionTemplateController|createSessionTemplate}. - * @memberof google.cloud.dataproc.v1.SessionTemplateController - * @typedef CreateSessionTemplateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dataproc.v1.SessionTemplate} [response] SessionTemplate - */ - - /** - * Calls CreateSessionTemplate. - * @function createSessionTemplate - * @memberof google.cloud.dataproc.v1.SessionTemplateController - * @instance - * @param {google.cloud.dataproc.v1.ICreateSessionTemplateRequest} request CreateSessionTemplateRequest message or plain object - * @param {google.cloud.dataproc.v1.SessionTemplateController.CreateSessionTemplateCallback} callback Node-style callback called with the error, if any, and SessionTemplate - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SessionTemplateController.prototype.createSessionTemplate = function createSessionTemplate(request, callback) { - return this.rpcCall(createSessionTemplate, $root.google.cloud.dataproc.v1.CreateSessionTemplateRequest, $root.google.cloud.dataproc.v1.SessionTemplate, request, callback); - }, "name", { value: "CreateSessionTemplate" }); - - /** - * Calls CreateSessionTemplate. - * @function createSessionTemplate - * @memberof google.cloud.dataproc.v1.SessionTemplateController - * @instance - * @param {google.cloud.dataproc.v1.ICreateSessionTemplateRequest} request CreateSessionTemplateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.SessionTemplateController|updateSessionTemplate}. - * @memberof google.cloud.dataproc.v1.SessionTemplateController - * @typedef UpdateSessionTemplateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dataproc.v1.SessionTemplate} [response] SessionTemplate - */ - - /** - * Calls UpdateSessionTemplate. - * @function updateSessionTemplate - * @memberof google.cloud.dataproc.v1.SessionTemplateController - * @instance - * @param {google.cloud.dataproc.v1.IUpdateSessionTemplateRequest} request UpdateSessionTemplateRequest message or plain object - * @param {google.cloud.dataproc.v1.SessionTemplateController.UpdateSessionTemplateCallback} callback Node-style callback called with the error, if any, and SessionTemplate - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SessionTemplateController.prototype.updateSessionTemplate = function updateSessionTemplate(request, callback) { - return this.rpcCall(updateSessionTemplate, $root.google.cloud.dataproc.v1.UpdateSessionTemplateRequest, $root.google.cloud.dataproc.v1.SessionTemplate, request, callback); - }, "name", { value: "UpdateSessionTemplate" }); - - /** - * Calls UpdateSessionTemplate. - * @function updateSessionTemplate - * @memberof google.cloud.dataproc.v1.SessionTemplateController - * @instance - * @param {google.cloud.dataproc.v1.IUpdateSessionTemplateRequest} request UpdateSessionTemplateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.SessionTemplateController|getSessionTemplate}. - * @memberof google.cloud.dataproc.v1.SessionTemplateController - * @typedef GetSessionTemplateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dataproc.v1.SessionTemplate} [response] SessionTemplate - */ - - /** - * Calls GetSessionTemplate. - * @function getSessionTemplate - * @memberof google.cloud.dataproc.v1.SessionTemplateController - * @instance - * @param {google.cloud.dataproc.v1.IGetSessionTemplateRequest} request GetSessionTemplateRequest message or plain object - * @param {google.cloud.dataproc.v1.SessionTemplateController.GetSessionTemplateCallback} callback Node-style callback called with the error, if any, and SessionTemplate - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SessionTemplateController.prototype.getSessionTemplate = function getSessionTemplate(request, callback) { - return this.rpcCall(getSessionTemplate, $root.google.cloud.dataproc.v1.GetSessionTemplateRequest, $root.google.cloud.dataproc.v1.SessionTemplate, request, callback); - }, "name", { value: "GetSessionTemplate" }); - - /** - * Calls GetSessionTemplate. - * @function getSessionTemplate - * @memberof google.cloud.dataproc.v1.SessionTemplateController - * @instance - * @param {google.cloud.dataproc.v1.IGetSessionTemplateRequest} request GetSessionTemplateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.SessionTemplateController|listSessionTemplates}. - * @memberof google.cloud.dataproc.v1.SessionTemplateController - * @typedef ListSessionTemplatesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dataproc.v1.ListSessionTemplatesResponse} [response] ListSessionTemplatesResponse - */ - - /** - * Calls ListSessionTemplates. - * @function listSessionTemplates - * @memberof google.cloud.dataproc.v1.SessionTemplateController - * @instance - * @param {google.cloud.dataproc.v1.IListSessionTemplatesRequest} request ListSessionTemplatesRequest message or plain object - * @param {google.cloud.dataproc.v1.SessionTemplateController.ListSessionTemplatesCallback} callback Node-style callback called with the error, if any, and ListSessionTemplatesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SessionTemplateController.prototype.listSessionTemplates = function listSessionTemplates(request, callback) { - return this.rpcCall(listSessionTemplates, $root.google.cloud.dataproc.v1.ListSessionTemplatesRequest, $root.google.cloud.dataproc.v1.ListSessionTemplatesResponse, request, callback); - }, "name", { value: "ListSessionTemplates" }); - - /** - * Calls ListSessionTemplates. - * @function listSessionTemplates - * @memberof google.cloud.dataproc.v1.SessionTemplateController - * @instance - * @param {google.cloud.dataproc.v1.IListSessionTemplatesRequest} request ListSessionTemplatesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.SessionTemplateController|deleteSessionTemplate}. - * @memberof google.cloud.dataproc.v1.SessionTemplateController - * @typedef DeleteSessionTemplateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteSessionTemplate. - * @function deleteSessionTemplate - * @memberof google.cloud.dataproc.v1.SessionTemplateController - * @instance - * @param {google.cloud.dataproc.v1.IDeleteSessionTemplateRequest} request DeleteSessionTemplateRequest message or plain object - * @param {google.cloud.dataproc.v1.SessionTemplateController.DeleteSessionTemplateCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SessionTemplateController.prototype.deleteSessionTemplate = function deleteSessionTemplate(request, callback) { - return this.rpcCall(deleteSessionTemplate, $root.google.cloud.dataproc.v1.DeleteSessionTemplateRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteSessionTemplate" }); - - /** - * Calls DeleteSessionTemplate. - * @function deleteSessionTemplate - * @memberof google.cloud.dataproc.v1.SessionTemplateController - * @instance - * @param {google.cloud.dataproc.v1.IDeleteSessionTemplateRequest} request DeleteSessionTemplateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return SessionTemplateController; - })(); - - v1.CreateSessionTemplateRequest = (function() { - - /** - * Properties of a CreateSessionTemplateRequest. - * @memberof google.cloud.dataproc.v1 - * @interface ICreateSessionTemplateRequest - * @property {string|null} [parent] CreateSessionTemplateRequest parent - * @property {google.cloud.dataproc.v1.ISessionTemplate|null} [sessionTemplate] CreateSessionTemplateRequest sessionTemplate - */ - - /** - * Constructs a new CreateSessionTemplateRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a CreateSessionTemplateRequest. - * @implements ICreateSessionTemplateRequest - * @constructor - * @param {google.cloud.dataproc.v1.ICreateSessionTemplateRequest=} [properties] Properties to set - */ - function CreateSessionTemplateRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateSessionTemplateRequest parent. - * @member {string} parent - * @memberof google.cloud.dataproc.v1.CreateSessionTemplateRequest - * @instance - */ - CreateSessionTemplateRequest.prototype.parent = ""; - - /** - * CreateSessionTemplateRequest sessionTemplate. - * @member {google.cloud.dataproc.v1.ISessionTemplate|null|undefined} sessionTemplate - * @memberof google.cloud.dataproc.v1.CreateSessionTemplateRequest - * @instance - */ - CreateSessionTemplateRequest.prototype.sessionTemplate = null; - - /** - * Creates a new CreateSessionTemplateRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.CreateSessionTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.ICreateSessionTemplateRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.CreateSessionTemplateRequest} CreateSessionTemplateRequest instance - */ - CreateSessionTemplateRequest.create = function create(properties) { - return new CreateSessionTemplateRequest(properties); - }; - - /** - * Encodes the specified CreateSessionTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.CreateSessionTemplateRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.CreateSessionTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.ICreateSessionTemplateRequest} message CreateSessionTemplateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSessionTemplateRequest.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.sessionTemplate != null && Object.hasOwnProperty.call(message, "sessionTemplate")) - $root.google.cloud.dataproc.v1.SessionTemplate.encode(message.sessionTemplate, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateSessionTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.CreateSessionTemplateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.CreateSessionTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.ICreateSessionTemplateRequest} message CreateSessionTemplateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSessionTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateSessionTemplateRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.CreateSessionTemplateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.CreateSessionTemplateRequest} CreateSessionTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSessionTemplateRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.CreateSessionTemplateRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 3: { - message.sessionTemplate = $root.google.cloud.dataproc.v1.SessionTemplate.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateSessionTemplateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.CreateSessionTemplateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.CreateSessionTemplateRequest} CreateSessionTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSessionTemplateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateSessionTemplateRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.CreateSessionTemplateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateSessionTemplateRequest.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.sessionTemplate != null && message.hasOwnProperty("sessionTemplate")) { - var error = $root.google.cloud.dataproc.v1.SessionTemplate.verify(message.sessionTemplate); - if (error) - return "sessionTemplate." + error; - } - return null; - }; - - /** - * Creates a CreateSessionTemplateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.CreateSessionTemplateRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.CreateSessionTemplateRequest} CreateSessionTemplateRequest - */ - CreateSessionTemplateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.CreateSessionTemplateRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.CreateSessionTemplateRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.sessionTemplate != null) { - if (typeof object.sessionTemplate !== "object") - throw TypeError(".google.cloud.dataproc.v1.CreateSessionTemplateRequest.sessionTemplate: object expected"); - message.sessionTemplate = $root.google.cloud.dataproc.v1.SessionTemplate.fromObject(object.sessionTemplate); - } - return message; - }; - - /** - * Creates a plain object from a CreateSessionTemplateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.CreateSessionTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.CreateSessionTemplateRequest} message CreateSessionTemplateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateSessionTemplateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.sessionTemplate = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.sessionTemplate != null && message.hasOwnProperty("sessionTemplate")) - object.sessionTemplate = $root.google.cloud.dataproc.v1.SessionTemplate.toObject(message.sessionTemplate, options); - return object; - }; - - /** - * Converts this CreateSessionTemplateRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.CreateSessionTemplateRequest - * @instance - * @returns {Object.} JSON object - */ - CreateSessionTemplateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateSessionTemplateRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.CreateSessionTemplateRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateSessionTemplateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.CreateSessionTemplateRequest"; - }; - - return CreateSessionTemplateRequest; - })(); - - v1.UpdateSessionTemplateRequest = (function() { - - /** - * Properties of an UpdateSessionTemplateRequest. - * @memberof google.cloud.dataproc.v1 - * @interface IUpdateSessionTemplateRequest - * @property {google.cloud.dataproc.v1.ISessionTemplate|null} [sessionTemplate] UpdateSessionTemplateRequest sessionTemplate - */ - - /** - * Constructs a new UpdateSessionTemplateRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents an UpdateSessionTemplateRequest. - * @implements IUpdateSessionTemplateRequest - * @constructor - * @param {google.cloud.dataproc.v1.IUpdateSessionTemplateRequest=} [properties] Properties to set - */ - function UpdateSessionTemplateRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateSessionTemplateRequest sessionTemplate. - * @member {google.cloud.dataproc.v1.ISessionTemplate|null|undefined} sessionTemplate - * @memberof google.cloud.dataproc.v1.UpdateSessionTemplateRequest - * @instance - */ - UpdateSessionTemplateRequest.prototype.sessionTemplate = null; - - /** - * Creates a new UpdateSessionTemplateRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.UpdateSessionTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.IUpdateSessionTemplateRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.UpdateSessionTemplateRequest} UpdateSessionTemplateRequest instance - */ - UpdateSessionTemplateRequest.create = function create(properties) { - return new UpdateSessionTemplateRequest(properties); - }; - - /** - * Encodes the specified UpdateSessionTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.UpdateSessionTemplateRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.UpdateSessionTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.IUpdateSessionTemplateRequest} message UpdateSessionTemplateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateSessionTemplateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sessionTemplate != null && Object.hasOwnProperty.call(message, "sessionTemplate")) - $root.google.cloud.dataproc.v1.SessionTemplate.encode(message.sessionTemplate, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateSessionTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.UpdateSessionTemplateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.UpdateSessionTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.IUpdateSessionTemplateRequest} message UpdateSessionTemplateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateSessionTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateSessionTemplateRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.UpdateSessionTemplateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.UpdateSessionTemplateRequest} UpdateSessionTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateSessionTemplateRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.UpdateSessionTemplateRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.sessionTemplate = $root.google.cloud.dataproc.v1.SessionTemplate.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateSessionTemplateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.UpdateSessionTemplateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.UpdateSessionTemplateRequest} UpdateSessionTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateSessionTemplateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateSessionTemplateRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.UpdateSessionTemplateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateSessionTemplateRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sessionTemplate != null && message.hasOwnProperty("sessionTemplate")) { - var error = $root.google.cloud.dataproc.v1.SessionTemplate.verify(message.sessionTemplate); - if (error) - return "sessionTemplate." + error; - } - return null; - }; - - /** - * Creates an UpdateSessionTemplateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.UpdateSessionTemplateRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.UpdateSessionTemplateRequest} UpdateSessionTemplateRequest - */ - UpdateSessionTemplateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.UpdateSessionTemplateRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.UpdateSessionTemplateRequest(); - if (object.sessionTemplate != null) { - if (typeof object.sessionTemplate !== "object") - throw TypeError(".google.cloud.dataproc.v1.UpdateSessionTemplateRequest.sessionTemplate: object expected"); - message.sessionTemplate = $root.google.cloud.dataproc.v1.SessionTemplate.fromObject(object.sessionTemplate); - } - return message; - }; - - /** - * Creates a plain object from an UpdateSessionTemplateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.UpdateSessionTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.UpdateSessionTemplateRequest} message UpdateSessionTemplateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateSessionTemplateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.sessionTemplate = null; - if (message.sessionTemplate != null && message.hasOwnProperty("sessionTemplate")) - object.sessionTemplate = $root.google.cloud.dataproc.v1.SessionTemplate.toObject(message.sessionTemplate, options); - return object; - }; - - /** - * Converts this UpdateSessionTemplateRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.UpdateSessionTemplateRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateSessionTemplateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateSessionTemplateRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.UpdateSessionTemplateRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateSessionTemplateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.UpdateSessionTemplateRequest"; - }; - - return UpdateSessionTemplateRequest; - })(); - - v1.GetSessionTemplateRequest = (function() { - - /** - * Properties of a GetSessionTemplateRequest. - * @memberof google.cloud.dataproc.v1 - * @interface IGetSessionTemplateRequest - * @property {string|null} [name] GetSessionTemplateRequest name - */ - - /** - * Constructs a new GetSessionTemplateRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a GetSessionTemplateRequest. - * @implements IGetSessionTemplateRequest - * @constructor - * @param {google.cloud.dataproc.v1.IGetSessionTemplateRequest=} [properties] Properties to set - */ - function GetSessionTemplateRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetSessionTemplateRequest name. - * @member {string} name - * @memberof google.cloud.dataproc.v1.GetSessionTemplateRequest - * @instance - */ - GetSessionTemplateRequest.prototype.name = ""; - - /** - * Creates a new GetSessionTemplateRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.GetSessionTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.IGetSessionTemplateRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.GetSessionTemplateRequest} GetSessionTemplateRequest instance - */ - GetSessionTemplateRequest.create = function create(properties) { - return new GetSessionTemplateRequest(properties); - }; - - /** - * Encodes the specified GetSessionTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.GetSessionTemplateRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.GetSessionTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.IGetSessionTemplateRequest} message GetSessionTemplateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetSessionTemplateRequest.encode = function encode(message, writer) { - 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 GetSessionTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GetSessionTemplateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.GetSessionTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.IGetSessionTemplateRequest} message GetSessionTemplateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetSessionTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetSessionTemplateRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.GetSessionTemplateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.GetSessionTemplateRequest} GetSessionTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetSessionTemplateRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.GetSessionTemplateRequest(); - 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 GetSessionTemplateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.GetSessionTemplateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.GetSessionTemplateRequest} GetSessionTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetSessionTemplateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetSessionTemplateRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.GetSessionTemplateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetSessionTemplateRequest.verify = function verify(message) { - if (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 GetSessionTemplateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.GetSessionTemplateRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.GetSessionTemplateRequest} GetSessionTemplateRequest - */ - GetSessionTemplateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.GetSessionTemplateRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.GetSessionTemplateRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetSessionTemplateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.GetSessionTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.GetSessionTemplateRequest} message GetSessionTemplateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetSessionTemplateRequest.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 GetSessionTemplateRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.GetSessionTemplateRequest - * @instance - * @returns {Object.} JSON object - */ - GetSessionTemplateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetSessionTemplateRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.GetSessionTemplateRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetSessionTemplateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.GetSessionTemplateRequest"; - }; - - return GetSessionTemplateRequest; - })(); - - v1.ListSessionTemplatesRequest = (function() { - - /** - * Properties of a ListSessionTemplatesRequest. - * @memberof google.cloud.dataproc.v1 - * @interface IListSessionTemplatesRequest - * @property {string|null} [parent] ListSessionTemplatesRequest parent - * @property {number|null} [pageSize] ListSessionTemplatesRequest pageSize - * @property {string|null} [pageToken] ListSessionTemplatesRequest pageToken - * @property {string|null} [filter] ListSessionTemplatesRequest filter - */ - - /** - * Constructs a new ListSessionTemplatesRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a ListSessionTemplatesRequest. - * @implements IListSessionTemplatesRequest - * @constructor - * @param {google.cloud.dataproc.v1.IListSessionTemplatesRequest=} [properties] Properties to set - */ - function ListSessionTemplatesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListSessionTemplatesRequest parent. - * @member {string} parent - * @memberof google.cloud.dataproc.v1.ListSessionTemplatesRequest - * @instance - */ - ListSessionTemplatesRequest.prototype.parent = ""; - - /** - * ListSessionTemplatesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.dataproc.v1.ListSessionTemplatesRequest - * @instance - */ - ListSessionTemplatesRequest.prototype.pageSize = 0; - - /** - * ListSessionTemplatesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.dataproc.v1.ListSessionTemplatesRequest - * @instance - */ - ListSessionTemplatesRequest.prototype.pageToken = ""; - - /** - * ListSessionTemplatesRequest filter. - * @member {string} filter - * @memberof google.cloud.dataproc.v1.ListSessionTemplatesRequest - * @instance - */ - ListSessionTemplatesRequest.prototype.filter = ""; - - /** - * Creates a new ListSessionTemplatesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.ListSessionTemplatesRequest - * @static - * @param {google.cloud.dataproc.v1.IListSessionTemplatesRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.ListSessionTemplatesRequest} ListSessionTemplatesRequest instance - */ - ListSessionTemplatesRequest.create = function create(properties) { - return new ListSessionTemplatesRequest(properties); - }; - - /** - * Encodes the specified ListSessionTemplatesRequest message. Does not implicitly {@link google.cloud.dataproc.v1.ListSessionTemplatesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.ListSessionTemplatesRequest - * @static - * @param {google.cloud.dataproc.v1.IListSessionTemplatesRequest} message ListSessionTemplatesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSessionTemplatesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - return writer; - }; - - /** - * Encodes the specified ListSessionTemplatesRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListSessionTemplatesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.ListSessionTemplatesRequest - * @static - * @param {google.cloud.dataproc.v1.IListSessionTemplatesRequest} message ListSessionTemplatesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSessionTemplatesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListSessionTemplatesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.ListSessionTemplatesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.ListSessionTemplatesRequest} ListSessionTemplatesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSessionTemplatesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ListSessionTemplatesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListSessionTemplatesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.ListSessionTemplatesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.ListSessionTemplatesRequest} ListSessionTemplatesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSessionTemplatesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListSessionTemplatesRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.ListSessionTemplatesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSessionTemplatesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - return null; - }; - - /** - * Creates a ListSessionTemplatesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.ListSessionTemplatesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.ListSessionTemplatesRequest} ListSessionTemplatesRequest - */ - ListSessionTemplatesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.ListSessionTemplatesRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.ListSessionTemplatesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - return message; - }; - - /** - * Creates a plain object from a ListSessionTemplatesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.ListSessionTemplatesRequest - * @static - * @param {google.cloud.dataproc.v1.ListSessionTemplatesRequest} message ListSessionTemplatesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSessionTemplatesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - return object; - }; - - /** - * Converts this ListSessionTemplatesRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.ListSessionTemplatesRequest - * @instance - * @returns {Object.} JSON object - */ - ListSessionTemplatesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListSessionTemplatesRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.ListSessionTemplatesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListSessionTemplatesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.ListSessionTemplatesRequest"; - }; - - return ListSessionTemplatesRequest; - })(); - - v1.ListSessionTemplatesResponse = (function() { - - /** - * Properties of a ListSessionTemplatesResponse. - * @memberof google.cloud.dataproc.v1 - * @interface IListSessionTemplatesResponse - * @property {Array.|null} [sessionTemplates] ListSessionTemplatesResponse sessionTemplates - * @property {string|null} [nextPageToken] ListSessionTemplatesResponse nextPageToken - */ - - /** - * Constructs a new ListSessionTemplatesResponse. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a ListSessionTemplatesResponse. - * @implements IListSessionTemplatesResponse - * @constructor - * @param {google.cloud.dataproc.v1.IListSessionTemplatesResponse=} [properties] Properties to set - */ - function ListSessionTemplatesResponse(properties) { - this.sessionTemplates = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListSessionTemplatesResponse sessionTemplates. - * @member {Array.} sessionTemplates - * @memberof google.cloud.dataproc.v1.ListSessionTemplatesResponse - * @instance - */ - ListSessionTemplatesResponse.prototype.sessionTemplates = $util.emptyArray; - - /** - * ListSessionTemplatesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.dataproc.v1.ListSessionTemplatesResponse - * @instance - */ - ListSessionTemplatesResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListSessionTemplatesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.ListSessionTemplatesResponse - * @static - * @param {google.cloud.dataproc.v1.IListSessionTemplatesResponse=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.ListSessionTemplatesResponse} ListSessionTemplatesResponse instance - */ - ListSessionTemplatesResponse.create = function create(properties) { - return new ListSessionTemplatesResponse(properties); - }; - - /** - * Encodes the specified ListSessionTemplatesResponse message. Does not implicitly {@link google.cloud.dataproc.v1.ListSessionTemplatesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.ListSessionTemplatesResponse - * @static - * @param {google.cloud.dataproc.v1.IListSessionTemplatesResponse} message ListSessionTemplatesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSessionTemplatesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sessionTemplates != null && message.sessionTemplates.length) - for (var i = 0; i < message.sessionTemplates.length; ++i) - $root.google.cloud.dataproc.v1.SessionTemplate.encode(message.sessionTemplates[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 ListSessionTemplatesResponse message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListSessionTemplatesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.ListSessionTemplatesResponse - * @static - * @param {google.cloud.dataproc.v1.IListSessionTemplatesResponse} message ListSessionTemplatesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSessionTemplatesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListSessionTemplatesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.ListSessionTemplatesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.ListSessionTemplatesResponse} ListSessionTemplatesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSessionTemplatesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ListSessionTemplatesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.sessionTemplates && message.sessionTemplates.length)) - message.sessionTemplates = []; - message.sessionTemplates.push($root.google.cloud.dataproc.v1.SessionTemplate.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListSessionTemplatesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.ListSessionTemplatesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.ListSessionTemplatesResponse} ListSessionTemplatesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSessionTemplatesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListSessionTemplatesResponse message. - * @function verify - * @memberof google.cloud.dataproc.v1.ListSessionTemplatesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSessionTemplatesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sessionTemplates != null && message.hasOwnProperty("sessionTemplates")) { - if (!Array.isArray(message.sessionTemplates)) - return "sessionTemplates: array expected"; - for (var i = 0; i < message.sessionTemplates.length; ++i) { - var error = $root.google.cloud.dataproc.v1.SessionTemplate.verify(message.sessionTemplates[i]); - if (error) - return "sessionTemplates." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListSessionTemplatesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.ListSessionTemplatesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.ListSessionTemplatesResponse} ListSessionTemplatesResponse - */ - ListSessionTemplatesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.ListSessionTemplatesResponse) - return object; - var message = new $root.google.cloud.dataproc.v1.ListSessionTemplatesResponse(); - if (object.sessionTemplates) { - if (!Array.isArray(object.sessionTemplates)) - throw TypeError(".google.cloud.dataproc.v1.ListSessionTemplatesResponse.sessionTemplates: array expected"); - message.sessionTemplates = []; - for (var i = 0; i < object.sessionTemplates.length; ++i) { - if (typeof object.sessionTemplates[i] !== "object") - throw TypeError(".google.cloud.dataproc.v1.ListSessionTemplatesResponse.sessionTemplates: object expected"); - message.sessionTemplates[i] = $root.google.cloud.dataproc.v1.SessionTemplate.fromObject(object.sessionTemplates[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListSessionTemplatesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.ListSessionTemplatesResponse - * @static - * @param {google.cloud.dataproc.v1.ListSessionTemplatesResponse} message ListSessionTemplatesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSessionTemplatesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.sessionTemplates = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.sessionTemplates && message.sessionTemplates.length) { - object.sessionTemplates = []; - for (var j = 0; j < message.sessionTemplates.length; ++j) - object.sessionTemplates[j] = $root.google.cloud.dataproc.v1.SessionTemplate.toObject(message.sessionTemplates[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListSessionTemplatesResponse to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.ListSessionTemplatesResponse - * @instance - * @returns {Object.} JSON object - */ - ListSessionTemplatesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListSessionTemplatesResponse - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.ListSessionTemplatesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListSessionTemplatesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.ListSessionTemplatesResponse"; - }; - - return ListSessionTemplatesResponse; - })(); - - v1.DeleteSessionTemplateRequest = (function() { - - /** - * Properties of a DeleteSessionTemplateRequest. - * @memberof google.cloud.dataproc.v1 - * @interface IDeleteSessionTemplateRequest - * @property {string|null} [name] DeleteSessionTemplateRequest name - */ - - /** - * Constructs a new DeleteSessionTemplateRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a DeleteSessionTemplateRequest. - * @implements IDeleteSessionTemplateRequest - * @constructor - * @param {google.cloud.dataproc.v1.IDeleteSessionTemplateRequest=} [properties] Properties to set - */ - function DeleteSessionTemplateRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteSessionTemplateRequest name. - * @member {string} name - * @memberof google.cloud.dataproc.v1.DeleteSessionTemplateRequest - * @instance - */ - DeleteSessionTemplateRequest.prototype.name = ""; - - /** - * Creates a new DeleteSessionTemplateRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.DeleteSessionTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.IDeleteSessionTemplateRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.DeleteSessionTemplateRequest} DeleteSessionTemplateRequest instance - */ - DeleteSessionTemplateRequest.create = function create(properties) { - return new DeleteSessionTemplateRequest(properties); - }; - - /** - * Encodes the specified DeleteSessionTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.DeleteSessionTemplateRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.DeleteSessionTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.IDeleteSessionTemplateRequest} message DeleteSessionTemplateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteSessionTemplateRequest.encode = function encode(message, writer) { - 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 DeleteSessionTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DeleteSessionTemplateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.DeleteSessionTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.IDeleteSessionTemplateRequest} message DeleteSessionTemplateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteSessionTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteSessionTemplateRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.DeleteSessionTemplateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.DeleteSessionTemplateRequest} DeleteSessionTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteSessionTemplateRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.DeleteSessionTemplateRequest(); - 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 DeleteSessionTemplateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.DeleteSessionTemplateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.DeleteSessionTemplateRequest} DeleteSessionTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteSessionTemplateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteSessionTemplateRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.DeleteSessionTemplateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteSessionTemplateRequest.verify = function verify(message) { - if (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 DeleteSessionTemplateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.DeleteSessionTemplateRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.DeleteSessionTemplateRequest} DeleteSessionTemplateRequest - */ - DeleteSessionTemplateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.DeleteSessionTemplateRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.DeleteSessionTemplateRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteSessionTemplateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.DeleteSessionTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.DeleteSessionTemplateRequest} message DeleteSessionTemplateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteSessionTemplateRequest.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 DeleteSessionTemplateRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.DeleteSessionTemplateRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteSessionTemplateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteSessionTemplateRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.DeleteSessionTemplateRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteSessionTemplateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.DeleteSessionTemplateRequest"; - }; - - return DeleteSessionTemplateRequest; - })(); - - v1.SessionTemplate = (function() { - - /** - * Properties of a SessionTemplate. - * @memberof google.cloud.dataproc.v1 - * @interface ISessionTemplate - * @property {string|null} [name] SessionTemplate name - * @property {string|null} [description] SessionTemplate description - * @property {google.protobuf.ITimestamp|null} [createTime] SessionTemplate createTime - * @property {google.cloud.dataproc.v1.IJupyterConfig|null} [jupyterSession] SessionTemplate jupyterSession - * @property {google.cloud.dataproc.v1.ISparkConnectConfig|null} [sparkConnectSession] SessionTemplate sparkConnectSession - * @property {string|null} [creator] SessionTemplate creator - * @property {Object.|null} [labels] SessionTemplate labels - * @property {google.cloud.dataproc.v1.IRuntimeConfig|null} [runtimeConfig] SessionTemplate runtimeConfig - * @property {google.cloud.dataproc.v1.IEnvironmentConfig|null} [environmentConfig] SessionTemplate environmentConfig - * @property {google.protobuf.ITimestamp|null} [updateTime] SessionTemplate updateTime - * @property {string|null} [uuid] SessionTemplate uuid - */ - - /** - * Constructs a new SessionTemplate. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a SessionTemplate. - * @implements ISessionTemplate - * @constructor - * @param {google.cloud.dataproc.v1.ISessionTemplate=} [properties] Properties to set - */ - function SessionTemplate(properties) { - this.labels = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SessionTemplate name. - * @member {string} name - * @memberof google.cloud.dataproc.v1.SessionTemplate - * @instance - */ - SessionTemplate.prototype.name = ""; - - /** - * SessionTemplate description. - * @member {string} description - * @memberof google.cloud.dataproc.v1.SessionTemplate - * @instance - */ - SessionTemplate.prototype.description = ""; - - /** - * SessionTemplate createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.dataproc.v1.SessionTemplate - * @instance - */ - SessionTemplate.prototype.createTime = null; - - /** - * SessionTemplate jupyterSession. - * @member {google.cloud.dataproc.v1.IJupyterConfig|null|undefined} jupyterSession - * @memberof google.cloud.dataproc.v1.SessionTemplate - * @instance - */ - SessionTemplate.prototype.jupyterSession = null; - - /** - * SessionTemplate sparkConnectSession. - * @member {google.cloud.dataproc.v1.ISparkConnectConfig|null|undefined} sparkConnectSession - * @memberof google.cloud.dataproc.v1.SessionTemplate - * @instance - */ - SessionTemplate.prototype.sparkConnectSession = null; - - /** - * SessionTemplate creator. - * @member {string} creator - * @memberof google.cloud.dataproc.v1.SessionTemplate - * @instance - */ - SessionTemplate.prototype.creator = ""; - - /** - * SessionTemplate labels. - * @member {Object.} labels - * @memberof google.cloud.dataproc.v1.SessionTemplate - * @instance - */ - SessionTemplate.prototype.labels = $util.emptyObject; - - /** - * SessionTemplate runtimeConfig. - * @member {google.cloud.dataproc.v1.IRuntimeConfig|null|undefined} runtimeConfig - * @memberof google.cloud.dataproc.v1.SessionTemplate - * @instance - */ - SessionTemplate.prototype.runtimeConfig = null; - - /** - * SessionTemplate environmentConfig. - * @member {google.cloud.dataproc.v1.IEnvironmentConfig|null|undefined} environmentConfig - * @memberof google.cloud.dataproc.v1.SessionTemplate - * @instance - */ - SessionTemplate.prototype.environmentConfig = null; - - /** - * SessionTemplate updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.dataproc.v1.SessionTemplate - * @instance - */ - SessionTemplate.prototype.updateTime = null; - - /** - * SessionTemplate uuid. - * @member {string} uuid - * @memberof google.cloud.dataproc.v1.SessionTemplate - * @instance - */ - SessionTemplate.prototype.uuid = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * SessionTemplate sessionConfig. - * @member {"jupyterSession"|"sparkConnectSession"|undefined} sessionConfig - * @memberof google.cloud.dataproc.v1.SessionTemplate - * @instance - */ - Object.defineProperty(SessionTemplate.prototype, "sessionConfig", { - get: $util.oneOfGetter($oneOfFields = ["jupyterSession", "sparkConnectSession"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SessionTemplate instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.SessionTemplate - * @static - * @param {google.cloud.dataproc.v1.ISessionTemplate=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.SessionTemplate} SessionTemplate instance - */ - SessionTemplate.create = function create(properties) { - return new SessionTemplate(properties); - }; - - /** - * Encodes the specified SessionTemplate message. Does not implicitly {@link google.cloud.dataproc.v1.SessionTemplate.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.SessionTemplate - * @static - * @param {google.cloud.dataproc.v1.ISessionTemplate} message SessionTemplate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SessionTemplate.encode = function encode(message, writer) { - if (!writer) - 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.jupyterSession != null && Object.hasOwnProperty.call(message, "jupyterSession")) - $root.google.cloud.dataproc.v1.JupyterConfig.encode(message.jupyterSession, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.creator); - 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.runtimeConfig != null && Object.hasOwnProperty.call(message, "runtimeConfig")) - $root.google.cloud.dataproc.v1.RuntimeConfig.encode(message.runtimeConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.environmentConfig != null && Object.hasOwnProperty.call(message, "environmentConfig")) - $root.google.cloud.dataproc.v1.EnvironmentConfig.encode(message.environmentConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.description); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.sparkConnectSession != null && Object.hasOwnProperty.call(message, "sparkConnectSession")) - $root.google.cloud.dataproc.v1.SparkConnectConfig.encode(message.sparkConnectSession, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.uuid != null && Object.hasOwnProperty.call(message, "uuid")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.uuid); - return writer; - }; - - /** - * Encodes the specified SessionTemplate message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SessionTemplate.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.SessionTemplate - * @static - * @param {google.cloud.dataproc.v1.ISessionTemplate} message SessionTemplate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SessionTemplate.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SessionTemplate message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.SessionTemplate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.SessionTemplate} SessionTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SessionTemplate.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.SessionTemplate(), 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 9: { - message.description = reader.string(); - break; - } - case 2: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.jupyterSession = $root.google.cloud.dataproc.v1.JupyterConfig.decode(reader, reader.uint32()); - break; - } - case 11: { - message.sparkConnectSession = $root.google.cloud.dataproc.v1.SparkConnectConfig.decode(reader, reader.uint32()); - break; - } - case 5: { - message.creator = reader.string(); - break; - } - case 6: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 7: { - message.runtimeConfig = $root.google.cloud.dataproc.v1.RuntimeConfig.decode(reader, reader.uint32()); - break; - } - case 8: { - message.environmentConfig = $root.google.cloud.dataproc.v1.EnvironmentConfig.decode(reader, reader.uint32()); - break; - } - case 10: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 12: { - message.uuid = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SessionTemplate message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.SessionTemplate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.SessionTemplate} SessionTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SessionTemplate.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SessionTemplate message. - * @function verify - * @memberof google.cloud.dataproc.v1.SessionTemplate - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SessionTemplate.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.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.jupyterSession != null && message.hasOwnProperty("jupyterSession")) { - properties.sessionConfig = 1; - { - var error = $root.google.cloud.dataproc.v1.JupyterConfig.verify(message.jupyterSession); - if (error) - return "jupyterSession." + error; - } - } - if (message.sparkConnectSession != null && message.hasOwnProperty("sparkConnectSession")) { - if (properties.sessionConfig === 1) - return "sessionConfig: multiple values"; - properties.sessionConfig = 1; - { - var error = $root.google.cloud.dataproc.v1.SparkConnectConfig.verify(message.sparkConnectSession); - if (error) - return "sparkConnectSession." + error; - } - } - if (message.creator != null && message.hasOwnProperty("creator")) - if (!$util.isString(message.creator)) - return "creator: 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.runtimeConfig != null && message.hasOwnProperty("runtimeConfig")) { - var error = $root.google.cloud.dataproc.v1.RuntimeConfig.verify(message.runtimeConfig); - if (error) - return "runtimeConfig." + error; - } - if (message.environmentConfig != null && message.hasOwnProperty("environmentConfig")) { - var error = $root.google.cloud.dataproc.v1.EnvironmentConfig.verify(message.environmentConfig); - if (error) - return "environmentConfig." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.uuid != null && message.hasOwnProperty("uuid")) - if (!$util.isString(message.uuid)) - return "uuid: string expected"; - return null; - }; - - /** - * Creates a SessionTemplate message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.SessionTemplate - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.SessionTemplate} SessionTemplate - */ - SessionTemplate.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.SessionTemplate) - return object; - var message = new $root.google.cloud.dataproc.v1.SessionTemplate(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.dataproc.v1.SessionTemplate.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.jupyterSession != null) { - if (typeof object.jupyterSession !== "object") - throw TypeError(".google.cloud.dataproc.v1.SessionTemplate.jupyterSession: object expected"); - message.jupyterSession = $root.google.cloud.dataproc.v1.JupyterConfig.fromObject(object.jupyterSession); - } - if (object.sparkConnectSession != null) { - if (typeof object.sparkConnectSession !== "object") - throw TypeError(".google.cloud.dataproc.v1.SessionTemplate.sparkConnectSession: object expected"); - message.sparkConnectSession = $root.google.cloud.dataproc.v1.SparkConnectConfig.fromObject(object.sparkConnectSession); - } - if (object.creator != null) - message.creator = String(object.creator); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.dataproc.v1.SessionTemplate.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.runtimeConfig != null) { - if (typeof object.runtimeConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.SessionTemplate.runtimeConfig: object expected"); - message.runtimeConfig = $root.google.cloud.dataproc.v1.RuntimeConfig.fromObject(object.runtimeConfig); - } - if (object.environmentConfig != null) { - if (typeof object.environmentConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.SessionTemplate.environmentConfig: object expected"); - message.environmentConfig = $root.google.cloud.dataproc.v1.EnvironmentConfig.fromObject(object.environmentConfig); - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.dataproc.v1.SessionTemplate.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.uuid != null) - message.uuid = String(object.uuid); - return message; - }; - - /** - * Creates a plain object from a SessionTemplate message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.SessionTemplate - * @static - * @param {google.cloud.dataproc.v1.SessionTemplate} message SessionTemplate - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SessionTemplate.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.createTime = null; - object.creator = ""; - object.runtimeConfig = null; - object.environmentConfig = null; - object.description = ""; - object.updateTime = null; - object.uuid = ""; - } - 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.jupyterSession != null && message.hasOwnProperty("jupyterSession")) { - object.jupyterSession = $root.google.cloud.dataproc.v1.JupyterConfig.toObject(message.jupyterSession, options); - if (options.oneofs) - object.sessionConfig = "jupyterSession"; - } - if (message.creator != null && message.hasOwnProperty("creator")) - object.creator = message.creator; - 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.runtimeConfig != null && message.hasOwnProperty("runtimeConfig")) - object.runtimeConfig = $root.google.cloud.dataproc.v1.RuntimeConfig.toObject(message.runtimeConfig, options); - if (message.environmentConfig != null && message.hasOwnProperty("environmentConfig")) - object.environmentConfig = $root.google.cloud.dataproc.v1.EnvironmentConfig.toObject(message.environmentConfig, options); - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.sparkConnectSession != null && message.hasOwnProperty("sparkConnectSession")) { - object.sparkConnectSession = $root.google.cloud.dataproc.v1.SparkConnectConfig.toObject(message.sparkConnectSession, options); - if (options.oneofs) - object.sessionConfig = "sparkConnectSession"; - } - if (message.uuid != null && message.hasOwnProperty("uuid")) - object.uuid = message.uuid; - return object; - }; - - /** - * Converts this SessionTemplate to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.SessionTemplate - * @instance - * @returns {Object.} JSON object - */ - SessionTemplate.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SessionTemplate - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.SessionTemplate - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SessionTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.SessionTemplate"; - }; - - return SessionTemplate; - })(); - - v1.SessionController = (function() { - - /** - * Constructs a new SessionController service. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a SessionController - * @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 SessionController(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (SessionController.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SessionController; - - /** - * Creates new SessionController service using the specified rpc implementation. - * @function create - * @memberof google.cloud.dataproc.v1.SessionController - * @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 {SessionController} RPC service. Useful where requests and/or responses are streamed. - */ - SessionController.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.SessionController|createSession}. - * @memberof google.cloud.dataproc.v1.SessionController - * @typedef CreateSessionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateSession. - * @function createSession - * @memberof google.cloud.dataproc.v1.SessionController - * @instance - * @param {google.cloud.dataproc.v1.ICreateSessionRequest} request CreateSessionRequest message or plain object - * @param {google.cloud.dataproc.v1.SessionController.CreateSessionCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SessionController.prototype.createSession = function createSession(request, callback) { - return this.rpcCall(createSession, $root.google.cloud.dataproc.v1.CreateSessionRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateSession" }); - - /** - * Calls CreateSession. - * @function createSession - * @memberof google.cloud.dataproc.v1.SessionController - * @instance - * @param {google.cloud.dataproc.v1.ICreateSessionRequest} request CreateSessionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.SessionController|getSession}. - * @memberof google.cloud.dataproc.v1.SessionController - * @typedef GetSessionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dataproc.v1.Session} [response] Session - */ - - /** - * Calls GetSession. - * @function getSession - * @memberof google.cloud.dataproc.v1.SessionController - * @instance - * @param {google.cloud.dataproc.v1.IGetSessionRequest} request GetSessionRequest message or plain object - * @param {google.cloud.dataproc.v1.SessionController.GetSessionCallback} callback Node-style callback called with the error, if any, and Session - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SessionController.prototype.getSession = function getSession(request, callback) { - return this.rpcCall(getSession, $root.google.cloud.dataproc.v1.GetSessionRequest, $root.google.cloud.dataproc.v1.Session, request, callback); - }, "name", { value: "GetSession" }); - - /** - * Calls GetSession. - * @function getSession - * @memberof google.cloud.dataproc.v1.SessionController - * @instance - * @param {google.cloud.dataproc.v1.IGetSessionRequest} request GetSessionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.SessionController|listSessions}. - * @memberof google.cloud.dataproc.v1.SessionController - * @typedef ListSessionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dataproc.v1.ListSessionsResponse} [response] ListSessionsResponse - */ - - /** - * Calls ListSessions. - * @function listSessions - * @memberof google.cloud.dataproc.v1.SessionController - * @instance - * @param {google.cloud.dataproc.v1.IListSessionsRequest} request ListSessionsRequest message or plain object - * @param {google.cloud.dataproc.v1.SessionController.ListSessionsCallback} callback Node-style callback called with the error, if any, and ListSessionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SessionController.prototype.listSessions = function listSessions(request, callback) { - return this.rpcCall(listSessions, $root.google.cloud.dataproc.v1.ListSessionsRequest, $root.google.cloud.dataproc.v1.ListSessionsResponse, request, callback); - }, "name", { value: "ListSessions" }); - - /** - * Calls ListSessions. - * @function listSessions - * @memberof google.cloud.dataproc.v1.SessionController - * @instance - * @param {google.cloud.dataproc.v1.IListSessionsRequest} request ListSessionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.SessionController|terminateSession}. - * @memberof google.cloud.dataproc.v1.SessionController - * @typedef TerminateSessionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls TerminateSession. - * @function terminateSession - * @memberof google.cloud.dataproc.v1.SessionController - * @instance - * @param {google.cloud.dataproc.v1.ITerminateSessionRequest} request TerminateSessionRequest message or plain object - * @param {google.cloud.dataproc.v1.SessionController.TerminateSessionCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SessionController.prototype.terminateSession = function terminateSession(request, callback) { - return this.rpcCall(terminateSession, $root.google.cloud.dataproc.v1.TerminateSessionRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "TerminateSession" }); - - /** - * Calls TerminateSession. - * @function terminateSession - * @memberof google.cloud.dataproc.v1.SessionController - * @instance - * @param {google.cloud.dataproc.v1.ITerminateSessionRequest} request TerminateSessionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.SessionController|deleteSession}. - * @memberof google.cloud.dataproc.v1.SessionController - * @typedef DeleteSessionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteSession. - * @function deleteSession - * @memberof google.cloud.dataproc.v1.SessionController - * @instance - * @param {google.cloud.dataproc.v1.IDeleteSessionRequest} request DeleteSessionRequest message or plain object - * @param {google.cloud.dataproc.v1.SessionController.DeleteSessionCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SessionController.prototype.deleteSession = function deleteSession(request, callback) { - return this.rpcCall(deleteSession, $root.google.cloud.dataproc.v1.DeleteSessionRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteSession" }); - - /** - * Calls DeleteSession. - * @function deleteSession - * @memberof google.cloud.dataproc.v1.SessionController - * @instance - * @param {google.cloud.dataproc.v1.IDeleteSessionRequest} request DeleteSessionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return SessionController; - })(); - - v1.CreateSessionRequest = (function() { - - /** - * Properties of a CreateSessionRequest. - * @memberof google.cloud.dataproc.v1 - * @interface ICreateSessionRequest - * @property {string|null} [parent] CreateSessionRequest parent - * @property {google.cloud.dataproc.v1.ISession|null} [session] CreateSessionRequest session - * @property {string|null} [sessionId] CreateSessionRequest sessionId - * @property {string|null} [requestId] CreateSessionRequest requestId - */ - - /** - * Constructs a new CreateSessionRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a CreateSessionRequest. - * @implements ICreateSessionRequest - * @constructor - * @param {google.cloud.dataproc.v1.ICreateSessionRequest=} [properties] Properties to set - */ - function CreateSessionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateSessionRequest parent. - * @member {string} parent - * @memberof google.cloud.dataproc.v1.CreateSessionRequest - * @instance - */ - CreateSessionRequest.prototype.parent = ""; - - /** - * CreateSessionRequest session. - * @member {google.cloud.dataproc.v1.ISession|null|undefined} session - * @memberof google.cloud.dataproc.v1.CreateSessionRequest - * @instance - */ - CreateSessionRequest.prototype.session = null; - - /** - * CreateSessionRequest sessionId. - * @member {string} sessionId - * @memberof google.cloud.dataproc.v1.CreateSessionRequest - * @instance - */ - CreateSessionRequest.prototype.sessionId = ""; - - /** - * CreateSessionRequest requestId. - * @member {string} requestId - * @memberof google.cloud.dataproc.v1.CreateSessionRequest - * @instance - */ - CreateSessionRequest.prototype.requestId = ""; - - /** - * Creates a new CreateSessionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.CreateSessionRequest - * @static - * @param {google.cloud.dataproc.v1.ICreateSessionRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.CreateSessionRequest} CreateSessionRequest instance - */ - CreateSessionRequest.create = function create(properties) { - return new CreateSessionRequest(properties); - }; - - /** - * Encodes the specified CreateSessionRequest message. Does not implicitly {@link google.cloud.dataproc.v1.CreateSessionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.CreateSessionRequest - * @static - * @param {google.cloud.dataproc.v1.ICreateSessionRequest} message CreateSessionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSessionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.session != null && Object.hasOwnProperty.call(message, "session")) - $root.google.cloud.dataproc.v1.Session.encode(message.session, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.sessionId != null && Object.hasOwnProperty.call(message, "sessionId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.sessionId); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified CreateSessionRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.CreateSessionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.CreateSessionRequest - * @static - * @param {google.cloud.dataproc.v1.ICreateSessionRequest} message CreateSessionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateSessionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.CreateSessionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.CreateSessionRequest} CreateSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSessionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.CreateSessionRequest(); - 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.session = $root.google.cloud.dataproc.v1.Session.decode(reader, reader.uint32()); - break; - } - case 3: { - message.sessionId = reader.string(); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateSessionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.CreateSessionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.CreateSessionRequest} CreateSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSessionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateSessionRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.CreateSessionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateSessionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.session != null && message.hasOwnProperty("session")) { - var error = $root.google.cloud.dataproc.v1.Session.verify(message.session); - if (error) - return "session." + error; - } - if (message.sessionId != null && message.hasOwnProperty("sessionId")) - if (!$util.isString(message.sessionId)) - return "sessionId: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a CreateSessionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.CreateSessionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.CreateSessionRequest} CreateSessionRequest - */ - CreateSessionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.CreateSessionRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.CreateSessionRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.session != null) { - if (typeof object.session !== "object") - throw TypeError(".google.cloud.dataproc.v1.CreateSessionRequest.session: object expected"); - message.session = $root.google.cloud.dataproc.v1.Session.fromObject(object.session); - } - if (object.sessionId != null) - message.sessionId = String(object.sessionId); - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a CreateSessionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.CreateSessionRequest - * @static - * @param {google.cloud.dataproc.v1.CreateSessionRequest} message CreateSessionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateSessionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.session = null; - object.sessionId = ""; - object.requestId = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.session != null && message.hasOwnProperty("session")) - object.session = $root.google.cloud.dataproc.v1.Session.toObject(message.session, options); - if (message.sessionId != null && message.hasOwnProperty("sessionId")) - object.sessionId = message.sessionId; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this CreateSessionRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.CreateSessionRequest - * @instance - * @returns {Object.} JSON object - */ - CreateSessionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateSessionRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.CreateSessionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.CreateSessionRequest"; - }; - - return CreateSessionRequest; - })(); - - v1.GetSessionRequest = (function() { - - /** - * Properties of a GetSessionRequest. - * @memberof google.cloud.dataproc.v1 - * @interface IGetSessionRequest - * @property {string|null} [name] GetSessionRequest name - */ - - /** - * Constructs a new GetSessionRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a GetSessionRequest. - * @implements IGetSessionRequest - * @constructor - * @param {google.cloud.dataproc.v1.IGetSessionRequest=} [properties] Properties to set - */ - function GetSessionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetSessionRequest name. - * @member {string} name - * @memberof google.cloud.dataproc.v1.GetSessionRequest - * @instance - */ - GetSessionRequest.prototype.name = ""; - - /** - * Creates a new GetSessionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.GetSessionRequest - * @static - * @param {google.cloud.dataproc.v1.IGetSessionRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.GetSessionRequest} GetSessionRequest instance - */ - GetSessionRequest.create = function create(properties) { - return new GetSessionRequest(properties); - }; - - /** - * Encodes the specified GetSessionRequest message. Does not implicitly {@link google.cloud.dataproc.v1.GetSessionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.GetSessionRequest - * @static - * @param {google.cloud.dataproc.v1.IGetSessionRequest} message GetSessionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetSessionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetSessionRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GetSessionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.GetSessionRequest - * @static - * @param {google.cloud.dataproc.v1.IGetSessionRequest} message GetSessionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetSessionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.GetSessionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.GetSessionRequest} GetSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetSessionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.GetSessionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetSessionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.GetSessionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.GetSessionRequest} GetSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetSessionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetSessionRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.GetSessionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetSessionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetSessionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.GetSessionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.GetSessionRequest} GetSessionRequest - */ - GetSessionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.GetSessionRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.GetSessionRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetSessionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.GetSessionRequest - * @static - * @param {google.cloud.dataproc.v1.GetSessionRequest} message GetSessionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetSessionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this GetSessionRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.GetSessionRequest - * @instance - * @returns {Object.} JSON object - */ - GetSessionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetSessionRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.GetSessionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.GetSessionRequest"; - }; - - return GetSessionRequest; - })(); - - v1.ListSessionsRequest = (function() { - - /** - * Properties of a ListSessionsRequest. - * @memberof google.cloud.dataproc.v1 - * @interface IListSessionsRequest - * @property {string|null} [parent] ListSessionsRequest parent - * @property {number|null} [pageSize] ListSessionsRequest pageSize - * @property {string|null} [pageToken] ListSessionsRequest pageToken - * @property {string|null} [filter] ListSessionsRequest filter - */ - - /** - * Constructs a new ListSessionsRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a ListSessionsRequest. - * @implements IListSessionsRequest - * @constructor - * @param {google.cloud.dataproc.v1.IListSessionsRequest=} [properties] Properties to set - */ - function ListSessionsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListSessionsRequest parent. - * @member {string} parent - * @memberof google.cloud.dataproc.v1.ListSessionsRequest - * @instance - */ - ListSessionsRequest.prototype.parent = ""; - - /** - * ListSessionsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.dataproc.v1.ListSessionsRequest - * @instance - */ - ListSessionsRequest.prototype.pageSize = 0; - - /** - * ListSessionsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.dataproc.v1.ListSessionsRequest - * @instance - */ - ListSessionsRequest.prototype.pageToken = ""; - - /** - * ListSessionsRequest filter. - * @member {string} filter - * @memberof google.cloud.dataproc.v1.ListSessionsRequest - * @instance - */ - ListSessionsRequest.prototype.filter = ""; - - /** - * Creates a new ListSessionsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.ListSessionsRequest - * @static - * @param {google.cloud.dataproc.v1.IListSessionsRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.ListSessionsRequest} ListSessionsRequest instance - */ - ListSessionsRequest.create = function create(properties) { - return new ListSessionsRequest(properties); - }; - - /** - * Encodes the specified ListSessionsRequest message. Does not implicitly {@link google.cloud.dataproc.v1.ListSessionsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.ListSessionsRequest - * @static - * @param {google.cloud.dataproc.v1.IListSessionsRequest} message ListSessionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSessionsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - return writer; - }; - - /** - * Encodes the specified ListSessionsRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListSessionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.ListSessionsRequest - * @static - * @param {google.cloud.dataproc.v1.IListSessionsRequest} message ListSessionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSessionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListSessionsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.ListSessionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.ListSessionsRequest} ListSessionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSessionsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ListSessionsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListSessionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.ListSessionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.ListSessionsRequest} ListSessionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSessionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListSessionsRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.ListSessionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSessionsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - return null; - }; - - /** - * Creates a ListSessionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.ListSessionsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.ListSessionsRequest} ListSessionsRequest - */ - ListSessionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.ListSessionsRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.ListSessionsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - return message; - }; - - /** - * Creates a plain object from a ListSessionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.ListSessionsRequest - * @static - * @param {google.cloud.dataproc.v1.ListSessionsRequest} message ListSessionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSessionsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - return object; - }; - - /** - * Converts this ListSessionsRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.ListSessionsRequest - * @instance - * @returns {Object.} JSON object - */ - ListSessionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListSessionsRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.ListSessionsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListSessionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.ListSessionsRequest"; - }; - - return ListSessionsRequest; - })(); - - v1.ListSessionsResponse = (function() { - - /** - * Properties of a ListSessionsResponse. - * @memberof google.cloud.dataproc.v1 - * @interface IListSessionsResponse - * @property {Array.|null} [sessions] ListSessionsResponse sessions - * @property {string|null} [nextPageToken] ListSessionsResponse nextPageToken - */ - - /** - * Constructs a new ListSessionsResponse. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a ListSessionsResponse. - * @implements IListSessionsResponse - * @constructor - * @param {google.cloud.dataproc.v1.IListSessionsResponse=} [properties] Properties to set - */ - function ListSessionsResponse(properties) { - this.sessions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListSessionsResponse sessions. - * @member {Array.} sessions - * @memberof google.cloud.dataproc.v1.ListSessionsResponse - * @instance - */ - ListSessionsResponse.prototype.sessions = $util.emptyArray; - - /** - * ListSessionsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.dataproc.v1.ListSessionsResponse - * @instance - */ - ListSessionsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListSessionsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.ListSessionsResponse - * @static - * @param {google.cloud.dataproc.v1.IListSessionsResponse=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.ListSessionsResponse} ListSessionsResponse instance - */ - ListSessionsResponse.create = function create(properties) { - return new ListSessionsResponse(properties); - }; - - /** - * Encodes the specified ListSessionsResponse message. Does not implicitly {@link google.cloud.dataproc.v1.ListSessionsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.ListSessionsResponse - * @static - * @param {google.cloud.dataproc.v1.IListSessionsResponse} message ListSessionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSessionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sessions != null && message.sessions.length) - for (var i = 0; i < message.sessions.length; ++i) - $root.google.cloud.dataproc.v1.Session.encode(message.sessions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListSessionsResponse message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListSessionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.ListSessionsResponse - * @static - * @param {google.cloud.dataproc.v1.IListSessionsResponse} message ListSessionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSessionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListSessionsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.ListSessionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.ListSessionsResponse} ListSessionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSessionsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ListSessionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.sessions && message.sessions.length)) - message.sessions = []; - message.sessions.push($root.google.cloud.dataproc.v1.Session.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListSessionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.ListSessionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.ListSessionsResponse} ListSessionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSessionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListSessionsResponse message. - * @function verify - * @memberof google.cloud.dataproc.v1.ListSessionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSessionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sessions != null && message.hasOwnProperty("sessions")) { - if (!Array.isArray(message.sessions)) - return "sessions: array expected"; - for (var i = 0; i < message.sessions.length; ++i) { - var error = $root.google.cloud.dataproc.v1.Session.verify(message.sessions[i]); - if (error) - return "sessions." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListSessionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.ListSessionsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.ListSessionsResponse} ListSessionsResponse - */ - ListSessionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.ListSessionsResponse) - return object; - var message = new $root.google.cloud.dataproc.v1.ListSessionsResponse(); - if (object.sessions) { - if (!Array.isArray(object.sessions)) - throw TypeError(".google.cloud.dataproc.v1.ListSessionsResponse.sessions: array expected"); - message.sessions = []; - for (var i = 0; i < object.sessions.length; ++i) { - if (typeof object.sessions[i] !== "object") - throw TypeError(".google.cloud.dataproc.v1.ListSessionsResponse.sessions: object expected"); - message.sessions[i] = $root.google.cloud.dataproc.v1.Session.fromObject(object.sessions[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListSessionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.ListSessionsResponse - * @static - * @param {google.cloud.dataproc.v1.ListSessionsResponse} message ListSessionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSessionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.sessions = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.sessions && message.sessions.length) { - object.sessions = []; - for (var j = 0; j < message.sessions.length; ++j) - object.sessions[j] = $root.google.cloud.dataproc.v1.Session.toObject(message.sessions[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListSessionsResponse to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.ListSessionsResponse - * @instance - * @returns {Object.} JSON object - */ - ListSessionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListSessionsResponse - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.ListSessionsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListSessionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.ListSessionsResponse"; - }; - - return ListSessionsResponse; - })(); - - v1.TerminateSessionRequest = (function() { - - /** - * Properties of a TerminateSessionRequest. - * @memberof google.cloud.dataproc.v1 - * @interface ITerminateSessionRequest - * @property {string|null} [name] TerminateSessionRequest name - * @property {string|null} [requestId] TerminateSessionRequest requestId - */ - - /** - * Constructs a new TerminateSessionRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a TerminateSessionRequest. - * @implements ITerminateSessionRequest - * @constructor - * @param {google.cloud.dataproc.v1.ITerminateSessionRequest=} [properties] Properties to set - */ - function TerminateSessionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TerminateSessionRequest name. - * @member {string} name - * @memberof google.cloud.dataproc.v1.TerminateSessionRequest - * @instance - */ - TerminateSessionRequest.prototype.name = ""; - - /** - * TerminateSessionRequest requestId. - * @member {string} requestId - * @memberof google.cloud.dataproc.v1.TerminateSessionRequest - * @instance - */ - TerminateSessionRequest.prototype.requestId = ""; - - /** - * Creates a new TerminateSessionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.TerminateSessionRequest - * @static - * @param {google.cloud.dataproc.v1.ITerminateSessionRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.TerminateSessionRequest} TerminateSessionRequest instance - */ - TerminateSessionRequest.create = function create(properties) { - return new TerminateSessionRequest(properties); - }; - - /** - * Encodes the specified TerminateSessionRequest message. Does not implicitly {@link google.cloud.dataproc.v1.TerminateSessionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.TerminateSessionRequest - * @static - * @param {google.cloud.dataproc.v1.ITerminateSessionRequest} message TerminateSessionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TerminateSessionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified TerminateSessionRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.TerminateSessionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.TerminateSessionRequest - * @static - * @param {google.cloud.dataproc.v1.ITerminateSessionRequest} message TerminateSessionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TerminateSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TerminateSessionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.TerminateSessionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.TerminateSessionRequest} TerminateSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TerminateSessionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.TerminateSessionRequest(); - 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.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TerminateSessionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.TerminateSessionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.TerminateSessionRequest} TerminateSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TerminateSessionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TerminateSessionRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.TerminateSessionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TerminateSessionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a TerminateSessionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.TerminateSessionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.TerminateSessionRequest} TerminateSessionRequest - */ - TerminateSessionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.TerminateSessionRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.TerminateSessionRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a TerminateSessionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.TerminateSessionRequest - * @static - * @param {google.cloud.dataproc.v1.TerminateSessionRequest} message TerminateSessionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TerminateSessionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this TerminateSessionRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.TerminateSessionRequest - * @instance - * @returns {Object.} JSON object - */ - TerminateSessionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TerminateSessionRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.TerminateSessionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TerminateSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.TerminateSessionRequest"; - }; - - return TerminateSessionRequest; - })(); - - v1.DeleteSessionRequest = (function() { - - /** - * Properties of a DeleteSessionRequest. - * @memberof google.cloud.dataproc.v1 - * @interface IDeleteSessionRequest - * @property {string|null} [name] DeleteSessionRequest name - * @property {string|null} [requestId] DeleteSessionRequest requestId - */ - - /** - * Constructs a new DeleteSessionRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a DeleteSessionRequest. - * @implements IDeleteSessionRequest - * @constructor - * @param {google.cloud.dataproc.v1.IDeleteSessionRequest=} [properties] Properties to set - */ - function DeleteSessionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteSessionRequest name. - * @member {string} name - * @memberof google.cloud.dataproc.v1.DeleteSessionRequest - * @instance - */ - DeleteSessionRequest.prototype.name = ""; - - /** - * DeleteSessionRequest requestId. - * @member {string} requestId - * @memberof google.cloud.dataproc.v1.DeleteSessionRequest - * @instance - */ - DeleteSessionRequest.prototype.requestId = ""; - - /** - * Creates a new DeleteSessionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.DeleteSessionRequest - * @static - * @param {google.cloud.dataproc.v1.IDeleteSessionRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.DeleteSessionRequest} DeleteSessionRequest instance - */ - DeleteSessionRequest.create = function create(properties) { - return new DeleteSessionRequest(properties); - }; - - /** - * Encodes the specified DeleteSessionRequest message. Does not implicitly {@link google.cloud.dataproc.v1.DeleteSessionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.DeleteSessionRequest - * @static - * @param {google.cloud.dataproc.v1.IDeleteSessionRequest} message DeleteSessionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteSessionRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified DeleteSessionRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DeleteSessionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.DeleteSessionRequest - * @static - * @param {google.cloud.dataproc.v1.IDeleteSessionRequest} message DeleteSessionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteSessionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteSessionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.DeleteSessionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.DeleteSessionRequest} DeleteSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteSessionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.DeleteSessionRequest(); - 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.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteSessionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.DeleteSessionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.DeleteSessionRequest} DeleteSessionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteSessionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteSessionRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.DeleteSessionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteSessionRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a DeleteSessionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.DeleteSessionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.DeleteSessionRequest} DeleteSessionRequest - */ - DeleteSessionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.DeleteSessionRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.DeleteSessionRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a DeleteSessionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.DeleteSessionRequest - * @static - * @param {google.cloud.dataproc.v1.DeleteSessionRequest} message DeleteSessionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteSessionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this DeleteSessionRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.DeleteSessionRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteSessionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteSessionRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.DeleteSessionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteSessionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.DeleteSessionRequest"; - }; - - return DeleteSessionRequest; - })(); - - v1.Session = (function() { - - /** - * Properties of a Session. - * @memberof google.cloud.dataproc.v1 - * @interface ISession - * @property {string|null} [name] Session name - * @property {string|null} [uuid] Session uuid - * @property {google.protobuf.ITimestamp|null} [createTime] Session createTime - * @property {google.cloud.dataproc.v1.IJupyterConfig|null} [jupyterSession] Session jupyterSession - * @property {google.cloud.dataproc.v1.ISparkConnectConfig|null} [sparkConnectSession] Session sparkConnectSession - * @property {google.cloud.dataproc.v1.IRuntimeInfo|null} [runtimeInfo] Session runtimeInfo - * @property {google.cloud.dataproc.v1.Session.State|null} [state] Session state - * @property {string|null} [stateMessage] Session stateMessage - * @property {google.protobuf.ITimestamp|null} [stateTime] Session stateTime - * @property {string|null} [creator] Session creator - * @property {Object.|null} [labels] Session labels - * @property {google.cloud.dataproc.v1.IRuntimeConfig|null} [runtimeConfig] Session runtimeConfig - * @property {google.cloud.dataproc.v1.IEnvironmentConfig|null} [environmentConfig] Session environmentConfig - * @property {string|null} [user] Session user - * @property {Array.|null} [stateHistory] Session stateHistory - * @property {string|null} [sessionTemplate] Session sessionTemplate - */ - - /** - * Constructs a new Session. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a Session. - * @implements ISession - * @constructor - * @param {google.cloud.dataproc.v1.ISession=} [properties] Properties to set - */ - function Session(properties) { - this.labels = {}; - this.stateHistory = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Session name. - * @member {string} name - * @memberof google.cloud.dataproc.v1.Session - * @instance - */ - Session.prototype.name = ""; - - /** - * Session uuid. - * @member {string} uuid - * @memberof google.cloud.dataproc.v1.Session - * @instance - */ - Session.prototype.uuid = ""; - - /** - * Session createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.dataproc.v1.Session - * @instance - */ - Session.prototype.createTime = null; - - /** - * Session jupyterSession. - * @member {google.cloud.dataproc.v1.IJupyterConfig|null|undefined} jupyterSession - * @memberof google.cloud.dataproc.v1.Session - * @instance - */ - Session.prototype.jupyterSession = null; - - /** - * Session sparkConnectSession. - * @member {google.cloud.dataproc.v1.ISparkConnectConfig|null|undefined} sparkConnectSession - * @memberof google.cloud.dataproc.v1.Session - * @instance - */ - Session.prototype.sparkConnectSession = null; - - /** - * Session runtimeInfo. - * @member {google.cloud.dataproc.v1.IRuntimeInfo|null|undefined} runtimeInfo - * @memberof google.cloud.dataproc.v1.Session - * @instance - */ - Session.prototype.runtimeInfo = null; - - /** - * Session state. - * @member {google.cloud.dataproc.v1.Session.State} state - * @memberof google.cloud.dataproc.v1.Session - * @instance - */ - Session.prototype.state = 0; - - /** - * Session stateMessage. - * @member {string} stateMessage - * @memberof google.cloud.dataproc.v1.Session - * @instance - */ - Session.prototype.stateMessage = ""; - - /** - * Session stateTime. - * @member {google.protobuf.ITimestamp|null|undefined} stateTime - * @memberof google.cloud.dataproc.v1.Session - * @instance - */ - Session.prototype.stateTime = null; - - /** - * Session creator. - * @member {string} creator - * @memberof google.cloud.dataproc.v1.Session - * @instance - */ - Session.prototype.creator = ""; - - /** - * Session labels. - * @member {Object.} labels - * @memberof google.cloud.dataproc.v1.Session - * @instance - */ - Session.prototype.labels = $util.emptyObject; - - /** - * Session runtimeConfig. - * @member {google.cloud.dataproc.v1.IRuntimeConfig|null|undefined} runtimeConfig - * @memberof google.cloud.dataproc.v1.Session - * @instance - */ - Session.prototype.runtimeConfig = null; - - /** - * Session environmentConfig. - * @member {google.cloud.dataproc.v1.IEnvironmentConfig|null|undefined} environmentConfig - * @memberof google.cloud.dataproc.v1.Session - * @instance - */ - Session.prototype.environmentConfig = null; - - /** - * Session user. - * @member {string} user - * @memberof google.cloud.dataproc.v1.Session - * @instance - */ - Session.prototype.user = ""; - - /** - * Session stateHistory. - * @member {Array.} stateHistory - * @memberof google.cloud.dataproc.v1.Session - * @instance - */ - Session.prototype.stateHistory = $util.emptyArray; - - /** - * Session sessionTemplate. - * @member {string} sessionTemplate - * @memberof google.cloud.dataproc.v1.Session - * @instance - */ - Session.prototype.sessionTemplate = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Session sessionConfig. - * @member {"jupyterSession"|"sparkConnectSession"|undefined} sessionConfig - * @memberof google.cloud.dataproc.v1.Session - * @instance - */ - Object.defineProperty(Session.prototype, "sessionConfig", { - get: $util.oneOfGetter($oneOfFields = ["jupyterSession", "sparkConnectSession"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Session instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.Session - * @static - * @param {google.cloud.dataproc.v1.ISession=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.Session} Session instance - */ - Session.create = function create(properties) { - return new Session(properties); - }; - - /** - * Encodes the specified Session message. Does not implicitly {@link google.cloud.dataproc.v1.Session.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.Session - * @static - * @param {google.cloud.dataproc.v1.ISession} message Session message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Session.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.uuid != null && Object.hasOwnProperty.call(message, "uuid")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.uuid); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.jupyterSession != null && Object.hasOwnProperty.call(message, "jupyterSession")) - $root.google.cloud.dataproc.v1.JupyterConfig.encode(message.jupyterSession, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.runtimeInfo != null && Object.hasOwnProperty.call(message, "runtimeInfo")) - $root.google.cloud.dataproc.v1.RuntimeInfo.encode(message.runtimeInfo, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); - if (message.stateMessage != null && Object.hasOwnProperty.call(message, "stateMessage")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.stateMessage); - if (message.stateTime != null && Object.hasOwnProperty.call(message, "stateTime")) - $root.google.protobuf.Timestamp.encode(message.stateTime, 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.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 11, wireType 2 =*/90).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.runtimeConfig != null && Object.hasOwnProperty.call(message, "runtimeConfig")) - $root.google.cloud.dataproc.v1.RuntimeConfig.encode(message.runtimeConfig, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.environmentConfig != null && Object.hasOwnProperty.call(message, "environmentConfig")) - $root.google.cloud.dataproc.v1.EnvironmentConfig.encode(message.environmentConfig, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.user != null && Object.hasOwnProperty.call(message, "user")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.user); - if (message.stateHistory != null && message.stateHistory.length) - for (var i = 0; i < message.stateHistory.length; ++i) - $root.google.cloud.dataproc.v1.Session.SessionStateHistory.encode(message.stateHistory[i], writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.sessionTemplate != null && Object.hasOwnProperty.call(message, "sessionTemplate")) - writer.uint32(/* id 16, wireType 2 =*/130).string(message.sessionTemplate); - if (message.sparkConnectSession != null && Object.hasOwnProperty.call(message, "sparkConnectSession")) - $root.google.cloud.dataproc.v1.SparkConnectConfig.encode(message.sparkConnectSession, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Session message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.Session.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.Session - * @static - * @param {google.cloud.dataproc.v1.ISession} message Session message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Session.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Session message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.Session - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.Session} Session - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Session.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.Session(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.uuid = reader.string(); - break; - } - case 3: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.jupyterSession = $root.google.cloud.dataproc.v1.JupyterConfig.decode(reader, reader.uint32()); - break; - } - case 17: { - message.sparkConnectSession = $root.google.cloud.dataproc.v1.SparkConnectConfig.decode(reader, reader.uint32()); - break; - } - case 6: { - message.runtimeInfo = $root.google.cloud.dataproc.v1.RuntimeInfo.decode(reader, reader.uint32()); - break; - } - case 7: { - message.state = reader.int32(); - break; - } - case 8: { - message.stateMessage = reader.string(); - break; - } - case 9: { - message.stateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 10: { - message.creator = reader.string(); - break; - } - case 11: { - 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 12: { - message.runtimeConfig = $root.google.cloud.dataproc.v1.RuntimeConfig.decode(reader, reader.uint32()); - break; - } - case 13: { - message.environmentConfig = $root.google.cloud.dataproc.v1.EnvironmentConfig.decode(reader, reader.uint32()); - break; - } - case 14: { - message.user = reader.string(); - break; - } - case 15: { - if (!(message.stateHistory && message.stateHistory.length)) - message.stateHistory = []; - message.stateHistory.push($root.google.cloud.dataproc.v1.Session.SessionStateHistory.decode(reader, reader.uint32())); - break; - } - case 16: { - message.sessionTemplate = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Session message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.Session - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.Session} Session - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Session.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Session message. - * @function verify - * @memberof google.cloud.dataproc.v1.Session - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Session.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.uuid != null && message.hasOwnProperty("uuid")) - if (!$util.isString(message.uuid)) - return "uuid: 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.jupyterSession != null && message.hasOwnProperty("jupyterSession")) { - properties.sessionConfig = 1; - { - var error = $root.google.cloud.dataproc.v1.JupyterConfig.verify(message.jupyterSession); - if (error) - return "jupyterSession." + error; - } - } - if (message.sparkConnectSession != null && message.hasOwnProperty("sparkConnectSession")) { - if (properties.sessionConfig === 1) - return "sessionConfig: multiple values"; - properties.sessionConfig = 1; - { - var error = $root.google.cloud.dataproc.v1.SparkConnectConfig.verify(message.sparkConnectSession); - if (error) - return "sparkConnectSession." + error; - } - } - if (message.runtimeInfo != null && message.hasOwnProperty("runtimeInfo")) { - var error = $root.google.cloud.dataproc.v1.RuntimeInfo.verify(message.runtimeInfo); - if (error) - return "runtimeInfo." + error; - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) - if (!$util.isString(message.stateMessage)) - return "stateMessage: string expected"; - if (message.stateTime != null && message.hasOwnProperty("stateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.stateTime); - if (error) - return "stateTime." + error; - } - if (message.creator != null && message.hasOwnProperty("creator")) - if (!$util.isString(message.creator)) - return "creator: 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.runtimeConfig != null && message.hasOwnProperty("runtimeConfig")) { - var error = $root.google.cloud.dataproc.v1.RuntimeConfig.verify(message.runtimeConfig); - if (error) - return "runtimeConfig." + error; - } - if (message.environmentConfig != null && message.hasOwnProperty("environmentConfig")) { - var error = $root.google.cloud.dataproc.v1.EnvironmentConfig.verify(message.environmentConfig); - if (error) - return "environmentConfig." + error; - } - if (message.user != null && message.hasOwnProperty("user")) - if (!$util.isString(message.user)) - return "user: string expected"; - if (message.stateHistory != null && message.hasOwnProperty("stateHistory")) { - if (!Array.isArray(message.stateHistory)) - return "stateHistory: array expected"; - for (var i = 0; i < message.stateHistory.length; ++i) { - var error = $root.google.cloud.dataproc.v1.Session.SessionStateHistory.verify(message.stateHistory[i]); - if (error) - return "stateHistory." + error; - } - } - if (message.sessionTemplate != null && message.hasOwnProperty("sessionTemplate")) - if (!$util.isString(message.sessionTemplate)) - return "sessionTemplate: string expected"; - return null; - }; - - /** - * Creates a Session message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.Session - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.Session} Session - */ - Session.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.Session) - return object; - var message = new $root.google.cloud.dataproc.v1.Session(); - if (object.name != null) - message.name = String(object.name); - if (object.uuid != null) - message.uuid = String(object.uuid); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.dataproc.v1.Session.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.jupyterSession != null) { - if (typeof object.jupyterSession !== "object") - throw TypeError(".google.cloud.dataproc.v1.Session.jupyterSession: object expected"); - message.jupyterSession = $root.google.cloud.dataproc.v1.JupyterConfig.fromObject(object.jupyterSession); - } - if (object.sparkConnectSession != null) { - if (typeof object.sparkConnectSession !== "object") - throw TypeError(".google.cloud.dataproc.v1.Session.sparkConnectSession: object expected"); - message.sparkConnectSession = $root.google.cloud.dataproc.v1.SparkConnectConfig.fromObject(object.sparkConnectSession); - } - if (object.runtimeInfo != null) { - if (typeof object.runtimeInfo !== "object") - throw TypeError(".google.cloud.dataproc.v1.Session.runtimeInfo: object expected"); - message.runtimeInfo = $root.google.cloud.dataproc.v1.RuntimeInfo.fromObject(object.runtimeInfo); - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "CREATING": - case 1: - message.state = 1; - break; - case "ACTIVE": - case 2: - message.state = 2; - break; - case "TERMINATING": - case 3: - message.state = 3; - break; - case "TERMINATED": - case 4: - message.state = 4; - break; - case "FAILED": - case 5: - message.state = 5; - break; - } - if (object.stateMessage != null) - message.stateMessage = String(object.stateMessage); - if (object.stateTime != null) { - if (typeof object.stateTime !== "object") - throw TypeError(".google.cloud.dataproc.v1.Session.stateTime: object expected"); - message.stateTime = $root.google.protobuf.Timestamp.fromObject(object.stateTime); - } - if (object.creator != null) - message.creator = String(object.creator); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.dataproc.v1.Session.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - if (object.runtimeConfig != null) { - if (typeof object.runtimeConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.Session.runtimeConfig: object expected"); - message.runtimeConfig = $root.google.cloud.dataproc.v1.RuntimeConfig.fromObject(object.runtimeConfig); - } - if (object.environmentConfig != null) { - if (typeof object.environmentConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.Session.environmentConfig: object expected"); - message.environmentConfig = $root.google.cloud.dataproc.v1.EnvironmentConfig.fromObject(object.environmentConfig); - } - if (object.user != null) - message.user = String(object.user); - if (object.stateHistory) { - if (!Array.isArray(object.stateHistory)) - throw TypeError(".google.cloud.dataproc.v1.Session.stateHistory: array expected"); - message.stateHistory = []; - for (var i = 0; i < object.stateHistory.length; ++i) { - if (typeof object.stateHistory[i] !== "object") - throw TypeError(".google.cloud.dataproc.v1.Session.stateHistory: object expected"); - message.stateHistory[i] = $root.google.cloud.dataproc.v1.Session.SessionStateHistory.fromObject(object.stateHistory[i]); - } - } - if (object.sessionTemplate != null) - message.sessionTemplate = String(object.sessionTemplate); - return message; - }; - - /** - * Creates a plain object from a Session message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.Session - * @static - * @param {google.cloud.dataproc.v1.Session} message Session - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Session.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.stateHistory = []; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.uuid = ""; - object.createTime = null; - object.runtimeInfo = null; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.stateMessage = ""; - object.stateTime = null; - object.creator = ""; - object.runtimeConfig = null; - object.environmentConfig = null; - object.user = ""; - object.sessionTemplate = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.uuid != null && message.hasOwnProperty("uuid")) - object.uuid = message.uuid; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.jupyterSession != null && message.hasOwnProperty("jupyterSession")) { - object.jupyterSession = $root.google.cloud.dataproc.v1.JupyterConfig.toObject(message.jupyterSession, options); - if (options.oneofs) - object.sessionConfig = "jupyterSession"; - } - if (message.runtimeInfo != null && message.hasOwnProperty("runtimeInfo")) - object.runtimeInfo = $root.google.cloud.dataproc.v1.RuntimeInfo.toObject(message.runtimeInfo, options); - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.dataproc.v1.Session.State[message.state] === undefined ? message.state : $root.google.cloud.dataproc.v1.Session.State[message.state] : message.state; - if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) - object.stateMessage = message.stateMessage; - if (message.stateTime != null && message.hasOwnProperty("stateTime")) - object.stateTime = $root.google.protobuf.Timestamp.toObject(message.stateTime, options); - if (message.creator != null && message.hasOwnProperty("creator")) - object.creator = message.creator; - 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.runtimeConfig != null && message.hasOwnProperty("runtimeConfig")) - object.runtimeConfig = $root.google.cloud.dataproc.v1.RuntimeConfig.toObject(message.runtimeConfig, options); - if (message.environmentConfig != null && message.hasOwnProperty("environmentConfig")) - object.environmentConfig = $root.google.cloud.dataproc.v1.EnvironmentConfig.toObject(message.environmentConfig, options); - if (message.user != null && message.hasOwnProperty("user")) - object.user = message.user; - if (message.stateHistory && message.stateHistory.length) { - object.stateHistory = []; - for (var j = 0; j < message.stateHistory.length; ++j) - object.stateHistory[j] = $root.google.cloud.dataproc.v1.Session.SessionStateHistory.toObject(message.stateHistory[j], options); - } - if (message.sessionTemplate != null && message.hasOwnProperty("sessionTemplate")) - object.sessionTemplate = message.sessionTemplate; - if (message.sparkConnectSession != null && message.hasOwnProperty("sparkConnectSession")) { - object.sparkConnectSession = $root.google.cloud.dataproc.v1.SparkConnectConfig.toObject(message.sparkConnectSession, options); - if (options.oneofs) - object.sessionConfig = "sparkConnectSession"; - } - return object; - }; - - /** - * Converts this Session to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.Session - * @instance - * @returns {Object.} JSON object - */ - Session.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Session - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.Session - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Session.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.Session"; - }; - - /** - * State enum. - * @name google.cloud.dataproc.v1.Session.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} CREATING=1 CREATING value - * @property {number} ACTIVE=2 ACTIVE value - * @property {number} TERMINATING=3 TERMINATING value - * @property {number} TERMINATED=4 TERMINATED value - * @property {number} FAILED=5 FAILED value - */ - Session.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CREATING"] = 1; - values[valuesById[2] = "ACTIVE"] = 2; - values[valuesById[3] = "TERMINATING"] = 3; - values[valuesById[4] = "TERMINATED"] = 4; - values[valuesById[5] = "FAILED"] = 5; - return values; - })(); - - Session.SessionStateHistory = (function() { - - /** - * Properties of a SessionStateHistory. - * @memberof google.cloud.dataproc.v1.Session - * @interface ISessionStateHistory - * @property {google.cloud.dataproc.v1.Session.State|null} [state] SessionStateHistory state - * @property {string|null} [stateMessage] SessionStateHistory stateMessage - * @property {google.protobuf.ITimestamp|null} [stateStartTime] SessionStateHistory stateStartTime - */ - - /** - * Constructs a new SessionStateHistory. - * @memberof google.cloud.dataproc.v1.Session - * @classdesc Represents a SessionStateHistory. - * @implements ISessionStateHistory - * @constructor - * @param {google.cloud.dataproc.v1.Session.ISessionStateHistory=} [properties] Properties to set - */ - function SessionStateHistory(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SessionStateHistory state. - * @member {google.cloud.dataproc.v1.Session.State} state - * @memberof google.cloud.dataproc.v1.Session.SessionStateHistory - * @instance - */ - SessionStateHistory.prototype.state = 0; - - /** - * SessionStateHistory stateMessage. - * @member {string} stateMessage - * @memberof google.cloud.dataproc.v1.Session.SessionStateHistory - * @instance - */ - SessionStateHistory.prototype.stateMessage = ""; - - /** - * SessionStateHistory stateStartTime. - * @member {google.protobuf.ITimestamp|null|undefined} stateStartTime - * @memberof google.cloud.dataproc.v1.Session.SessionStateHistory - * @instance - */ - SessionStateHistory.prototype.stateStartTime = null; - - /** - * Creates a new SessionStateHistory instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.Session.SessionStateHistory - * @static - * @param {google.cloud.dataproc.v1.Session.ISessionStateHistory=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.Session.SessionStateHistory} SessionStateHistory instance - */ - SessionStateHistory.create = function create(properties) { - return new SessionStateHistory(properties); - }; - - /** - * Encodes the specified SessionStateHistory message. Does not implicitly {@link google.cloud.dataproc.v1.Session.SessionStateHistory.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.Session.SessionStateHistory - * @static - * @param {google.cloud.dataproc.v1.Session.ISessionStateHistory} message SessionStateHistory message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SessionStateHistory.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - if (message.stateMessage != null && Object.hasOwnProperty.call(message, "stateMessage")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.stateMessage); - if (message.stateStartTime != null && Object.hasOwnProperty.call(message, "stateStartTime")) - $root.google.protobuf.Timestamp.encode(message.stateStartTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SessionStateHistory message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.Session.SessionStateHistory.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.Session.SessionStateHistory - * @static - * @param {google.cloud.dataproc.v1.Session.ISessionStateHistory} message SessionStateHistory message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SessionStateHistory.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SessionStateHistory message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.Session.SessionStateHistory - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.Session.SessionStateHistory} SessionStateHistory - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SessionStateHistory.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.Session.SessionStateHistory(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.state = reader.int32(); - break; - } - case 2: { - message.stateMessage = reader.string(); - break; - } - case 3: { - message.stateStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SessionStateHistory message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.Session.SessionStateHistory - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.Session.SessionStateHistory} SessionStateHistory - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SessionStateHistory.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SessionStateHistory message. - * @function verify - * @memberof google.cloud.dataproc.v1.Session.SessionStateHistory - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SessionStateHistory.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) - if (!$util.isString(message.stateMessage)) - return "stateMessage: string expected"; - if (message.stateStartTime != null && message.hasOwnProperty("stateStartTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.stateStartTime); - if (error) - return "stateStartTime." + error; - } - return null; - }; - - /** - * Creates a SessionStateHistory message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.Session.SessionStateHistory - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.Session.SessionStateHistory} SessionStateHistory - */ - SessionStateHistory.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.Session.SessionStateHistory) - return object; - var message = new $root.google.cloud.dataproc.v1.Session.SessionStateHistory(); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "CREATING": - case 1: - message.state = 1; - break; - case "ACTIVE": - case 2: - message.state = 2; - break; - case "TERMINATING": - case 3: - message.state = 3; - break; - case "TERMINATED": - case 4: - message.state = 4; - break; - case "FAILED": - case 5: - message.state = 5; - break; - } - if (object.stateMessage != null) - message.stateMessage = String(object.stateMessage); - if (object.stateStartTime != null) { - if (typeof object.stateStartTime !== "object") - throw TypeError(".google.cloud.dataproc.v1.Session.SessionStateHistory.stateStartTime: object expected"); - message.stateStartTime = $root.google.protobuf.Timestamp.fromObject(object.stateStartTime); - } - return message; - }; - - /** - * Creates a plain object from a SessionStateHistory message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.Session.SessionStateHistory - * @static - * @param {google.cloud.dataproc.v1.Session.SessionStateHistory} message SessionStateHistory - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SessionStateHistory.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.stateMessage = ""; - object.stateStartTime = null; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.dataproc.v1.Session.State[message.state] === undefined ? message.state : $root.google.cloud.dataproc.v1.Session.State[message.state] : message.state; - if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) - object.stateMessage = message.stateMessage; - if (message.stateStartTime != null && message.hasOwnProperty("stateStartTime")) - object.stateStartTime = $root.google.protobuf.Timestamp.toObject(message.stateStartTime, options); - return object; - }; - - /** - * Converts this SessionStateHistory to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.Session.SessionStateHistory - * @instance - * @returns {Object.} JSON object - */ - SessionStateHistory.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SessionStateHistory - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.Session.SessionStateHistory - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SessionStateHistory.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.Session.SessionStateHistory"; - }; - - return SessionStateHistory; - })(); - - return Session; - })(); - - v1.JupyterConfig = (function() { - - /** - * Properties of a JupyterConfig. - * @memberof google.cloud.dataproc.v1 - * @interface IJupyterConfig - * @property {google.cloud.dataproc.v1.JupyterConfig.Kernel|null} [kernel] JupyterConfig kernel - * @property {string|null} [displayName] JupyterConfig displayName - */ - - /** - * Constructs a new JupyterConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a JupyterConfig. - * @implements IJupyterConfig - * @constructor - * @param {google.cloud.dataproc.v1.IJupyterConfig=} [properties] Properties to set - */ - function JupyterConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * JupyterConfig kernel. - * @member {google.cloud.dataproc.v1.JupyterConfig.Kernel} kernel - * @memberof google.cloud.dataproc.v1.JupyterConfig - * @instance - */ - JupyterConfig.prototype.kernel = 0; - - /** - * JupyterConfig displayName. - * @member {string} displayName - * @memberof google.cloud.dataproc.v1.JupyterConfig - * @instance - */ - JupyterConfig.prototype.displayName = ""; - - /** - * Creates a new JupyterConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.JupyterConfig - * @static - * @param {google.cloud.dataproc.v1.IJupyterConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.JupyterConfig} JupyterConfig instance - */ - JupyterConfig.create = function create(properties) { - return new JupyterConfig(properties); - }; - - /** - * Encodes the specified JupyterConfig message. Does not implicitly {@link google.cloud.dataproc.v1.JupyterConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.JupyterConfig - * @static - * @param {google.cloud.dataproc.v1.IJupyterConfig} message JupyterConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JupyterConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kernel != null && Object.hasOwnProperty.call(message, "kernel")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.kernel); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - return writer; - }; - - /** - * Encodes the specified JupyterConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.JupyterConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.JupyterConfig - * @static - * @param {google.cloud.dataproc.v1.IJupyterConfig} message JupyterConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JupyterConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a JupyterConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.JupyterConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.JupyterConfig} JupyterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JupyterConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.JupyterConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.kernel = reader.int32(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a JupyterConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.JupyterConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.JupyterConfig} JupyterConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JupyterConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a JupyterConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.JupyterConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - JupyterConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kernel != null && message.hasOwnProperty("kernel")) - switch (message.kernel) { - default: - return "kernel: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - return null; - }; - - /** - * Creates a JupyterConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.JupyterConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.JupyterConfig} JupyterConfig - */ - JupyterConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.JupyterConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.JupyterConfig(); - switch (object.kernel) { - default: - if (typeof object.kernel === "number") { - message.kernel = object.kernel; - break; - } - break; - case "KERNEL_UNSPECIFIED": - case 0: - message.kernel = 0; - break; - case "PYTHON": - case 1: - message.kernel = 1; - break; - case "SCALA": - case 2: - message.kernel = 2; - break; - } - if (object.displayName != null) - message.displayName = String(object.displayName); - return message; - }; - - /** - * Creates a plain object from a JupyterConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.JupyterConfig - * @static - * @param {google.cloud.dataproc.v1.JupyterConfig} message JupyterConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - JupyterConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.kernel = options.enums === String ? "KERNEL_UNSPECIFIED" : 0; - object.displayName = ""; - } - if (message.kernel != null && message.hasOwnProperty("kernel")) - object.kernel = options.enums === String ? $root.google.cloud.dataproc.v1.JupyterConfig.Kernel[message.kernel] === undefined ? message.kernel : $root.google.cloud.dataproc.v1.JupyterConfig.Kernel[message.kernel] : message.kernel; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - return object; - }; - - /** - * Converts this JupyterConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.JupyterConfig - * @instance - * @returns {Object.} JSON object - */ - JupyterConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for JupyterConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.JupyterConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - JupyterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.JupyterConfig"; - }; - - /** - * Kernel enum. - * @name google.cloud.dataproc.v1.JupyterConfig.Kernel - * @enum {number} - * @property {number} KERNEL_UNSPECIFIED=0 KERNEL_UNSPECIFIED value - * @property {number} PYTHON=1 PYTHON value - * @property {number} SCALA=2 SCALA value - */ - JupyterConfig.Kernel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "KERNEL_UNSPECIFIED"] = 0; - values[valuesById[1] = "PYTHON"] = 1; - values[valuesById[2] = "SCALA"] = 2; - return values; - })(); - - return JupyterConfig; - })(); - - v1.SparkConnectConfig = (function() { - - /** - * Properties of a SparkConnectConfig. - * @memberof google.cloud.dataproc.v1 - * @interface ISparkConnectConfig - */ - - /** - * Constructs a new SparkConnectConfig. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a SparkConnectConfig. - * @implements ISparkConnectConfig - * @constructor - * @param {google.cloud.dataproc.v1.ISparkConnectConfig=} [properties] Properties to set - */ - function SparkConnectConfig(properties) { - if (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 SparkConnectConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.SparkConnectConfig - * @static - * @param {google.cloud.dataproc.v1.ISparkConnectConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.SparkConnectConfig} SparkConnectConfig instance - */ - SparkConnectConfig.create = function create(properties) { - return new SparkConnectConfig(properties); - }; - - /** - * Encodes the specified SparkConnectConfig message. Does not implicitly {@link google.cloud.dataproc.v1.SparkConnectConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.SparkConnectConfig - * @static - * @param {google.cloud.dataproc.v1.ISparkConnectConfig} message SparkConnectConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SparkConnectConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified SparkConnectConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.SparkConnectConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.SparkConnectConfig - * @static - * @param {google.cloud.dataproc.v1.ISparkConnectConfig} message SparkConnectConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SparkConnectConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SparkConnectConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.SparkConnectConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.SparkConnectConfig} SparkConnectConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SparkConnectConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.SparkConnectConfig(); - 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 SparkConnectConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.SparkConnectConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.SparkConnectConfig} SparkConnectConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SparkConnectConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SparkConnectConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.SparkConnectConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SparkConnectConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a SparkConnectConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.SparkConnectConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.SparkConnectConfig} SparkConnectConfig - */ - SparkConnectConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.SparkConnectConfig) - return object; - return new $root.google.cloud.dataproc.v1.SparkConnectConfig(); - }; - - /** - * Creates a plain object from a SparkConnectConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.SparkConnectConfig - * @static - * @param {google.cloud.dataproc.v1.SparkConnectConfig} message SparkConnectConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SparkConnectConfig.toObject = function toObject() { - return {}; - }; - - /** - * Converts this SparkConnectConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.SparkConnectConfig - * @instance - * @returns {Object.} JSON object - */ - SparkConnectConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SparkConnectConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.SparkConnectConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SparkConnectConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.SparkConnectConfig"; - }; - - return SparkConnectConfig; - })(); - - v1.WorkflowTemplateService = (function() { - - /** - * Constructs a new WorkflowTemplateService service. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a WorkflowTemplateService - * @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 WorkflowTemplateService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (WorkflowTemplateService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = WorkflowTemplateService; - - /** - * Creates new WorkflowTemplateService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.dataproc.v1.WorkflowTemplateService - * @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 {WorkflowTemplateService} RPC service. Useful where requests and/or responses are streamed. - */ - WorkflowTemplateService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.dataproc.v1.WorkflowTemplateService|createWorkflowTemplate}. - * @memberof google.cloud.dataproc.v1.WorkflowTemplateService - * @typedef CreateWorkflowTemplateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dataproc.v1.WorkflowTemplate} [response] WorkflowTemplate - */ - - /** - * Calls CreateWorkflowTemplate. - * @function createWorkflowTemplate - * @memberof google.cloud.dataproc.v1.WorkflowTemplateService - * @instance - * @param {google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest} request CreateWorkflowTemplateRequest message or plain object - * @param {google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplateCallback} callback Node-style callback called with the error, if any, and WorkflowTemplate - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(WorkflowTemplateService.prototype.createWorkflowTemplate = function createWorkflowTemplate(request, callback) { - return this.rpcCall(createWorkflowTemplate, $root.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest, $root.google.cloud.dataproc.v1.WorkflowTemplate, request, callback); - }, "name", { value: "CreateWorkflowTemplate" }); - - /** - * Calls CreateWorkflowTemplate. - * @function createWorkflowTemplate - * @memberof google.cloud.dataproc.v1.WorkflowTemplateService - * @instance - * @param {google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest} request CreateWorkflowTemplateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.WorkflowTemplateService|getWorkflowTemplate}. - * @memberof google.cloud.dataproc.v1.WorkflowTemplateService - * @typedef GetWorkflowTemplateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dataproc.v1.WorkflowTemplate} [response] WorkflowTemplate - */ - - /** - * Calls GetWorkflowTemplate. - * @function getWorkflowTemplate - * @memberof google.cloud.dataproc.v1.WorkflowTemplateService - * @instance - * @param {google.cloud.dataproc.v1.IGetWorkflowTemplateRequest} request GetWorkflowTemplateRequest message or plain object - * @param {google.cloud.dataproc.v1.WorkflowTemplateService.GetWorkflowTemplateCallback} callback Node-style callback called with the error, if any, and WorkflowTemplate - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(WorkflowTemplateService.prototype.getWorkflowTemplate = function getWorkflowTemplate(request, callback) { - return this.rpcCall(getWorkflowTemplate, $root.google.cloud.dataproc.v1.GetWorkflowTemplateRequest, $root.google.cloud.dataproc.v1.WorkflowTemplate, request, callback); - }, "name", { value: "GetWorkflowTemplate" }); - - /** - * Calls GetWorkflowTemplate. - * @function getWorkflowTemplate - * @memberof google.cloud.dataproc.v1.WorkflowTemplateService - * @instance - * @param {google.cloud.dataproc.v1.IGetWorkflowTemplateRequest} request GetWorkflowTemplateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.WorkflowTemplateService|instantiateWorkflowTemplate}. - * @memberof google.cloud.dataproc.v1.WorkflowTemplateService - * @typedef InstantiateWorkflowTemplateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls InstantiateWorkflowTemplate. - * @function instantiateWorkflowTemplate - * @memberof google.cloud.dataproc.v1.WorkflowTemplateService - * @instance - * @param {google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest} request InstantiateWorkflowTemplateRequest message or plain object - * @param {google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplateCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(WorkflowTemplateService.prototype.instantiateWorkflowTemplate = function instantiateWorkflowTemplate(request, callback) { - return this.rpcCall(instantiateWorkflowTemplate, $root.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "InstantiateWorkflowTemplate" }); - - /** - * Calls InstantiateWorkflowTemplate. - * @function instantiateWorkflowTemplate - * @memberof google.cloud.dataproc.v1.WorkflowTemplateService - * @instance - * @param {google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest} request InstantiateWorkflowTemplateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.WorkflowTemplateService|instantiateInlineWorkflowTemplate}. - * @memberof google.cloud.dataproc.v1.WorkflowTemplateService - * @typedef InstantiateInlineWorkflowTemplateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls InstantiateInlineWorkflowTemplate. - * @function instantiateInlineWorkflowTemplate - * @memberof google.cloud.dataproc.v1.WorkflowTemplateService - * @instance - * @param {google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest} request InstantiateInlineWorkflowTemplateRequest message or plain object - * @param {google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateInlineWorkflowTemplateCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(WorkflowTemplateService.prototype.instantiateInlineWorkflowTemplate = function instantiateInlineWorkflowTemplate(request, callback) { - return this.rpcCall(instantiateInlineWorkflowTemplate, $root.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "InstantiateInlineWorkflowTemplate" }); - - /** - * Calls InstantiateInlineWorkflowTemplate. - * @function instantiateInlineWorkflowTemplate - * @memberof google.cloud.dataproc.v1.WorkflowTemplateService - * @instance - * @param {google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest} request InstantiateInlineWorkflowTemplateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.WorkflowTemplateService|updateWorkflowTemplate}. - * @memberof google.cloud.dataproc.v1.WorkflowTemplateService - * @typedef UpdateWorkflowTemplateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dataproc.v1.WorkflowTemplate} [response] WorkflowTemplate - */ - - /** - * Calls UpdateWorkflowTemplate. - * @function updateWorkflowTemplate - * @memberof google.cloud.dataproc.v1.WorkflowTemplateService - * @instance - * @param {google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest} request UpdateWorkflowTemplateRequest message or plain object - * @param {google.cloud.dataproc.v1.WorkflowTemplateService.UpdateWorkflowTemplateCallback} callback Node-style callback called with the error, if any, and WorkflowTemplate - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(WorkflowTemplateService.prototype.updateWorkflowTemplate = function updateWorkflowTemplate(request, callback) { - return this.rpcCall(updateWorkflowTemplate, $root.google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest, $root.google.cloud.dataproc.v1.WorkflowTemplate, request, callback); - }, "name", { value: "UpdateWorkflowTemplate" }); - - /** - * Calls UpdateWorkflowTemplate. - * @function updateWorkflowTemplate - * @memberof google.cloud.dataproc.v1.WorkflowTemplateService - * @instance - * @param {google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest} request UpdateWorkflowTemplateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.WorkflowTemplateService|listWorkflowTemplates}. - * @memberof google.cloud.dataproc.v1.WorkflowTemplateService - * @typedef ListWorkflowTemplatesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dataproc.v1.ListWorkflowTemplatesResponse} [response] ListWorkflowTemplatesResponse - */ - - /** - * Calls ListWorkflowTemplates. - * @function listWorkflowTemplates - * @memberof google.cloud.dataproc.v1.WorkflowTemplateService - * @instance - * @param {google.cloud.dataproc.v1.IListWorkflowTemplatesRequest} request ListWorkflowTemplatesRequest message or plain object - * @param {google.cloud.dataproc.v1.WorkflowTemplateService.ListWorkflowTemplatesCallback} callback Node-style callback called with the error, if any, and ListWorkflowTemplatesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(WorkflowTemplateService.prototype.listWorkflowTemplates = function listWorkflowTemplates(request, callback) { - return this.rpcCall(listWorkflowTemplates, $root.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest, $root.google.cloud.dataproc.v1.ListWorkflowTemplatesResponse, request, callback); - }, "name", { value: "ListWorkflowTemplates" }); - - /** - * Calls ListWorkflowTemplates. - * @function listWorkflowTemplates - * @memberof google.cloud.dataproc.v1.WorkflowTemplateService - * @instance - * @param {google.cloud.dataproc.v1.IListWorkflowTemplatesRequest} request ListWorkflowTemplatesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dataproc.v1.WorkflowTemplateService|deleteWorkflowTemplate}. - * @memberof google.cloud.dataproc.v1.WorkflowTemplateService - * @typedef DeleteWorkflowTemplateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteWorkflowTemplate. - * @function deleteWorkflowTemplate - * @memberof google.cloud.dataproc.v1.WorkflowTemplateService - * @instance - * @param {google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest} request DeleteWorkflowTemplateRequest message or plain object - * @param {google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplateCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(WorkflowTemplateService.prototype.deleteWorkflowTemplate = function deleteWorkflowTemplate(request, callback) { - return this.rpcCall(deleteWorkflowTemplate, $root.google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteWorkflowTemplate" }); - - /** - * Calls DeleteWorkflowTemplate. - * @function deleteWorkflowTemplate - * @memberof google.cloud.dataproc.v1.WorkflowTemplateService - * @instance - * @param {google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest} request DeleteWorkflowTemplateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return WorkflowTemplateService; - })(); - - v1.WorkflowTemplate = (function() { - - /** - * Properties of a WorkflowTemplate. - * @memberof google.cloud.dataproc.v1 - * @interface IWorkflowTemplate - * @property {string|null} [id] WorkflowTemplate id - * @property {string|null} [name] WorkflowTemplate name - * @property {number|null} [version] WorkflowTemplate version - * @property {google.protobuf.ITimestamp|null} [createTime] WorkflowTemplate createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] WorkflowTemplate updateTime - * @property {Object.|null} [labels] WorkflowTemplate labels - * @property {google.cloud.dataproc.v1.IWorkflowTemplatePlacement|null} [placement] WorkflowTemplate placement - * @property {Array.|null} [jobs] WorkflowTemplate jobs - * @property {Array.|null} [parameters] WorkflowTemplate parameters - * @property {google.protobuf.IDuration|null} [dagTimeout] WorkflowTemplate dagTimeout - * @property {google.cloud.dataproc.v1.WorkflowTemplate.IEncryptionConfig|null} [encryptionConfig] WorkflowTemplate encryptionConfig - */ - - /** - * Constructs a new WorkflowTemplate. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a WorkflowTemplate. - * @implements IWorkflowTemplate - * @constructor - * @param {google.cloud.dataproc.v1.IWorkflowTemplate=} [properties] Properties to set - */ - function WorkflowTemplate(properties) { - this.labels = {}; - this.jobs = []; - this.parameters = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WorkflowTemplate id. - * @member {string} id - * @memberof google.cloud.dataproc.v1.WorkflowTemplate - * @instance - */ - WorkflowTemplate.prototype.id = ""; - - /** - * WorkflowTemplate name. - * @member {string} name - * @memberof google.cloud.dataproc.v1.WorkflowTemplate - * @instance - */ - WorkflowTemplate.prototype.name = ""; - - /** - * WorkflowTemplate version. - * @member {number} version - * @memberof google.cloud.dataproc.v1.WorkflowTemplate - * @instance - */ - WorkflowTemplate.prototype.version = 0; - - /** - * WorkflowTemplate createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.dataproc.v1.WorkflowTemplate - * @instance - */ - WorkflowTemplate.prototype.createTime = null; - - /** - * WorkflowTemplate updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.dataproc.v1.WorkflowTemplate - * @instance - */ - WorkflowTemplate.prototype.updateTime = null; - - /** - * WorkflowTemplate labels. - * @member {Object.} labels - * @memberof google.cloud.dataproc.v1.WorkflowTemplate - * @instance - */ - WorkflowTemplate.prototype.labels = $util.emptyObject; - - /** - * WorkflowTemplate placement. - * @member {google.cloud.dataproc.v1.IWorkflowTemplatePlacement|null|undefined} placement - * @memberof google.cloud.dataproc.v1.WorkflowTemplate - * @instance - */ - WorkflowTemplate.prototype.placement = null; - - /** - * WorkflowTemplate jobs. - * @member {Array.} jobs - * @memberof google.cloud.dataproc.v1.WorkflowTemplate - * @instance - */ - WorkflowTemplate.prototype.jobs = $util.emptyArray; - - /** - * WorkflowTemplate parameters. - * @member {Array.} parameters - * @memberof google.cloud.dataproc.v1.WorkflowTemplate - * @instance - */ - WorkflowTemplate.prototype.parameters = $util.emptyArray; - - /** - * WorkflowTemplate dagTimeout. - * @member {google.protobuf.IDuration|null|undefined} dagTimeout - * @memberof google.cloud.dataproc.v1.WorkflowTemplate - * @instance - */ - WorkflowTemplate.prototype.dagTimeout = null; - - /** - * WorkflowTemplate encryptionConfig. - * @member {google.cloud.dataproc.v1.WorkflowTemplate.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.cloud.dataproc.v1.WorkflowTemplate - * @instance - */ - WorkflowTemplate.prototype.encryptionConfig = null; - - /** - * Creates a new WorkflowTemplate instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.WorkflowTemplate - * @static - * @param {google.cloud.dataproc.v1.IWorkflowTemplate=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.WorkflowTemplate} WorkflowTemplate instance - */ - WorkflowTemplate.create = function create(properties) { - return new WorkflowTemplate(properties); - }; - - /** - * Encodes the specified WorkflowTemplate message. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowTemplate.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.WorkflowTemplate - * @static - * @param {google.cloud.dataproc.v1.IWorkflowTemplate} message WorkflowTemplate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WorkflowTemplate.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.version); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.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.placement != null && Object.hasOwnProperty.call(message, "placement")) - $root.google.cloud.dataproc.v1.WorkflowTemplatePlacement.encode(message.placement, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.jobs != null && message.jobs.length) - for (var i = 0; i < message.jobs.length; ++i) - $root.google.cloud.dataproc.v1.OrderedJob.encode(message.jobs[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.parameters != null && message.parameters.length) - for (var i = 0; i < message.parameters.length; ++i) - $root.google.cloud.dataproc.v1.TemplateParameter.encode(message.parameters[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.dagTimeout != null && Object.hasOwnProperty.call(message, "dagTimeout")) - $root.google.protobuf.Duration.encode(message.dagTimeout, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified WorkflowTemplate message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowTemplate.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.WorkflowTemplate - * @static - * @param {google.cloud.dataproc.v1.IWorkflowTemplate} message WorkflowTemplate message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WorkflowTemplate.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WorkflowTemplate message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.WorkflowTemplate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.WorkflowTemplate} WorkflowTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WorkflowTemplate.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.WorkflowTemplate(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.id = reader.string(); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.version = reader.int32(); - break; - } - case 4: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 7: { - message.placement = $root.google.cloud.dataproc.v1.WorkflowTemplatePlacement.decode(reader, reader.uint32()); - break; - } - case 8: { - if (!(message.jobs && message.jobs.length)) - message.jobs = []; - message.jobs.push($root.google.cloud.dataproc.v1.OrderedJob.decode(reader, reader.uint32())); - break; - } - case 9: { - if (!(message.parameters && message.parameters.length)) - message.parameters = []; - message.parameters.push($root.google.cloud.dataproc.v1.TemplateParameter.decode(reader, reader.uint32())); - break; - } - case 10: { - message.dagTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 11: { - message.encryptionConfig = $root.google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WorkflowTemplate message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.WorkflowTemplate - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.WorkflowTemplate} WorkflowTemplate - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WorkflowTemplate.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WorkflowTemplate message. - * @function verify - * @memberof google.cloud.dataproc.v1.WorkflowTemplate - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WorkflowTemplate.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isInteger(message.version)) - return "version: integer 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.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.placement != null && message.hasOwnProperty("placement")) { - var error = $root.google.cloud.dataproc.v1.WorkflowTemplatePlacement.verify(message.placement); - if (error) - return "placement." + error; - } - 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.dataproc.v1.OrderedJob.verify(message.jobs[i]); - if (error) - return "jobs." + error; - } - } - if (message.parameters != null && message.hasOwnProperty("parameters")) { - if (!Array.isArray(message.parameters)) - return "parameters: array expected"; - for (var i = 0; i < message.parameters.length; ++i) { - var error = $root.google.cloud.dataproc.v1.TemplateParameter.verify(message.parameters[i]); - if (error) - return "parameters." + error; - } - } - if (message.dagTimeout != null && message.hasOwnProperty("dagTimeout")) { - var error = $root.google.protobuf.Duration.verify(message.dagTimeout); - if (error) - return "dagTimeout." + error; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - var error = $root.google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - return null; - }; - - /** - * Creates a WorkflowTemplate message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.WorkflowTemplate - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.WorkflowTemplate} WorkflowTemplate - */ - WorkflowTemplate.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.WorkflowTemplate) - return object; - var message = new $root.google.cloud.dataproc.v1.WorkflowTemplate(); - if (object.id != null) - message.id = String(object.id); - if (object.name != null) - message.name = String(object.name); - if (object.version != null) - message.version = object.version | 0; - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.dataproc.v1.WorkflowTemplate.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.dataproc.v1.WorkflowTemplate.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.dataproc.v1.WorkflowTemplate.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.placement != null) { - if (typeof object.placement !== "object") - throw TypeError(".google.cloud.dataproc.v1.WorkflowTemplate.placement: object expected"); - message.placement = $root.google.cloud.dataproc.v1.WorkflowTemplatePlacement.fromObject(object.placement); - } - if (object.jobs) { - if (!Array.isArray(object.jobs)) - throw TypeError(".google.cloud.dataproc.v1.WorkflowTemplate.jobs: array expected"); - message.jobs = []; - for (var i = 0; i < object.jobs.length; ++i) { - if (typeof object.jobs[i] !== "object") - throw TypeError(".google.cloud.dataproc.v1.WorkflowTemplate.jobs: object expected"); - message.jobs[i] = $root.google.cloud.dataproc.v1.OrderedJob.fromObject(object.jobs[i]); - } - } - if (object.parameters) { - if (!Array.isArray(object.parameters)) - throw TypeError(".google.cloud.dataproc.v1.WorkflowTemplate.parameters: array expected"); - message.parameters = []; - for (var i = 0; i < object.parameters.length; ++i) { - if (typeof object.parameters[i] !== "object") - throw TypeError(".google.cloud.dataproc.v1.WorkflowTemplate.parameters: object expected"); - message.parameters[i] = $root.google.cloud.dataproc.v1.TemplateParameter.fromObject(object.parameters[i]); - } - } - if (object.dagTimeout != null) { - if (typeof object.dagTimeout !== "object") - throw TypeError(".google.cloud.dataproc.v1.WorkflowTemplate.dagTimeout: object expected"); - message.dagTimeout = $root.google.protobuf.Duration.fromObject(object.dagTimeout); - } - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.cloud.dataproc.v1.WorkflowTemplate.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig.fromObject(object.encryptionConfig); - } - return message; - }; - - /** - * Creates a plain object from a WorkflowTemplate message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.WorkflowTemplate - * @static - * @param {google.cloud.dataproc.v1.WorkflowTemplate} message WorkflowTemplate - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WorkflowTemplate.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.jobs = []; - object.parameters = []; - } - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.id = ""; - object.version = 0; - object.createTime = null; - object.updateTime = null; - object.placement = null; - object.dagTimeout = null; - object.encryptionConfig = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - 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); - 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.placement != null && message.hasOwnProperty("placement")) - object.placement = $root.google.cloud.dataproc.v1.WorkflowTemplatePlacement.toObject(message.placement, options); - if (message.jobs && message.jobs.length) { - object.jobs = []; - for (var j = 0; j < message.jobs.length; ++j) - object.jobs[j] = $root.google.cloud.dataproc.v1.OrderedJob.toObject(message.jobs[j], options); - } - if (message.parameters && message.parameters.length) { - object.parameters = []; - for (var j = 0; j < message.parameters.length; ++j) - object.parameters[j] = $root.google.cloud.dataproc.v1.TemplateParameter.toObject(message.parameters[j], options); - } - if (message.dagTimeout != null && message.hasOwnProperty("dagTimeout")) - object.dagTimeout = $root.google.protobuf.Duration.toObject(message.dagTimeout, options); - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) - object.encryptionConfig = $root.google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig.toObject(message.encryptionConfig, options); - return object; - }; - - /** - * Converts this WorkflowTemplate to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.WorkflowTemplate - * @instance - * @returns {Object.} JSON object - */ - WorkflowTemplate.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WorkflowTemplate - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.WorkflowTemplate - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WorkflowTemplate.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.WorkflowTemplate"; - }; - - WorkflowTemplate.EncryptionConfig = (function() { - - /** - * Properties of an EncryptionConfig. - * @memberof google.cloud.dataproc.v1.WorkflowTemplate - * @interface IEncryptionConfig - * @property {string|null} [kmsKey] EncryptionConfig kmsKey - */ - - /** - * Constructs a new EncryptionConfig. - * @memberof google.cloud.dataproc.v1.WorkflowTemplate - * @classdesc Represents an EncryptionConfig. - * @implements IEncryptionConfig - * @constructor - * @param {google.cloud.dataproc.v1.WorkflowTemplate.IEncryptionConfig=} [properties] Properties to set - */ - function EncryptionConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EncryptionConfig kmsKey. - * @member {string} kmsKey - * @memberof google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig - * @instance - */ - EncryptionConfig.prototype.kmsKey = ""; - - /** - * Creates a new EncryptionConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig - * @static - * @param {google.cloud.dataproc.v1.WorkflowTemplate.IEncryptionConfig=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig} EncryptionConfig instance - */ - EncryptionConfig.create = function create(properties) { - return new EncryptionConfig(properties); - }; - - /** - * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig - * @static - * @param {google.cloud.dataproc.v1.WorkflowTemplate.IEncryptionConfig} message EncryptionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EncryptionConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kmsKey != null && Object.hasOwnProperty.call(message, "kmsKey")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kmsKey); - return writer; - }; - - /** - * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig - * @static - * @param {google.cloud.dataproc.v1.WorkflowTemplate.IEncryptionConfig} message EncryptionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EncryptionConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EncryptionConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig} EncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EncryptionConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.kmsKey = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EncryptionConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig} EncryptionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EncryptionConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EncryptionConfig message. - * @function verify - * @memberof google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EncryptionConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) - if (!$util.isString(message.kmsKey)) - return "kmsKey: string expected"; - return null; - }; - - /** - * Creates an EncryptionConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig} EncryptionConfig - */ - EncryptionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig) - return object; - var message = new $root.google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig(); - if (object.kmsKey != null) - message.kmsKey = String(object.kmsKey); - return message; - }; - - /** - * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig - * @static - * @param {google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig} message EncryptionConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EncryptionConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.kmsKey = ""; - if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) - object.kmsKey = message.kmsKey; - return object; - }; - - /** - * Converts this EncryptionConfig to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig - * @instance - * @returns {Object.} JSON object - */ - EncryptionConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EncryptionConfig - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EncryptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.WorkflowTemplate.EncryptionConfig"; - }; - - return EncryptionConfig; - })(); - - return WorkflowTemplate; - })(); - - v1.WorkflowTemplatePlacement = (function() { - - /** - * Properties of a WorkflowTemplatePlacement. - * @memberof google.cloud.dataproc.v1 - * @interface IWorkflowTemplatePlacement - * @property {google.cloud.dataproc.v1.IManagedCluster|null} [managedCluster] WorkflowTemplatePlacement managedCluster - * @property {google.cloud.dataproc.v1.IClusterSelector|null} [clusterSelector] WorkflowTemplatePlacement clusterSelector - */ - - /** - * Constructs a new WorkflowTemplatePlacement. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a WorkflowTemplatePlacement. - * @implements IWorkflowTemplatePlacement - * @constructor - * @param {google.cloud.dataproc.v1.IWorkflowTemplatePlacement=} [properties] Properties to set - */ - function WorkflowTemplatePlacement(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WorkflowTemplatePlacement managedCluster. - * @member {google.cloud.dataproc.v1.IManagedCluster|null|undefined} managedCluster - * @memberof google.cloud.dataproc.v1.WorkflowTemplatePlacement - * @instance - */ - WorkflowTemplatePlacement.prototype.managedCluster = null; - - /** - * WorkflowTemplatePlacement clusterSelector. - * @member {google.cloud.dataproc.v1.IClusterSelector|null|undefined} clusterSelector - * @memberof google.cloud.dataproc.v1.WorkflowTemplatePlacement - * @instance - */ - WorkflowTemplatePlacement.prototype.clusterSelector = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * WorkflowTemplatePlacement placement. - * @member {"managedCluster"|"clusterSelector"|undefined} placement - * @memberof google.cloud.dataproc.v1.WorkflowTemplatePlacement - * @instance - */ - Object.defineProperty(WorkflowTemplatePlacement.prototype, "placement", { - get: $util.oneOfGetter($oneOfFields = ["managedCluster", "clusterSelector"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new WorkflowTemplatePlacement instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.WorkflowTemplatePlacement - * @static - * @param {google.cloud.dataproc.v1.IWorkflowTemplatePlacement=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.WorkflowTemplatePlacement} WorkflowTemplatePlacement instance - */ - WorkflowTemplatePlacement.create = function create(properties) { - return new WorkflowTemplatePlacement(properties); - }; - - /** - * Encodes the specified WorkflowTemplatePlacement message. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowTemplatePlacement.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.WorkflowTemplatePlacement - * @static - * @param {google.cloud.dataproc.v1.IWorkflowTemplatePlacement} message WorkflowTemplatePlacement message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WorkflowTemplatePlacement.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.managedCluster != null && Object.hasOwnProperty.call(message, "managedCluster")) - $root.google.cloud.dataproc.v1.ManagedCluster.encode(message.managedCluster, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.clusterSelector != null && Object.hasOwnProperty.call(message, "clusterSelector")) - $root.google.cloud.dataproc.v1.ClusterSelector.encode(message.clusterSelector, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified WorkflowTemplatePlacement message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowTemplatePlacement.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.WorkflowTemplatePlacement - * @static - * @param {google.cloud.dataproc.v1.IWorkflowTemplatePlacement} message WorkflowTemplatePlacement message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WorkflowTemplatePlacement.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WorkflowTemplatePlacement message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.WorkflowTemplatePlacement - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.WorkflowTemplatePlacement} WorkflowTemplatePlacement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WorkflowTemplatePlacement.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.WorkflowTemplatePlacement(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.managedCluster = $root.google.cloud.dataproc.v1.ManagedCluster.decode(reader, reader.uint32()); - break; - } - case 2: { - message.clusterSelector = $root.google.cloud.dataproc.v1.ClusterSelector.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WorkflowTemplatePlacement message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.WorkflowTemplatePlacement - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.WorkflowTemplatePlacement} WorkflowTemplatePlacement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WorkflowTemplatePlacement.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WorkflowTemplatePlacement message. - * @function verify - * @memberof google.cloud.dataproc.v1.WorkflowTemplatePlacement - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WorkflowTemplatePlacement.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.managedCluster != null && message.hasOwnProperty("managedCluster")) { - properties.placement = 1; - { - var error = $root.google.cloud.dataproc.v1.ManagedCluster.verify(message.managedCluster); - if (error) - return "managedCluster." + error; - } - } - if (message.clusterSelector != null && message.hasOwnProperty("clusterSelector")) { - if (properties.placement === 1) - return "placement: multiple values"; - properties.placement = 1; - { - var error = $root.google.cloud.dataproc.v1.ClusterSelector.verify(message.clusterSelector); - if (error) - return "clusterSelector." + error; - } - } - return null; - }; - - /** - * Creates a WorkflowTemplatePlacement message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.WorkflowTemplatePlacement - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.WorkflowTemplatePlacement} WorkflowTemplatePlacement - */ - WorkflowTemplatePlacement.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.WorkflowTemplatePlacement) - return object; - var message = new $root.google.cloud.dataproc.v1.WorkflowTemplatePlacement(); - if (object.managedCluster != null) { - if (typeof object.managedCluster !== "object") - throw TypeError(".google.cloud.dataproc.v1.WorkflowTemplatePlacement.managedCluster: object expected"); - message.managedCluster = $root.google.cloud.dataproc.v1.ManagedCluster.fromObject(object.managedCluster); - } - if (object.clusterSelector != null) { - if (typeof object.clusterSelector !== "object") - throw TypeError(".google.cloud.dataproc.v1.WorkflowTemplatePlacement.clusterSelector: object expected"); - message.clusterSelector = $root.google.cloud.dataproc.v1.ClusterSelector.fromObject(object.clusterSelector); - } - return message; - }; - - /** - * Creates a plain object from a WorkflowTemplatePlacement message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.WorkflowTemplatePlacement - * @static - * @param {google.cloud.dataproc.v1.WorkflowTemplatePlacement} message WorkflowTemplatePlacement - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WorkflowTemplatePlacement.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.managedCluster != null && message.hasOwnProperty("managedCluster")) { - object.managedCluster = $root.google.cloud.dataproc.v1.ManagedCluster.toObject(message.managedCluster, options); - if (options.oneofs) - object.placement = "managedCluster"; - } - if (message.clusterSelector != null && message.hasOwnProperty("clusterSelector")) { - object.clusterSelector = $root.google.cloud.dataproc.v1.ClusterSelector.toObject(message.clusterSelector, options); - if (options.oneofs) - object.placement = "clusterSelector"; - } - return object; - }; - - /** - * Converts this WorkflowTemplatePlacement to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.WorkflowTemplatePlacement - * @instance - * @returns {Object.} JSON object - */ - WorkflowTemplatePlacement.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WorkflowTemplatePlacement - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.WorkflowTemplatePlacement - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WorkflowTemplatePlacement.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.WorkflowTemplatePlacement"; - }; - - return WorkflowTemplatePlacement; - })(); - - v1.ManagedCluster = (function() { - - /** - * Properties of a ManagedCluster. - * @memberof google.cloud.dataproc.v1 - * @interface IManagedCluster - * @property {string|null} [clusterName] ManagedCluster clusterName - * @property {google.cloud.dataproc.v1.IClusterConfig|null} [config] ManagedCluster config - * @property {Object.|null} [labels] ManagedCluster labels - */ - - /** - * Constructs a new ManagedCluster. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a ManagedCluster. - * @implements IManagedCluster - * @constructor - * @param {google.cloud.dataproc.v1.IManagedCluster=} [properties] Properties to set - */ - function ManagedCluster(properties) { - this.labels = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ManagedCluster clusterName. - * @member {string} clusterName - * @memberof google.cloud.dataproc.v1.ManagedCluster - * @instance - */ - ManagedCluster.prototype.clusterName = ""; - - /** - * ManagedCluster config. - * @member {google.cloud.dataproc.v1.IClusterConfig|null|undefined} config - * @memberof google.cloud.dataproc.v1.ManagedCluster - * @instance - */ - ManagedCluster.prototype.config = null; - - /** - * ManagedCluster labels. - * @member {Object.} labels - * @memberof google.cloud.dataproc.v1.ManagedCluster - * @instance - */ - ManagedCluster.prototype.labels = $util.emptyObject; - - /** - * Creates a new ManagedCluster instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.ManagedCluster - * @static - * @param {google.cloud.dataproc.v1.IManagedCluster=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.ManagedCluster} ManagedCluster instance - */ - ManagedCluster.create = function create(properties) { - return new ManagedCluster(properties); - }; - - /** - * Encodes the specified ManagedCluster message. Does not implicitly {@link google.cloud.dataproc.v1.ManagedCluster.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.ManagedCluster - * @static - * @param {google.cloud.dataproc.v1.IManagedCluster} message ManagedCluster message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ManagedCluster.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterName); - if (message.config != null && Object.hasOwnProperty.call(message, "config")) - $root.google.cloud.dataproc.v1.ClusterConfig.encode(message.config, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - return writer; - }; - - /** - * Encodes the specified ManagedCluster message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ManagedCluster.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.ManagedCluster - * @static - * @param {google.cloud.dataproc.v1.IManagedCluster} message ManagedCluster message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ManagedCluster.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ManagedCluster message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.ManagedCluster - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.ManagedCluster} ManagedCluster - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ManagedCluster.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ManagedCluster(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.clusterName = reader.string(); - break; - } - case 3: { - message.config = $root.google.cloud.dataproc.v1.ClusterConfig.decode(reader, reader.uint32()); - break; - } - case 4: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ManagedCluster message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.ManagedCluster - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.ManagedCluster} ManagedCluster - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ManagedCluster.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ManagedCluster message. - * @function verify - * @memberof google.cloud.dataproc.v1.ManagedCluster - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ManagedCluster.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - if (!$util.isString(message.clusterName)) - return "clusterName: string expected"; - if (message.config != null && message.hasOwnProperty("config")) { - var error = $root.google.cloud.dataproc.v1.ClusterConfig.verify(message.config); - if (error) - return "config." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - return null; - }; - - /** - * Creates a ManagedCluster message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.ManagedCluster - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.ManagedCluster} ManagedCluster - */ - ManagedCluster.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.ManagedCluster) - return object; - var message = new $root.google.cloud.dataproc.v1.ManagedCluster(); - if (object.clusterName != null) - message.clusterName = String(object.clusterName); - if (object.config != null) { - if (typeof object.config !== "object") - throw TypeError(".google.cloud.dataproc.v1.ManagedCluster.config: object expected"); - message.config = $root.google.cloud.dataproc.v1.ClusterConfig.fromObject(object.config); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.dataproc.v1.ManagedCluster.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - return message; - }; - - /** - * Creates a plain object from a ManagedCluster message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.ManagedCluster - * @static - * @param {google.cloud.dataproc.v1.ManagedCluster} message ManagedCluster - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ManagedCluster.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.clusterName = ""; - object.config = null; - } - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - object.clusterName = message.clusterName; - if (message.config != null && message.hasOwnProperty("config")) - object.config = $root.google.cloud.dataproc.v1.ClusterConfig.toObject(message.config, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - return object; - }; - - /** - * Converts this ManagedCluster to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.ManagedCluster - * @instance - * @returns {Object.} JSON object - */ - ManagedCluster.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ManagedCluster - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.ManagedCluster - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ManagedCluster.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.ManagedCluster"; - }; - - return ManagedCluster; - })(); - - v1.ClusterSelector = (function() { - - /** - * Properties of a ClusterSelector. - * @memberof google.cloud.dataproc.v1 - * @interface IClusterSelector - * @property {string|null} [zone] ClusterSelector zone - * @property {Object.|null} [clusterLabels] ClusterSelector clusterLabels - */ - - /** - * Constructs a new ClusterSelector. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a ClusterSelector. - * @implements IClusterSelector - * @constructor - * @param {google.cloud.dataproc.v1.IClusterSelector=} [properties] Properties to set - */ - function ClusterSelector(properties) { - this.clusterLabels = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClusterSelector zone. - * @member {string} zone - * @memberof google.cloud.dataproc.v1.ClusterSelector - * @instance - */ - ClusterSelector.prototype.zone = ""; - - /** - * ClusterSelector clusterLabels. - * @member {Object.} clusterLabels - * @memberof google.cloud.dataproc.v1.ClusterSelector - * @instance - */ - ClusterSelector.prototype.clusterLabels = $util.emptyObject; - - /** - * Creates a new ClusterSelector instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.ClusterSelector - * @static - * @param {google.cloud.dataproc.v1.IClusterSelector=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.ClusterSelector} ClusterSelector instance - */ - ClusterSelector.create = function create(properties) { - return new ClusterSelector(properties); - }; - - /** - * Encodes the specified ClusterSelector message. Does not implicitly {@link google.cloud.dataproc.v1.ClusterSelector.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.ClusterSelector - * @static - * @param {google.cloud.dataproc.v1.IClusterSelector} message ClusterSelector message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClusterSelector.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.zone); - if (message.clusterLabels != null && Object.hasOwnProperty.call(message, "clusterLabels")) - for (var keys = Object.keys(message.clusterLabels), 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.clusterLabels[keys[i]]).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClusterSelector message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ClusterSelector.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.ClusterSelector - * @static - * @param {google.cloud.dataproc.v1.IClusterSelector} message ClusterSelector message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClusterSelector.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClusterSelector message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.ClusterSelector - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.ClusterSelector} ClusterSelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClusterSelector.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ClusterSelector(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.zone = reader.string(); - break; - } - case 2: { - if (message.clusterLabels === $util.emptyObject) - message.clusterLabels = {}; - 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.clusterLabels[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClusterSelector message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.ClusterSelector - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.ClusterSelector} ClusterSelector - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClusterSelector.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClusterSelector message. - * @function verify - * @memberof google.cloud.dataproc.v1.ClusterSelector - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClusterSelector.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.zone != null && message.hasOwnProperty("zone")) - if (!$util.isString(message.zone)) - return "zone: string expected"; - if (message.clusterLabels != null && message.hasOwnProperty("clusterLabels")) { - if (!$util.isObject(message.clusterLabels)) - return "clusterLabels: object expected"; - var key = Object.keys(message.clusterLabels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.clusterLabels[key[i]])) - return "clusterLabels: string{k:string} expected"; - } - return null; - }; - - /** - * Creates a ClusterSelector message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.ClusterSelector - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.ClusterSelector} ClusterSelector - */ - ClusterSelector.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.ClusterSelector) - return object; - var message = new $root.google.cloud.dataproc.v1.ClusterSelector(); - if (object.zone != null) - message.zone = String(object.zone); - if (object.clusterLabels) { - if (typeof object.clusterLabels !== "object") - throw TypeError(".google.cloud.dataproc.v1.ClusterSelector.clusterLabels: object expected"); - message.clusterLabels = {}; - for (var keys = Object.keys(object.clusterLabels), i = 0; i < keys.length; ++i) - message.clusterLabels[keys[i]] = String(object.clusterLabels[keys[i]]); - } - return message; - }; - - /** - * Creates a plain object from a ClusterSelector message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.ClusterSelector - * @static - * @param {google.cloud.dataproc.v1.ClusterSelector} message ClusterSelector - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClusterSelector.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.clusterLabels = {}; - if (options.defaults) - object.zone = ""; - if (message.zone != null && message.hasOwnProperty("zone")) - object.zone = message.zone; - var keys2; - if (message.clusterLabels && (keys2 = Object.keys(message.clusterLabels)).length) { - object.clusterLabels = {}; - for (var j = 0; j < keys2.length; ++j) - object.clusterLabels[keys2[j]] = message.clusterLabels[keys2[j]]; - } - return object; - }; - - /** - * Converts this ClusterSelector to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.ClusterSelector - * @instance - * @returns {Object.} JSON object - */ - ClusterSelector.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClusterSelector - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.ClusterSelector - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClusterSelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.ClusterSelector"; - }; - - return ClusterSelector; - })(); - - v1.OrderedJob = (function() { - - /** - * Properties of an OrderedJob. - * @memberof google.cloud.dataproc.v1 - * @interface IOrderedJob - * @property {string|null} [stepId] OrderedJob stepId - * @property {google.cloud.dataproc.v1.IHadoopJob|null} [hadoopJob] OrderedJob hadoopJob - * @property {google.cloud.dataproc.v1.ISparkJob|null} [sparkJob] OrderedJob sparkJob - * @property {google.cloud.dataproc.v1.IPySparkJob|null} [pysparkJob] OrderedJob pysparkJob - * @property {google.cloud.dataproc.v1.IHiveJob|null} [hiveJob] OrderedJob hiveJob - * @property {google.cloud.dataproc.v1.IPigJob|null} [pigJob] OrderedJob pigJob - * @property {google.cloud.dataproc.v1.ISparkRJob|null} [sparkRJob] OrderedJob sparkRJob - * @property {google.cloud.dataproc.v1.ISparkSqlJob|null} [sparkSqlJob] OrderedJob sparkSqlJob - * @property {google.cloud.dataproc.v1.IPrestoJob|null} [prestoJob] OrderedJob prestoJob - * @property {google.cloud.dataproc.v1.ITrinoJob|null} [trinoJob] OrderedJob trinoJob - * @property {google.cloud.dataproc.v1.IFlinkJob|null} [flinkJob] OrderedJob flinkJob - * @property {Object.|null} [labels] OrderedJob labels - * @property {google.cloud.dataproc.v1.IJobScheduling|null} [scheduling] OrderedJob scheduling - * @property {Array.|null} [prerequisiteStepIds] OrderedJob prerequisiteStepIds - */ - - /** - * Constructs a new OrderedJob. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents an OrderedJob. - * @implements IOrderedJob - * @constructor - * @param {google.cloud.dataproc.v1.IOrderedJob=} [properties] Properties to set - */ - function OrderedJob(properties) { - this.labels = {}; - this.prerequisiteStepIds = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OrderedJob stepId. - * @member {string} stepId - * @memberof google.cloud.dataproc.v1.OrderedJob - * @instance - */ - OrderedJob.prototype.stepId = ""; - - /** - * OrderedJob hadoopJob. - * @member {google.cloud.dataproc.v1.IHadoopJob|null|undefined} hadoopJob - * @memberof google.cloud.dataproc.v1.OrderedJob - * @instance - */ - OrderedJob.prototype.hadoopJob = null; - - /** - * OrderedJob sparkJob. - * @member {google.cloud.dataproc.v1.ISparkJob|null|undefined} sparkJob - * @memberof google.cloud.dataproc.v1.OrderedJob - * @instance - */ - OrderedJob.prototype.sparkJob = null; - - /** - * OrderedJob pysparkJob. - * @member {google.cloud.dataproc.v1.IPySparkJob|null|undefined} pysparkJob - * @memberof google.cloud.dataproc.v1.OrderedJob - * @instance - */ - OrderedJob.prototype.pysparkJob = null; - - /** - * OrderedJob hiveJob. - * @member {google.cloud.dataproc.v1.IHiveJob|null|undefined} hiveJob - * @memberof google.cloud.dataproc.v1.OrderedJob - * @instance - */ - OrderedJob.prototype.hiveJob = null; - - /** - * OrderedJob pigJob. - * @member {google.cloud.dataproc.v1.IPigJob|null|undefined} pigJob - * @memberof google.cloud.dataproc.v1.OrderedJob - * @instance - */ - OrderedJob.prototype.pigJob = null; - - /** - * OrderedJob sparkRJob. - * @member {google.cloud.dataproc.v1.ISparkRJob|null|undefined} sparkRJob - * @memberof google.cloud.dataproc.v1.OrderedJob - * @instance - */ - OrderedJob.prototype.sparkRJob = null; - - /** - * OrderedJob sparkSqlJob. - * @member {google.cloud.dataproc.v1.ISparkSqlJob|null|undefined} sparkSqlJob - * @memberof google.cloud.dataproc.v1.OrderedJob - * @instance - */ - OrderedJob.prototype.sparkSqlJob = null; - - /** - * OrderedJob prestoJob. - * @member {google.cloud.dataproc.v1.IPrestoJob|null|undefined} prestoJob - * @memberof google.cloud.dataproc.v1.OrderedJob - * @instance - */ - OrderedJob.prototype.prestoJob = null; - - /** - * OrderedJob trinoJob. - * @member {google.cloud.dataproc.v1.ITrinoJob|null|undefined} trinoJob - * @memberof google.cloud.dataproc.v1.OrderedJob - * @instance - */ - OrderedJob.prototype.trinoJob = null; - - /** - * OrderedJob flinkJob. - * @member {google.cloud.dataproc.v1.IFlinkJob|null|undefined} flinkJob - * @memberof google.cloud.dataproc.v1.OrderedJob - * @instance - */ - OrderedJob.prototype.flinkJob = null; - - /** - * OrderedJob labels. - * @member {Object.} labels - * @memberof google.cloud.dataproc.v1.OrderedJob - * @instance - */ - OrderedJob.prototype.labels = $util.emptyObject; - - /** - * OrderedJob scheduling. - * @member {google.cloud.dataproc.v1.IJobScheduling|null|undefined} scheduling - * @memberof google.cloud.dataproc.v1.OrderedJob - * @instance - */ - OrderedJob.prototype.scheduling = null; - - /** - * OrderedJob prerequisiteStepIds. - * @member {Array.} prerequisiteStepIds - * @memberof google.cloud.dataproc.v1.OrderedJob - * @instance - */ - OrderedJob.prototype.prerequisiteStepIds = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * OrderedJob jobType. - * @member {"hadoopJob"|"sparkJob"|"pysparkJob"|"hiveJob"|"pigJob"|"sparkRJob"|"sparkSqlJob"|"prestoJob"|"trinoJob"|"flinkJob"|undefined} jobType - * @memberof google.cloud.dataproc.v1.OrderedJob - * @instance - */ - Object.defineProperty(OrderedJob.prototype, "jobType", { - get: $util.oneOfGetter($oneOfFields = ["hadoopJob", "sparkJob", "pysparkJob", "hiveJob", "pigJob", "sparkRJob", "sparkSqlJob", "prestoJob", "trinoJob", "flinkJob"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new OrderedJob instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.OrderedJob - * @static - * @param {google.cloud.dataproc.v1.IOrderedJob=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.OrderedJob} OrderedJob instance - */ - OrderedJob.create = function create(properties) { - return new OrderedJob(properties); - }; - - /** - * Encodes the specified OrderedJob message. Does not implicitly {@link google.cloud.dataproc.v1.OrderedJob.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.OrderedJob - * @static - * @param {google.cloud.dataproc.v1.IOrderedJob} message OrderedJob message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OrderedJob.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.stepId != null && Object.hasOwnProperty.call(message, "stepId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.stepId); - if (message.hadoopJob != null && Object.hasOwnProperty.call(message, "hadoopJob")) - $root.google.cloud.dataproc.v1.HadoopJob.encode(message.hadoopJob, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.sparkJob != null && Object.hasOwnProperty.call(message, "sparkJob")) - $root.google.cloud.dataproc.v1.SparkJob.encode(message.sparkJob, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.pysparkJob != null && Object.hasOwnProperty.call(message, "pysparkJob")) - $root.google.cloud.dataproc.v1.PySparkJob.encode(message.pysparkJob, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.hiveJob != null && Object.hasOwnProperty.call(message, "hiveJob")) - $root.google.cloud.dataproc.v1.HiveJob.encode(message.hiveJob, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.pigJob != null && Object.hasOwnProperty.call(message, "pigJob")) - $root.google.cloud.dataproc.v1.PigJob.encode(message.pigJob, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.sparkSqlJob != null && Object.hasOwnProperty.call(message, "sparkSqlJob")) - $root.google.cloud.dataproc.v1.SparkSqlJob.encode(message.sparkSqlJob, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.scheduling != null && Object.hasOwnProperty.call(message, "scheduling")) - $root.google.cloud.dataproc.v1.JobScheduling.encode(message.scheduling, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.prerequisiteStepIds != null && message.prerequisiteStepIds.length) - for (var i = 0; i < message.prerequisiteStepIds.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.prerequisiteStepIds[i]); - if (message.sparkRJob != null && Object.hasOwnProperty.call(message, "sparkRJob")) - $root.google.cloud.dataproc.v1.SparkRJob.encode(message.sparkRJob, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.prestoJob != null && Object.hasOwnProperty.call(message, "prestoJob")) - $root.google.cloud.dataproc.v1.PrestoJob.encode(message.prestoJob, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.trinoJob != null && Object.hasOwnProperty.call(message, "trinoJob")) - $root.google.cloud.dataproc.v1.TrinoJob.encode(message.trinoJob, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.flinkJob != null && Object.hasOwnProperty.call(message, "flinkJob")) - $root.google.cloud.dataproc.v1.FlinkJob.encode(message.flinkJob, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OrderedJob message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.OrderedJob.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.OrderedJob - * @static - * @param {google.cloud.dataproc.v1.IOrderedJob} message OrderedJob message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OrderedJob.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OrderedJob message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.OrderedJob - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.OrderedJob} OrderedJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OrderedJob.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.OrderedJob(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.stepId = reader.string(); - break; - } - case 2: { - message.hadoopJob = $root.google.cloud.dataproc.v1.HadoopJob.decode(reader, reader.uint32()); - break; - } - case 3: { - message.sparkJob = $root.google.cloud.dataproc.v1.SparkJob.decode(reader, reader.uint32()); - break; - } - case 4: { - message.pysparkJob = $root.google.cloud.dataproc.v1.PySparkJob.decode(reader, reader.uint32()); - break; - } - case 5: { - message.hiveJob = $root.google.cloud.dataproc.v1.HiveJob.decode(reader, reader.uint32()); - break; - } - case 6: { - message.pigJob = $root.google.cloud.dataproc.v1.PigJob.decode(reader, reader.uint32()); - break; - } - case 11: { - message.sparkRJob = $root.google.cloud.dataproc.v1.SparkRJob.decode(reader, reader.uint32()); - break; - } - case 7: { - message.sparkSqlJob = $root.google.cloud.dataproc.v1.SparkSqlJob.decode(reader, reader.uint32()); - break; - } - case 12: { - message.prestoJob = $root.google.cloud.dataproc.v1.PrestoJob.decode(reader, reader.uint32()); - break; - } - case 13: { - message.trinoJob = $root.google.cloud.dataproc.v1.TrinoJob.decode(reader, reader.uint32()); - break; - } - case 14: { - message.flinkJob = $root.google.cloud.dataproc.v1.FlinkJob.decode(reader, reader.uint32()); - break; - } - case 8: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 9: { - message.scheduling = $root.google.cloud.dataproc.v1.JobScheduling.decode(reader, reader.uint32()); - break; - } - case 10: { - if (!(message.prerequisiteStepIds && message.prerequisiteStepIds.length)) - message.prerequisiteStepIds = []; - message.prerequisiteStepIds.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OrderedJob message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.OrderedJob - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.OrderedJob} OrderedJob - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OrderedJob.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OrderedJob message. - * @function verify - * @memberof google.cloud.dataproc.v1.OrderedJob - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OrderedJob.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.stepId != null && message.hasOwnProperty("stepId")) - if (!$util.isString(message.stepId)) - return "stepId: string expected"; - if (message.hadoopJob != null && message.hasOwnProperty("hadoopJob")) { - properties.jobType = 1; - { - var error = $root.google.cloud.dataproc.v1.HadoopJob.verify(message.hadoopJob); - if (error) - return "hadoopJob." + error; - } - } - if (message.sparkJob != null && message.hasOwnProperty("sparkJob")) { - if (properties.jobType === 1) - return "jobType: multiple values"; - properties.jobType = 1; - { - var error = $root.google.cloud.dataproc.v1.SparkJob.verify(message.sparkJob); - if (error) - return "sparkJob." + error; - } - } - if (message.pysparkJob != null && message.hasOwnProperty("pysparkJob")) { - if (properties.jobType === 1) - return "jobType: multiple values"; - properties.jobType = 1; - { - var error = $root.google.cloud.dataproc.v1.PySparkJob.verify(message.pysparkJob); - if (error) - return "pysparkJob." + error; - } - } - if (message.hiveJob != null && message.hasOwnProperty("hiveJob")) { - if (properties.jobType === 1) - return "jobType: multiple values"; - properties.jobType = 1; - { - var error = $root.google.cloud.dataproc.v1.HiveJob.verify(message.hiveJob); - if (error) - return "hiveJob." + error; - } - } - if (message.pigJob != null && message.hasOwnProperty("pigJob")) { - if (properties.jobType === 1) - return "jobType: multiple values"; - properties.jobType = 1; - { - var error = $root.google.cloud.dataproc.v1.PigJob.verify(message.pigJob); - if (error) - return "pigJob." + error; - } - } - if (message.sparkRJob != null && message.hasOwnProperty("sparkRJob")) { - if (properties.jobType === 1) - return "jobType: multiple values"; - properties.jobType = 1; - { - var error = $root.google.cloud.dataproc.v1.SparkRJob.verify(message.sparkRJob); - if (error) - return "sparkRJob." + error; - } - } - if (message.sparkSqlJob != null && message.hasOwnProperty("sparkSqlJob")) { - if (properties.jobType === 1) - return "jobType: multiple values"; - properties.jobType = 1; - { - var error = $root.google.cloud.dataproc.v1.SparkSqlJob.verify(message.sparkSqlJob); - if (error) - return "sparkSqlJob." + error; - } - } - if (message.prestoJob != null && message.hasOwnProperty("prestoJob")) { - if (properties.jobType === 1) - return "jobType: multiple values"; - properties.jobType = 1; - { - var error = $root.google.cloud.dataproc.v1.PrestoJob.verify(message.prestoJob); - if (error) - return "prestoJob." + error; - } - } - if (message.trinoJob != null && message.hasOwnProperty("trinoJob")) { - if (properties.jobType === 1) - return "jobType: multiple values"; - properties.jobType = 1; - { - var error = $root.google.cloud.dataproc.v1.TrinoJob.verify(message.trinoJob); - if (error) - return "trinoJob." + error; - } - } - if (message.flinkJob != null && message.hasOwnProperty("flinkJob")) { - if (properties.jobType === 1) - return "jobType: multiple values"; - properties.jobType = 1; - { - var error = $root.google.cloud.dataproc.v1.FlinkJob.verify(message.flinkJob); - if (error) - return "flinkJob." + error; - } - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.scheduling != null && message.hasOwnProperty("scheduling")) { - var error = $root.google.cloud.dataproc.v1.JobScheduling.verify(message.scheduling); - if (error) - return "scheduling." + error; - } - if (message.prerequisiteStepIds != null && message.hasOwnProperty("prerequisiteStepIds")) { - if (!Array.isArray(message.prerequisiteStepIds)) - return "prerequisiteStepIds: array expected"; - for (var i = 0; i < message.prerequisiteStepIds.length; ++i) - if (!$util.isString(message.prerequisiteStepIds[i])) - return "prerequisiteStepIds: string[] expected"; - } - return null; - }; - - /** - * Creates an OrderedJob message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.OrderedJob - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.OrderedJob} OrderedJob - */ - OrderedJob.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.OrderedJob) - return object; - var message = new $root.google.cloud.dataproc.v1.OrderedJob(); - if (object.stepId != null) - message.stepId = String(object.stepId); - if (object.hadoopJob != null) { - if (typeof object.hadoopJob !== "object") - throw TypeError(".google.cloud.dataproc.v1.OrderedJob.hadoopJob: object expected"); - message.hadoopJob = $root.google.cloud.dataproc.v1.HadoopJob.fromObject(object.hadoopJob); - } - if (object.sparkJob != null) { - if (typeof object.sparkJob !== "object") - throw TypeError(".google.cloud.dataproc.v1.OrderedJob.sparkJob: object expected"); - message.sparkJob = $root.google.cloud.dataproc.v1.SparkJob.fromObject(object.sparkJob); - } - if (object.pysparkJob != null) { - if (typeof object.pysparkJob !== "object") - throw TypeError(".google.cloud.dataproc.v1.OrderedJob.pysparkJob: object expected"); - message.pysparkJob = $root.google.cloud.dataproc.v1.PySparkJob.fromObject(object.pysparkJob); - } - if (object.hiveJob != null) { - if (typeof object.hiveJob !== "object") - throw TypeError(".google.cloud.dataproc.v1.OrderedJob.hiveJob: object expected"); - message.hiveJob = $root.google.cloud.dataproc.v1.HiveJob.fromObject(object.hiveJob); - } - if (object.pigJob != null) { - if (typeof object.pigJob !== "object") - throw TypeError(".google.cloud.dataproc.v1.OrderedJob.pigJob: object expected"); - message.pigJob = $root.google.cloud.dataproc.v1.PigJob.fromObject(object.pigJob); - } - if (object.sparkRJob != null) { - if (typeof object.sparkRJob !== "object") - throw TypeError(".google.cloud.dataproc.v1.OrderedJob.sparkRJob: object expected"); - message.sparkRJob = $root.google.cloud.dataproc.v1.SparkRJob.fromObject(object.sparkRJob); - } - if (object.sparkSqlJob != null) { - if (typeof object.sparkSqlJob !== "object") - throw TypeError(".google.cloud.dataproc.v1.OrderedJob.sparkSqlJob: object expected"); - message.sparkSqlJob = $root.google.cloud.dataproc.v1.SparkSqlJob.fromObject(object.sparkSqlJob); - } - if (object.prestoJob != null) { - if (typeof object.prestoJob !== "object") - throw TypeError(".google.cloud.dataproc.v1.OrderedJob.prestoJob: object expected"); - message.prestoJob = $root.google.cloud.dataproc.v1.PrestoJob.fromObject(object.prestoJob); - } - if (object.trinoJob != null) { - if (typeof object.trinoJob !== "object") - throw TypeError(".google.cloud.dataproc.v1.OrderedJob.trinoJob: object expected"); - message.trinoJob = $root.google.cloud.dataproc.v1.TrinoJob.fromObject(object.trinoJob); - } - if (object.flinkJob != null) { - if (typeof object.flinkJob !== "object") - throw TypeError(".google.cloud.dataproc.v1.OrderedJob.flinkJob: object expected"); - message.flinkJob = $root.google.cloud.dataproc.v1.FlinkJob.fromObject(object.flinkJob); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.dataproc.v1.OrderedJob.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.scheduling != null) { - if (typeof object.scheduling !== "object") - throw TypeError(".google.cloud.dataproc.v1.OrderedJob.scheduling: object expected"); - message.scheduling = $root.google.cloud.dataproc.v1.JobScheduling.fromObject(object.scheduling); - } - if (object.prerequisiteStepIds) { - if (!Array.isArray(object.prerequisiteStepIds)) - throw TypeError(".google.cloud.dataproc.v1.OrderedJob.prerequisiteStepIds: array expected"); - message.prerequisiteStepIds = []; - for (var i = 0; i < object.prerequisiteStepIds.length; ++i) - message.prerequisiteStepIds[i] = String(object.prerequisiteStepIds[i]); - } - return message; - }; - - /** - * Creates a plain object from an OrderedJob message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.OrderedJob - * @static - * @param {google.cloud.dataproc.v1.OrderedJob} message OrderedJob - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OrderedJob.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.prerequisiteStepIds = []; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.stepId = ""; - object.scheduling = null; - } - if (message.stepId != null && message.hasOwnProperty("stepId")) - object.stepId = message.stepId; - if (message.hadoopJob != null && message.hasOwnProperty("hadoopJob")) { - object.hadoopJob = $root.google.cloud.dataproc.v1.HadoopJob.toObject(message.hadoopJob, options); - if (options.oneofs) - object.jobType = "hadoopJob"; - } - if (message.sparkJob != null && message.hasOwnProperty("sparkJob")) { - object.sparkJob = $root.google.cloud.dataproc.v1.SparkJob.toObject(message.sparkJob, options); - if (options.oneofs) - object.jobType = "sparkJob"; - } - if (message.pysparkJob != null && message.hasOwnProperty("pysparkJob")) { - object.pysparkJob = $root.google.cloud.dataproc.v1.PySparkJob.toObject(message.pysparkJob, options); - if (options.oneofs) - object.jobType = "pysparkJob"; - } - if (message.hiveJob != null && message.hasOwnProperty("hiveJob")) { - object.hiveJob = $root.google.cloud.dataproc.v1.HiveJob.toObject(message.hiveJob, options); - if (options.oneofs) - object.jobType = "hiveJob"; - } - if (message.pigJob != null && message.hasOwnProperty("pigJob")) { - object.pigJob = $root.google.cloud.dataproc.v1.PigJob.toObject(message.pigJob, options); - if (options.oneofs) - object.jobType = "pigJob"; - } - if (message.sparkSqlJob != null && message.hasOwnProperty("sparkSqlJob")) { - object.sparkSqlJob = $root.google.cloud.dataproc.v1.SparkSqlJob.toObject(message.sparkSqlJob, options); - if (options.oneofs) - object.jobType = "sparkSqlJob"; - } - 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.scheduling != null && message.hasOwnProperty("scheduling")) - object.scheduling = $root.google.cloud.dataproc.v1.JobScheduling.toObject(message.scheduling, options); - if (message.prerequisiteStepIds && message.prerequisiteStepIds.length) { - object.prerequisiteStepIds = []; - for (var j = 0; j < message.prerequisiteStepIds.length; ++j) - object.prerequisiteStepIds[j] = message.prerequisiteStepIds[j]; - } - if (message.sparkRJob != null && message.hasOwnProperty("sparkRJob")) { - object.sparkRJob = $root.google.cloud.dataproc.v1.SparkRJob.toObject(message.sparkRJob, options); - if (options.oneofs) - object.jobType = "sparkRJob"; - } - if (message.prestoJob != null && message.hasOwnProperty("prestoJob")) { - object.prestoJob = $root.google.cloud.dataproc.v1.PrestoJob.toObject(message.prestoJob, options); - if (options.oneofs) - object.jobType = "prestoJob"; - } - if (message.trinoJob != null && message.hasOwnProperty("trinoJob")) { - object.trinoJob = $root.google.cloud.dataproc.v1.TrinoJob.toObject(message.trinoJob, options); - if (options.oneofs) - object.jobType = "trinoJob"; - } - if (message.flinkJob != null && message.hasOwnProperty("flinkJob")) { - object.flinkJob = $root.google.cloud.dataproc.v1.FlinkJob.toObject(message.flinkJob, options); - if (options.oneofs) - object.jobType = "flinkJob"; - } - return object; - }; - - /** - * Converts this OrderedJob to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.OrderedJob - * @instance - * @returns {Object.} JSON object - */ - OrderedJob.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OrderedJob - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.OrderedJob - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OrderedJob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.OrderedJob"; - }; - - return OrderedJob; - })(); - - v1.TemplateParameter = (function() { - - /** - * Properties of a TemplateParameter. - * @memberof google.cloud.dataproc.v1 - * @interface ITemplateParameter - * @property {string|null} [name] TemplateParameter name - * @property {Array.|null} [fields] TemplateParameter fields - * @property {string|null} [description] TemplateParameter description - * @property {google.cloud.dataproc.v1.IParameterValidation|null} [validation] TemplateParameter validation - */ - - /** - * Constructs a new TemplateParameter. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a TemplateParameter. - * @implements ITemplateParameter - * @constructor - * @param {google.cloud.dataproc.v1.ITemplateParameter=} [properties] Properties to set - */ - function TemplateParameter(properties) { - this.fields = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TemplateParameter name. - * @member {string} name - * @memberof google.cloud.dataproc.v1.TemplateParameter - * @instance - */ - TemplateParameter.prototype.name = ""; - - /** - * TemplateParameter fields. - * @member {Array.} fields - * @memberof google.cloud.dataproc.v1.TemplateParameter - * @instance - */ - TemplateParameter.prototype.fields = $util.emptyArray; - - /** - * TemplateParameter description. - * @member {string} description - * @memberof google.cloud.dataproc.v1.TemplateParameter - * @instance - */ - TemplateParameter.prototype.description = ""; - - /** - * TemplateParameter validation. - * @member {google.cloud.dataproc.v1.IParameterValidation|null|undefined} validation - * @memberof google.cloud.dataproc.v1.TemplateParameter - * @instance - */ - TemplateParameter.prototype.validation = null; - - /** - * Creates a new TemplateParameter instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.TemplateParameter - * @static - * @param {google.cloud.dataproc.v1.ITemplateParameter=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.TemplateParameter} TemplateParameter instance - */ - TemplateParameter.create = function create(properties) { - return new TemplateParameter(properties); - }; - - /** - * Encodes the specified TemplateParameter message. Does not implicitly {@link google.cloud.dataproc.v1.TemplateParameter.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.TemplateParameter - * @static - * @param {google.cloud.dataproc.v1.ITemplateParameter} message TemplateParameter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TemplateParameter.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.fields != null && message.fields.length) - for (var i = 0; i < message.fields.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.fields[i]); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.validation != null && Object.hasOwnProperty.call(message, "validation")) - $root.google.cloud.dataproc.v1.ParameterValidation.encode(message.validation, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TemplateParameter message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.TemplateParameter.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.TemplateParameter - * @static - * @param {google.cloud.dataproc.v1.ITemplateParameter} message TemplateParameter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TemplateParameter.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TemplateParameter message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.TemplateParameter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.TemplateParameter} TemplateParameter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TemplateParameter.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.TemplateParameter(); - 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.fields && message.fields.length)) - message.fields = []; - message.fields.push(reader.string()); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 4: { - message.validation = $root.google.cloud.dataproc.v1.ParameterValidation.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TemplateParameter message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.TemplateParameter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.TemplateParameter} TemplateParameter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TemplateParameter.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TemplateParameter message. - * @function verify - * @memberof google.cloud.dataproc.v1.TemplateParameter - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TemplateParameter.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.fields != null && message.hasOwnProperty("fields")) { - if (!Array.isArray(message.fields)) - return "fields: array expected"; - for (var i = 0; i < message.fields.length; ++i) - if (!$util.isString(message.fields[i])) - return "fields: string[] expected"; - } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.validation != null && message.hasOwnProperty("validation")) { - var error = $root.google.cloud.dataproc.v1.ParameterValidation.verify(message.validation); - if (error) - return "validation." + error; - } - return null; - }; - - /** - * Creates a TemplateParameter message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.TemplateParameter - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.TemplateParameter} TemplateParameter - */ - TemplateParameter.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.TemplateParameter) - return object; - var message = new $root.google.cloud.dataproc.v1.TemplateParameter(); - if (object.name != null) - message.name = String(object.name); - if (object.fields) { - if (!Array.isArray(object.fields)) - throw TypeError(".google.cloud.dataproc.v1.TemplateParameter.fields: array expected"); - message.fields = []; - for (var i = 0; i < object.fields.length; ++i) - message.fields[i] = String(object.fields[i]); - } - if (object.description != null) - message.description = String(object.description); - if (object.validation != null) { - if (typeof object.validation !== "object") - throw TypeError(".google.cloud.dataproc.v1.TemplateParameter.validation: object expected"); - message.validation = $root.google.cloud.dataproc.v1.ParameterValidation.fromObject(object.validation); - } - return message; - }; - - /** - * Creates a plain object from a TemplateParameter message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.TemplateParameter - * @static - * @param {google.cloud.dataproc.v1.TemplateParameter} message TemplateParameter - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TemplateParameter.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.fields = []; - if (options.defaults) { - object.name = ""; - object.description = ""; - object.validation = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.fields && message.fields.length) { - object.fields = []; - for (var j = 0; j < message.fields.length; ++j) - object.fields[j] = message.fields[j]; - } - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.validation != null && message.hasOwnProperty("validation")) - object.validation = $root.google.cloud.dataproc.v1.ParameterValidation.toObject(message.validation, options); - return object; - }; - - /** - * Converts this TemplateParameter to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.TemplateParameter - * @instance - * @returns {Object.} JSON object - */ - TemplateParameter.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TemplateParameter - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.TemplateParameter - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TemplateParameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.TemplateParameter"; - }; - - return TemplateParameter; - })(); - - v1.ParameterValidation = (function() { - - /** - * Properties of a ParameterValidation. - * @memberof google.cloud.dataproc.v1 - * @interface IParameterValidation - * @property {google.cloud.dataproc.v1.IRegexValidation|null} [regex] ParameterValidation regex - * @property {google.cloud.dataproc.v1.IValueValidation|null} [values] ParameterValidation values - */ - - /** - * Constructs a new ParameterValidation. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a ParameterValidation. - * @implements IParameterValidation - * @constructor - * @param {google.cloud.dataproc.v1.IParameterValidation=} [properties] Properties to set - */ - function ParameterValidation(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ParameterValidation regex. - * @member {google.cloud.dataproc.v1.IRegexValidation|null|undefined} regex - * @memberof google.cloud.dataproc.v1.ParameterValidation - * @instance - */ - ParameterValidation.prototype.regex = null; - - /** - * ParameterValidation values. - * @member {google.cloud.dataproc.v1.IValueValidation|null|undefined} values - * @memberof google.cloud.dataproc.v1.ParameterValidation - * @instance - */ - ParameterValidation.prototype.values = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ParameterValidation validationType. - * @member {"regex"|"values"|undefined} validationType - * @memberof google.cloud.dataproc.v1.ParameterValidation - * @instance - */ - Object.defineProperty(ParameterValidation.prototype, "validationType", { - get: $util.oneOfGetter($oneOfFields = ["regex", "values"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ParameterValidation instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.ParameterValidation - * @static - * @param {google.cloud.dataproc.v1.IParameterValidation=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.ParameterValidation} ParameterValidation instance - */ - ParameterValidation.create = function create(properties) { - return new ParameterValidation(properties); - }; - - /** - * Encodes the specified ParameterValidation message. Does not implicitly {@link google.cloud.dataproc.v1.ParameterValidation.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.ParameterValidation - * @static - * @param {google.cloud.dataproc.v1.IParameterValidation} message ParameterValidation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ParameterValidation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.regex != null && Object.hasOwnProperty.call(message, "regex")) - $root.google.cloud.dataproc.v1.RegexValidation.encode(message.regex, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.values != null && Object.hasOwnProperty.call(message, "values")) - $root.google.cloud.dataproc.v1.ValueValidation.encode(message.values, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ParameterValidation message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ParameterValidation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.ParameterValidation - * @static - * @param {google.cloud.dataproc.v1.IParameterValidation} message ParameterValidation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ParameterValidation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ParameterValidation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.ParameterValidation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.ParameterValidation} ParameterValidation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ParameterValidation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ParameterValidation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.regex = $root.google.cloud.dataproc.v1.RegexValidation.decode(reader, reader.uint32()); - break; - } - case 2: { - message.values = $root.google.cloud.dataproc.v1.ValueValidation.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ParameterValidation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.ParameterValidation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.ParameterValidation} ParameterValidation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ParameterValidation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ParameterValidation message. - * @function verify - * @memberof google.cloud.dataproc.v1.ParameterValidation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ParameterValidation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.regex != null && message.hasOwnProperty("regex")) { - properties.validationType = 1; - { - var error = $root.google.cloud.dataproc.v1.RegexValidation.verify(message.regex); - if (error) - return "regex." + error; - } - } - if (message.values != null && message.hasOwnProperty("values")) { - if (properties.validationType === 1) - return "validationType: multiple values"; - properties.validationType = 1; - { - var error = $root.google.cloud.dataproc.v1.ValueValidation.verify(message.values); - if (error) - return "values." + error; - } - } - return null; - }; - - /** - * Creates a ParameterValidation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.ParameterValidation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.ParameterValidation} ParameterValidation - */ - ParameterValidation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.ParameterValidation) - return object; - var message = new $root.google.cloud.dataproc.v1.ParameterValidation(); - if (object.regex != null) { - if (typeof object.regex !== "object") - throw TypeError(".google.cloud.dataproc.v1.ParameterValidation.regex: object expected"); - message.regex = $root.google.cloud.dataproc.v1.RegexValidation.fromObject(object.regex); - } - if (object.values != null) { - if (typeof object.values !== "object") - throw TypeError(".google.cloud.dataproc.v1.ParameterValidation.values: object expected"); - message.values = $root.google.cloud.dataproc.v1.ValueValidation.fromObject(object.values); - } - return message; - }; - - /** - * Creates a plain object from a ParameterValidation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.ParameterValidation - * @static - * @param {google.cloud.dataproc.v1.ParameterValidation} message ParameterValidation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ParameterValidation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.regex != null && message.hasOwnProperty("regex")) { - object.regex = $root.google.cloud.dataproc.v1.RegexValidation.toObject(message.regex, options); - if (options.oneofs) - object.validationType = "regex"; - } - if (message.values != null && message.hasOwnProperty("values")) { - object.values = $root.google.cloud.dataproc.v1.ValueValidation.toObject(message.values, options); - if (options.oneofs) - object.validationType = "values"; - } - return object; - }; - - /** - * Converts this ParameterValidation to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.ParameterValidation - * @instance - * @returns {Object.} JSON object - */ - ParameterValidation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ParameterValidation - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.ParameterValidation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ParameterValidation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.ParameterValidation"; - }; - - return ParameterValidation; - })(); - - v1.RegexValidation = (function() { - - /** - * Properties of a RegexValidation. - * @memberof google.cloud.dataproc.v1 - * @interface IRegexValidation - * @property {Array.|null} [regexes] RegexValidation regexes - */ - - /** - * Constructs a new RegexValidation. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a RegexValidation. - * @implements IRegexValidation - * @constructor - * @param {google.cloud.dataproc.v1.IRegexValidation=} [properties] Properties to set - */ - function RegexValidation(properties) { - this.regexes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RegexValidation regexes. - * @member {Array.} regexes - * @memberof google.cloud.dataproc.v1.RegexValidation - * @instance - */ - RegexValidation.prototype.regexes = $util.emptyArray; - - /** - * Creates a new RegexValidation instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.RegexValidation - * @static - * @param {google.cloud.dataproc.v1.IRegexValidation=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.RegexValidation} RegexValidation instance - */ - RegexValidation.create = function create(properties) { - return new RegexValidation(properties); - }; - - /** - * Encodes the specified RegexValidation message. Does not implicitly {@link google.cloud.dataproc.v1.RegexValidation.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.RegexValidation - * @static - * @param {google.cloud.dataproc.v1.IRegexValidation} message RegexValidation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RegexValidation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.regexes != null && message.regexes.length) - for (var i = 0; i < message.regexes.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.regexes[i]); - return writer; - }; - - /** - * Encodes the specified RegexValidation message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.RegexValidation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.RegexValidation - * @static - * @param {google.cloud.dataproc.v1.IRegexValidation} message RegexValidation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RegexValidation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RegexValidation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.RegexValidation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.RegexValidation} RegexValidation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RegexValidation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.RegexValidation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.regexes && message.regexes.length)) - message.regexes = []; - message.regexes.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RegexValidation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.RegexValidation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.RegexValidation} RegexValidation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RegexValidation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RegexValidation message. - * @function verify - * @memberof google.cloud.dataproc.v1.RegexValidation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RegexValidation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.regexes != null && message.hasOwnProperty("regexes")) { - if (!Array.isArray(message.regexes)) - return "regexes: array expected"; - for (var i = 0; i < message.regexes.length; ++i) - if (!$util.isString(message.regexes[i])) - return "regexes: string[] expected"; - } - return null; - }; - - /** - * Creates a RegexValidation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.RegexValidation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.RegexValidation} RegexValidation - */ - RegexValidation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.RegexValidation) - return object; - var message = new $root.google.cloud.dataproc.v1.RegexValidation(); - if (object.regexes) { - if (!Array.isArray(object.regexes)) - throw TypeError(".google.cloud.dataproc.v1.RegexValidation.regexes: array expected"); - message.regexes = []; - for (var i = 0; i < object.regexes.length; ++i) - message.regexes[i] = String(object.regexes[i]); - } - return message; - }; - - /** - * Creates a plain object from a RegexValidation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.RegexValidation - * @static - * @param {google.cloud.dataproc.v1.RegexValidation} message RegexValidation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RegexValidation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.regexes = []; - if (message.regexes && message.regexes.length) { - object.regexes = []; - for (var j = 0; j < message.regexes.length; ++j) - object.regexes[j] = message.regexes[j]; - } - return object; - }; - - /** - * Converts this RegexValidation to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.RegexValidation - * @instance - * @returns {Object.} JSON object - */ - RegexValidation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RegexValidation - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.RegexValidation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RegexValidation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.RegexValidation"; - }; - - return RegexValidation; - })(); - - v1.ValueValidation = (function() { - - /** - * Properties of a ValueValidation. - * @memberof google.cloud.dataproc.v1 - * @interface IValueValidation - * @property {Array.|null} [values] ValueValidation values - */ - - /** - * Constructs a new ValueValidation. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a ValueValidation. - * @implements IValueValidation - * @constructor - * @param {google.cloud.dataproc.v1.IValueValidation=} [properties] Properties to set - */ - function ValueValidation(properties) { - this.values = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ValueValidation values. - * @member {Array.} values - * @memberof google.cloud.dataproc.v1.ValueValidation - * @instance - */ - ValueValidation.prototype.values = $util.emptyArray; - - /** - * Creates a new ValueValidation instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.ValueValidation - * @static - * @param {google.cloud.dataproc.v1.IValueValidation=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.ValueValidation} ValueValidation instance - */ - ValueValidation.create = function create(properties) { - return new ValueValidation(properties); - }; - - /** - * Encodes the specified ValueValidation message. Does not implicitly {@link google.cloud.dataproc.v1.ValueValidation.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.ValueValidation - * @static - * @param {google.cloud.dataproc.v1.IValueValidation} message ValueValidation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValueValidation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.values != null && message.values.length) - for (var i = 0; i < message.values.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.values[i]); - return writer; - }; - - /** - * Encodes the specified ValueValidation message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ValueValidation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.ValueValidation - * @static - * @param {google.cloud.dataproc.v1.IValueValidation} message ValueValidation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ValueValidation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ValueValidation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.ValueValidation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.ValueValidation} ValueValidation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValueValidation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ValueValidation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.values && message.values.length)) - message.values = []; - message.values.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ValueValidation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.ValueValidation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.ValueValidation} ValueValidation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ValueValidation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ValueValidation message. - * @function verify - * @memberof google.cloud.dataproc.v1.ValueValidation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ValueValidation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.values != null && message.hasOwnProperty("values")) { - if (!Array.isArray(message.values)) - return "values: array expected"; - for (var i = 0; i < message.values.length; ++i) - if (!$util.isString(message.values[i])) - return "values: string[] expected"; - } - return null; - }; - - /** - * Creates a ValueValidation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.ValueValidation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.ValueValidation} ValueValidation - */ - ValueValidation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.ValueValidation) - return object; - var message = new $root.google.cloud.dataproc.v1.ValueValidation(); - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.cloud.dataproc.v1.ValueValidation.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) - message.values[i] = String(object.values[i]); - } - return message; - }; - - /** - * Creates a plain object from a ValueValidation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.ValueValidation - * @static - * @param {google.cloud.dataproc.v1.ValueValidation} message ValueValidation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ValueValidation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.values = []; - if (message.values && message.values.length) { - object.values = []; - for (var j = 0; j < message.values.length; ++j) - object.values[j] = message.values[j]; - } - return object; - }; - - /** - * Converts this ValueValidation to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.ValueValidation - * @instance - * @returns {Object.} JSON object - */ - ValueValidation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ValueValidation - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.ValueValidation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ValueValidation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.ValueValidation"; - }; - - return ValueValidation; - })(); - - v1.WorkflowMetadata = (function() { - - /** - * Properties of a WorkflowMetadata. - * @memberof google.cloud.dataproc.v1 - * @interface IWorkflowMetadata - * @property {string|null} [template] WorkflowMetadata template - * @property {number|null} [version] WorkflowMetadata version - * @property {google.cloud.dataproc.v1.IClusterOperation|null} [createCluster] WorkflowMetadata createCluster - * @property {google.cloud.dataproc.v1.IWorkflowGraph|null} [graph] WorkflowMetadata graph - * @property {google.cloud.dataproc.v1.IClusterOperation|null} [deleteCluster] WorkflowMetadata deleteCluster - * @property {google.cloud.dataproc.v1.WorkflowMetadata.State|null} [state] WorkflowMetadata state - * @property {string|null} [clusterName] WorkflowMetadata clusterName - * @property {Object.|null} [parameters] WorkflowMetadata parameters - * @property {google.protobuf.ITimestamp|null} [startTime] WorkflowMetadata startTime - * @property {google.protobuf.ITimestamp|null} [endTime] WorkflowMetadata endTime - * @property {string|null} [clusterUuid] WorkflowMetadata clusterUuid - * @property {google.protobuf.IDuration|null} [dagTimeout] WorkflowMetadata dagTimeout - * @property {google.protobuf.ITimestamp|null} [dagStartTime] WorkflowMetadata dagStartTime - * @property {google.protobuf.ITimestamp|null} [dagEndTime] WorkflowMetadata dagEndTime - */ - - /** - * Constructs a new WorkflowMetadata. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a WorkflowMetadata. - * @implements IWorkflowMetadata - * @constructor - * @param {google.cloud.dataproc.v1.IWorkflowMetadata=} [properties] Properties to set - */ - function WorkflowMetadata(properties) { - this.parameters = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WorkflowMetadata template. - * @member {string} template - * @memberof google.cloud.dataproc.v1.WorkflowMetadata - * @instance - */ - WorkflowMetadata.prototype.template = ""; - - /** - * WorkflowMetadata version. - * @member {number} version - * @memberof google.cloud.dataproc.v1.WorkflowMetadata - * @instance - */ - WorkflowMetadata.prototype.version = 0; - - /** - * WorkflowMetadata createCluster. - * @member {google.cloud.dataproc.v1.IClusterOperation|null|undefined} createCluster - * @memberof google.cloud.dataproc.v1.WorkflowMetadata - * @instance - */ - WorkflowMetadata.prototype.createCluster = null; - - /** - * WorkflowMetadata graph. - * @member {google.cloud.dataproc.v1.IWorkflowGraph|null|undefined} graph - * @memberof google.cloud.dataproc.v1.WorkflowMetadata - * @instance - */ - WorkflowMetadata.prototype.graph = null; - - /** - * WorkflowMetadata deleteCluster. - * @member {google.cloud.dataproc.v1.IClusterOperation|null|undefined} deleteCluster - * @memberof google.cloud.dataproc.v1.WorkflowMetadata - * @instance - */ - WorkflowMetadata.prototype.deleteCluster = null; - - /** - * WorkflowMetadata state. - * @member {google.cloud.dataproc.v1.WorkflowMetadata.State} state - * @memberof google.cloud.dataproc.v1.WorkflowMetadata - * @instance - */ - WorkflowMetadata.prototype.state = 0; - - /** - * WorkflowMetadata clusterName. - * @member {string} clusterName - * @memberof google.cloud.dataproc.v1.WorkflowMetadata - * @instance - */ - WorkflowMetadata.prototype.clusterName = ""; - - /** - * WorkflowMetadata parameters. - * @member {Object.} parameters - * @memberof google.cloud.dataproc.v1.WorkflowMetadata - * @instance - */ - WorkflowMetadata.prototype.parameters = $util.emptyObject; - - /** - * WorkflowMetadata startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.dataproc.v1.WorkflowMetadata - * @instance - */ - WorkflowMetadata.prototype.startTime = null; - - /** - * WorkflowMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.dataproc.v1.WorkflowMetadata - * @instance - */ - WorkflowMetadata.prototype.endTime = null; - - /** - * WorkflowMetadata clusterUuid. - * @member {string} clusterUuid - * @memberof google.cloud.dataproc.v1.WorkflowMetadata - * @instance - */ - WorkflowMetadata.prototype.clusterUuid = ""; - - /** - * WorkflowMetadata dagTimeout. - * @member {google.protobuf.IDuration|null|undefined} dagTimeout - * @memberof google.cloud.dataproc.v1.WorkflowMetadata - * @instance - */ - WorkflowMetadata.prototype.dagTimeout = null; - - /** - * WorkflowMetadata dagStartTime. - * @member {google.protobuf.ITimestamp|null|undefined} dagStartTime - * @memberof google.cloud.dataproc.v1.WorkflowMetadata - * @instance - */ - WorkflowMetadata.prototype.dagStartTime = null; - - /** - * WorkflowMetadata dagEndTime. - * @member {google.protobuf.ITimestamp|null|undefined} dagEndTime - * @memberof google.cloud.dataproc.v1.WorkflowMetadata - * @instance - */ - WorkflowMetadata.prototype.dagEndTime = null; - - /** - * Creates a new WorkflowMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.WorkflowMetadata - * @static - * @param {google.cloud.dataproc.v1.IWorkflowMetadata=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.WorkflowMetadata} WorkflowMetadata instance - */ - WorkflowMetadata.create = function create(properties) { - return new WorkflowMetadata(properties); - }; - - /** - * Encodes the specified WorkflowMetadata message. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.WorkflowMetadata - * @static - * @param {google.cloud.dataproc.v1.IWorkflowMetadata} message WorkflowMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WorkflowMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.template != null && Object.hasOwnProperty.call(message, "template")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.template); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.version); - if (message.createCluster != null && Object.hasOwnProperty.call(message, "createCluster")) - $root.google.cloud.dataproc.v1.ClusterOperation.encode(message.createCluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.graph != null && Object.hasOwnProperty.call(message, "graph")) - $root.google.cloud.dataproc.v1.WorkflowGraph.encode(message.graph, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.deleteCluster != null && Object.hasOwnProperty.call(message, "deleteCluster")) - $root.google.cloud.dataproc.v1.ClusterOperation.encode(message.deleteCluster, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); - if (message.clusterName != null && Object.hasOwnProperty.call(message, "clusterName")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.clusterName); - if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) - for (var keys = Object.keys(message.parameters), 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.parameters[keys[i]]).ldelim(); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.clusterUuid != null && Object.hasOwnProperty.call(message, "clusterUuid")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.clusterUuid); - if (message.dagTimeout != null && Object.hasOwnProperty.call(message, "dagTimeout")) - $root.google.protobuf.Duration.encode(message.dagTimeout, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.dagStartTime != null && Object.hasOwnProperty.call(message, "dagStartTime")) - $root.google.protobuf.Timestamp.encode(message.dagStartTime, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.dagEndTime != null && Object.hasOwnProperty.call(message, "dagEndTime")) - $root.google.protobuf.Timestamp.encode(message.dagEndTime, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified WorkflowMetadata message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.WorkflowMetadata - * @static - * @param {google.cloud.dataproc.v1.IWorkflowMetadata} message WorkflowMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WorkflowMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WorkflowMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.WorkflowMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.WorkflowMetadata} WorkflowMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WorkflowMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.WorkflowMetadata(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.template = reader.string(); - break; - } - case 2: { - message.version = reader.int32(); - break; - } - case 3: { - message.createCluster = $root.google.cloud.dataproc.v1.ClusterOperation.decode(reader, reader.uint32()); - break; - } - case 4: { - message.graph = $root.google.cloud.dataproc.v1.WorkflowGraph.decode(reader, reader.uint32()); - break; - } - case 5: { - message.deleteCluster = $root.google.cloud.dataproc.v1.ClusterOperation.decode(reader, reader.uint32()); - break; - } - case 6: { - message.state = reader.int32(); - break; - } - case 7: { - message.clusterName = reader.string(); - break; - } - case 8: { - if (message.parameters === $util.emptyObject) - message.parameters = {}; - 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.parameters[key] = value; - break; - } - case 9: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 10: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 11: { - message.clusterUuid = reader.string(); - break; - } - case 12: { - message.dagTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 13: { - message.dagStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 14: { - message.dagEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WorkflowMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.WorkflowMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.WorkflowMetadata} WorkflowMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WorkflowMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WorkflowMetadata message. - * @function verify - * @memberof google.cloud.dataproc.v1.WorkflowMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WorkflowMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.template != null && message.hasOwnProperty("template")) - if (!$util.isString(message.template)) - return "template: string expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isInteger(message.version)) - return "version: integer expected"; - if (message.createCluster != null && message.hasOwnProperty("createCluster")) { - var error = $root.google.cloud.dataproc.v1.ClusterOperation.verify(message.createCluster); - if (error) - return "createCluster." + error; - } - if (message.graph != null && message.hasOwnProperty("graph")) { - var error = $root.google.cloud.dataproc.v1.WorkflowGraph.verify(message.graph); - if (error) - return "graph." + error; - } - if (message.deleteCluster != null && message.hasOwnProperty("deleteCluster")) { - var error = $root.google.cloud.dataproc.v1.ClusterOperation.verify(message.deleteCluster); - if (error) - return "deleteCluster." + error; - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - if (!$util.isString(message.clusterName)) - return "clusterName: string expected"; - if (message.parameters != null && message.hasOwnProperty("parameters")) { - if (!$util.isObject(message.parameters)) - return "parameters: object expected"; - var key = Object.keys(message.parameters); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.parameters[key[i]])) - return "parameters: string{k:string} expected"; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - if (message.clusterUuid != null && message.hasOwnProperty("clusterUuid")) - if (!$util.isString(message.clusterUuid)) - return "clusterUuid: string expected"; - if (message.dagTimeout != null && message.hasOwnProperty("dagTimeout")) { - var error = $root.google.protobuf.Duration.verify(message.dagTimeout); - if (error) - return "dagTimeout." + error; - } - if (message.dagStartTime != null && message.hasOwnProperty("dagStartTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.dagStartTime); - if (error) - return "dagStartTime." + error; - } - if (message.dagEndTime != null && message.hasOwnProperty("dagEndTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.dagEndTime); - if (error) - return "dagEndTime." + error; - } - return null; - }; - - /** - * Creates a WorkflowMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.WorkflowMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.WorkflowMetadata} WorkflowMetadata - */ - WorkflowMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.WorkflowMetadata) - return object; - var message = new $root.google.cloud.dataproc.v1.WorkflowMetadata(); - if (object.template != null) - message.template = String(object.template); - if (object.version != null) - message.version = object.version | 0; - if (object.createCluster != null) { - if (typeof object.createCluster !== "object") - throw TypeError(".google.cloud.dataproc.v1.WorkflowMetadata.createCluster: object expected"); - message.createCluster = $root.google.cloud.dataproc.v1.ClusterOperation.fromObject(object.createCluster); - } - if (object.graph != null) { - if (typeof object.graph !== "object") - throw TypeError(".google.cloud.dataproc.v1.WorkflowMetadata.graph: object expected"); - message.graph = $root.google.cloud.dataproc.v1.WorkflowGraph.fromObject(object.graph); - } - if (object.deleteCluster != null) { - if (typeof object.deleteCluster !== "object") - throw TypeError(".google.cloud.dataproc.v1.WorkflowMetadata.deleteCluster: object expected"); - message.deleteCluster = $root.google.cloud.dataproc.v1.ClusterOperation.fromObject(object.deleteCluster); - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "UNKNOWN": - case 0: - message.state = 0; - break; - case "PENDING": - case 1: - message.state = 1; - break; - case "RUNNING": - case 2: - message.state = 2; - break; - case "DONE": - case 3: - message.state = 3; - break; - } - if (object.clusterName != null) - message.clusterName = String(object.clusterName); - if (object.parameters) { - if (typeof object.parameters !== "object") - throw TypeError(".google.cloud.dataproc.v1.WorkflowMetadata.parameters: object expected"); - message.parameters = {}; - for (var keys = Object.keys(object.parameters), i = 0; i < keys.length; ++i) - message.parameters[keys[i]] = String(object.parameters[keys[i]]); - } - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.dataproc.v1.WorkflowMetadata.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.dataproc.v1.WorkflowMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.clusterUuid != null) - message.clusterUuid = String(object.clusterUuid); - if (object.dagTimeout != null) { - if (typeof object.dagTimeout !== "object") - throw TypeError(".google.cloud.dataproc.v1.WorkflowMetadata.dagTimeout: object expected"); - message.dagTimeout = $root.google.protobuf.Duration.fromObject(object.dagTimeout); - } - if (object.dagStartTime != null) { - if (typeof object.dagStartTime !== "object") - throw TypeError(".google.cloud.dataproc.v1.WorkflowMetadata.dagStartTime: object expected"); - message.dagStartTime = $root.google.protobuf.Timestamp.fromObject(object.dagStartTime); - } - if (object.dagEndTime != null) { - if (typeof object.dagEndTime !== "object") - throw TypeError(".google.cloud.dataproc.v1.WorkflowMetadata.dagEndTime: object expected"); - message.dagEndTime = $root.google.protobuf.Timestamp.fromObject(object.dagEndTime); - } - return message; - }; - - /** - * Creates a plain object from a WorkflowMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.WorkflowMetadata - * @static - * @param {google.cloud.dataproc.v1.WorkflowMetadata} message WorkflowMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WorkflowMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.parameters = {}; - if (options.defaults) { - object.template = ""; - object.version = 0; - object.createCluster = null; - object.graph = null; - object.deleteCluster = null; - object.state = options.enums === String ? "UNKNOWN" : 0; - object.clusterName = ""; - object.startTime = null; - object.endTime = null; - object.clusterUuid = ""; - object.dagTimeout = null; - object.dagStartTime = null; - object.dagEndTime = null; - } - if (message.template != null && message.hasOwnProperty("template")) - object.template = message.template; - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.createCluster != null && message.hasOwnProperty("createCluster")) - object.createCluster = $root.google.cloud.dataproc.v1.ClusterOperation.toObject(message.createCluster, options); - if (message.graph != null && message.hasOwnProperty("graph")) - object.graph = $root.google.cloud.dataproc.v1.WorkflowGraph.toObject(message.graph, options); - if (message.deleteCluster != null && message.hasOwnProperty("deleteCluster")) - object.deleteCluster = $root.google.cloud.dataproc.v1.ClusterOperation.toObject(message.deleteCluster, options); - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.dataproc.v1.WorkflowMetadata.State[message.state] === undefined ? message.state : $root.google.cloud.dataproc.v1.WorkflowMetadata.State[message.state] : message.state; - if (message.clusterName != null && message.hasOwnProperty("clusterName")) - object.clusterName = message.clusterName; - var keys2; - if (message.parameters && (keys2 = Object.keys(message.parameters)).length) { - object.parameters = {}; - for (var j = 0; j < keys2.length; ++j) - object.parameters[keys2[j]] = message.parameters[keys2[j]]; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.clusterUuid != null && message.hasOwnProperty("clusterUuid")) - object.clusterUuid = message.clusterUuid; - if (message.dagTimeout != null && message.hasOwnProperty("dagTimeout")) - object.dagTimeout = $root.google.protobuf.Duration.toObject(message.dagTimeout, options); - if (message.dagStartTime != null && message.hasOwnProperty("dagStartTime")) - object.dagStartTime = $root.google.protobuf.Timestamp.toObject(message.dagStartTime, options); - if (message.dagEndTime != null && message.hasOwnProperty("dagEndTime")) - object.dagEndTime = $root.google.protobuf.Timestamp.toObject(message.dagEndTime, options); - return object; - }; - - /** - * Converts this WorkflowMetadata to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.WorkflowMetadata - * @instance - * @returns {Object.} JSON object - */ - WorkflowMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WorkflowMetadata - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.WorkflowMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WorkflowMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.WorkflowMetadata"; - }; - - /** - * State enum. - * @name google.cloud.dataproc.v1.WorkflowMetadata.State - * @enum {number} - * @property {number} UNKNOWN=0 UNKNOWN value - * @property {number} PENDING=1 PENDING value - * @property {number} RUNNING=2 RUNNING value - * @property {number} DONE=3 DONE value - */ - WorkflowMetadata.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNKNOWN"] = 0; - values[valuesById[1] = "PENDING"] = 1; - values[valuesById[2] = "RUNNING"] = 2; - values[valuesById[3] = "DONE"] = 3; - return values; - })(); - - return WorkflowMetadata; - })(); - - v1.ClusterOperation = (function() { - - /** - * Properties of a ClusterOperation. - * @memberof google.cloud.dataproc.v1 - * @interface IClusterOperation - * @property {string|null} [operationId] ClusterOperation operationId - * @property {string|null} [error] ClusterOperation error - * @property {boolean|null} [done] ClusterOperation done - */ - - /** - * Constructs a new ClusterOperation. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a ClusterOperation. - * @implements IClusterOperation - * @constructor - * @param {google.cloud.dataproc.v1.IClusterOperation=} [properties] Properties to set - */ - function ClusterOperation(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClusterOperation operationId. - * @member {string} operationId - * @memberof google.cloud.dataproc.v1.ClusterOperation - * @instance - */ - ClusterOperation.prototype.operationId = ""; - - /** - * ClusterOperation error. - * @member {string} error - * @memberof google.cloud.dataproc.v1.ClusterOperation - * @instance - */ - ClusterOperation.prototype.error = ""; - - /** - * ClusterOperation done. - * @member {boolean} done - * @memberof google.cloud.dataproc.v1.ClusterOperation - * @instance - */ - ClusterOperation.prototype.done = false; - - /** - * Creates a new ClusterOperation instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.ClusterOperation - * @static - * @param {google.cloud.dataproc.v1.IClusterOperation=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.ClusterOperation} ClusterOperation instance - */ - ClusterOperation.create = function create(properties) { - return new ClusterOperation(properties); - }; - - /** - * Encodes the specified ClusterOperation message. Does not implicitly {@link google.cloud.dataproc.v1.ClusterOperation.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.ClusterOperation - * @static - * @param {google.cloud.dataproc.v1.IClusterOperation} message ClusterOperation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClusterOperation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.operationId != null && Object.hasOwnProperty.call(message, "operationId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.operationId); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.error); - if (message.done != null && Object.hasOwnProperty.call(message, "done")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); - return writer; - }; - - /** - * Encodes the specified ClusterOperation message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ClusterOperation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.ClusterOperation - * @static - * @param {google.cloud.dataproc.v1.IClusterOperation} message ClusterOperation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClusterOperation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClusterOperation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.ClusterOperation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.ClusterOperation} ClusterOperation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClusterOperation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ClusterOperation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.operationId = reader.string(); - break; - } - case 2: { - message.error = reader.string(); - break; - } - case 3: { - message.done = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ClusterOperation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.ClusterOperation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.ClusterOperation} ClusterOperation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClusterOperation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClusterOperation message. - * @function verify - * @memberof google.cloud.dataproc.v1.ClusterOperation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClusterOperation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.operationId != null && message.hasOwnProperty("operationId")) - if (!$util.isString(message.operationId)) - return "operationId: string expected"; - if (message.error != null && message.hasOwnProperty("error")) - if (!$util.isString(message.error)) - return "error: string expected"; - if (message.done != null && message.hasOwnProperty("done")) - if (typeof message.done !== "boolean") - return "done: boolean expected"; - return null; - }; - - /** - * Creates a ClusterOperation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.ClusterOperation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.ClusterOperation} ClusterOperation - */ - ClusterOperation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.ClusterOperation) - return object; - var message = new $root.google.cloud.dataproc.v1.ClusterOperation(); - if (object.operationId != null) - message.operationId = String(object.operationId); - if (object.error != null) - message.error = String(object.error); - if (object.done != null) - message.done = Boolean(object.done); - return message; - }; - - /** - * Creates a plain object from a ClusterOperation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.ClusterOperation - * @static - * @param {google.cloud.dataproc.v1.ClusterOperation} message ClusterOperation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClusterOperation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.operationId = ""; - object.error = ""; - object.done = false; - } - if (message.operationId != null && message.hasOwnProperty("operationId")) - object.operationId = message.operationId; - if (message.error != null && message.hasOwnProperty("error")) - object.error = message.error; - if (message.done != null && message.hasOwnProperty("done")) - object.done = message.done; - return object; - }; - - /** - * Converts this ClusterOperation to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.ClusterOperation - * @instance - * @returns {Object.} JSON object - */ - ClusterOperation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClusterOperation - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.ClusterOperation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClusterOperation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.ClusterOperation"; - }; - - return ClusterOperation; - })(); - - v1.WorkflowGraph = (function() { - - /** - * Properties of a WorkflowGraph. - * @memberof google.cloud.dataproc.v1 - * @interface IWorkflowGraph - * @property {Array.|null} [nodes] WorkflowGraph nodes - */ - - /** - * Constructs a new WorkflowGraph. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a WorkflowGraph. - * @implements IWorkflowGraph - * @constructor - * @param {google.cloud.dataproc.v1.IWorkflowGraph=} [properties] Properties to set - */ - function WorkflowGraph(properties) { - this.nodes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WorkflowGraph nodes. - * @member {Array.} nodes - * @memberof google.cloud.dataproc.v1.WorkflowGraph - * @instance - */ - WorkflowGraph.prototype.nodes = $util.emptyArray; - - /** - * Creates a new WorkflowGraph instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.WorkflowGraph - * @static - * @param {google.cloud.dataproc.v1.IWorkflowGraph=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.WorkflowGraph} WorkflowGraph instance - */ - WorkflowGraph.create = function create(properties) { - return new WorkflowGraph(properties); - }; - - /** - * Encodes the specified WorkflowGraph message. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowGraph.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.WorkflowGraph - * @static - * @param {google.cloud.dataproc.v1.IWorkflowGraph} message WorkflowGraph message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WorkflowGraph.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nodes != null && message.nodes.length) - for (var i = 0; i < message.nodes.length; ++i) - $root.google.cloud.dataproc.v1.WorkflowNode.encode(message.nodes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified WorkflowGraph message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowGraph.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.WorkflowGraph - * @static - * @param {google.cloud.dataproc.v1.IWorkflowGraph} message WorkflowGraph message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WorkflowGraph.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WorkflowGraph message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.WorkflowGraph - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.WorkflowGraph} WorkflowGraph - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WorkflowGraph.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.WorkflowGraph(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.nodes && message.nodes.length)) - message.nodes = []; - message.nodes.push($root.google.cloud.dataproc.v1.WorkflowNode.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WorkflowGraph message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.WorkflowGraph - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.WorkflowGraph} WorkflowGraph - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WorkflowGraph.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WorkflowGraph message. - * @function verify - * @memberof google.cloud.dataproc.v1.WorkflowGraph - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WorkflowGraph.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.nodes != null && message.hasOwnProperty("nodes")) { - if (!Array.isArray(message.nodes)) - return "nodes: array expected"; - for (var i = 0; i < message.nodes.length; ++i) { - var error = $root.google.cloud.dataproc.v1.WorkflowNode.verify(message.nodes[i]); - if (error) - return "nodes." + error; - } - } - return null; - }; - - /** - * Creates a WorkflowGraph message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.WorkflowGraph - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.WorkflowGraph} WorkflowGraph - */ - WorkflowGraph.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.WorkflowGraph) - return object; - var message = new $root.google.cloud.dataproc.v1.WorkflowGraph(); - if (object.nodes) { - if (!Array.isArray(object.nodes)) - throw TypeError(".google.cloud.dataproc.v1.WorkflowGraph.nodes: array expected"); - message.nodes = []; - for (var i = 0; i < object.nodes.length; ++i) { - if (typeof object.nodes[i] !== "object") - throw TypeError(".google.cloud.dataproc.v1.WorkflowGraph.nodes: object expected"); - message.nodes[i] = $root.google.cloud.dataproc.v1.WorkflowNode.fromObject(object.nodes[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a WorkflowGraph message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.WorkflowGraph - * @static - * @param {google.cloud.dataproc.v1.WorkflowGraph} message WorkflowGraph - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WorkflowGraph.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.nodes = []; - if (message.nodes && message.nodes.length) { - object.nodes = []; - for (var j = 0; j < message.nodes.length; ++j) - object.nodes[j] = $root.google.cloud.dataproc.v1.WorkflowNode.toObject(message.nodes[j], options); - } - return object; - }; - - /** - * Converts this WorkflowGraph to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.WorkflowGraph - * @instance - * @returns {Object.} JSON object - */ - WorkflowGraph.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WorkflowGraph - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.WorkflowGraph - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WorkflowGraph.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.WorkflowGraph"; - }; - - return WorkflowGraph; - })(); - - v1.WorkflowNode = (function() { - - /** - * Properties of a WorkflowNode. - * @memberof google.cloud.dataproc.v1 - * @interface IWorkflowNode - * @property {string|null} [stepId] WorkflowNode stepId - * @property {Array.|null} [prerequisiteStepIds] WorkflowNode prerequisiteStepIds - * @property {string|null} [jobId] WorkflowNode jobId - * @property {google.cloud.dataproc.v1.WorkflowNode.NodeState|null} [state] WorkflowNode state - * @property {string|null} [error] WorkflowNode error - */ - - /** - * Constructs a new WorkflowNode. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a WorkflowNode. - * @implements IWorkflowNode - * @constructor - * @param {google.cloud.dataproc.v1.IWorkflowNode=} [properties] Properties to set - */ - function WorkflowNode(properties) { - this.prerequisiteStepIds = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WorkflowNode stepId. - * @member {string} stepId - * @memberof google.cloud.dataproc.v1.WorkflowNode - * @instance - */ - WorkflowNode.prototype.stepId = ""; - - /** - * WorkflowNode prerequisiteStepIds. - * @member {Array.} prerequisiteStepIds - * @memberof google.cloud.dataproc.v1.WorkflowNode - * @instance - */ - WorkflowNode.prototype.prerequisiteStepIds = $util.emptyArray; - - /** - * WorkflowNode jobId. - * @member {string} jobId - * @memberof google.cloud.dataproc.v1.WorkflowNode - * @instance - */ - WorkflowNode.prototype.jobId = ""; - - /** - * WorkflowNode state. - * @member {google.cloud.dataproc.v1.WorkflowNode.NodeState} state - * @memberof google.cloud.dataproc.v1.WorkflowNode - * @instance - */ - WorkflowNode.prototype.state = 0; - - /** - * WorkflowNode error. - * @member {string} error - * @memberof google.cloud.dataproc.v1.WorkflowNode - * @instance - */ - WorkflowNode.prototype.error = ""; - - /** - * Creates a new WorkflowNode instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.WorkflowNode - * @static - * @param {google.cloud.dataproc.v1.IWorkflowNode=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.WorkflowNode} WorkflowNode instance - */ - WorkflowNode.create = function create(properties) { - return new WorkflowNode(properties); - }; - - /** - * Encodes the specified WorkflowNode message. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowNode.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.WorkflowNode - * @static - * @param {google.cloud.dataproc.v1.IWorkflowNode} message WorkflowNode message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WorkflowNode.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.stepId != null && Object.hasOwnProperty.call(message, "stepId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.stepId); - if (message.prerequisiteStepIds != null && message.prerequisiteStepIds.length) - for (var i = 0; i < message.prerequisiteStepIds.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.prerequisiteStepIds[i]); - if (message.jobId != null && Object.hasOwnProperty.call(message, "jobId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.jobId); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.error); - return writer; - }; - - /** - * Encodes the specified WorkflowNode message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.WorkflowNode.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.WorkflowNode - * @static - * @param {google.cloud.dataproc.v1.IWorkflowNode} message WorkflowNode message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WorkflowNode.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WorkflowNode message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.WorkflowNode - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.WorkflowNode} WorkflowNode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WorkflowNode.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.WorkflowNode(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.stepId = reader.string(); - break; - } - case 2: { - if (!(message.prerequisiteStepIds && message.prerequisiteStepIds.length)) - message.prerequisiteStepIds = []; - message.prerequisiteStepIds.push(reader.string()); - break; - } - case 3: { - message.jobId = reader.string(); - break; - } - case 5: { - message.state = reader.int32(); - break; - } - case 6: { - message.error = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WorkflowNode message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.WorkflowNode - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.WorkflowNode} WorkflowNode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WorkflowNode.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WorkflowNode message. - * @function verify - * @memberof google.cloud.dataproc.v1.WorkflowNode - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WorkflowNode.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.stepId != null && message.hasOwnProperty("stepId")) - if (!$util.isString(message.stepId)) - return "stepId: string expected"; - if (message.prerequisiteStepIds != null && message.hasOwnProperty("prerequisiteStepIds")) { - if (!Array.isArray(message.prerequisiteStepIds)) - return "prerequisiteStepIds: array expected"; - for (var i = 0; i < message.prerequisiteStepIds.length; ++i) - if (!$util.isString(message.prerequisiteStepIds[i])) - return "prerequisiteStepIds: string[] expected"; - } - if (message.jobId != null && message.hasOwnProperty("jobId")) - if (!$util.isString(message.jobId)) - return "jobId: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.error != null && message.hasOwnProperty("error")) - if (!$util.isString(message.error)) - return "error: string expected"; - return null; - }; - - /** - * Creates a WorkflowNode message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.WorkflowNode - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.WorkflowNode} WorkflowNode - */ - WorkflowNode.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.WorkflowNode) - return object; - var message = new $root.google.cloud.dataproc.v1.WorkflowNode(); - if (object.stepId != null) - message.stepId = String(object.stepId); - if (object.prerequisiteStepIds) { - if (!Array.isArray(object.prerequisiteStepIds)) - throw TypeError(".google.cloud.dataproc.v1.WorkflowNode.prerequisiteStepIds: array expected"); - message.prerequisiteStepIds = []; - for (var i = 0; i < object.prerequisiteStepIds.length; ++i) - message.prerequisiteStepIds[i] = String(object.prerequisiteStepIds[i]); - } - if (object.jobId != null) - message.jobId = String(object.jobId); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "NODE_STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "BLOCKED": - case 1: - message.state = 1; - break; - case "RUNNABLE": - case 2: - message.state = 2; - break; - case "RUNNING": - case 3: - message.state = 3; - break; - case "COMPLETED": - case 4: - message.state = 4; - break; - case "FAILED": - case 5: - message.state = 5; - break; - } - if (object.error != null) - message.error = String(object.error); - return message; - }; - - /** - * Creates a plain object from a WorkflowNode message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.WorkflowNode - * @static - * @param {google.cloud.dataproc.v1.WorkflowNode} message WorkflowNode - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WorkflowNode.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.prerequisiteStepIds = []; - if (options.defaults) { - object.stepId = ""; - object.jobId = ""; - object.state = options.enums === String ? "NODE_STATE_UNSPECIFIED" : 0; - object.error = ""; - } - if (message.stepId != null && message.hasOwnProperty("stepId")) - object.stepId = message.stepId; - if (message.prerequisiteStepIds && message.prerequisiteStepIds.length) { - object.prerequisiteStepIds = []; - for (var j = 0; j < message.prerequisiteStepIds.length; ++j) - object.prerequisiteStepIds[j] = message.prerequisiteStepIds[j]; - } - if (message.jobId != null && message.hasOwnProperty("jobId")) - object.jobId = message.jobId; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.dataproc.v1.WorkflowNode.NodeState[message.state] === undefined ? message.state : $root.google.cloud.dataproc.v1.WorkflowNode.NodeState[message.state] : message.state; - if (message.error != null && message.hasOwnProperty("error")) - object.error = message.error; - return object; - }; - - /** - * Converts this WorkflowNode to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.WorkflowNode - * @instance - * @returns {Object.} JSON object - */ - WorkflowNode.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WorkflowNode - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.WorkflowNode - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WorkflowNode.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.WorkflowNode"; - }; - - /** - * NodeState enum. - * @name google.cloud.dataproc.v1.WorkflowNode.NodeState - * @enum {number} - * @property {number} NODE_STATE_UNSPECIFIED=0 NODE_STATE_UNSPECIFIED value - * @property {number} BLOCKED=1 BLOCKED value - * @property {number} RUNNABLE=2 RUNNABLE value - * @property {number} RUNNING=3 RUNNING value - * @property {number} COMPLETED=4 COMPLETED value - * @property {number} FAILED=5 FAILED value - */ - WorkflowNode.NodeState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NODE_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "BLOCKED"] = 1; - values[valuesById[2] = "RUNNABLE"] = 2; - values[valuesById[3] = "RUNNING"] = 3; - values[valuesById[4] = "COMPLETED"] = 4; - values[valuesById[5] = "FAILED"] = 5; - return values; - })(); - - return WorkflowNode; - })(); - - v1.CreateWorkflowTemplateRequest = (function() { - - /** - * Properties of a CreateWorkflowTemplateRequest. - * @memberof google.cloud.dataproc.v1 - * @interface ICreateWorkflowTemplateRequest - * @property {string|null} [parent] CreateWorkflowTemplateRequest parent - * @property {google.cloud.dataproc.v1.IWorkflowTemplate|null} [template] CreateWorkflowTemplateRequest template - */ - - /** - * Constructs a new CreateWorkflowTemplateRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a CreateWorkflowTemplateRequest. - * @implements ICreateWorkflowTemplateRequest - * @constructor - * @param {google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest=} [properties] Properties to set - */ - function CreateWorkflowTemplateRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateWorkflowTemplateRequest parent. - * @member {string} parent - * @memberof google.cloud.dataproc.v1.CreateWorkflowTemplateRequest - * @instance - */ - CreateWorkflowTemplateRequest.prototype.parent = ""; - - /** - * CreateWorkflowTemplateRequest template. - * @member {google.cloud.dataproc.v1.IWorkflowTemplate|null|undefined} template - * @memberof google.cloud.dataproc.v1.CreateWorkflowTemplateRequest - * @instance - */ - CreateWorkflowTemplateRequest.prototype.template = null; - - /** - * Creates a new CreateWorkflowTemplateRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.CreateWorkflowTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.CreateWorkflowTemplateRequest} CreateWorkflowTemplateRequest instance - */ - CreateWorkflowTemplateRequest.create = function create(properties) { - return new CreateWorkflowTemplateRequest(properties); - }; - - /** - * Encodes the specified CreateWorkflowTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.CreateWorkflowTemplateRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.CreateWorkflowTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest} message CreateWorkflowTemplateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateWorkflowTemplateRequest.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.template != null && Object.hasOwnProperty.call(message, "template")) - $root.google.cloud.dataproc.v1.WorkflowTemplate.encode(message.template, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CreateWorkflowTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.CreateWorkflowTemplateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.CreateWorkflowTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest} message CreateWorkflowTemplateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateWorkflowTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateWorkflowTemplateRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.CreateWorkflowTemplateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.CreateWorkflowTemplateRequest} CreateWorkflowTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateWorkflowTemplateRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest(); - 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.template = $root.google.cloud.dataproc.v1.WorkflowTemplate.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateWorkflowTemplateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.CreateWorkflowTemplateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.CreateWorkflowTemplateRequest} CreateWorkflowTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateWorkflowTemplateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateWorkflowTemplateRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.CreateWorkflowTemplateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateWorkflowTemplateRequest.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.template != null && message.hasOwnProperty("template")) { - var error = $root.google.cloud.dataproc.v1.WorkflowTemplate.verify(message.template); - if (error) - return "template." + error; - } - return null; - }; - - /** - * Creates a CreateWorkflowTemplateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.CreateWorkflowTemplateRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.CreateWorkflowTemplateRequest} CreateWorkflowTemplateRequest - */ - CreateWorkflowTemplateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.template != null) { - if (typeof object.template !== "object") - throw TypeError(".google.cloud.dataproc.v1.CreateWorkflowTemplateRequest.template: object expected"); - message.template = $root.google.cloud.dataproc.v1.WorkflowTemplate.fromObject(object.template); - } - return message; - }; - - /** - * Creates a plain object from a CreateWorkflowTemplateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.CreateWorkflowTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.CreateWorkflowTemplateRequest} message CreateWorkflowTemplateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateWorkflowTemplateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.template = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.template != null && message.hasOwnProperty("template")) - object.template = $root.google.cloud.dataproc.v1.WorkflowTemplate.toObject(message.template, options); - return object; - }; - - /** - * Converts this CreateWorkflowTemplateRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.CreateWorkflowTemplateRequest - * @instance - * @returns {Object.} JSON object - */ - CreateWorkflowTemplateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateWorkflowTemplateRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.CreateWorkflowTemplateRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateWorkflowTemplateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.CreateWorkflowTemplateRequest"; - }; - - return CreateWorkflowTemplateRequest; - })(); - - v1.GetWorkflowTemplateRequest = (function() { - - /** - * Properties of a GetWorkflowTemplateRequest. - * @memberof google.cloud.dataproc.v1 - * @interface IGetWorkflowTemplateRequest - * @property {string|null} [name] GetWorkflowTemplateRequest name - * @property {number|null} [version] GetWorkflowTemplateRequest version - */ - - /** - * Constructs a new GetWorkflowTemplateRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a GetWorkflowTemplateRequest. - * @implements IGetWorkflowTemplateRequest - * @constructor - * @param {google.cloud.dataproc.v1.IGetWorkflowTemplateRequest=} [properties] Properties to set - */ - function GetWorkflowTemplateRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetWorkflowTemplateRequest name. - * @member {string} name - * @memberof google.cloud.dataproc.v1.GetWorkflowTemplateRequest - * @instance - */ - GetWorkflowTemplateRequest.prototype.name = ""; - - /** - * GetWorkflowTemplateRequest version. - * @member {number} version - * @memberof google.cloud.dataproc.v1.GetWorkflowTemplateRequest - * @instance - */ - GetWorkflowTemplateRequest.prototype.version = 0; - - /** - * Creates a new GetWorkflowTemplateRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.GetWorkflowTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.IGetWorkflowTemplateRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.GetWorkflowTemplateRequest} GetWorkflowTemplateRequest instance - */ - GetWorkflowTemplateRequest.create = function create(properties) { - return new GetWorkflowTemplateRequest(properties); - }; - - /** - * Encodes the specified GetWorkflowTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.GetWorkflowTemplateRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.GetWorkflowTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.IGetWorkflowTemplateRequest} message GetWorkflowTemplateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetWorkflowTemplateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.version); - return writer; - }; - - /** - * Encodes the specified GetWorkflowTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.GetWorkflowTemplateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.GetWorkflowTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.IGetWorkflowTemplateRequest} message GetWorkflowTemplateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetWorkflowTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetWorkflowTemplateRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.GetWorkflowTemplateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.GetWorkflowTemplateRequest} GetWorkflowTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetWorkflowTemplateRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.GetWorkflowTemplateRequest(); - 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.version = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetWorkflowTemplateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.GetWorkflowTemplateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.GetWorkflowTemplateRequest} GetWorkflowTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetWorkflowTemplateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetWorkflowTemplateRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.GetWorkflowTemplateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetWorkflowTemplateRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isInteger(message.version)) - return "version: integer expected"; - return null; - }; - - /** - * Creates a GetWorkflowTemplateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.GetWorkflowTemplateRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.GetWorkflowTemplateRequest} GetWorkflowTemplateRequest - */ - GetWorkflowTemplateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.GetWorkflowTemplateRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.GetWorkflowTemplateRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.version != null) - message.version = object.version | 0; - return message; - }; - - /** - * Creates a plain object from a GetWorkflowTemplateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.GetWorkflowTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.GetWorkflowTemplateRequest} message GetWorkflowTemplateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetWorkflowTemplateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.version = 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - return object; - }; - - /** - * Converts this GetWorkflowTemplateRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.GetWorkflowTemplateRequest - * @instance - * @returns {Object.} JSON object - */ - GetWorkflowTemplateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetWorkflowTemplateRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.GetWorkflowTemplateRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetWorkflowTemplateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.GetWorkflowTemplateRequest"; - }; - - return GetWorkflowTemplateRequest; - })(); - - v1.InstantiateWorkflowTemplateRequest = (function() { - - /** - * Properties of an InstantiateWorkflowTemplateRequest. - * @memberof google.cloud.dataproc.v1 - * @interface IInstantiateWorkflowTemplateRequest - * @property {string|null} [name] InstantiateWorkflowTemplateRequest name - * @property {number|null} [version] InstantiateWorkflowTemplateRequest version - * @property {string|null} [requestId] InstantiateWorkflowTemplateRequest requestId - * @property {Object.|null} [parameters] InstantiateWorkflowTemplateRequest parameters - */ - - /** - * Constructs a new InstantiateWorkflowTemplateRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents an InstantiateWorkflowTemplateRequest. - * @implements IInstantiateWorkflowTemplateRequest - * @constructor - * @param {google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest=} [properties] Properties to set - */ - function InstantiateWorkflowTemplateRequest(properties) { - this.parameters = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstantiateWorkflowTemplateRequest name. - * @member {string} name - * @memberof google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest - * @instance - */ - InstantiateWorkflowTemplateRequest.prototype.name = ""; - - /** - * InstantiateWorkflowTemplateRequest version. - * @member {number} version - * @memberof google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest - * @instance - */ - InstantiateWorkflowTemplateRequest.prototype.version = 0; - - /** - * InstantiateWorkflowTemplateRequest requestId. - * @member {string} requestId - * @memberof google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest - * @instance - */ - InstantiateWorkflowTemplateRequest.prototype.requestId = ""; - - /** - * InstantiateWorkflowTemplateRequest parameters. - * @member {Object.} parameters - * @memberof google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest - * @instance - */ - InstantiateWorkflowTemplateRequest.prototype.parameters = $util.emptyObject; - - /** - * Creates a new InstantiateWorkflowTemplateRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest} InstantiateWorkflowTemplateRequest instance - */ - InstantiateWorkflowTemplateRequest.create = function create(properties) { - return new InstantiateWorkflowTemplateRequest(properties); - }; - - /** - * Encodes the specified InstantiateWorkflowTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest} message InstantiateWorkflowTemplateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstantiateWorkflowTemplateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.version); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.requestId); - if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) - for (var keys = Object.keys(message.parameters), 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.parameters[keys[i]]).ldelim(); - return writer; - }; - - /** - * Encodes the specified InstantiateWorkflowTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest} message InstantiateWorkflowTemplateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstantiateWorkflowTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstantiateWorkflowTemplateRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest} InstantiateWorkflowTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstantiateWorkflowTemplateRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest(), 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.version = reader.int32(); - break; - } - case 5: { - message.requestId = reader.string(); - break; - } - case 6: { - if (message.parameters === $util.emptyObject) - message.parameters = {}; - 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.parameters[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstantiateWorkflowTemplateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest} InstantiateWorkflowTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstantiateWorkflowTemplateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstantiateWorkflowTemplateRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstantiateWorkflowTemplateRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isInteger(message.version)) - return "version: integer expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.parameters != null && message.hasOwnProperty("parameters")) { - if (!$util.isObject(message.parameters)) - return "parameters: object expected"; - var key = Object.keys(message.parameters); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.parameters[key[i]])) - return "parameters: string{k:string} expected"; - } - return null; - }; - - /** - * Creates an InstantiateWorkflowTemplateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest} InstantiateWorkflowTemplateRequest - */ - InstantiateWorkflowTemplateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.version != null) - message.version = object.version | 0; - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.parameters) { - if (typeof object.parameters !== "object") - throw TypeError(".google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest.parameters: object expected"); - message.parameters = {}; - for (var keys = Object.keys(object.parameters), i = 0; i < keys.length; ++i) - message.parameters[keys[i]] = String(object.parameters[keys[i]]); - } - return message; - }; - - /** - * Creates a plain object from an InstantiateWorkflowTemplateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest} message InstantiateWorkflowTemplateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstantiateWorkflowTemplateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.parameters = {}; - if (options.defaults) { - object.name = ""; - object.version = 0; - object.requestId = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - var keys2; - if (message.parameters && (keys2 = Object.keys(message.parameters)).length) { - object.parameters = {}; - for (var j = 0; j < keys2.length; ++j) - object.parameters[keys2[j]] = message.parameters[keys2[j]]; - } - return object; - }; - - /** - * Converts this InstantiateWorkflowTemplateRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest - * @instance - * @returns {Object.} JSON object - */ - InstantiateWorkflowTemplateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InstantiateWorkflowTemplateRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstantiateWorkflowTemplateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest"; - }; - - return InstantiateWorkflowTemplateRequest; - })(); - - v1.InstantiateInlineWorkflowTemplateRequest = (function() { - - /** - * Properties of an InstantiateInlineWorkflowTemplateRequest. - * @memberof google.cloud.dataproc.v1 - * @interface IInstantiateInlineWorkflowTemplateRequest - * @property {string|null} [parent] InstantiateInlineWorkflowTemplateRequest parent - * @property {google.cloud.dataproc.v1.IWorkflowTemplate|null} [template] InstantiateInlineWorkflowTemplateRequest template - * @property {string|null} [requestId] InstantiateInlineWorkflowTemplateRequest requestId - */ - - /** - * Constructs a new InstantiateInlineWorkflowTemplateRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents an InstantiateInlineWorkflowTemplateRequest. - * @implements IInstantiateInlineWorkflowTemplateRequest - * @constructor - * @param {google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest=} [properties] Properties to set - */ - function InstantiateInlineWorkflowTemplateRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstantiateInlineWorkflowTemplateRequest parent. - * @member {string} parent - * @memberof google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest - * @instance - */ - InstantiateInlineWorkflowTemplateRequest.prototype.parent = ""; - - /** - * InstantiateInlineWorkflowTemplateRequest template. - * @member {google.cloud.dataproc.v1.IWorkflowTemplate|null|undefined} template - * @memberof google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest - * @instance - */ - InstantiateInlineWorkflowTemplateRequest.prototype.template = null; - - /** - * InstantiateInlineWorkflowTemplateRequest requestId. - * @member {string} requestId - * @memberof google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest - * @instance - */ - InstantiateInlineWorkflowTemplateRequest.prototype.requestId = ""; - - /** - * Creates a new InstantiateInlineWorkflowTemplateRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest} InstantiateInlineWorkflowTemplateRequest instance - */ - InstantiateInlineWorkflowTemplateRequest.create = function create(properties) { - return new InstantiateInlineWorkflowTemplateRequest(properties); - }; - - /** - * Encodes the specified InstantiateInlineWorkflowTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest} message InstantiateInlineWorkflowTemplateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstantiateInlineWorkflowTemplateRequest.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.template != null && Object.hasOwnProperty.call(message, "template")) - $root.google.cloud.dataproc.v1.WorkflowTemplate.encode(message.template, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified InstantiateInlineWorkflowTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest} message InstantiateInlineWorkflowTemplateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstantiateInlineWorkflowTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstantiateInlineWorkflowTemplateRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest} InstantiateInlineWorkflowTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstantiateInlineWorkflowTemplateRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest(); - 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.template = $root.google.cloud.dataproc.v1.WorkflowTemplate.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstantiateInlineWorkflowTemplateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest} InstantiateInlineWorkflowTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstantiateInlineWorkflowTemplateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstantiateInlineWorkflowTemplateRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstantiateInlineWorkflowTemplateRequest.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.template != null && message.hasOwnProperty("template")) { - var error = $root.google.cloud.dataproc.v1.WorkflowTemplate.verify(message.template); - if (error) - return "template." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates an InstantiateInlineWorkflowTemplateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest} InstantiateInlineWorkflowTemplateRequest - */ - InstantiateInlineWorkflowTemplateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.template != null) { - if (typeof object.template !== "object") - throw TypeError(".google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest.template: object expected"); - message.template = $root.google.cloud.dataproc.v1.WorkflowTemplate.fromObject(object.template); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from an InstantiateInlineWorkflowTemplateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest} message InstantiateInlineWorkflowTemplateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstantiateInlineWorkflowTemplateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.template = null; - object.requestId = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.template != null && message.hasOwnProperty("template")) - object.template = $root.google.cloud.dataproc.v1.WorkflowTemplate.toObject(message.template, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this InstantiateInlineWorkflowTemplateRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest - * @instance - * @returns {Object.} JSON object - */ - InstantiateInlineWorkflowTemplateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InstantiateInlineWorkflowTemplateRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstantiateInlineWorkflowTemplateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest"; - }; - - return InstantiateInlineWorkflowTemplateRequest; - })(); - - v1.UpdateWorkflowTemplateRequest = (function() { - - /** - * Properties of an UpdateWorkflowTemplateRequest. - * @memberof google.cloud.dataproc.v1 - * @interface IUpdateWorkflowTemplateRequest - * @property {google.cloud.dataproc.v1.IWorkflowTemplate|null} [template] UpdateWorkflowTemplateRequest template - */ - - /** - * Constructs a new UpdateWorkflowTemplateRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents an UpdateWorkflowTemplateRequest. - * @implements IUpdateWorkflowTemplateRequest - * @constructor - * @param {google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest=} [properties] Properties to set - */ - function UpdateWorkflowTemplateRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateWorkflowTemplateRequest template. - * @member {google.cloud.dataproc.v1.IWorkflowTemplate|null|undefined} template - * @memberof google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest - * @instance - */ - UpdateWorkflowTemplateRequest.prototype.template = null; - - /** - * Creates a new UpdateWorkflowTemplateRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest} UpdateWorkflowTemplateRequest instance - */ - UpdateWorkflowTemplateRequest.create = function create(properties) { - return new UpdateWorkflowTemplateRequest(properties); - }; - - /** - * Encodes the specified UpdateWorkflowTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest} message UpdateWorkflowTemplateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateWorkflowTemplateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.template != null && Object.hasOwnProperty.call(message, "template")) - $root.google.cloud.dataproc.v1.WorkflowTemplate.encode(message.template, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateWorkflowTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest} message UpdateWorkflowTemplateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateWorkflowTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateWorkflowTemplateRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest} UpdateWorkflowTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateWorkflowTemplateRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.template = $root.google.cloud.dataproc.v1.WorkflowTemplate.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateWorkflowTemplateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest} UpdateWorkflowTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateWorkflowTemplateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateWorkflowTemplateRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateWorkflowTemplateRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.template != null && message.hasOwnProperty("template")) { - var error = $root.google.cloud.dataproc.v1.WorkflowTemplate.verify(message.template); - if (error) - return "template." + error; - } - return null; - }; - - /** - * Creates an UpdateWorkflowTemplateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest} UpdateWorkflowTemplateRequest - */ - UpdateWorkflowTemplateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest(); - if (object.template != null) { - if (typeof object.template !== "object") - throw TypeError(".google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest.template: object expected"); - message.template = $root.google.cloud.dataproc.v1.WorkflowTemplate.fromObject(object.template); - } - return message; - }; - - /** - * Creates a plain object from an UpdateWorkflowTemplateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest} message UpdateWorkflowTemplateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateWorkflowTemplateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.template = null; - if (message.template != null && message.hasOwnProperty("template")) - object.template = $root.google.cloud.dataproc.v1.WorkflowTemplate.toObject(message.template, options); - return object; - }; - - /** - * Converts this UpdateWorkflowTemplateRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateWorkflowTemplateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateWorkflowTemplateRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateWorkflowTemplateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest"; - }; - - return UpdateWorkflowTemplateRequest; - })(); - - v1.ListWorkflowTemplatesRequest = (function() { - - /** - * Properties of a ListWorkflowTemplatesRequest. - * @memberof google.cloud.dataproc.v1 - * @interface IListWorkflowTemplatesRequest - * @property {string|null} [parent] ListWorkflowTemplatesRequest parent - * @property {number|null} [pageSize] ListWorkflowTemplatesRequest pageSize - * @property {string|null} [pageToken] ListWorkflowTemplatesRequest pageToken - */ - - /** - * Constructs a new ListWorkflowTemplatesRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a ListWorkflowTemplatesRequest. - * @implements IListWorkflowTemplatesRequest - * @constructor - * @param {google.cloud.dataproc.v1.IListWorkflowTemplatesRequest=} [properties] Properties to set - */ - function ListWorkflowTemplatesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListWorkflowTemplatesRequest parent. - * @member {string} parent - * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesRequest - * @instance - */ - ListWorkflowTemplatesRequest.prototype.parent = ""; - - /** - * ListWorkflowTemplatesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesRequest - * @instance - */ - ListWorkflowTemplatesRequest.prototype.pageSize = 0; - - /** - * ListWorkflowTemplatesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesRequest - * @instance - */ - ListWorkflowTemplatesRequest.prototype.pageToken = ""; - - /** - * Creates a new ListWorkflowTemplatesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesRequest - * @static - * @param {google.cloud.dataproc.v1.IListWorkflowTemplatesRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.ListWorkflowTemplatesRequest} ListWorkflowTemplatesRequest instance - */ - ListWorkflowTemplatesRequest.create = function create(properties) { - return new ListWorkflowTemplatesRequest(properties); - }; - - /** - * Encodes the specified ListWorkflowTemplatesRequest message. Does not implicitly {@link google.cloud.dataproc.v1.ListWorkflowTemplatesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesRequest - * @static - * @param {google.cloud.dataproc.v1.IListWorkflowTemplatesRequest} message ListWorkflowTemplatesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListWorkflowTemplatesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - return writer; - }; - - /** - * Encodes the specified ListWorkflowTemplatesRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListWorkflowTemplatesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesRequest - * @static - * @param {google.cloud.dataproc.v1.IListWorkflowTemplatesRequest} message ListWorkflowTemplatesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListWorkflowTemplatesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListWorkflowTemplatesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.ListWorkflowTemplatesRequest} ListWorkflowTemplatesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListWorkflowTemplatesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListWorkflowTemplatesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.ListWorkflowTemplatesRequest} ListWorkflowTemplatesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListWorkflowTemplatesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListWorkflowTemplatesRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListWorkflowTemplatesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListWorkflowTemplatesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.ListWorkflowTemplatesRequest} ListWorkflowTemplatesRequest - */ - ListWorkflowTemplatesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListWorkflowTemplatesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesRequest - * @static - * @param {google.cloud.dataproc.v1.ListWorkflowTemplatesRequest} message ListWorkflowTemplatesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListWorkflowTemplatesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListWorkflowTemplatesRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesRequest - * @instance - * @returns {Object.} JSON object - */ - ListWorkflowTemplatesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListWorkflowTemplatesRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListWorkflowTemplatesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.ListWorkflowTemplatesRequest"; - }; - - return ListWorkflowTemplatesRequest; - })(); - - v1.ListWorkflowTemplatesResponse = (function() { - - /** - * Properties of a ListWorkflowTemplatesResponse. - * @memberof google.cloud.dataproc.v1 - * @interface IListWorkflowTemplatesResponse - * @property {Array.|null} [templates] ListWorkflowTemplatesResponse templates - * @property {string|null} [nextPageToken] ListWorkflowTemplatesResponse nextPageToken - * @property {Array.|null} [unreachable] ListWorkflowTemplatesResponse unreachable - */ - - /** - * Constructs a new ListWorkflowTemplatesResponse. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a ListWorkflowTemplatesResponse. - * @implements IListWorkflowTemplatesResponse - * @constructor - * @param {google.cloud.dataproc.v1.IListWorkflowTemplatesResponse=} [properties] Properties to set - */ - function ListWorkflowTemplatesResponse(properties) { - this.templates = []; - 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]]; - } - - /** - * ListWorkflowTemplatesResponse templates. - * @member {Array.} templates - * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesResponse - * @instance - */ - ListWorkflowTemplatesResponse.prototype.templates = $util.emptyArray; - - /** - * ListWorkflowTemplatesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesResponse - * @instance - */ - ListWorkflowTemplatesResponse.prototype.nextPageToken = ""; - - /** - * ListWorkflowTemplatesResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesResponse - * @instance - */ - ListWorkflowTemplatesResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListWorkflowTemplatesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesResponse - * @static - * @param {google.cloud.dataproc.v1.IListWorkflowTemplatesResponse=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.ListWorkflowTemplatesResponse} ListWorkflowTemplatesResponse instance - */ - ListWorkflowTemplatesResponse.create = function create(properties) { - return new ListWorkflowTemplatesResponse(properties); - }; - - /** - * Encodes the specified ListWorkflowTemplatesResponse message. Does not implicitly {@link google.cloud.dataproc.v1.ListWorkflowTemplatesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesResponse - * @static - * @param {google.cloud.dataproc.v1.IListWorkflowTemplatesResponse} message ListWorkflowTemplatesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListWorkflowTemplatesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.templates != null && message.templates.length) - for (var i = 0; i < message.templates.length; ++i) - $root.google.cloud.dataproc.v1.WorkflowTemplate.encode(message.templates[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 ListWorkflowTemplatesResponse message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.ListWorkflowTemplatesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesResponse - * @static - * @param {google.cloud.dataproc.v1.IListWorkflowTemplatesResponse} message ListWorkflowTemplatesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListWorkflowTemplatesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListWorkflowTemplatesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.ListWorkflowTemplatesResponse} ListWorkflowTemplatesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListWorkflowTemplatesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.ListWorkflowTemplatesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.templates && message.templates.length)) - message.templates = []; - message.templates.push($root.google.cloud.dataproc.v1.WorkflowTemplate.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 ListWorkflowTemplatesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.ListWorkflowTemplatesResponse} ListWorkflowTemplatesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListWorkflowTemplatesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListWorkflowTemplatesResponse message. - * @function verify - * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListWorkflowTemplatesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.templates != null && message.hasOwnProperty("templates")) { - if (!Array.isArray(message.templates)) - return "templates: array expected"; - for (var i = 0; i < message.templates.length; ++i) { - var error = $root.google.cloud.dataproc.v1.WorkflowTemplate.verify(message.templates[i]); - if (error) - return "templates." + 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 ListWorkflowTemplatesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.ListWorkflowTemplatesResponse} ListWorkflowTemplatesResponse - */ - ListWorkflowTemplatesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.ListWorkflowTemplatesResponse) - return object; - var message = new $root.google.cloud.dataproc.v1.ListWorkflowTemplatesResponse(); - if (object.templates) { - if (!Array.isArray(object.templates)) - throw TypeError(".google.cloud.dataproc.v1.ListWorkflowTemplatesResponse.templates: array expected"); - message.templates = []; - for (var i = 0; i < object.templates.length; ++i) { - if (typeof object.templates[i] !== "object") - throw TypeError(".google.cloud.dataproc.v1.ListWorkflowTemplatesResponse.templates: object expected"); - message.templates[i] = $root.google.cloud.dataproc.v1.WorkflowTemplate.fromObject(object.templates[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.dataproc.v1.ListWorkflowTemplatesResponse.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 ListWorkflowTemplatesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesResponse - * @static - * @param {google.cloud.dataproc.v1.ListWorkflowTemplatesResponse} message ListWorkflowTemplatesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListWorkflowTemplatesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.templates = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.templates && message.templates.length) { - object.templates = []; - for (var j = 0; j < message.templates.length; ++j) - object.templates[j] = $root.google.cloud.dataproc.v1.WorkflowTemplate.toObject(message.templates[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 ListWorkflowTemplatesResponse to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesResponse - * @instance - * @returns {Object.} JSON object - */ - ListWorkflowTemplatesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListWorkflowTemplatesResponse - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.ListWorkflowTemplatesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListWorkflowTemplatesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.ListWorkflowTemplatesResponse"; - }; - - return ListWorkflowTemplatesResponse; - })(); - - v1.DeleteWorkflowTemplateRequest = (function() { - - /** - * Properties of a DeleteWorkflowTemplateRequest. - * @memberof google.cloud.dataproc.v1 - * @interface IDeleteWorkflowTemplateRequest - * @property {string|null} [name] DeleteWorkflowTemplateRequest name - * @property {number|null} [version] DeleteWorkflowTemplateRequest version - */ - - /** - * Constructs a new DeleteWorkflowTemplateRequest. - * @memberof google.cloud.dataproc.v1 - * @classdesc Represents a DeleteWorkflowTemplateRequest. - * @implements IDeleteWorkflowTemplateRequest - * @constructor - * @param {google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest=} [properties] Properties to set - */ - function DeleteWorkflowTemplateRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteWorkflowTemplateRequest name. - * @member {string} name - * @memberof google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest - * @instance - */ - DeleteWorkflowTemplateRequest.prototype.name = ""; - - /** - * DeleteWorkflowTemplateRequest version. - * @member {number} version - * @memberof google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest - * @instance - */ - DeleteWorkflowTemplateRequest.prototype.version = 0; - - /** - * Creates a new DeleteWorkflowTemplateRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest=} [properties] Properties to set - * @returns {google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest} DeleteWorkflowTemplateRequest instance - */ - DeleteWorkflowTemplateRequest.create = function create(properties) { - return new DeleteWorkflowTemplateRequest(properties); - }; - - /** - * Encodes the specified DeleteWorkflowTemplateRequest message. Does not implicitly {@link google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest} message DeleteWorkflowTemplateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteWorkflowTemplateRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.version); - return writer; - }; - - /** - * Encodes the specified DeleteWorkflowTemplateRequest message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest} message DeleteWorkflowTemplateRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteWorkflowTemplateRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteWorkflowTemplateRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest} DeleteWorkflowTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteWorkflowTemplateRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest(); - 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.version = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteWorkflowTemplateRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest} DeleteWorkflowTemplateRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteWorkflowTemplateRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteWorkflowTemplateRequest message. - * @function verify - * @memberof google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteWorkflowTemplateRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isInteger(message.version)) - return "version: integer expected"; - return null; - }; - - /** - * Creates a DeleteWorkflowTemplateRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest} DeleteWorkflowTemplateRequest - */ - DeleteWorkflowTemplateRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest) - return object; - var message = new $root.google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.version != null) - message.version = object.version | 0; - return message; - }; - - /** - * Creates a plain object from a DeleteWorkflowTemplateRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest - * @static - * @param {google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest} message DeleteWorkflowTemplateRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteWorkflowTemplateRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.version = 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - return object; - }; - - /** - * Converts this DeleteWorkflowTemplateRequest to JSON. - * @function toJSON - * @memberof google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteWorkflowTemplateRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteWorkflowTemplateRequest - * @function getTypeUrl - * @memberof google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteWorkflowTemplateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest"; - }; - - return DeleteWorkflowTemplateRequest; - })(); - - return v1; - })(); - - return dataproc; - })(); - - 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; - })(); - - return api; - })(); - - google.protobuf = (function() { - - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; - - protobuf.FileDescriptorSet = (function() { - - /** - * Properties of a FileDescriptorSet. - * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file - */ - - /** - * Constructs a new FileDescriptorSet. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorSet. - * @implements IFileDescriptorSet - * @constructor - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - */ - function FileDescriptorSet(properties) { - this.file = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet - * @instance - */ - FileDescriptorSet.prototype.file = $util.emptyArray; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance - */ - FileDescriptorSet.create = function create(properties) { - return new FileDescriptorSet(properties); - }; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.file != null && message.file.length) - for (var i = 0; i < message.file.length; ++i) - $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.file && message.file.length)) - message.file = []; - message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorSet message. - * @function verify - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.file != null && message.hasOwnProperty("file")) { - if (!Array.isArray(message.file)) - return "file: array expected"; - for (var i = 0; i < message.file.length; ++i) { - var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); - if (error) - return "file." + error; - } - } - return null; - }; - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - */ - FileDescriptorSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorSet) - return object; - var message = new $root.google.protobuf.FileDescriptorSet(); - if (object.file) { - if (!Array.isArray(object.file)) - throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); - message.file = []; - for (var i = 0; i < object.file.length; ++i) { - if (typeof object.file[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); - message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.file = []; - if (message.file && message.file.length) { - object.file = []; - for (var j = 0; j < message.file.length; ++j) - object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); - } - return object; - }; - - /** - * Converts this FileDescriptorSet to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorSet - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorSet - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; - }; - - return FileDescriptorSet; - })(); - - /** - * Edition enum. - * @name google.protobuf.Edition - * @enum {number} - * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value - * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value - * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value - * @property {number} EDITION_2023=1000 EDITION_2023 value - * @property {number} EDITION_2024=1001 EDITION_2024 value - * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value - * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value - * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value - * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value - * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value - * @property {number} EDITION_MAX=2147483647 EDITION_MAX value - */ - protobuf.Edition = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EDITION_UNKNOWN"] = 0; - values[valuesById[998] = "EDITION_PROTO2"] = 998; - values[valuesById[999] = "EDITION_PROTO3"] = 999; - values[valuesById[1000] = "EDITION_2023"] = 1000; - values[valuesById[1001] = "EDITION_2024"] = 1001; - values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; - values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; - values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; - values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; - values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; - values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; - return values; - })(); - - protobuf.FileDescriptorProto = (function() { - - /** - * Properties of a FileDescriptorProto. - * @memberof google.protobuf - * @interface IFileDescriptorProto - * @property {string|null} [name] FileDescriptorProto name - * @property {string|null} ["package"] FileDescriptorProto package - * @property {Array.|null} [dependency] FileDescriptorProto dependency - * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency - * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency - * @property {Array.|null} [messageType] FileDescriptorProto messageType - * @property {Array.|null} [enumType] FileDescriptorProto enumType - * @property {Array.|null} [service] FileDescriptorProto service - * @property {Array.|null} [extension] FileDescriptorProto extension - * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options - * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo - * @property {string|null} [syntax] FileDescriptorProto syntax - * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition - */ - - /** - * Constructs a new FileDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorProto. - * @implements IFileDescriptorProto - * @constructor - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - */ - function FileDescriptorProto(properties) { - this.dependency = []; - this.publicDependency = []; - this.weakDependency = []; - this.messageType = []; - this.enumType = []; - this.service = []; - this.extension = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.name = ""; - - /** - * FileDescriptorProto package. - * @member {string} package - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype["package"] = ""; - - /** - * FileDescriptorProto dependency. - * @member {Array.} dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.dependency = $util.emptyArray; - - /** - * FileDescriptorProto publicDependency. - * @member {Array.} publicDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.publicDependency = $util.emptyArray; - - /** - * FileDescriptorProto weakDependency. - * @member {Array.} weakDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.weakDependency = $util.emptyArray; - - /** - * FileDescriptorProto messageType. - * @member {Array.} messageType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.messageType = $util.emptyArray; - - /** - * FileDescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * FileDescriptorProto service. - * @member {Array.} service - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.service = $util.emptyArray; - - /** - * FileDescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.extension = $util.emptyArray; - - /** - * FileDescriptorProto options. - * @member {google.protobuf.IFileOptions|null|undefined} options - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.options = null; - - /** - * FileDescriptorProto sourceCodeInfo. - * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.sourceCodeInfo = null; - - /** - * FileDescriptorProto syntax. - * @member {string} syntax - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.syntax = ""; - - /** - * FileDescriptorProto edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.edition = 0; - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance - */ - FileDescriptorProto.create = function create(properties) { - return new FileDescriptorProto(properties); - }; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); - if (message.dependency != null && message.dependency.length) - for (var i = 0; i < message.dependency.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); - if (message.messageType != null && message.messageType.length) - for (var i = 0; i < message.messageType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.service != null && message.service.length) - for (var i = 0; i < message.service.length; ++i) - $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) - $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.publicDependency != null && message.publicDependency.length) - for (var i = 0; i < message.publicDependency.length; ++i) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); - if (message.weakDependency != null && message.weakDependency.length) - for (var i = 0; i < message.weakDependency.length; ++i) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); - if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message["package"] = reader.string(); - break; - } - case 3: { - if (!(message.dependency && message.dependency.length)) - message.dependency = []; - message.dependency.push(reader.string()); - break; - } - case 10: { - if (!(message.publicDependency && message.publicDependency.length)) - message.publicDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.publicDependency.push(reader.int32()); - } else - message.publicDependency.push(reader.int32()); - break; - } - case 11: { - if (!(message.weakDependency && message.weakDependency.length)) - message.weakDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.weakDependency.push(reader.int32()); - } else - message.weakDependency.push(reader.int32()); - break; - } - case 4: { - if (!(message.messageType && message.messageType.length)) - message.messageType = []; - message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.service && message.service.length)) - message.service = []; - message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 7: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 8: { - message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); - break; - } - case 12: { - message.syntax = reader.string(); - break; - } - case 14: { - message.edition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorProto message. - * @function verify - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message["package"] != null && message.hasOwnProperty("package")) - if (!$util.isString(message["package"])) - return "package: string expected"; - if (message.dependency != null && message.hasOwnProperty("dependency")) { - if (!Array.isArray(message.dependency)) - return "dependency: array expected"; - for (var i = 0; i < message.dependency.length; ++i) - if (!$util.isString(message.dependency[i])) - return "dependency: string[] expected"; - } - if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { - if (!Array.isArray(message.publicDependency)) - return "publicDependency: array expected"; - for (var i = 0; i < message.publicDependency.length; ++i) - if (!$util.isInteger(message.publicDependency[i])) - return "publicDependency: integer[] expected"; - } - if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { - if (!Array.isArray(message.weakDependency)) - return "weakDependency: array expected"; - for (var i = 0; i < message.weakDependency.length; ++i) - if (!$util.isInteger(message.weakDependency[i])) - return "weakDependency: integer[] expected"; - } - if (message.messageType != null && message.hasOwnProperty("messageType")) { - if (!Array.isArray(message.messageType)) - return "messageType: array expected"; - for (var i = 0; i < message.messageType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); - if (error) - return "messageType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.service != null && message.hasOwnProperty("service")) { - if (!Array.isArray(message.service)) - return "service: array expected"; - for (var i = 0; i < message.service.length; ++i) { - var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); - if (error) - return "service." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FileOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { - var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); - if (error) - return "sourceCodeInfo." + error; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - if (!$util.isString(message.syntax)) - return "syntax: string expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - */ - FileDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorProto) - return object; - var message = new $root.google.protobuf.FileDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object["package"] != null) - message["package"] = String(object["package"]); - if (object.dependency) { - if (!Array.isArray(object.dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); - message.dependency = []; - for (var i = 0; i < object.dependency.length; ++i) - message.dependency[i] = String(object.dependency[i]); - } - if (object.publicDependency) { - if (!Array.isArray(object.publicDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); - message.publicDependency = []; - for (var i = 0; i < object.publicDependency.length; ++i) - message.publicDependency[i] = object.publicDependency[i] | 0; - } - if (object.weakDependency) { - if (!Array.isArray(object.weakDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); - message.weakDependency = []; - for (var i = 0; i < object.weakDependency.length; ++i) - message.weakDependency[i] = object.weakDependency[i] | 0; - } - if (object.messageType) { - if (!Array.isArray(object.messageType)) - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); - message.messageType = []; - for (var i = 0; i < object.messageType.length; ++i) { - if (typeof object.messageType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); - message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.service) { - if (!Array.isArray(object.service)) - throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); - message.service = []; - for (var i = 0; i < object.service.length; ++i) { - if (typeof object.service[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); - message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FileOptions.fromObject(object.options); - } - if (object.sourceCodeInfo != null) { - if (typeof object.sourceCodeInfo !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); - } - if (object.syntax != null) - message.syntax = String(object.syntax); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.dependency = []; - object.messageType = []; - object.enumType = []; - object.service = []; - object.extension = []; - object.publicDependency = []; - object.weakDependency = []; - } - if (options.defaults) { - object.name = ""; - object["package"] = ""; - object.options = null; - object.sourceCodeInfo = null; - object.syntax = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message["package"] != null && message.hasOwnProperty("package")) - object["package"] = message["package"]; - if (message.dependency && message.dependency.length) { - object.dependency = []; - for (var j = 0; j < message.dependency.length; ++j) - object.dependency[j] = message.dependency[j]; - } - if (message.messageType && message.messageType.length) { - object.messageType = []; - for (var j = 0; j < message.messageType.length; ++j) - object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.service && message.service.length) { - object.service = []; - for (var j = 0; j < message.service.length; ++j) - object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) - object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); - if (message.publicDependency && message.publicDependency.length) { - object.publicDependency = []; - for (var j = 0; j < message.publicDependency.length; ++j) - object.publicDependency[j] = message.publicDependency[j]; - } - if (message.weakDependency && message.weakDependency.length) { - object.weakDependency = []; - for (var j = 0; j < message.weakDependency.length; ++j) - object.weakDependency[j] = message.weakDependency[j]; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - object.syntax = message.syntax; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this FileDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; - }; - - return FileDescriptorProto; - })(); - - protobuf.DescriptorProto = (function() { - - /** - * Properties of a DescriptorProto. - * @memberof google.protobuf - * @interface IDescriptorProto - * @property {string|null} [name] DescriptorProto name - * @property {Array.|null} [field] DescriptorProto field - * @property {Array.|null} [extension] DescriptorProto extension - * @property {Array.|null} [nestedType] DescriptorProto nestedType - * @property {Array.|null} [enumType] DescriptorProto enumType - * @property {Array.|null} [extensionRange] DescriptorProto extensionRange - * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl - * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options - * @property {Array.|null} [reservedRange] DescriptorProto reservedRange - * @property {Array.|null} [reservedName] DescriptorProto reservedName - */ - - /** - * Constructs a new DescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a DescriptorProto. - * @implements IDescriptorProto - * @constructor - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - */ - function DescriptorProto(properties) { - this.field = []; - this.extension = []; - this.nestedType = []; - this.enumType = []; - this.extensionRange = []; - this.oneofDecl = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DescriptorProto name. - * @member {string} name - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.name = ""; - - /** - * DescriptorProto field. - * @member {Array.} field - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.field = $util.emptyArray; - - /** - * DescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extension = $util.emptyArray; - - /** - * DescriptorProto nestedType. - * @member {Array.} nestedType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.nestedType = $util.emptyArray; - - /** - * DescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * DescriptorProto extensionRange. - * @member {Array.} extensionRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extensionRange = $util.emptyArray; - - /** - * DescriptorProto oneofDecl. - * @member {Array.} oneofDecl - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.oneofDecl = $util.emptyArray; - - /** - * DescriptorProto options. - * @member {google.protobuf.IMessageOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.options = null; - - /** - * DescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * DescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto} DescriptorProto instance - */ - DescriptorProto.create = function create(properties) { - return new DescriptorProto(properties); - }; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.field != null && message.field.length) - for (var i = 0; i < message.field.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nestedType != null && message.nestedType.length) - for (var i = 0; i < message.nestedType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.extensionRange != null && message.extensionRange.length) - for (var i = 0; i < message.extensionRange.length; ++i) - $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.oneofDecl != null && message.oneofDecl.length) - for (var i = 0; i < message.oneofDecl.length; ++i) - $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.field && message.field.length)) - message.field = []; - message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.nestedType && message.nestedType.length)) - message.nestedType = []; - message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - } - case 4: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.extensionRange && message.extensionRange.length)) - message.extensionRange = []; - message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); - break; - } - case 8: { - if (!(message.oneofDecl && message.oneofDecl.length)) - message.oneofDecl = []; - message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 7: { - message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); - break; - } - case 9: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); - break; - } - case 10: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DescriptorProto message. - * @function verify - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.field != null && message.hasOwnProperty("field")) { - if (!Array.isArray(message.field)) - return "field: array expected"; - for (var i = 0; i < message.field.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); - if (error) - return "field." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.nestedType != null && message.hasOwnProperty("nestedType")) { - if (!Array.isArray(message.nestedType)) - return "nestedType: array expected"; - for (var i = 0; i < message.nestedType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); - if (error) - return "nestedType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { - if (!Array.isArray(message.extensionRange)) - return "extensionRange: array expected"; - for (var i = 0; i < message.extensionRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); - if (error) - return "extensionRange." + error; - } - } - if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { - if (!Array.isArray(message.oneofDecl)) - return "oneofDecl: array expected"; - for (var i = 0; i < message.oneofDecl.length; ++i) { - var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); - if (error) - return "oneofDecl." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MessageOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto} DescriptorProto - */ - DescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto) - return object; - var message = new $root.google.protobuf.DescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.field) { - if (!Array.isArray(object.field)) - throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); - message.field = []; - for (var i = 0; i < object.field.length; ++i) { - if (typeof object.field[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); - message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.nestedType) { - if (!Array.isArray(object.nestedType)) - throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); - message.nestedType = []; - for (var i = 0; i < object.nestedType.length; ++i) { - if (typeof object.nestedType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); - message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.extensionRange) { - if (!Array.isArray(object.extensionRange)) - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); - message.extensionRange = []; - for (var i = 0; i < object.extensionRange.length; ++i) { - if (typeof object.extensionRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); - message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); - } - } - if (object.oneofDecl) { - if (!Array.isArray(object.oneofDecl)) - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); - message.oneofDecl = []; - for (var i = 0; i < object.oneofDecl.length; ++i) { - if (typeof object.oneofDecl[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); - message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.DescriptorProto} message DescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.field = []; - object.nestedType = []; - object.enumType = []; - object.extensionRange = []; - object.extension = []; - object.oneofDecl = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.field && message.field.length) { - object.field = []; - for (var j = 0; j < message.field.length; ++j) - object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); - } - if (message.nestedType && message.nestedType.length) { - object.nestedType = []; - for (var j = 0; j < message.nestedType.length; ++j) - object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.extensionRange && message.extensionRange.length) { - object.extensionRange = []; - for (var j = 0; j < message.extensionRange.length; ++j) - object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); - if (message.oneofDecl && message.oneofDecl.length) { - object.oneofDecl = []; - for (var j = 0; j < message.oneofDecl.length; ++j) - object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); - } - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this DescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto - * @instance - * @returns {Object.} JSON object - */ - DescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto"; - }; - - DescriptorProto.ExtensionRange = (function() { - - /** - * Properties of an ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @interface IExtensionRange - * @property {number|null} [start] ExtensionRange start - * @property {number|null} [end] ExtensionRange end - * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options - */ - - /** - * Constructs a new ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents an ExtensionRange. - * @implements IExtensionRange - * @constructor - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - */ - function ExtensionRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.start = 0; - - /** - * ExtensionRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.end = 0; - - /** - * ExtensionRange options. - * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.options = null; - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance - */ - ExtensionRange.create = function create(properties) { - return new ExtensionRange(properties); - }; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - */ - ExtensionRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); - message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - object.options = null; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ExtensionRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - * @returns {Object.} JSON object - */ - ExtensionRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; - }; - - return ExtensionRange; - })(); - - DescriptorProto.ReservedRange = (function() { - - /** - * Properties of a ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @interface IReservedRange - * @property {number|null} [start] ReservedRange start - * @property {number|null} [end] ReservedRange end - */ - - /** - * Constructs a new ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents a ReservedRange. - * @implements IReservedRange - * @constructor - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - */ - function ReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReservedRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.start = 0; - - /** - * ReservedRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.end = 0; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance - */ - ReservedRange.create = function create(properties) { - return new ReservedRange(properties); - }; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReservedRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - */ - ReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this ReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - * @returns {Object.} JSON object - */ - ReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReservedRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; - }; - - return ReservedRange; - })(); - - return DescriptorProto; - })(); - - protobuf.ExtensionRangeOptions = (function() { - - /** - * Properties of an ExtensionRangeOptions. - * @memberof google.protobuf - * @interface IExtensionRangeOptions - * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption - * @property {Array.|null} [declaration] ExtensionRangeOptions declaration - * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features - * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification - */ - - /** - * Constructs a new ExtensionRangeOptions. - * @memberof google.protobuf - * @classdesc Represents an ExtensionRangeOptions. - * @implements IExtensionRangeOptions - * @constructor - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - */ - function ExtensionRangeOptions(properties) { - this.uninterpretedOption = []; - this.declaration = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRangeOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ExtensionRangeOptions declaration. - * @member {Array.} declaration - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.declaration = $util.emptyArray; - - /** - * ExtensionRangeOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.features = null; - - /** - * ExtensionRangeOptions verification. - * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.verification = 1; - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance - */ - ExtensionRangeOptions.create = function create(properties) { - return new ExtensionRangeOptions(properties); - }; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.declaration != null && message.declaration.length) - for (var i = 0; i < message.declaration.length; ++i) - $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 2: { - if (!(message.declaration && message.declaration.length)) - message.declaration = []; - message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.verification = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRangeOptions message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRangeOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message.declaration != null && message.hasOwnProperty("declaration")) { - if (!Array.isArray(message.declaration)) - return "declaration: array expected"; - for (var i = 0; i < message.declaration.length; ++i) { - var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); - if (error) - return "declaration." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.verification != null && message.hasOwnProperty("verification")) - switch (message.verification) { - default: - return "verification: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - */ - ExtensionRangeOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions(); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object.declaration) { - if (!Array.isArray(object.declaration)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); - message.declaration = []; - for (var i = 0; i < object.declaration.length; ++i) { - if (typeof object.declaration[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); - message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - switch (object.verification) { - case "DECLARATION": - case 0: - message.verification = 0; - break; - default: - if (typeof object.verification === "number") { - message.verification = object.verification; - break; - } - break; - case "UNVERIFIED": - case 1: - message.verification = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRangeOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.declaration = []; - object.uninterpretedOption = []; - } - if (options.defaults) { - object.verification = options.enums === String ? "UNVERIFIED" : 1; - object.features = null; - } - if (message.declaration && message.declaration.length) { - object.declaration = []; - for (var j = 0; j < message.declaration.length; ++j) - object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); - } - if (message.verification != null && message.hasOwnProperty("verification")) - object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - * @returns {Object.} JSON object - */ - ExtensionRangeOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; - }; - - ExtensionRangeOptions.Declaration = (function() { - - /** - * Properties of a Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @interface IDeclaration - * @property {number|null} [number] Declaration number - * @property {string|null} [fullName] Declaration fullName - * @property {string|null} [type] Declaration type - * @property {boolean|null} [reserved] Declaration reserved - * @property {boolean|null} [repeated] Declaration repeated - */ - - /** - * Constructs a new Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @classdesc Represents a Declaration. - * @implements IDeclaration - * @constructor - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - */ - function Declaration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Declaration number. - * @member {number} number - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.number = 0; - - /** - * Declaration fullName. - * @member {string} fullName - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.fullName = ""; - - /** - * Declaration type. - * @member {string} type - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.type = ""; - - /** - * Declaration reserved. - * @member {boolean} reserved - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.reserved = false; - - /** - * Declaration repeated. - * @member {boolean} repeated - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.repeated = false; - - /** - * Creates a new Declaration instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance - */ - Declaration.create = function create(properties) { - return new Declaration(properties); - }; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); - if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); - if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); - if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); - return writer; - }; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.number = reader.int32(); - break; - } - case 2: { - message.fullName = reader.string(); - break; - } - case 3: { - message.type = reader.string(); - break; - } - case 5: { - message.reserved = reader.bool(); - break; - } - case 6: { - message.repeated = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Declaration message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Declaration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.fullName != null && message.hasOwnProperty("fullName")) - if (!$util.isString(message.fullName)) - return "fullName: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.reserved != null && message.hasOwnProperty("reserved")) - if (typeof message.reserved !== "boolean") - return "reserved: boolean expected"; - if (message.repeated != null && message.hasOwnProperty("repeated")) - if (typeof message.repeated !== "boolean") - return "repeated: boolean expected"; - return null; - }; - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - */ - Declaration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - if (object.number != null) - message.number = object.number | 0; - if (object.fullName != null) - message.fullName = String(object.fullName); - if (object.type != null) - message.type = String(object.type); - if (object.reserved != null) - message.reserved = Boolean(object.reserved); - if (object.repeated != null) - message.repeated = Boolean(object.repeated); - return message; - }; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Declaration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.number = 0; - object.fullName = ""; - object.type = ""; - object.reserved = false; - object.repeated = false; - } - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.fullName != null && message.hasOwnProperty("fullName")) - object.fullName = message.fullName; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.reserved != null && message.hasOwnProperty("reserved")) - object.reserved = message.reserved; - if (message.repeated != null && message.hasOwnProperty("repeated")) - object.repeated = message.repeated; - return object; - }; - - /** - * Converts this Declaration to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - * @returns {Object.} JSON object - */ - Declaration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Declaration - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; - }; - - return Declaration; - })(); - - /** - * VerificationState enum. - * @name google.protobuf.ExtensionRangeOptions.VerificationState - * @enum {number} - * @property {number} DECLARATION=0 DECLARATION value - * @property {number} UNVERIFIED=1 UNVERIFIED value - */ - ExtensionRangeOptions.VerificationState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DECLARATION"] = 0; - values[valuesById[1] = "UNVERIFIED"] = 1; - return values; - })(); - - return ExtensionRangeOptions; - })(); - - protobuf.FieldDescriptorProto = (function() { - - /** - * Properties of a FieldDescriptorProto. - * @memberof google.protobuf - * @interface IFieldDescriptorProto - * @property {string|null} [name] FieldDescriptorProto name - * @property {number|null} [number] FieldDescriptorProto number - * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label - * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type - * @property {string|null} [typeName] FieldDescriptorProto typeName - * @property {string|null} [extendee] FieldDescriptorProto extendee - * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue - * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex - * @property {string|null} [jsonName] FieldDescriptorProto jsonName - * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options - * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional - */ - - /** - * Constructs a new FieldDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FieldDescriptorProto. - * @implements IFieldDescriptorProto - * @constructor - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - */ - function FieldDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.name = ""; - - /** - * FieldDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.number = 0; - - /** - * FieldDescriptorProto label. - * @member {google.protobuf.FieldDescriptorProto.Label} label - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.label = 1; - - /** - * FieldDescriptorProto type. - * @member {google.protobuf.FieldDescriptorProto.Type} type - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.type = 1; - - /** - * FieldDescriptorProto typeName. - * @member {string} typeName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.typeName = ""; - - /** - * FieldDescriptorProto extendee. - * @member {string} extendee - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.extendee = ""; - - /** - * FieldDescriptorProto defaultValue. - * @member {string} defaultValue - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.defaultValue = ""; - - /** - * FieldDescriptorProto oneofIndex. - * @member {number} oneofIndex - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.oneofIndex = 0; - - /** - * FieldDescriptorProto jsonName. - * @member {string} jsonName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.jsonName = ""; - - /** - * FieldDescriptorProto options. - * @member {google.protobuf.IFieldOptions|null|undefined} options - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.options = null; - - /** - * FieldDescriptorProto proto3Optional. - * @member {boolean} proto3Optional - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.proto3Optional = false; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance - */ - FieldDescriptorProto.create = function create(properties) { - return new FieldDescriptorProto(properties); - }; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && Object.hasOwnProperty.call(message, "label")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); - if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); - return writer; - }; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.number = reader.int32(); - break; - } - case 4: { - message.label = reader.int32(); - break; - } - case 5: { - message.type = reader.int32(); - break; - } - case 6: { - message.typeName = reader.string(); - break; - } - case 2: { - message.extendee = reader.string(); - break; - } - case 7: { - message.defaultValue = reader.string(); - break; - } - case 9: { - message.oneofIndex = reader.int32(); - break; - } - case 10: { - message.jsonName = reader.string(); - break; - } - case 8: { - message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); - break; - } - case 17: { - message.proto3Optional = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldDescriptorProto message. - * @function verify - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.label != null && message.hasOwnProperty("label")) - switch (message.label) { - default: - return "label: enum value expected"; - case 1: - case 3: - case 2: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - break; - } - if (message.typeName != null && message.hasOwnProperty("typeName")) - if (!$util.isString(message.typeName)) - return "typeName: string expected"; - if (message.extendee != null && message.hasOwnProperty("extendee")) - if (!$util.isString(message.extendee)) - return "extendee: string expected"; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - if (!$util.isString(message.defaultValue)) - return "defaultValue: string expected"; - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - if (!$util.isInteger(message.oneofIndex)) - return "oneofIndex: integer expected"; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - if (!$util.isString(message.jsonName)) - return "jsonName: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FieldOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - if (typeof message.proto3Optional !== "boolean") - return "proto3Optional: boolean expected"; - return null; - }; - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - */ - FieldDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldDescriptorProto) - return object; - var message = new $root.google.protobuf.FieldDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - switch (object.label) { - default: - if (typeof object.label === "number") { - message.label = object.label; - break; - } - break; - case "LABEL_OPTIONAL": - case 1: - message.label = 1; - break; - case "LABEL_REPEATED": - case 3: - message.label = 3; - break; - case "LABEL_REQUIRED": - case 2: - message.label = 2; - break; - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_DOUBLE": - case 1: - message.type = 1; - break; - case "TYPE_FLOAT": - case 2: - message.type = 2; - break; - case "TYPE_INT64": - case 3: - message.type = 3; - break; - case "TYPE_UINT64": - case 4: - message.type = 4; - break; - case "TYPE_INT32": - case 5: - message.type = 5; - break; - case "TYPE_FIXED64": - case 6: - message.type = 6; - break; - case "TYPE_FIXED32": - case 7: - message.type = 7; - break; - case "TYPE_BOOL": - case 8: - message.type = 8; - break; - case "TYPE_STRING": - case 9: - message.type = 9; - break; - case "TYPE_GROUP": - case 10: - message.type = 10; - break; - case "TYPE_MESSAGE": - case 11: - message.type = 11; - break; - case "TYPE_BYTES": - case 12: - message.type = 12; - break; - case "TYPE_UINT32": - case 13: - message.type = 13; - break; - case "TYPE_ENUM": - case 14: - message.type = 14; - break; - case "TYPE_SFIXED32": - case 15: - message.type = 15; - break; - case "TYPE_SFIXED64": - case 16: - message.type = 16; - break; - case "TYPE_SINT32": - case 17: - message.type = 17; - break; - case "TYPE_SINT64": - case 18: - message.type = 18; - break; - } - if (object.typeName != null) - message.typeName = String(object.typeName); - if (object.extendee != null) - message.extendee = String(object.extendee); - if (object.defaultValue != null) - message.defaultValue = String(object.defaultValue); - if (object.oneofIndex != null) - message.oneofIndex = object.oneofIndex | 0; - if (object.jsonName != null) - message.jsonName = String(object.jsonName); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); - } - if (object.proto3Optional != null) - message.proto3Optional = Boolean(object.proto3Optional); - return message; - }; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.extendee = ""; - object.number = 0; - object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; - object.type = options.enums === String ? "TYPE_DOUBLE" : 1; - object.typeName = ""; - object.defaultValue = ""; - object.options = null; - object.oneofIndex = 0; - object.jsonName = ""; - object.proto3Optional = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.extendee != null && message.hasOwnProperty("extendee")) - object.extendee = message.extendee; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; - if (message.typeName != null && message.hasOwnProperty("typeName")) - object.typeName = message.typeName; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - object.defaultValue = message.defaultValue; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - object.oneofIndex = message.oneofIndex; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - object.jsonName = message.jsonName; - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - object.proto3Optional = message.proto3Optional; - return object; - }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FieldDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FieldDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; - }; - - /** - * Type enum. - * @name google.protobuf.FieldDescriptorProto.Type - * @enum {number} - * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value - * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value - * @property {number} TYPE_INT64=3 TYPE_INT64 value - * @property {number} TYPE_UINT64=4 TYPE_UINT64 value - * @property {number} TYPE_INT32=5 TYPE_INT32 value - * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value - * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value - * @property {number} TYPE_BOOL=8 TYPE_BOOL value - * @property {number} TYPE_STRING=9 TYPE_STRING value - * @property {number} TYPE_GROUP=10 TYPE_GROUP value - * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value - * @property {number} TYPE_BYTES=12 TYPE_BYTES value - * @property {number} TYPE_UINT32=13 TYPE_UINT32 value - * @property {number} TYPE_ENUM=14 TYPE_ENUM value - * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value - * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value - * @property {number} TYPE_SINT32=17 TYPE_SINT32 value - * @property {number} TYPE_SINT64=18 TYPE_SINT64 value - */ - FieldDescriptorProto.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "TYPE_DOUBLE"] = 1; - values[valuesById[2] = "TYPE_FLOAT"] = 2; - values[valuesById[3] = "TYPE_INT64"] = 3; - values[valuesById[4] = "TYPE_UINT64"] = 4; - values[valuesById[5] = "TYPE_INT32"] = 5; - values[valuesById[6] = "TYPE_FIXED64"] = 6; - values[valuesById[7] = "TYPE_FIXED32"] = 7; - values[valuesById[8] = "TYPE_BOOL"] = 8; - values[valuesById[9] = "TYPE_STRING"] = 9; - values[valuesById[10] = "TYPE_GROUP"] = 10; - values[valuesById[11] = "TYPE_MESSAGE"] = 11; - values[valuesById[12] = "TYPE_BYTES"] = 12; - values[valuesById[13] = "TYPE_UINT32"] = 13; - values[valuesById[14] = "TYPE_ENUM"] = 14; - values[valuesById[15] = "TYPE_SFIXED32"] = 15; - values[valuesById[16] = "TYPE_SFIXED64"] = 16; - values[valuesById[17] = "TYPE_SINT32"] = 17; - values[valuesById[18] = "TYPE_SINT64"] = 18; - return values; - })(); - - /** - * Label enum. - * @name google.protobuf.FieldDescriptorProto.Label - * @enum {number} - * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value - * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value - * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value - */ - FieldDescriptorProto.Label = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "LABEL_OPTIONAL"] = 1; - values[valuesById[3] = "LABEL_REPEATED"] = 3; - values[valuesById[2] = "LABEL_REQUIRED"] = 2; - return values; - })(); - - return FieldDescriptorProto; - })(); - - protobuf.OneofDescriptorProto = (function() { - - /** - * Properties of an OneofDescriptorProto. - * @memberof google.protobuf - * @interface IOneofDescriptorProto - * @property {string|null} [name] OneofDescriptorProto name - * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options - */ - - /** - * Constructs a new OneofDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an OneofDescriptorProto. - * @implements IOneofDescriptorProto - * @constructor - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - */ - function OneofDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.name = ""; - - /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.options = null; - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance - */ - OneofDescriptorProto.create = function create(properties) { - return new OneofDescriptorProto(properties); - }; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofDescriptorProto message. - * @function verify - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.OneofOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - */ - OneofDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofDescriptorProto) - return object; - var message = new $root.google.protobuf.OneofDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.OneofDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - OneofDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; - }; - - return OneofDescriptorProto; - })(); - - protobuf.EnumDescriptorProto = (function() { - - /** - * Properties of an EnumDescriptorProto. - * @memberof google.protobuf - * @interface IEnumDescriptorProto - * @property {string|null} [name] EnumDescriptorProto name - * @property {Array.|null} [value] EnumDescriptorProto value - * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options - * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange - * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName - */ - - /** - * Constructs a new EnumDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumDescriptorProto. - * @implements IEnumDescriptorProto - * @constructor - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - */ - function EnumDescriptorProto(properties) { - this.value = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.name = ""; - - /** - * EnumDescriptorProto value. - * @member {Array.} value - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.value = $util.emptyArray; - - /** - * EnumDescriptorProto options. - * @member {google.protobuf.IEnumOptions|null|undefined} options - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.options = null; - - /** - * EnumDescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * EnumDescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance - */ - EnumDescriptorProto.create = function create(properties) { - return new EnumDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.value != null && message.value.length) - for (var i = 0; i < message.value.length; ++i) - $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.value && message.value.length)) - message.value = []; - message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); - break; - } - case 4: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); - break; - } - case 5: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.value != null && message.hasOwnProperty("value")) { - if (!Array.isArray(message.value)) - return "value: array expected"; - for (var i = 0; i < message.value.length; ++i) { - var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); - if (error) - return "value." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - */ - EnumDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.value) { - if (!Array.isArray(object.value)) - throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); - message.value = []; - for (var i = 0; i < object.value.length; ++i) { - if (typeof object.value[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); - message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.value = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.value && message.value.length) { - object.value = []; - for (var j = 0; j < message.value.length; ++j) - object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; - }; - - EnumDescriptorProto.EnumReservedRange = (function() { - - /** - * Properties of an EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @interface IEnumReservedRange - * @property {number|null} [start] EnumReservedRange start - * @property {number|null} [end] EnumReservedRange end - */ - - /** - * Constructs a new EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @classdesc Represents an EnumReservedRange. - * @implements IEnumReservedRange - * @constructor - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - */ - function EnumReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumReservedRange start. - * @member {number} start - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.start = 0; - - /** - * EnumReservedRange end. - * @member {number} end - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.end = 0; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance - */ - EnumReservedRange.create = function create(properties) { - return new EnumReservedRange(properties); - }; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumReservedRange message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - */ - EnumReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this EnumReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - * @returns {Object.} JSON object - */ - EnumReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumReservedRange - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; - }; - - return EnumReservedRange; - })(); - - return EnumDescriptorProto; - })(); - - protobuf.EnumValueDescriptorProto = (function() { - - /** - * Properties of an EnumValueDescriptorProto. - * @memberof google.protobuf - * @interface IEnumValueDescriptorProto - * @property {string|null} [name] EnumValueDescriptorProto name - * @property {number|null} [number] EnumValueDescriptorProto number - * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options - */ - - /** - * Constructs a new EnumValueDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumValueDescriptorProto. - * @implements IEnumValueDescriptorProto - * @constructor - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - */ - function EnumValueDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.name = ""; - - /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.number = 0; - - /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.options = null; - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance - */ - EnumValueDescriptorProto.create = function create(properties) { - return new EnumValueDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.number = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumValueOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - */ - EnumValueDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumValueDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.number = 0; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumValueDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; - }; - - return EnumValueDescriptorProto; - })(); - - protobuf.ServiceDescriptorProto = (function() { - - /** - * Properties of a ServiceDescriptorProto. - * @memberof google.protobuf - * @interface IServiceDescriptorProto - * @property {string|null} [name] ServiceDescriptorProto name - * @property {Array.|null} [method] ServiceDescriptorProto method - * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options - */ - - /** - * Constructs a new ServiceDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a ServiceDescriptorProto. - * @implements IServiceDescriptorProto - * @constructor - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - */ - function ServiceDescriptorProto(properties) { - this.method = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.name = ""; - - /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; - - /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.options = null; - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance - */ - ServiceDescriptorProto.create = function create(properties) { - return new ServiceDescriptorProto(properties); - }; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.method != null && message.method.length) - for (var i = 0; i < message.method.length; ++i) - $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.method && message.method.length)) - message.method = []; - message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); - break; - } - case 3: { - message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceDescriptorProto message. - * @function verify - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.method != null && message.hasOwnProperty("method")) { - if (!Array.isArray(message.method)) - return "method: array expected"; - for (var i = 0; i < message.method.length; ++i) { - var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); - if (error) - return "method." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ServiceOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - */ - ServiceDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceDescriptorProto) - return object; - var message = new $root.google.protobuf.ServiceDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.method) { - if (!Array.isArray(object.method)) - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); - message.method = []; - for (var i = 0; i < object.method.length; ++i) { - if (typeof object.method[i] !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); - message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.method = []; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.method && message.method.length) { - object.method = []; - for (var j = 0; j < message.method.length; ++j) - object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - ServiceDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; - }; - - return ServiceDescriptorProto; - })(); - - protobuf.MethodDescriptorProto = (function() { - - /** - * Properties of a MethodDescriptorProto. - * @memberof google.protobuf - * @interface IMethodDescriptorProto - * @property {string|null} [name] MethodDescriptorProto name - * @property {string|null} [inputType] MethodDescriptorProto inputType - * @property {string|null} [outputType] MethodDescriptorProto outputType - * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options - * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming - * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming - */ - - /** - * Constructs a new MethodDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a MethodDescriptorProto. - * @implements IMethodDescriptorProto - * @constructor - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - */ - function MethodDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.name = ""; - - /** - * MethodDescriptorProto inputType. - * @member {string} inputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.inputType = ""; - - /** - * MethodDescriptorProto outputType. - * @member {string} outputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.outputType = ""; - - /** - * MethodDescriptorProto options. - * @member {google.protobuf.IMethodOptions|null|undefined} options - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.options = null; - - /** - * MethodDescriptorProto clientStreaming. - * @member {boolean} clientStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.clientStreaming = false; - - /** - * MethodDescriptorProto serverStreaming. - * @member {boolean} serverStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.serverStreaming = false; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance - */ - MethodDescriptorProto.create = function create(properties) { - return new MethodDescriptorProto(properties); - }; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); - return writer; - }; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.inputType = reader.string(); - break; - } - case 3: { - message.outputType = reader.string(); - break; - } - case 4: { - message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); - break; - } - case 5: { - message.clientStreaming = reader.bool(); - break; - } - case 6: { - message.serverStreaming = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodDescriptorProto message. - * @function verify - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.inputType != null && message.hasOwnProperty("inputType")) - if (!$util.isString(message.inputType)) - return "inputType: string expected"; - if (message.outputType != null && message.hasOwnProperty("outputType")) - if (!$util.isString(message.outputType)) - return "outputType: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MethodOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - if (typeof message.clientStreaming !== "boolean") - return "clientStreaming: boolean expected"; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - if (typeof message.serverStreaming !== "boolean") - return "serverStreaming: boolean expected"; - return null; - }; - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - */ - MethodDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodDescriptorProto) - return object; - var message = new $root.google.protobuf.MethodDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.inputType != null) - message.inputType = String(object.inputType); - if (object.outputType != null) - message.outputType = String(object.outputType); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); - } - if (object.clientStreaming != null) - message.clientStreaming = Boolean(object.clientStreaming); - if (object.serverStreaming != null) - message.serverStreaming = Boolean(object.serverStreaming); - return message; - }; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.inputType = ""; - object.outputType = ""; - object.options = null; - object.clientStreaming = false; - object.serverStreaming = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.inputType != null && message.hasOwnProperty("inputType")) - object.inputType = message.inputType; - if (message.outputType != null && message.hasOwnProperty("outputType")) - object.outputType = message.outputType; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - object.clientStreaming = message.clientStreaming; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - object.serverStreaming = message.serverStreaming; - return object; - }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.MethodDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - MethodDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; - }; - - return MethodDescriptorProto; - })(); - - protobuf.FileOptions = (function() { - - /** - * Properties of a FileOptions. - * @memberof google.protobuf - * @interface IFileOptions - * @property {string|null} [javaPackage] FileOptions javaPackage - * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname - * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles - * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash - * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 - * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor - * @property {string|null} [goPackage] FileOptions goPackage - * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices - * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices - * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices - * @property {boolean|null} [deprecated] FileOptions deprecated - * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas - * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix - * @property {string|null} [csharpNamespace] FileOptions csharpNamespace - * @property {string|null} [swiftPrefix] FileOptions swiftPrefix - * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix - * @property {string|null} [phpNamespace] FileOptions phpNamespace - * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace - * @property {string|null} [rubyPackage] FileOptions rubyPackage - * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features - * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption - * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition - */ - - /** - * Constructs a new FileOptions. - * @memberof google.protobuf - * @classdesc Represents a FileOptions. - * @implements IFileOptions - * @constructor - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - */ - function FileOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.resourceDefinition"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileOptions javaPackage. - * @member {string} javaPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaPackage = ""; - - /** - * FileOptions javaOuterClassname. - * @member {string} javaOuterClassname - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaOuterClassname = ""; - - /** - * FileOptions javaMultipleFiles. - * @member {boolean} javaMultipleFiles - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaMultipleFiles = false; - - /** - * FileOptions javaGenerateEqualsAndHash. - * @member {boolean} javaGenerateEqualsAndHash - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenerateEqualsAndHash = false; - - /** - * FileOptions javaStringCheckUtf8. - * @member {boolean} javaStringCheckUtf8 - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaStringCheckUtf8 = false; - - /** - * FileOptions optimizeFor. - * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.optimizeFor = 1; - - /** - * FileOptions goPackage. - * @member {string} goPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.goPackage = ""; - - /** - * FileOptions ccGenericServices. - * @member {boolean} ccGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccGenericServices = false; - - /** - * FileOptions javaGenericServices. - * @member {boolean} javaGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenericServices = false; - - /** - * FileOptions pyGenericServices. - * @member {boolean} pyGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.pyGenericServices = false; - - /** - * FileOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.deprecated = false; - - /** - * FileOptions ccEnableArenas. - * @member {boolean} ccEnableArenas - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccEnableArenas = true; - - /** - * FileOptions objcClassPrefix. - * @member {string} objcClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.objcClassPrefix = ""; - - /** - * FileOptions csharpNamespace. - * @member {string} csharpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.csharpNamespace = ""; - - /** - * FileOptions swiftPrefix. - * @member {string} swiftPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.swiftPrefix = ""; - - /** - * FileOptions phpClassPrefix. - * @member {string} phpClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpClassPrefix = ""; - - /** - * FileOptions phpNamespace. - * @member {string} phpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpNamespace = ""; - - /** - * FileOptions phpMetadataNamespace. - * @member {string} phpMetadataNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpMetadataNamespace = ""; - - /** - * FileOptions rubyPackage. - * @member {string} rubyPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.rubyPackage = ""; - - /** - * FileOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.features = null; - - /** - * FileOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FileOptions .google.api.resourceDefinition. - * @member {Array.} .google.api.resourceDefinition - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; - - /** - * Creates a new FileOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - * @returns {google.protobuf.FileOptions} FileOptions instance - */ - FileOptions.create = function create(properties) { - return new FileOptions(properties); - }; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); - if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) - writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) - writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) - writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) - writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) - writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) - writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) - writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); - if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) - writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); - if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) - writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); - if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) - writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) - writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.javaPackage = reader.string(); - break; - } - case 8: { - message.javaOuterClassname = reader.string(); - break; - } - case 10: { - message.javaMultipleFiles = reader.bool(); - break; - } - case 20: { - message.javaGenerateEqualsAndHash = reader.bool(); - break; - } - case 27: { - message.javaStringCheckUtf8 = reader.bool(); - break; - } - case 9: { - message.optimizeFor = reader.int32(); - break; - } - case 11: { - message.goPackage = reader.string(); - break; - } - case 16: { - message.ccGenericServices = reader.bool(); - break; - } - case 17: { - message.javaGenericServices = reader.bool(); - break; - } - case 18: { - message.pyGenericServices = reader.bool(); - break; - } - case 23: { - message.deprecated = reader.bool(); - break; - } - case 31: { - message.ccEnableArenas = reader.bool(); - break; - } - case 36: { - message.objcClassPrefix = reader.string(); - break; - } - case 37: { - message.csharpNamespace = reader.string(); - break; - } - case 39: { - message.swiftPrefix = reader.string(); - break; - } - case 40: { - message.phpClassPrefix = reader.string(); - break; - } - case 41: { - message.phpNamespace = reader.string(); - break; - } - case 44: { - message.phpMetadataNamespace = reader.string(); - break; - } - case 45: { - message.rubyPackage = reader.string(); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1053: { - if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) - message[".google.api.resourceDefinition"] = []; - message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileOptions message. - * @function verify - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - if (!$util.isString(message.javaPackage)) - return "javaPackage: string expected"; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - if (!$util.isString(message.javaOuterClassname)) - return "javaOuterClassname: string expected"; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - if (typeof message.javaMultipleFiles !== "boolean") - return "javaMultipleFiles: boolean expected"; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - if (typeof message.javaGenerateEqualsAndHash !== "boolean") - return "javaGenerateEqualsAndHash: boolean expected"; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - if (typeof message.javaStringCheckUtf8 !== "boolean") - return "javaStringCheckUtf8: boolean expected"; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - switch (message.optimizeFor) { - default: - return "optimizeFor: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - if (!$util.isString(message.goPackage)) - return "goPackage: string expected"; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - if (typeof message.ccGenericServices !== "boolean") - return "ccGenericServices: boolean expected"; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - if (typeof message.javaGenericServices !== "boolean") - return "javaGenericServices: boolean expected"; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - if (typeof message.pyGenericServices !== "boolean") - return "pyGenericServices: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - if (typeof message.ccEnableArenas !== "boolean") - return "ccEnableArenas: boolean expected"; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - if (!$util.isString(message.objcClassPrefix)) - return "objcClassPrefix: string expected"; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - if (!$util.isString(message.csharpNamespace)) - return "csharpNamespace: string expected"; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - if (!$util.isString(message.swiftPrefix)) - return "swiftPrefix: string expected"; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - if (!$util.isString(message.phpClassPrefix)) - return "phpClassPrefix: string expected"; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - if (!$util.isString(message.phpNamespace)) - return "phpNamespace: string expected"; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - if (!$util.isString(message.phpMetadataNamespace)) - return "phpMetadataNamespace: string expected"; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - if (!$util.isString(message.rubyPackage)) - return "rubyPackage: string expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { - if (!Array.isArray(message[".google.api.resourceDefinition"])) - return ".google.api.resourceDefinition: array expected"; - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); - if (error) - return ".google.api.resourceDefinition." + error; - } - } - return null; - }; - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileOptions} FileOptions - */ - FileOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileOptions) - return object; - var message = new $root.google.protobuf.FileOptions(); - if (object.javaPackage != null) - message.javaPackage = String(object.javaPackage); - if (object.javaOuterClassname != null) - message.javaOuterClassname = String(object.javaOuterClassname); - if (object.javaMultipleFiles != null) - message.javaMultipleFiles = Boolean(object.javaMultipleFiles); - if (object.javaGenerateEqualsAndHash != null) - message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); - if (object.javaStringCheckUtf8 != null) - message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); - switch (object.optimizeFor) { - default: - if (typeof object.optimizeFor === "number") { - message.optimizeFor = object.optimizeFor; - break; - } - break; - case "SPEED": - case 1: - message.optimizeFor = 1; - break; - case "CODE_SIZE": - case 2: - message.optimizeFor = 2; - break; - case "LITE_RUNTIME": - case 3: - message.optimizeFor = 3; - break; - } - if (object.goPackage != null) - message.goPackage = String(object.goPackage); - if (object.ccGenericServices != null) - message.ccGenericServices = Boolean(object.ccGenericServices); - if (object.javaGenericServices != null) - message.javaGenericServices = Boolean(object.javaGenericServices); - if (object.pyGenericServices != null) - message.pyGenericServices = Boolean(object.pyGenericServices); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.ccEnableArenas != null) - message.ccEnableArenas = Boolean(object.ccEnableArenas); - if (object.objcClassPrefix != null) - message.objcClassPrefix = String(object.objcClassPrefix); - if (object.csharpNamespace != null) - message.csharpNamespace = String(object.csharpNamespace); - if (object.swiftPrefix != null) - message.swiftPrefix = String(object.swiftPrefix); - if (object.phpClassPrefix != null) - message.phpClassPrefix = String(object.phpClassPrefix); - if (object.phpNamespace != null) - message.phpNamespace = String(object.phpNamespace); - if (object.phpMetadataNamespace != null) - message.phpMetadataNamespace = String(object.phpMetadataNamespace); - if (object.rubyPackage != null) - message.rubyPackage = String(object.rubyPackage); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FileOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resourceDefinition"]) { - if (!Array.isArray(object[".google.api.resourceDefinition"])) - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); - message[".google.api.resourceDefinition"] = []; - for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { - if (typeof object[".google.api.resourceDefinition"][i] !== "object") - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); - message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.FileOptions} message FileOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.resourceDefinition"] = []; - } - if (options.defaults) { - object.javaPackage = ""; - object.javaOuterClassname = ""; - object.optimizeFor = options.enums === String ? "SPEED" : 1; - object.javaMultipleFiles = false; - object.goPackage = ""; - object.ccGenericServices = false; - object.javaGenericServices = false; - object.pyGenericServices = false; - object.javaGenerateEqualsAndHash = false; - object.deprecated = false; - object.javaStringCheckUtf8 = false; - object.ccEnableArenas = true; - object.objcClassPrefix = ""; - object.csharpNamespace = ""; - object.swiftPrefix = ""; - object.phpClassPrefix = ""; - object.phpNamespace = ""; - object.phpMetadataNamespace = ""; - object.rubyPackage = ""; - object.features = null; - } - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - object.javaPackage = message.javaPackage; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - object.javaOuterClassname = message.javaOuterClassname; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - object.javaMultipleFiles = message.javaMultipleFiles; - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - object.goPackage = message.goPackage; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - object.ccGenericServices = message.ccGenericServices; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - object.javaGenericServices = message.javaGenericServices; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - object.pyGenericServices = message.pyGenericServices; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - object.javaStringCheckUtf8 = message.javaStringCheckUtf8; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - object.ccEnableArenas = message.ccEnableArenas; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - object.objcClassPrefix = message.objcClassPrefix; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - object.csharpNamespace = message.csharpNamespace; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - object.swiftPrefix = message.swiftPrefix; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - object.phpClassPrefix = message.phpClassPrefix; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - object.phpNamespace = message.phpNamespace; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - object.phpMetadataNamespace = message.phpMetadataNamespace; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - object.rubyPackage = message.rubyPackage; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { - object[".google.api.resourceDefinition"] = []; - for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) - object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); - } - return object; - }; - - /** - * Converts this FileOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FileOptions - * @instance - * @returns {Object.} JSON object - */ - FileOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileOptions - * @function getTypeUrl - * @memberof google.protobuf.FileOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileOptions"; - }; - - /** - * OptimizeMode enum. - * @name google.protobuf.FileOptions.OptimizeMode - * @enum {number} - * @property {number} SPEED=1 SPEED value - * @property {number} CODE_SIZE=2 CODE_SIZE value - * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value - */ - FileOptions.OptimizeMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "SPEED"] = 1; - values[valuesById[2] = "CODE_SIZE"] = 2; - values[valuesById[3] = "LITE_RUNTIME"] = 3; - return values; - })(); - - return FileOptions; - })(); - - protobuf.MessageOptions = (function() { - - /** - * Properties of a MessageOptions. - * @memberof google.protobuf - * @interface IMessageOptions - * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat - * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor - * @property {boolean|null} [deprecated] MessageOptions deprecated - * @property {boolean|null} [mapEntry] MessageOptions mapEntry - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features - * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption - * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource - */ - - /** - * Constructs a new MessageOptions. - * @memberof google.protobuf - * @classdesc Represents a MessageOptions. - * @implements IMessageOptions - * @constructor - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - */ - function MessageOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MessageOptions messageSetWireFormat. - * @member {boolean} messageSetWireFormat - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.messageSetWireFormat = false; - - /** - * MessageOptions noStandardDescriptorAccessor. - * @member {boolean} noStandardDescriptorAccessor - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.noStandardDescriptorAccessor = false; - - /** - * MessageOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecated = false; - - /** - * MessageOptions mapEntry. - * @member {boolean} mapEntry - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.mapEntry = false; - - /** - * MessageOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * MessageOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.features = null; - - /** - * MessageOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * MessageOptions .google.api.resource. - * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".google.api.resource"] = null; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - * @returns {google.protobuf.MessageOptions} MessageOptions instance - */ - MessageOptions.create = function create(properties) { - return new MessageOptions(properties); - }; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.messageSetWireFormat = reader.bool(); - break; - } - case 2: { - message.noStandardDescriptorAccessor = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 7: { - message.mapEntry = reader.bool(); - break; - } - case 11: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 12: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1053: { - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MessageOptions message. - * @function verify - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MessageOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - if (typeof message.messageSetWireFormat !== "boolean") - return "messageSetWireFormat: boolean expected"; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - if (typeof message.noStandardDescriptorAccessor !== "boolean") - return "noStandardDescriptorAccessor: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - if (typeof message.mapEntry !== "boolean") - return "mapEntry: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); - if (error) - return ".google.api.resource." + error; - } - return null; - }; - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MessageOptions} MessageOptions - */ - MessageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MessageOptions) - return object; - var message = new $root.google.protobuf.MessageOptions(); - if (object.messageSetWireFormat != null) - message.messageSetWireFormat = Boolean(object.messageSetWireFormat); - if (object.noStandardDescriptorAccessor != null) - message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.mapEntry != null) - message.mapEntry = Boolean(object.mapEntry); - if (object.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MessageOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resource"] != null) { - if (typeof object[".google.api.resource"] !== "object") - throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); - } - return message; - }; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.MessageOptions} message MessageOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MessageOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.messageSetWireFormat = false; - object.noStandardDescriptorAccessor = false; - object.deprecated = false; - object.mapEntry = false; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - object[".google.api.resource"] = null; - } - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - object.messageSetWireFormat = message.messageSetWireFormat; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - object.mapEntry = message.mapEntry; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) - object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); - return object; - }; - - /** - * Converts this MessageOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MessageOptions - * @instance - * @returns {Object.} JSON object - */ - MessageOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MessageOptions - * @function getTypeUrl - * @memberof google.protobuf.MessageOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MessageOptions"; - }; - - return MessageOptions; - })(); - - protobuf.FieldOptions = (function() { - - /** - * Properties of a FieldOptions. - * @memberof google.protobuf - * @interface IFieldOptions - * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype - * @property {boolean|null} [packed] FieldOptions packed - * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype - * @property {boolean|null} [lazy] FieldOptions lazy - * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy - * @property {boolean|null} [deprecated] FieldOptions deprecated - * @property {boolean|null} [weak] FieldOptions weak - * @property {boolean|null} [debugRedact] FieldOptions debugRedact - * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention - * @property {Array.|null} [targets] FieldOptions targets - * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults - * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features - * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption - * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior - * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference - */ - - /** - * Constructs a new FieldOptions. - * @memberof google.protobuf - * @classdesc Represents a FieldOptions. - * @implements IFieldOptions - * @constructor - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - */ - function FieldOptions(properties) { - this.targets = []; - this.editionDefaults = []; - this.uninterpretedOption = []; - this[".google.api.fieldBehavior"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldOptions ctype. - * @member {google.protobuf.FieldOptions.CType} ctype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.ctype = 0; - - /** - * FieldOptions packed. - * @member {boolean} packed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.packed = false; - - /** - * FieldOptions jstype. - * @member {google.protobuf.FieldOptions.JSType} jstype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.jstype = 0; - - /** - * FieldOptions lazy. - * @member {boolean} lazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.lazy = false; - - /** - * FieldOptions unverifiedLazy. - * @member {boolean} unverifiedLazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.unverifiedLazy = false; - - /** - * FieldOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.deprecated = false; - - /** - * FieldOptions weak. - * @member {boolean} weak - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.weak = false; - - /** - * FieldOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.debugRedact = false; - - /** - * FieldOptions retention. - * @member {google.protobuf.FieldOptions.OptionRetention} retention - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.retention = 0; - - /** - * FieldOptions targets. - * @member {Array.} targets - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.targets = $util.emptyArray; - - /** - * FieldOptions editionDefaults. - * @member {Array.} editionDefaults - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.editionDefaults = $util.emptyArray; - - /** - * FieldOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.features = null; - - /** - * FieldOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FieldOptions .google.api.fieldBehavior. - * @member {Array.} .google.api.fieldBehavior - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; - - /** - * FieldOptions .google.api.resourceReference. - * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.resourceReference"] = null; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions} FieldOptions instance - */ - FieldOptions.create = function create(properties) { - return new FieldOptions(properties); - }; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); - if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) - writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); - if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) - writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); - if (message.targets != null && message.targets.length) - for (var i = 0; i < message.targets.length; ++i) - writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); - if (message.editionDefaults != null && message.editionDefaults.length) - for (var i = 0; i < message.editionDefaults.length; ++i) - $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); - if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) - $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.ctype = reader.int32(); - break; - } - case 2: { - message.packed = reader.bool(); - break; - } - case 6: { - message.jstype = reader.int32(); - break; - } - case 5: { - message.lazy = reader.bool(); - break; - } - case 15: { - message.unverifiedLazy = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 10: { - message.weak = reader.bool(); - break; - } - case 16: { - message.debugRedact = reader.bool(); - break; - } - case 17: { - message.retention = reader.int32(); - break; - } - case 19: { - if (!(message.targets && message.targets.length)) - message.targets = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.targets.push(reader.int32()); - } else - message.targets.push(reader.int32()); - break; - } - case 20: { - if (!(message.editionDefaults && message.editionDefaults.length)) - message.editionDefaults = []; - message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); - break; - } - case 21: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1052: { - if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) - message[".google.api.fieldBehavior"] = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message[".google.api.fieldBehavior"].push(reader.int32()); - } else - message[".google.api.fieldBehavior"].push(reader.int32()); - break; - } - case 1055: { - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldOptions message. - * @function verify - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ctype != null && message.hasOwnProperty("ctype")) - switch (message.ctype) { - default: - return "ctype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.packed != null && message.hasOwnProperty("packed")) - if (typeof message.packed !== "boolean") - return "packed: boolean expected"; - if (message.jstype != null && message.hasOwnProperty("jstype")) - switch (message.jstype) { - default: - return "jstype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.lazy != null && message.hasOwnProperty("lazy")) - if (typeof message.lazy !== "boolean") - return "lazy: boolean expected"; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - if (typeof message.unverifiedLazy !== "boolean") - return "unverifiedLazy: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.weak != null && message.hasOwnProperty("weak")) - if (typeof message.weak !== "boolean") - return "weak: boolean expected"; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.retention != null && message.hasOwnProperty("retention")) - switch (message.retention) { - default: - return "retention: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.targets != null && message.hasOwnProperty("targets")) { - if (!Array.isArray(message.targets)) - return "targets: array expected"; - for (var i = 0; i < message.targets.length; ++i) - switch (message.targets[i]) { - default: - return "targets: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - } - if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { - if (!Array.isArray(message.editionDefaults)) - return "editionDefaults: array expected"; - for (var i = 0; i < message.editionDefaults.length; ++i) { - var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); - if (error) - return "editionDefaults." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { - if (!Array.isArray(message[".google.api.fieldBehavior"])) - return ".google.api.fieldBehavior: array expected"; - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - switch (message[".google.api.fieldBehavior"][i]) { - default: - return ".google.api.fieldBehavior: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { - var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); - if (error) - return ".google.api.resourceReference." + error; - } - return null; - }; - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions} FieldOptions - */ - FieldOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions) - return object; - var message = new $root.google.protobuf.FieldOptions(); - switch (object.ctype) { - default: - if (typeof object.ctype === "number") { - message.ctype = object.ctype; - break; - } - break; - case "STRING": - case 0: - message.ctype = 0; - break; - case "CORD": - case 1: - message.ctype = 1; - break; - case "STRING_PIECE": - case 2: - message.ctype = 2; - break; - } - if (object.packed != null) - message.packed = Boolean(object.packed); - switch (object.jstype) { - default: - if (typeof object.jstype === "number") { - message.jstype = object.jstype; - break; - } - break; - case "JS_NORMAL": - case 0: - message.jstype = 0; - break; - case "JS_STRING": - case 1: - message.jstype = 1; - break; - case "JS_NUMBER": - case 2: - message.jstype = 2; - break; - } - if (object.lazy != null) - message.lazy = Boolean(object.lazy); - if (object.unverifiedLazy != null) - message.unverifiedLazy = Boolean(object.unverifiedLazy); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.weak != null) - message.weak = Boolean(object.weak); - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - switch (object.retention) { - default: - if (typeof object.retention === "number") { - message.retention = object.retention; - break; - } - break; - case "RETENTION_UNKNOWN": - case 0: - message.retention = 0; - break; - case "RETENTION_RUNTIME": - case 1: - message.retention = 1; - break; - case "RETENTION_SOURCE": - case 2: - message.retention = 2; - break; - } - if (object.targets) { - if (!Array.isArray(object.targets)) - throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); - message.targets = []; - for (var i = 0; i < object.targets.length; ++i) - switch (object.targets[i]) { - default: - if (typeof object.targets[i] === "number") { - message.targets[i] = object.targets[i]; - break; - } - case "TARGET_TYPE_UNKNOWN": - case 0: - message.targets[i] = 0; - break; - case "TARGET_TYPE_FILE": - case 1: - message.targets[i] = 1; - break; - case "TARGET_TYPE_EXTENSION_RANGE": - case 2: - message.targets[i] = 2; - break; - case "TARGET_TYPE_MESSAGE": - case 3: - message.targets[i] = 3; - break; - case "TARGET_TYPE_FIELD": - case 4: - message.targets[i] = 4; - break; - case "TARGET_TYPE_ONEOF": - case 5: - message.targets[i] = 5; - break; - case "TARGET_TYPE_ENUM": - case 6: - message.targets[i] = 6; - break; - case "TARGET_TYPE_ENUM_ENTRY": - case 7: - message.targets[i] = 7; - break; - case "TARGET_TYPE_SERVICE": - case 8: - message.targets[i] = 8; - break; - case "TARGET_TYPE_METHOD": - case 9: - message.targets[i] = 9; - break; - } - } - if (object.editionDefaults) { - if (!Array.isArray(object.editionDefaults)) - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); - message.editionDefaults = []; - for (var i = 0; i < object.editionDefaults.length; ++i) { - if (typeof object.editionDefaults[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); - message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FieldOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.fieldBehavior"]) { - if (!Array.isArray(object[".google.api.fieldBehavior"])) - throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); - message[".google.api.fieldBehavior"] = []; - for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) - switch (object[".google.api.fieldBehavior"][i]) { - default: - if (typeof object[".google.api.fieldBehavior"][i] === "number") { - message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; - break; - } - case "FIELD_BEHAVIOR_UNSPECIFIED": - case 0: - message[".google.api.fieldBehavior"][i] = 0; - break; - case "OPTIONAL": - case 1: - message[".google.api.fieldBehavior"][i] = 1; - break; - case "REQUIRED": - case 2: - message[".google.api.fieldBehavior"][i] = 2; - break; - case "OUTPUT_ONLY": - case 3: - message[".google.api.fieldBehavior"][i] = 3; - break; - case "INPUT_ONLY": - case 4: - message[".google.api.fieldBehavior"][i] = 4; - break; - case "IMMUTABLE": - case 5: - message[".google.api.fieldBehavior"][i] = 5; - break; - case "UNORDERED_LIST": - case 6: - message[".google.api.fieldBehavior"][i] = 6; - break; - case "NON_EMPTY_DEFAULT": - case 7: - message[".google.api.fieldBehavior"][i] = 7; - break; - case "IDENTIFIER": - case 8: - message[".google.api.fieldBehavior"][i] = 8; - break; - } - } - if (object[".google.api.resourceReference"] != null) { - if (typeof object[".google.api.resourceReference"] !== "object") - throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); - } - return message; - }; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.FieldOptions} message FieldOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.targets = []; - object.editionDefaults = []; - object.uninterpretedOption = []; - object[".google.api.fieldBehavior"] = []; - } - if (options.defaults) { - object.ctype = options.enums === String ? "STRING" : 0; - object.packed = false; - object.deprecated = false; - object.lazy = false; - object.jstype = options.enums === String ? "JS_NORMAL" : 0; - object.weak = false; - object.unverifiedLazy = false; - object.debugRedact = false; - object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; - object.features = null; - object[".google.api.resourceReference"] = null; - } - if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; - if (message.packed != null && message.hasOwnProperty("packed")) - object.packed = message.packed; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.lazy != null && message.hasOwnProperty("lazy")) - object.lazy = message.lazy; - if (message.jstype != null && message.hasOwnProperty("jstype")) - object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; - if (message.weak != null && message.hasOwnProperty("weak")) - object.weak = message.weak; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - object.unverifiedLazy = message.unverifiedLazy; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.retention != null && message.hasOwnProperty("retention")) - object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; - if (message.targets && message.targets.length) { - object.targets = []; - for (var j = 0; j < message.targets.length; ++j) - object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; - } - if (message.editionDefaults && message.editionDefaults.length) { - object.editionDefaults = []; - for (var j = 0; j < message.editionDefaults.length; ++j) - object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { - object[".google.api.fieldBehavior"] = []; - for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) - object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) - object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); - return object; - }; - - /** - * Converts this FieldOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions - * @instance - * @returns {Object.} JSON object - */ - FieldOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldOptions - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions"; - }; - - /** - * CType enum. - * @name google.protobuf.FieldOptions.CType - * @enum {number} - * @property {number} STRING=0 STRING value - * @property {number} CORD=1 CORD value - * @property {number} STRING_PIECE=2 STRING_PIECE value - */ - FieldOptions.CType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STRING"] = 0; - values[valuesById[1] = "CORD"] = 1; - values[valuesById[2] = "STRING_PIECE"] = 2; - return values; - })(); - - /** - * JSType enum. - * @name google.protobuf.FieldOptions.JSType - * @enum {number} - * @property {number} JS_NORMAL=0 JS_NORMAL value - * @property {number} JS_STRING=1 JS_STRING value - * @property {number} JS_NUMBER=2 JS_NUMBER value - */ - FieldOptions.JSType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JS_NORMAL"] = 0; - values[valuesById[1] = "JS_STRING"] = 1; - values[valuesById[2] = "JS_NUMBER"] = 2; - return values; - })(); - - /** - * OptionRetention enum. - * @name google.protobuf.FieldOptions.OptionRetention - * @enum {number} - * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value - * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value - * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value - */ - FieldOptions.OptionRetention = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; - values[valuesById[1] = "RETENTION_RUNTIME"] = 1; - values[valuesById[2] = "RETENTION_SOURCE"] = 2; - return values; - })(); - - /** - * OptionTargetType enum. - * @name google.protobuf.FieldOptions.OptionTargetType - * @enum {number} - * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value - * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value - * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value - * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value - * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value - * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value - * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value - * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value - * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value - * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value - */ - FieldOptions.OptionTargetType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; - values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; - values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; - values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; - values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; - values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; - values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; - values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; - values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; - return values; - })(); - - FieldOptions.EditionDefault = (function() { - - /** - * Properties of an EditionDefault. - * @memberof google.protobuf.FieldOptions - * @interface IEditionDefault - * @property {google.protobuf.Edition|null} [edition] EditionDefault edition - * @property {string|null} [value] EditionDefault value - */ - - /** - * Constructs a new EditionDefault. - * @memberof google.protobuf.FieldOptions - * @classdesc Represents an EditionDefault. - * @implements IEditionDefault - * @constructor - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - */ - function EditionDefault(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.edition = 0; - - /** - * EditionDefault value. - * @member {string} value - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.value = ""; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance - */ - EditionDefault.create = function create(properties) { - return new EditionDefault(properties); - }; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.value = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EditionDefault message. - * @function verify - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - */ - EditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) - return object; - var message = new $root.google.protobuf.FieldOptions.EditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.value = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this EditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - * @returns {Object.} JSON object - */ - EditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; - }; - - return EditionDefault; - })(); - - return FieldOptions; - })(); - - protobuf.OneofOptions = (function() { - - /** - * Properties of an OneofOptions. - * @memberof google.protobuf - * @interface IOneofOptions - * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features - * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption - */ - - /** - * Constructs a new OneofOptions. - * @memberof google.protobuf - * @classdesc Represents an OneofOptions. - * @implements IOneofOptions - * @constructor - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - */ - function OneofOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.features = null; - - /** - * OneofOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - * @returns {google.protobuf.OneofOptions} OneofOptions instance - */ - OneofOptions.create = function create(properties) { - return new OneofOptions(properties); - }; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofOptions message. - * @function verify - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofOptions} OneofOptions - */ - OneofOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofOptions) - return object; - var message = new $root.google.protobuf.OneofOptions(); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.OneofOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.OneofOptions} message OneofOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) - object.features = null; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this OneofOptions to JSON. - * @function toJSON - * @memberof google.protobuf.OneofOptions - * @instance - * @returns {Object.} JSON object - */ - OneofOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofOptions - * @function getTypeUrl - * @memberof google.protobuf.OneofOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofOptions"; - }; - - return OneofOptions; - })(); - - protobuf.EnumOptions = (function() { - - /** - * Properties of an EnumOptions. - * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allowAlias] EnumOptions allowAlias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features - * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption - */ - - /** - * Constructs a new EnumOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumOptions. - * @implements IEnumOptions - * @constructor - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - */ - function EnumOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumOptions allowAlias. - * @member {boolean} allowAlias - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.allowAlias = false; - - /** - * EnumOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecated = false; - - /** - * EnumOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * EnumOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.features = null; - - /** - * EnumOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumOptions} EnumOptions instance - */ - EnumOptions.create = function create(properties) { - return new EnumOptions(properties); - }; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.allowAlias = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 6: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 7: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumOptions message. - * @function verify - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - if (typeof message.allowAlias !== "boolean") - return "allowAlias: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumOptions} EnumOptions - */ - EnumOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumOptions) - return object; - var message = new $root.google.protobuf.EnumOptions(); - if (object.allowAlias != null) - message.allowAlias = Boolean(object.allowAlias); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.EnumOptions} message EnumOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.allowAlias = false; - object.deprecated = false; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - } - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - object.allowAlias = message.allowAlias; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumOptions - * @instance - * @returns {Object.} JSON object - */ - EnumOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumOptions"; - }; - - return EnumOptions; - })(); - - protobuf.EnumValueOptions = (function() { - - /** - * Properties of an EnumValueOptions. - * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features - * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact - * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption - */ - - /** - * Constructs a new EnumValueOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumValueOptions. - * @implements IEnumValueOptions - * @constructor - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - */ - function EnumValueOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.deprecated = false; - - /** - * EnumValueOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.features = null; - - /** - * EnumValueOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.debugRedact = false; - - /** - * EnumValueOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance - */ - EnumValueOptions.create = function create(properties) { - return new EnumValueOptions(properties); - }; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.deprecated = reader.bool(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 3: { - message.debugRedact = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueOptions message. - * @function verify - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - */ - EnumValueOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueOptions) - return object; - var message = new $root.google.protobuf.EnumValueOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.EnumValueOptions} message EnumValueOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object.features = null; - object.debugRedact = false; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumValueOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueOptions - * @instance - * @returns {Object.} JSON object - */ - EnumValueOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; - }; - - return EnumValueOptions; - })(); - - protobuf.ServiceOptions = (function() { - - /** - * Properties of a ServiceOptions. - * @memberof google.protobuf - * @interface IServiceOptions - * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features - * @property {boolean|null} [deprecated] ServiceOptions deprecated - * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption - * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost - * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes - * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion - */ - - /** - * Constructs a new ServiceOptions. - * @memberof google.protobuf - * @classdesc Represents a ServiceOptions. - * @implements IServiceOptions - * @constructor - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - */ - function ServiceOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.features = null; - - /** - * ServiceOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.deprecated = false; - - /** - * ServiceOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ServiceOptions .google.api.defaultHost. - * @member {string} .google.api.defaultHost - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.defaultHost"] = ""; - - /** - * ServiceOptions .google.api.oauthScopes. - * @member {string} .google.api.oauthScopes - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.oauthScopes"] = ""; - - /** - * ServiceOptions .google.api.apiVersion. - * @member {string} .google.api.apiVersion - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.apiVersion"] = ""; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - * @returns {google.protobuf.ServiceOptions} ServiceOptions instance - */ - ServiceOptions.create = function create(properties) { - return new ServiceOptions(properties); - }; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) - writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); - if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) - writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); - if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) - writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); - return writer; - }; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 34: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 33: { - message.deprecated = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 1049: { - message[".google.api.defaultHost"] = reader.string(); - break; - } - case 1050: { - message[".google.api.oauthScopes"] = reader.string(); - break; - } - case 525000001: { - message[".google.api.apiVersion"] = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceOptions message. - * @function verify - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - if (!$util.isString(message[".google.api.defaultHost"])) - return ".google.api.defaultHost: string expected"; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - if (!$util.isString(message[".google.api.oauthScopes"])) - return ".google.api.oauthScopes: string expected"; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - if (!$util.isString(message[".google.api.apiVersion"])) - return ".google.api.apiVersion: string expected"; - return null; - }; - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions - */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) - return object; - var message = new $root.google.protobuf.ServiceOptions(); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.defaultHost"] != null) - message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); - if (object[".google.api.oauthScopes"] != null) - message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); - if (object[".google.api.apiVersion"] != null) - message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); - return message; - }; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object.features = null; - object[".google.api.defaultHost"] = ""; - object[".google.api.oauthScopes"] = ""; - object[".google.api.apiVersion"] = ""; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; - return object; - }; - - /** - * Converts this ServiceOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceOptions - * @instance - * @returns {Object.} JSON object - */ - ServiceOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceOptions - * @function getTypeUrl - * @memberof google.protobuf.ServiceOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceOptions"; - }; - - return ServiceOptions; - })(); - - protobuf.MethodOptions = (function() { - - /** - * Properties of a MethodOptions. - * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel - * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features - * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption - * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http - * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature - * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo - */ - - /** - * Constructs a new MethodOptions. - * @memberof google.protobuf - * @classdesc Represents a MethodOptions. - * @implements IMethodOptions - * @constructor - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - */ - function MethodOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.methodSignature"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.deprecated = false; - - /** - * MethodOptions idempotencyLevel. - * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.idempotencyLevel = 0; - - /** - * MethodOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.features = null; - - /** - * MethodOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * MethodOptions .google.api.http. - * @member {google.api.IHttpRule|null|undefined} .google.api.http - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.http"] = null; - - /** - * MethodOptions .google.api.methodSignature. - * @member {Array.} .google.api.methodSignature - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; - - /** - * MethodOptions .google.longrunning.operationInfo. - * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.longrunning.operationInfo"] = null; - - /** - * Creates a new MethodOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - * @returns {google.protobuf.MethodOptions} MethodOptions instance - */ - MethodOptions.create = function create(properties) { - return new MethodOptions(properties); - }; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) - writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) - $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); - if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); - if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) - $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 33: { - message.deprecated = reader.bool(); - break; - } - case 34: { - message.idempotencyLevel = reader.int32(); - break; - } - case 35: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - } - case 72295728: { - message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); - break; - } - case 1051: { - if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) - message[".google.api.methodSignature"] = []; - message[".google.api.methodSignature"].push(reader.string()); - break; - } - case 1049: { - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodOptions message. - * @function verify - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - switch (message.idempotencyLevel) { - default: - return "idempotencyLevel: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { - var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); - if (error) - return ".google.api.http." + error; - } - if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { - if (!Array.isArray(message[".google.api.methodSignature"])) - return ".google.api.methodSignature: array expected"; - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - if (!$util.isString(message[".google.api.methodSignature"][i])) - return ".google.api.methodSignature: string[] expected"; - } - if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { - var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); - if (error) - return ".google.longrunning.operationInfo." + error; - } - return null; - }; - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodOptions} MethodOptions - */ - MethodOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodOptions) - return object; - var message = new $root.google.protobuf.MethodOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - switch (object.idempotencyLevel) { - default: - if (typeof object.idempotencyLevel === "number") { - message.idempotencyLevel = object.idempotencyLevel; - break; - } - break; - case "IDEMPOTENCY_UNKNOWN": - case 0: - message.idempotencyLevel = 0; - break; - case "NO_SIDE_EFFECTS": - case 1: - message.idempotencyLevel = 1; - break; - case "IDEMPOTENT": - case 2: - message.idempotencyLevel = 2; - break; - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MethodOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.http"] != null) { - if (typeof object[".google.api.http"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); - message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); - } - if (object[".google.api.methodSignature"]) { - if (!Array.isArray(object[".google.api.methodSignature"])) - throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); - message[".google.api.methodSignature"] = []; - for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) - message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); - } - if (object[".google.longrunning.operationInfo"] != null) { - if (typeof object[".google.longrunning.operationInfo"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); - } - return message; - }; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.MethodOptions} message MethodOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.methodSignature"] = []; - } - if (options.defaults) { - object.deprecated = false; - object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; - object.features = null; - object[".google.longrunning.operationInfo"] = null; - object[".google.api.http"] = null; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) - object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); - if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { - object[".google.api.methodSignature"] = []; - for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) - object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) - object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); - return object; - }; - - /** - * Converts this MethodOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MethodOptions - * @instance - * @returns {Object.} JSON object - */ - MethodOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodOptions - * @function getTypeUrl - * @memberof google.protobuf.MethodOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodOptions"; - }; - - /** - * IdempotencyLevel enum. - * @name google.protobuf.MethodOptions.IdempotencyLevel - * @enum {number} - * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value - * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value - * @property {number} IDEMPOTENT=2 IDEMPOTENT value - */ - MethodOptions.IdempotencyLevel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; - values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; - values[valuesById[2] = "IDEMPOTENT"] = 2; - return values; - })(); - - return MethodOptions; - })(); - - protobuf.UninterpretedOption = (function() { - - /** - * Properties of an UninterpretedOption. - * @memberof google.protobuf - * @interface IUninterpretedOption - * @property {Array.|null} [name] UninterpretedOption name - * @property {string|null} [identifierValue] UninterpretedOption identifierValue - * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue - * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue - * @property {number|null} [doubleValue] UninterpretedOption doubleValue - * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue - * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue - */ - - /** - * Constructs a new UninterpretedOption. - * @memberof google.protobuf - * @classdesc Represents an UninterpretedOption. - * @implements IUninterpretedOption - * @constructor - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - */ - function UninterpretedOption(properties) { - this.name = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UninterpretedOption name. - * @member {Array.} name - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.name = $util.emptyArray; - - /** - * UninterpretedOption identifierValue. - * @member {string} identifierValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.identifierValue = ""; - - /** - * UninterpretedOption positiveIntValue. - * @member {number|Long} positiveIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * UninterpretedOption negativeIntValue. - * @member {number|Long} negativeIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * UninterpretedOption doubleValue. - * @member {number} doubleValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.doubleValue = 0; - - /** - * UninterpretedOption stringValue. - * @member {Uint8Array} stringValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.stringValue = $util.newBuffer([]); - - /** - * UninterpretedOption aggregateValue. - * @member {string} aggregateValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.aggregateValue = ""; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance - */ - UninterpretedOption.create = function create(properties) { - return new UninterpretedOption(properties); - }; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.name.length) - for (var i = 0; i < message.name.length; ++i) - $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) - writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); - return writer; - }; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - if (!(message.name && message.name.length)) - message.name = []; - message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); - break; - } - case 3: { - message.identifierValue = reader.string(); - break; - } - case 4: { - message.positiveIntValue = reader.uint64(); - break; - } - case 5: { - message.negativeIntValue = reader.int64(); - break; - } - case 6: { - message.doubleValue = reader.double(); - break; - } - case 7: { - message.stringValue = reader.bytes(); - break; - } - case 8: { - message.aggregateValue = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UninterpretedOption message. - * @function verify - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UninterpretedOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) { - if (!Array.isArray(message.name)) - return "name: array expected"; - for (var i = 0; i < message.name.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); - if (error) - return "name." + error; - } - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - if (!$util.isString(message.identifierValue)) - return "identifierValue: string expected"; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) - return "positiveIntValue: integer|Long expected"; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) - return "negativeIntValue: integer|Long expected"; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - if (typeof message.doubleValue !== "number") - return "doubleValue: number expected"; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) - return "stringValue: buffer expected"; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - if (!$util.isString(message.aggregateValue)) - return "aggregateValue: string expected"; - return null; - }; - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - */ - UninterpretedOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption) - return object; - var message = new $root.google.protobuf.UninterpretedOption(); - if (object.name) { - if (!Array.isArray(object.name)) - throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); - message.name = []; - for (var i = 0; i < object.name.length; ++i) { - if (typeof object.name[i] !== "object") - throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); - message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); - } - } - if (object.identifierValue != null) - message.identifierValue = String(object.identifierValue); - if (object.positiveIntValue != null) - if ($util.Long) - (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; - else if (typeof object.positiveIntValue === "string") - message.positiveIntValue = parseInt(object.positiveIntValue, 10); - else if (typeof object.positiveIntValue === "number") - message.positiveIntValue = object.positiveIntValue; - else if (typeof object.positiveIntValue === "object") - message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); - if (object.negativeIntValue != null) - if ($util.Long) - (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; - else if (typeof object.negativeIntValue === "string") - message.negativeIntValue = parseInt(object.negativeIntValue, 10); - else if (typeof object.negativeIntValue === "number") - message.negativeIntValue = object.negativeIntValue; - else if (typeof object.negativeIntValue === "object") - message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); - if (object.doubleValue != null) - message.doubleValue = Number(object.doubleValue); - if (object.stringValue != null) - if (typeof object.stringValue === "string") - $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); - else if (object.stringValue.length >= 0) - message.stringValue = object.stringValue; - if (object.aggregateValue != null) - message.aggregateValue = String(object.aggregateValue); - return message; - }; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.UninterpretedOption} message UninterpretedOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UninterpretedOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.name = []; - if (options.defaults) { - object.identifierValue = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.positiveIntValue = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.negativeIntValue = options.longs === String ? "0" : 0; - object.doubleValue = 0; - if (options.bytes === String) - object.stringValue = ""; - else { - object.stringValue = []; - if (options.bytes !== Array) - object.stringValue = $util.newBuffer(object.stringValue); - } - object.aggregateValue = ""; - } - if (message.name && message.name.length) { - object.name = []; - for (var j = 0; j < message.name.length; ++j) - object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - object.identifierValue = message.identifierValue; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (typeof message.positiveIntValue === "number") - object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; - else - object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (typeof message.negativeIntValue === "number") - object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; - else - object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - object.aggregateValue = message.aggregateValue; - return object; - }; - - /** - * Converts this UninterpretedOption to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption - * @instance - * @returns {Object.} JSON object - */ - UninterpretedOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UninterpretedOption - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; - }; - - UninterpretedOption.NamePart = (function() { - - /** - * Properties of a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} namePart NamePart namePart - * @property {boolean} isExtension NamePart isExtension - */ - - /** - * Constructs a new NamePart. - * @memberof google.protobuf.UninterpretedOption - * @classdesc Represents a NamePart. - * @implements INamePart - * @constructor - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - */ - function NamePart(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NamePart namePart. - * @member {string} namePart - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.namePart = ""; - - /** - * NamePart isExtension. - * @member {boolean} isExtension - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.isExtension = false; - - /** - * Creates a new NamePart instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance - */ - NamePart.create = function create(properties) { - return new NamePart(properties); - }; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); - return writer; - }; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.namePart = reader.string(); - break; - } - case 2: { - message.isExtension = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - if (!message.hasOwnProperty("namePart")) - throw $util.ProtocolError("missing required 'namePart'", { instance: message }); - if (!message.hasOwnProperty("isExtension")) - throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); - return message; - }; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NamePart message. - * @function verify - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NamePart.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (!$util.isString(message.namePart)) - return "namePart: string expected"; - if (typeof message.isExtension !== "boolean") - return "isExtension: boolean expected"; - return null; - }; - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - */ - NamePart.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) - return object; - var message = new $root.google.protobuf.UninterpretedOption.NamePart(); - if (object.namePart != null) - message.namePart = String(object.namePart); - if (object.isExtension != null) - message.isExtension = Boolean(object.isExtension); - return message; - }; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NamePart.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.namePart = ""; - object.isExtension = false; - } - if (message.namePart != null && message.hasOwnProperty("namePart")) - object.namePart = message.namePart; - if (message.isExtension != null && message.hasOwnProperty("isExtension")) - object.isExtension = message.isExtension; - return object; - }; - - /** - * Converts this NamePart to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - * @returns {Object.} JSON object - */ - NamePart.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NamePart - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; - }; - - return NamePart; - })(); - - return UninterpretedOption; - })(); - - protobuf.FeatureSet = (function() { - - /** - * Properties of a FeatureSet. - * @memberof google.protobuf - * @interface IFeatureSet - * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence - * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType - * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding - * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation - * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding - * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat - */ - - /** - * Constructs a new FeatureSet. - * @memberof google.protobuf - * @classdesc Represents a FeatureSet. - * @implements IFeatureSet - * @constructor - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - */ - function FeatureSet(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSet fieldPresence. - * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.fieldPresence = 0; - - /** - * FeatureSet enumType. - * @member {google.protobuf.FeatureSet.EnumType} enumType - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.enumType = 0; - - /** - * FeatureSet repeatedFieldEncoding. - * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.repeatedFieldEncoding = 0; - - /** - * FeatureSet utf8Validation. - * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.utf8Validation = 0; - - /** - * FeatureSet messageEncoding. - * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.messageEncoding = 0; - - /** - * FeatureSet jsonFormat. - * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.jsonFormat = 0; - - /** - * Creates a new FeatureSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - * @returns {google.protobuf.FeatureSet} FeatureSet instance - */ - FeatureSet.create = function create(properties) { - return new FeatureSet(properties); - }; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); - if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); - if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); - if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); - if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); - if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); - return writer; - }; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.fieldPresence = reader.int32(); - break; - } - case 2: { - message.enumType = reader.int32(); - break; - } - case 3: { - message.repeatedFieldEncoding = reader.int32(); - break; - } - case 4: { - message.utf8Validation = reader.int32(); - break; - } - case 5: { - message.messageEncoding = reader.int32(); - break; - } - case 6: { - message.jsonFormat = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSet message. - * @function verify - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - switch (message.fieldPresence) { - default: - return "fieldPresence: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.enumType != null && message.hasOwnProperty("enumType")) - switch (message.enumType) { - default: - return "enumType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - switch (message.repeatedFieldEncoding) { - default: - return "repeatedFieldEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - switch (message.utf8Validation) { - default: - return "utf8Validation: enum value expected"; - case 0: - case 2: - case 3: - break; - } - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - switch (message.messageEncoding) { - default: - return "messageEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - switch (message.jsonFormat) { - default: - return "jsonFormat: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSet} FeatureSet - */ - FeatureSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSet) - return object; - var message = new $root.google.protobuf.FeatureSet(); - switch (object.fieldPresence) { - default: - if (typeof object.fieldPresence === "number") { - message.fieldPresence = object.fieldPresence; - break; - } - break; - case "FIELD_PRESENCE_UNKNOWN": - case 0: - message.fieldPresence = 0; - break; - case "EXPLICIT": - case 1: - message.fieldPresence = 1; - break; - case "IMPLICIT": - case 2: - message.fieldPresence = 2; - break; - case "LEGACY_REQUIRED": - case 3: - message.fieldPresence = 3; - break; - } - switch (object.enumType) { - default: - if (typeof object.enumType === "number") { - message.enumType = object.enumType; - break; - } - break; - case "ENUM_TYPE_UNKNOWN": - case 0: - message.enumType = 0; - break; - case "OPEN": - case 1: - message.enumType = 1; - break; - case "CLOSED": - case 2: - message.enumType = 2; - break; - } - switch (object.repeatedFieldEncoding) { - default: - if (typeof object.repeatedFieldEncoding === "number") { - message.repeatedFieldEncoding = object.repeatedFieldEncoding; - break; - } - break; - case "REPEATED_FIELD_ENCODING_UNKNOWN": - case 0: - message.repeatedFieldEncoding = 0; - break; - case "PACKED": - case 1: - message.repeatedFieldEncoding = 1; - break; - case "EXPANDED": - case 2: - message.repeatedFieldEncoding = 2; - break; - } - switch (object.utf8Validation) { - default: - if (typeof object.utf8Validation === "number") { - message.utf8Validation = object.utf8Validation; - break; - } - break; - case "UTF8_VALIDATION_UNKNOWN": - case 0: - message.utf8Validation = 0; - break; - case "VERIFY": - case 2: - message.utf8Validation = 2; - break; - case "NONE": - case 3: - message.utf8Validation = 3; - break; - } - switch (object.messageEncoding) { - default: - if (typeof object.messageEncoding === "number") { - message.messageEncoding = object.messageEncoding; - break; - } - break; - case "MESSAGE_ENCODING_UNKNOWN": - case 0: - message.messageEncoding = 0; - break; - case "LENGTH_PREFIXED": - case 1: - message.messageEncoding = 1; - break; - case "DELIMITED": - case 2: - message.messageEncoding = 2; - break; - } - switch (object.jsonFormat) { - default: - if (typeof object.jsonFormat === "number") { - message.jsonFormat = object.jsonFormat; - break; - } - break; - case "JSON_FORMAT_UNKNOWN": - case 0: - message.jsonFormat = 0; - break; - case "ALLOW": - case 1: - message.jsonFormat = 1; - break; - case "LEGACY_BEST_EFFORT": - case 2: - message.jsonFormat = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.FeatureSet} message FeatureSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; - object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; - object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; - object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; - object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; - object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; - } - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; - if (message.enumType != null && message.hasOwnProperty("enumType")) - object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; - return object; - }; - - /** - * Converts this FeatureSet to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSet - * @instance - * @returns {Object.} JSON object - */ - FeatureSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSet - * @function getTypeUrl - * @memberof google.protobuf.FeatureSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSet"; - }; - - /** - * FieldPresence enum. - * @name google.protobuf.FeatureSet.FieldPresence - * @enum {number} - * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value - * @property {number} EXPLICIT=1 EXPLICIT value - * @property {number} IMPLICIT=2 IMPLICIT value - * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value - */ - FeatureSet.FieldPresence = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; - values[valuesById[1] = "EXPLICIT"] = 1; - values[valuesById[2] = "IMPLICIT"] = 2; - values[valuesById[3] = "LEGACY_REQUIRED"] = 3; - return values; - })(); - - /** - * EnumType enum. - * @name google.protobuf.FeatureSet.EnumType - * @enum {number} - * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value - * @property {number} OPEN=1 OPEN value - * @property {number} CLOSED=2 CLOSED value - */ - FeatureSet.EnumType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "OPEN"] = 1; - values[valuesById[2] = "CLOSED"] = 2; - return values; - })(); - - /** - * RepeatedFieldEncoding enum. - * @name google.protobuf.FeatureSet.RepeatedFieldEncoding - * @enum {number} - * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value - * @property {number} PACKED=1 PACKED value - * @property {number} EXPANDED=2 EXPANDED value - */ - FeatureSet.RepeatedFieldEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "PACKED"] = 1; - values[valuesById[2] = "EXPANDED"] = 2; - return values; - })(); - - /** - * Utf8Validation enum. - * @name google.protobuf.FeatureSet.Utf8Validation - * @enum {number} - * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value - * @property {number} VERIFY=2 VERIFY value - * @property {number} NONE=3 NONE value - */ - FeatureSet.Utf8Validation = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; - values[valuesById[2] = "VERIFY"] = 2; - values[valuesById[3] = "NONE"] = 3; - return values; - })(); - - /** - * MessageEncoding enum. - * @name google.protobuf.FeatureSet.MessageEncoding - * @enum {number} - * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value - * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value - * @property {number} DELIMITED=2 DELIMITED value - */ - FeatureSet.MessageEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "LENGTH_PREFIXED"] = 1; - values[valuesById[2] = "DELIMITED"] = 2; - return values; - })(); - - /** - * JsonFormat enum. - * @name google.protobuf.FeatureSet.JsonFormat - * @enum {number} - * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value - * @property {number} ALLOW=1 ALLOW value - * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value - */ - FeatureSet.JsonFormat = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; - values[valuesById[1] = "ALLOW"] = 1; - values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; - return values; - })(); - - return FeatureSet; - })(); - - protobuf.FeatureSetDefaults = (function() { - - /** - * Properties of a FeatureSetDefaults. - * @memberof google.protobuf - * @interface IFeatureSetDefaults - * @property {Array.|null} [defaults] FeatureSetDefaults defaults - * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition - * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition - */ - - /** - * Constructs a new FeatureSetDefaults. - * @memberof google.protobuf - * @classdesc Represents a FeatureSetDefaults. - * @implements IFeatureSetDefaults - * @constructor - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - */ - function FeatureSetDefaults(properties) { - this.defaults = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSetDefaults defaults. - * @member {Array.} defaults - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.defaults = $util.emptyArray; - - /** - * FeatureSetDefaults minimumEdition. - * @member {google.protobuf.Edition} minimumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.minimumEdition = 0; - - /** - * FeatureSetDefaults maximumEdition. - * @member {google.protobuf.Edition} maximumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.maximumEdition = 0; - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance - */ - FeatureSetDefaults.create = function create(properties) { - return new FeatureSetDefaults(properties); - }; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.defaults != null && message.defaults.length) - for (var i = 0; i < message.defaults.length; ++i) - $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); - if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); - return writer; - }; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.defaults && message.defaults.length)) - message.defaults = []; - message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); - break; - } - case 4: { - message.minimumEdition = reader.int32(); - break; - } - case 5: { - message.maximumEdition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetDefaults message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetDefaults.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.defaults != null && message.hasOwnProperty("defaults")) { - if (!Array.isArray(message.defaults)) - return "defaults: array expected"; - for (var i = 0; i < message.defaults.length; ++i) { - var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); - if (error) - return "defaults." + error; - } - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - switch (message.minimumEdition) { - default: - return "minimumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - switch (message.maximumEdition) { - default: - return "maximumEdition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - */ - FeatureSetDefaults.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults(); - if (object.defaults) { - if (!Array.isArray(object.defaults)) - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); - message.defaults = []; - for (var i = 0; i < object.defaults.length; ++i) { - if (typeof object.defaults[i] !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); - message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); - } - } - switch (object.minimumEdition) { - default: - if (typeof object.minimumEdition === "number") { - message.minimumEdition = object.minimumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.minimumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.minimumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.minimumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.minimumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.minimumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.minimumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.minimumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.minimumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.minimumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.minimumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.minimumEdition = 2147483647; - break; - } - switch (object.maximumEdition) { - default: - if (typeof object.maximumEdition === "number") { - message.maximumEdition = object.maximumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.maximumEdition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.maximumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.maximumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.maximumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.maximumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.maximumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.maximumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.maximumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.maximumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.maximumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.maximumEdition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetDefaults.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.defaults = []; - if (options.defaults) { - object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.defaults && message.defaults.length) { - object.defaults = []; - for (var j = 0; j < message.defaults.length; ++j) - object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; - return object; - }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults - * @instance - * @returns {Object.} JSON object - */ - FeatureSetDefaults.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetDefaults - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; - }; - - FeatureSetDefaults.FeatureSetEditionDefault = (function() { - - /** - * Properties of a FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @interface IFeatureSetEditionDefault - * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features - */ - - /** - * Constructs a new FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @classdesc Represents a FeatureSetEditionDefault. - * @implements IFeatureSetEditionDefault - * @constructor - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - */ - function FeatureSetEditionDefault(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSetEditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.edition = 0; - - /** - * FeatureSetEditionDefault features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.features = null; - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance - */ - FeatureSetEditionDefault.create = function create(properties) { - return new FeatureSetEditionDefault(properties); - }; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetEditionDefault message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetEditionDefault.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - return null; - }; - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - */ - FeatureSetEditionDefault.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) - return object; - var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetEditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.features = null; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - * @returns {Object.} JSON object - */ - FeatureSetEditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; - }; - - return FeatureSetEditionDefault; - })(); - - return FeatureSetDefaults; - })(); - - protobuf.SourceCodeInfo = (function() { - - /** - * Properties of a SourceCodeInfo. - * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|null} [location] SourceCodeInfo location - */ - - /** - * Constructs a new SourceCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a SourceCodeInfo. - * @implements ISourceCodeInfo - * @constructor - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - */ - function SourceCodeInfo(properties) { - this.location = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SourceCodeInfo location. - * @member {Array.} location - * @memberof google.protobuf.SourceCodeInfo - * @instance - */ - SourceCodeInfo.prototype.location = $util.emptyArray; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance - */ - SourceCodeInfo.create = function create(properties) { - return new SourceCodeInfo(properties); - }; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && message.location.length) - for (var i = 0; i < message.location.length; ++i) - $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.location && message.location.length)) - message.location = []; - message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SourceCodeInfo message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SourceCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) { - if (!Array.isArray(message.location)) - return "location: array expected"; - for (var i = 0; i < message.location.length; ++i) { - var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); - if (error) - return "location." + error; - } - } - return null; - }; - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - */ - SourceCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo) - return object; - var message = new $root.google.protobuf.SourceCodeInfo(); - if (object.location) { - if (!Array.isArray(object.location)) - throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); - message.location = []; - for (var i = 0; i < object.location.length; ++i) { - if (typeof object.location[i] !== "object") - throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); - message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SourceCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.location = []; - if (message.location && message.location.length) { - object.location = []; - for (var j = 0; j < message.location.length; ++j) - object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); - } - return object; - }; - - /** - * Converts this SourceCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo - * @instance - * @returns {Object.} JSON object - */ - SourceCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SourceCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; - }; - - SourceCodeInfo.Location = (function() { - - /** - * Properties of a Location. - * @memberof google.protobuf.SourceCodeInfo - * @interface ILocation - * @property {Array.|null} [path] Location path - * @property {Array.|null} [span] Location span - * @property {string|null} [leadingComments] Location leadingComments - * @property {string|null} [trailingComments] Location trailingComments - * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments - */ - - /** - * Constructs a new Location. - * @memberof google.protobuf.SourceCodeInfo - * @classdesc Represents a Location. - * @implements ILocation - * @constructor - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - */ - function Location(properties) { - this.path = []; - this.span = []; - this.leadingDetachedComments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Location path. - * @member {Array.} path - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.path = $util.emptyArray; - - /** - * Location span. - * @member {Array.} span - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.span = $util.emptyArray; - - /** - * Location leadingComments. - * @member {string} leadingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingComments = ""; - - /** - * Location trailingComments. - * @member {string} trailingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.trailingComments = ""; - - /** - * Location leadingDetachedComments. - * @member {Array.} leadingDetachedComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingDetachedComments = $util.emptyArray; - - /** - * Creates a new Location instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo.Location} Location instance - */ - Location.create = function create(properties) { - return new Location(properties); - }; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.span != null && message.span.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.span.length; ++i) - writer.int32(message.span[i]); - writer.ldelim(); - } - if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); - if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); - return writer; - }; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Location message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - if (!(message.span && message.span.length)) - message.span = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.span.push(reader.int32()); - } else - message.span.push(reader.int32()); - break; - } - case 3: { - message.leadingComments = reader.string(); - break; - } - case 4: { - message.trailingComments = reader.string(); - break; - } - case 6: { - if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) - message.leadingDetachedComments = []; - message.leadingDetachedComments.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Location message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Location.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.span != null && message.hasOwnProperty("span")) { - if (!Array.isArray(message.span)) - return "span: array expected"; - for (var i = 0; i < message.span.length; ++i) - if (!$util.isInteger(message.span[i])) - return "span: integer[] expected"; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - if (!$util.isString(message.leadingComments)) - return "leadingComments: string expected"; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - if (!$util.isString(message.trailingComments)) - return "trailingComments: string expected"; - if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { - if (!Array.isArray(message.leadingDetachedComments)) - return "leadingDetachedComments: array expected"; - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - if (!$util.isString(message.leadingDetachedComments[i])) - return "leadingDetachedComments: string[] expected"; - } - return null; - }; - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo.Location} Location - */ - Location.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) - return object; - var message = new $root.google.protobuf.SourceCodeInfo.Location(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.span) { - if (!Array.isArray(object.span)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); - message.span = []; - for (var i = 0; i < object.span.length; ++i) - message.span[i] = object.span[i] | 0; - } - if (object.leadingComments != null) - message.leadingComments = String(object.leadingComments); - if (object.trailingComments != null) - message.trailingComments = String(object.trailingComments); - if (object.leadingDetachedComments) { - if (!Array.isArray(object.leadingDetachedComments)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); - message.leadingDetachedComments = []; - for (var i = 0; i < object.leadingDetachedComments.length; ++i) - message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); - } - return message; - }; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.Location} message Location - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Location.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.path = []; - object.span = []; - object.leadingDetachedComments = []; - } - if (options.defaults) { - object.leadingComments = ""; - object.trailingComments = ""; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.span && message.span.length) { - object.span = []; - for (var j = 0; j < message.span.length; ++j) - object.span[j] = message.span[j]; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - object.leadingComments = message.leadingComments; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - object.trailingComments = message.trailingComments; - if (message.leadingDetachedComments && message.leadingDetachedComments.length) { - object.leadingDetachedComments = []; - for (var j = 0; j < message.leadingDetachedComments.length; ++j) - object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; - } - return object; - }; - - /** - * Converts this Location to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - * @returns {Object.} JSON object - */ - Location.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Location - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; - }; - - return Location; - })(); - - return SourceCodeInfo; - })(); - - protobuf.GeneratedCodeInfo = (function() { - - /** - * Properties of a GeneratedCodeInfo. - * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation - */ - - /** - * Constructs a new GeneratedCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a GeneratedCodeInfo. - * @implements IGeneratedCodeInfo - * @constructor - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - */ - function GeneratedCodeInfo(properties) { - this.annotation = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GeneratedCodeInfo annotation. - * @member {Array.} annotation - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - */ - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance - */ - GeneratedCodeInfo.create = function create(properties) { - return new GeneratedCodeInfo(properties); - }; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.annotation != null && message.annotation.length) - for (var i = 0; i < message.annotation.length; ++i) - $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.annotation && message.annotation.length)) - message.annotation = []; - message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GeneratedCodeInfo message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GeneratedCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.annotation != null && message.hasOwnProperty("annotation")) { - if (!Array.isArray(message.annotation)) - return "annotation: array expected"; - for (var i = 0; i < message.annotation.length; ++i) { - var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); - if (error) - return "annotation." + error; - } - } - return null; - }; - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - */ - GeneratedCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo(); - if (object.annotation) { - if (!Array.isArray(object.annotation)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); - message.annotation = []; - for (var i = 0; i < object.annotation.length; ++i) { - if (typeof object.annotation[i] !== "object") - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); - message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GeneratedCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.annotation = []; - if (message.annotation && message.annotation.length) { - object.annotation = []; - for (var j = 0; j < message.annotation.length; ++j) - object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); - } - return object; - }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - * @returns {Object.} JSON object - */ - GeneratedCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; - }; - - GeneratedCodeInfo.Annotation = (function() { - - /** - * Properties of an Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @interface IAnnotation - * @property {Array.|null} [path] Annotation path - * @property {string|null} [sourceFile] Annotation sourceFile - * @property {number|null} [begin] Annotation begin - * @property {number|null} [end] Annotation end - * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic - */ - - /** - * Constructs a new Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @classdesc Represents an Annotation. - * @implements IAnnotation - * @constructor - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - */ - function Annotation(properties) { - this.path = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Annotation path. - * @member {Array.} path - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.path = $util.emptyArray; - - /** - * Annotation sourceFile. - * @member {string} sourceFile - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.sourceFile = ""; - - /** - * Annotation begin. - * @member {number} begin - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.begin = 0; - - /** - * Annotation end. - * @member {number} end - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.end = 0; - - /** - * Annotation semantic. - * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.semantic = 0; - - /** - * Creates a new Annotation instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance - */ - Annotation.create = function create(properties) { - return new Annotation(properties); - }; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); - if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); - return writer; - }; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - message.sourceFile = reader.string(); - break; - } - case 3: { - message.begin = reader.int32(); - break; - } - case 4: { - message.end = reader.int32(); - break; - } - case 5: { - message.semantic = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Annotation message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Annotation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - if (!$util.isString(message.sourceFile)) - return "sourceFile: string expected"; - if (message.begin != null && message.hasOwnProperty("begin")) - if (!$util.isInteger(message.begin)) - return "begin: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.semantic != null && message.hasOwnProperty("semantic")) - switch (message.semantic) { - default: - return "semantic: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - */ - Annotation.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.sourceFile != null) - message.sourceFile = String(object.sourceFile); - if (object.begin != null) - message.begin = object.begin | 0; - if (object.end != null) - message.end = object.end | 0; - switch (object.semantic) { - default: - if (typeof object.semantic === "number") { - message.semantic = object.semantic; - break; - } - break; - case "NONE": - case 0: - message.semantic = 0; - break; - case "SET": - case 1: - message.semantic = 1; - break; - case "ALIAS": - case 2: - message.semantic = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Annotation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.path = []; - if (options.defaults) { - object.sourceFile = ""; - object.begin = 0; - object.end = 0; - object.semantic = options.enums === String ? "NONE" : 0; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - object.sourceFile = message.sourceFile; - if (message.begin != null && message.hasOwnProperty("begin")) - object.begin = message.begin; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.semantic != null && message.hasOwnProperty("semantic")) - object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; - return object; - }; - - /** - * Converts this Annotation to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - * @returns {Object.} JSON object - */ - Annotation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Annotation - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; - }; - - /** - * Semantic enum. - * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic - * @enum {number} - * @property {number} NONE=0 NONE value - * @property {number} SET=1 SET value - * @property {number} ALIAS=2 ALIAS value - */ - Annotation.Semantic = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NONE"] = 0; - values[valuesById[1] = "SET"] = 1; - values[valuesById[2] = "ALIAS"] = 2; - return values; - })(); - - return Annotation; - })(); - - return GeneratedCodeInfo; - })(); - - protobuf.Duration = (function() { - - /** - * Properties of a Duration. - * @memberof google.protobuf - * @interface IDuration - * @property {number|Long|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos - */ - - /** - * Constructs a new Duration. - * @memberof google.protobuf - * @classdesc Represents a Duration. - * @implements IDuration - * @constructor - * @param {google.protobuf.IDuration=} [properties] Properties to set - */ - function Duration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Duration seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Duration nanos. - * @member {number} nanos - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.nanos = 0; - - /** - * Creates a new Duration instance using the specified properties. - * @function create - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration=} [properties] Properties to set - * @returns {google.protobuf.Duration} Duration instance - */ - Duration.create = function create(properties) { - return new Duration(properties); - }; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Duration message. - * @function verify - * @memberof google.protobuf.Duration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Duration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Duration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Duration} Duration - */ - Duration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Duration) - return object; - var message = new $root.google.protobuf.Duration(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.Duration} message Duration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Duration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Duration to JSON. - * @function toJSON - * @memberof google.protobuf.Duration - * @instance - * @returns {Object.} JSON object - */ - Duration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Duration - * @function getTypeUrl - * @memberof google.protobuf.Duration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Duration"; - }; - - return Duration; - })(); - - protobuf.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.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.FieldMask = (function() { - - /** - * Properties of a FieldMask. - * @memberof google.protobuf - * @interface IFieldMask - * @property {Array.|null} [paths] FieldMask paths - */ - - /** - * Constructs a new FieldMask. - * @memberof google.protobuf - * @classdesc Represents a FieldMask. - * @implements IFieldMask - * @constructor - * @param {google.protobuf.IFieldMask=} [properties] Properties to set - */ - function FieldMask(properties) { - this.paths = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldMask paths. - * @member {Array.} paths - * @memberof google.protobuf.FieldMask - * @instance - */ - FieldMask.prototype.paths = $util.emptyArray; - - /** - * Creates a new FieldMask instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask=} [properties] Properties to set - * @returns {google.protobuf.FieldMask} FieldMask instance - */ - FieldMask.create = function create(properties) { - return new FieldMask(properties); - }; - - /** - * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldMask.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.paths != null && message.paths.length) - for (var i = 0; i < message.paths.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); - return writer; - }; - - /** - * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldMask.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldMask message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldMask - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldMask} FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldMask.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.paths && message.paths.length)) - message.paths = []; - message.paths.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldMask message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldMask - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldMask} FieldMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldMask.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldMask message. - * @function verify - * @memberof google.protobuf.FieldMask - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldMask.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.paths != null && message.hasOwnProperty("paths")) { - if (!Array.isArray(message.paths)) - return "paths: array expected"; - for (var i = 0; i < message.paths.length; ++i) - if (!$util.isString(message.paths[i])) - return "paths: string[] expected"; - } - return null; - }; - - /** - * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldMask - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldMask} FieldMask - */ - FieldMask.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldMask) - return object; - var message = new $root.google.protobuf.FieldMask(); - if (object.paths) { - if (!Array.isArray(object.paths)) - throw TypeError(".google.protobuf.FieldMask.paths: array expected"); - message.paths = []; - for (var i = 0; i < object.paths.length; ++i) - message.paths[i] = String(object.paths[i]); - } - return message; - }; - - /** - * Creates a plain object from a FieldMask message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldMask - * @static - * @param {google.protobuf.FieldMask} message FieldMask - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldMask.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.paths = []; - if (message.paths && message.paths.length) { - object.paths = []; - for (var j = 0; j < message.paths.length; ++j) - object.paths[j] = message.paths[j]; - } - return object; - }; - - /** - * Converts this FieldMask to JSON. - * @function toJSON - * @memberof google.protobuf.FieldMask - * @instance - * @returns {Object.} JSON object - */ - FieldMask.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldMask - * @function getTypeUrl - * @memberof google.protobuf.FieldMask - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldMask"; - }; - - return FieldMask; - })(); - - protobuf.DoubleValue = (function() { - - /** - * Properties of a DoubleValue. - * @memberof google.protobuf - * @interface IDoubleValue - * @property {number|null} [value] DoubleValue value - */ - - /** - * Constructs a new DoubleValue. - * @memberof google.protobuf - * @classdesc Represents a DoubleValue. - * @implements IDoubleValue - * @constructor - * @param {google.protobuf.IDoubleValue=} [properties] Properties to set - */ - function DoubleValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DoubleValue value. - * @member {number} value - * @memberof google.protobuf.DoubleValue - * @instance - */ - DoubleValue.prototype.value = 0; - - /** - * Creates a new DoubleValue instance using the specified properties. - * @function create - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue=} [properties] Properties to set - * @returns {google.protobuf.DoubleValue} DoubleValue instance - */ - DoubleValue.create = function create(properties) { - return new DoubleValue(properties); - }; - - /** - * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DoubleValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); - return writer; - }; - - /** - * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DoubleValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DoubleValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DoubleValue} DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DoubleValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DoubleValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DoubleValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DoubleValue} DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DoubleValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DoubleValue message. - * @function verify - * @memberof google.protobuf.DoubleValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DoubleValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "number") - return "value: number expected"; - return null; - }; - - /** - * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DoubleValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DoubleValue} DoubleValue - */ - DoubleValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DoubleValue) - return object; - var message = new $root.google.protobuf.DoubleValue(); - if (object.value != null) - message.value = Number(object.value); - return message; - }; - - /** - * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.DoubleValue} message DoubleValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DoubleValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; - return object; - }; - - /** - * Converts this DoubleValue to JSON. - * @function toJSON - * @memberof google.protobuf.DoubleValue - * @instance - * @returns {Object.} JSON object - */ - DoubleValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DoubleValue - * @function getTypeUrl - * @memberof google.protobuf.DoubleValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DoubleValue"; - }; - - return DoubleValue; - })(); - - protobuf.FloatValue = (function() { - - /** - * Properties of a FloatValue. - * @memberof google.protobuf - * @interface IFloatValue - * @property {number|null} [value] FloatValue value - */ - - /** - * Constructs a new FloatValue. - * @memberof google.protobuf - * @classdesc Represents a FloatValue. - * @implements IFloatValue - * @constructor - * @param {google.protobuf.IFloatValue=} [properties] Properties to set - */ - function FloatValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FloatValue value. - * @member {number} value - * @memberof google.protobuf.FloatValue - * @instance - */ - FloatValue.prototype.value = 0; - - /** - * Creates a new FloatValue instance using the specified properties. - * @function create - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue=} [properties] Properties to set - * @returns {google.protobuf.FloatValue} FloatValue instance - */ - FloatValue.create = function create(properties) { - return new FloatValue(properties); - }; - - /** - * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FloatValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); - return writer; - }; - - /** - * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FloatValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FloatValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FloatValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FloatValue} FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FloatValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.float(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FloatValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FloatValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FloatValue} FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FloatValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FloatValue message. - * @function verify - * @memberof google.protobuf.FloatValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FloatValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "number") - return "value: number expected"; - return null; - }; - - /** - * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FloatValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FloatValue} FloatValue - */ - FloatValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FloatValue) - return object; - var message = new $root.google.protobuf.FloatValue(); - if (object.value != null) - message.value = Number(object.value); - return message; - }; - - /** - * Creates a plain object from a FloatValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.FloatValue} message FloatValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FloatValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; - return object; - }; - - /** - * Converts this FloatValue to JSON. - * @function toJSON - * @memberof google.protobuf.FloatValue - * @instance - * @returns {Object.} JSON object - */ - FloatValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FloatValue - * @function getTypeUrl - * @memberof google.protobuf.FloatValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FloatValue"; - }; - - return FloatValue; - })(); - - protobuf.Int64Value = (function() { - - /** - * Properties of an Int64Value. - * @memberof google.protobuf - * @interface IInt64Value - * @property {number|Long|null} [value] Int64Value value - */ - - /** - * Constructs a new Int64Value. - * @memberof google.protobuf - * @classdesc Represents an Int64Value. - * @implements IInt64Value - * @constructor - * @param {google.protobuf.IInt64Value=} [properties] Properties to set - */ - function Int64Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Int64Value value. - * @member {number|Long} value - * @memberof google.protobuf.Int64Value - * @instance - */ - Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new Int64Value instance using the specified properties. - * @function create - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value=} [properties] Properties to set - * @returns {google.protobuf.Int64Value} Int64Value instance - */ - Int64Value.create = function create(properties) { - return new Int64Value(properties); - }; - - /** - * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int64Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); - return writer; - }; - - /** - * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int64Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Int64Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Int64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Int64Value} Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int64Value.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Int64Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Int64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Int64Value} Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int64Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Int64Value message. - * @function verify - * @memberof google.protobuf.Int64Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Int64Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) - return "value: integer|Long expected"; - return null; - }; - - /** - * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Int64Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Int64Value} Int64Value - */ - Int64Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Int64Value) - return object; - var message = new $root.google.protobuf.Int64Value(); - if (object.value != null) - if ($util.Long) - (message.value = $util.Long.fromValue(object.value)).unsigned = false; - else if (typeof object.value === "string") - message.value = parseInt(object.value, 10); - else if (typeof object.value === "number") - message.value = object.value; - else if (typeof object.value === "object") - message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from an Int64Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.Int64Value} message Int64Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Int64Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.value = options.longs === String ? "0" : 0; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value === "number") - object.value = options.longs === String ? String(message.value) : message.value; - else - object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; - return object; - }; - - /** - * Converts this Int64Value to JSON. - * @function toJSON - * @memberof google.protobuf.Int64Value - * @instance - * @returns {Object.} JSON object - */ - Int64Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Int64Value - * @function getTypeUrl - * @memberof google.protobuf.Int64Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Int64Value"; - }; - - return Int64Value; - })(); - - protobuf.UInt64Value = (function() { - - /** - * Properties of a UInt64Value. - * @memberof google.protobuf - * @interface IUInt64Value - * @property {number|Long|null} [value] UInt64Value value - */ - - /** - * Constructs a new UInt64Value. - * @memberof google.protobuf - * @classdesc Represents a UInt64Value. - * @implements IUInt64Value - * @constructor - * @param {google.protobuf.IUInt64Value=} [properties] Properties to set - */ - function UInt64Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UInt64Value value. - * @member {number|Long} value - * @memberof google.protobuf.UInt64Value - * @instance - */ - UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Creates a new UInt64Value instance using the specified properties. - * @function create - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value=} [properties] Properties to set - * @returns {google.protobuf.UInt64Value} UInt64Value instance - */ - UInt64Value.create = function create(properties) { - return new UInt64Value(properties); - }; - - /** - * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt64Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); - return writer; - }; - - /** - * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UInt64Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UInt64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UInt64Value} UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt64Value.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.uint64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a UInt64Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UInt64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UInt64Value} UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt64Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UInt64Value message. - * @function verify - * @memberof google.protobuf.UInt64Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UInt64Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) - return "value: integer|Long expected"; - return null; - }; - - /** - * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UInt64Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UInt64Value} UInt64Value - */ - UInt64Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UInt64Value) - return object; - var message = new $root.google.protobuf.UInt64Value(); - if (object.value != null) - if ($util.Long) - (message.value = $util.Long.fromValue(object.value)).unsigned = true; - else if (typeof object.value === "string") - message.value = parseInt(object.value, 10); - else if (typeof object.value === "number") - message.value = object.value; - else if (typeof object.value === "object") - message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.UInt64Value} message UInt64Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UInt64Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.value = options.longs === String ? "0" : 0; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value === "number") - object.value = options.longs === String ? String(message.value) : message.value; - else - object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; - return object; - }; - - /** - * Converts this UInt64Value to JSON. - * @function toJSON - * @memberof google.protobuf.UInt64Value - * @instance - * @returns {Object.} JSON object - */ - UInt64Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UInt64Value - * @function getTypeUrl - * @memberof google.protobuf.UInt64Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UInt64Value"; - }; - - return UInt64Value; - })(); - - protobuf.Int32Value = (function() { - - /** - * Properties of an Int32Value. - * @memberof google.protobuf - * @interface IInt32Value - * @property {number|null} [value] Int32Value value - */ - - /** - * Constructs a new Int32Value. - * @memberof google.protobuf - * @classdesc Represents an Int32Value. - * @implements IInt32Value - * @constructor - * @param {google.protobuf.IInt32Value=} [properties] Properties to set - */ - function Int32Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Int32Value value. - * @member {number} value - * @memberof google.protobuf.Int32Value - * @instance - */ - Int32Value.prototype.value = 0; - - /** - * Creates a new Int32Value instance using the specified properties. - * @function create - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value=} [properties] Properties to set - * @returns {google.protobuf.Int32Value} Int32Value instance - */ - Int32Value.create = function create(properties) { - return new Int32Value(properties); - }; - - /** - * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int32Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); - return writer; - }; - - /** - * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int32Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Int32Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Int32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Int32Value} Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int32Value.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Int32Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Int32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Int32Value} Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int32Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Int32Value message. - * @function verify - * @memberof google.protobuf.Int32Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Int32Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value)) - return "value: integer expected"; - return null; - }; - - /** - * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Int32Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Int32Value} Int32Value - */ - Int32Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Int32Value) - return object; - var message = new $root.google.protobuf.Int32Value(); - if (object.value != null) - message.value = object.value | 0; - return message; - }; - - /** - * Creates a plain object from an Int32Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.Int32Value} message Int32Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Int32Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this Int32Value to JSON. - * @function toJSON - * @memberof google.protobuf.Int32Value - * @instance - * @returns {Object.} JSON object - */ - Int32Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Int32Value - * @function getTypeUrl - * @memberof google.protobuf.Int32Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Int32Value"; - }; - - return Int32Value; - })(); - - protobuf.UInt32Value = (function() { - - /** - * Properties of a UInt32Value. - * @memberof google.protobuf - * @interface IUInt32Value - * @property {number|null} [value] UInt32Value value - */ - - /** - * Constructs a new UInt32Value. - * @memberof google.protobuf - * @classdesc Represents a UInt32Value. - * @implements IUInt32Value - * @constructor - * @param {google.protobuf.IUInt32Value=} [properties] Properties to set - */ - function UInt32Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UInt32Value value. - * @member {number} value - * @memberof google.protobuf.UInt32Value - * @instance - */ - UInt32Value.prototype.value = 0; - - /** - * Creates a new UInt32Value instance using the specified properties. - * @function create - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value=} [properties] Properties to set - * @returns {google.protobuf.UInt32Value} UInt32Value instance - */ - UInt32Value.create = function create(properties) { - return new UInt32Value(properties); - }; - - /** - * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt32Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); - return writer; - }; - - /** - * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UInt32Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UInt32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UInt32Value} UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt32Value.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.uint32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a UInt32Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UInt32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UInt32Value} UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt32Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UInt32Value message. - * @function verify - * @memberof google.protobuf.UInt32Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UInt32Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value)) - return "value: integer expected"; - return null; - }; - - /** - * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UInt32Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UInt32Value} UInt32Value - */ - UInt32Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UInt32Value) - return object; - var message = new $root.google.protobuf.UInt32Value(); - if (object.value != null) - message.value = object.value >>> 0; - return message; - }; - - /** - * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.UInt32Value} message UInt32Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UInt32Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this UInt32Value to JSON. - * @function toJSON - * @memberof google.protobuf.UInt32Value - * @instance - * @returns {Object.} JSON object - */ - UInt32Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UInt32Value - * @function getTypeUrl - * @memberof google.protobuf.UInt32Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UInt32Value"; - }; - - return UInt32Value; - })(); - - protobuf.BoolValue = (function() { - - /** - * Properties of a BoolValue. - * @memberof google.protobuf - * @interface IBoolValue - * @property {boolean|null} [value] BoolValue value - */ - - /** - * Constructs a new BoolValue. - * @memberof google.protobuf - * @classdesc Represents a BoolValue. - * @implements IBoolValue - * @constructor - * @param {google.protobuf.IBoolValue=} [properties] Properties to set - */ - function BoolValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BoolValue value. - * @member {boolean} value - * @memberof google.protobuf.BoolValue - * @instance - */ - BoolValue.prototype.value = false; - - /** - * Creates a new BoolValue instance using the specified properties. - * @function create - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue=} [properties] Properties to set - * @returns {google.protobuf.BoolValue} BoolValue instance - */ - BoolValue.create = function create(properties) { - return new BoolValue(properties); - }; - - /** - * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoolValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); - return writer; - }; - - /** - * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoolValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BoolValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.BoolValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.BoolValue} BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoolValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BoolValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.BoolValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.BoolValue} BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoolValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BoolValue message. - * @function verify - * @memberof google.protobuf.BoolValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BoolValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "boolean") - return "value: boolean expected"; - return null; - }; - - /** - * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.BoolValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.BoolValue} BoolValue - */ - BoolValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.BoolValue) - return object; - var message = new $root.google.protobuf.BoolValue(); - if (object.value != null) - message.value = Boolean(object.value); - return message; - }; - - /** - * Creates a plain object from a BoolValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.BoolValue} message BoolValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BoolValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = false; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this BoolValue to JSON. - * @function toJSON - * @memberof google.protobuf.BoolValue - * @instance - * @returns {Object.} JSON object - */ - BoolValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BoolValue - * @function getTypeUrl - * @memberof google.protobuf.BoolValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.BoolValue"; - }; - - return BoolValue; - })(); - - protobuf.StringValue = (function() { - - /** - * Properties of a StringValue. - * @memberof google.protobuf - * @interface IStringValue - * @property {string|null} [value] StringValue value - */ - - /** - * Constructs a new StringValue. - * @memberof google.protobuf - * @classdesc Represents a StringValue. - * @implements IStringValue - * @constructor - * @param {google.protobuf.IStringValue=} [properties] Properties to set - */ - function StringValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StringValue value. - * @member {string} value - * @memberof google.protobuf.StringValue - * @instance - */ - StringValue.prototype.value = ""; - - /** - * Creates a new StringValue instance using the specified properties. - * @function create - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue=} [properties] Properties to set - * @returns {google.protobuf.StringValue} StringValue instance - */ - StringValue.create = function create(properties) { - return new StringValue(properties); - }; - - /** - * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); - return writer; - }; - - /** - * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StringValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.StringValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.StringValue} StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StringValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.StringValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.StringValue} StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StringValue message. - * @function verify - * @memberof google.protobuf.StringValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StringValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates a StringValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.StringValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.StringValue} StringValue - */ - StringValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.StringValue) - return object; - var message = new $root.google.protobuf.StringValue(); - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from a StringValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.StringValue} message StringValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StringValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = ""; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this StringValue to JSON. - * @function toJSON - * @memberof google.protobuf.StringValue - * @instance - * @returns {Object.} JSON object - */ - StringValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StringValue - * @function getTypeUrl - * @memberof google.protobuf.StringValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.StringValue"; - }; - - return StringValue; - })(); - - protobuf.BytesValue = (function() { - - /** - * Properties of a BytesValue. - * @memberof google.protobuf - * @interface IBytesValue - * @property {Uint8Array|null} [value] BytesValue value - */ - - /** - * Constructs a new BytesValue. - * @memberof google.protobuf - * @classdesc Represents a BytesValue. - * @implements IBytesValue - * @constructor - * @param {google.protobuf.IBytesValue=} [properties] Properties to set - */ - function BytesValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BytesValue value. - * @member {Uint8Array} value - * @memberof google.protobuf.BytesValue - * @instance - */ - BytesValue.prototype.value = $util.newBuffer([]); - - /** - * Creates a new BytesValue instance using the specified properties. - * @function create - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue=} [properties] Properties to set - * @returns {google.protobuf.BytesValue} BytesValue instance - */ - BytesValue.create = function create(properties) { - return new BytesValue(properties); - }; - - /** - * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BytesValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BytesValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BytesValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.BytesValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.BytesValue} BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BytesValue.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BytesValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.BytesValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.BytesValue} BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BytesValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BytesValue message. - * @function verify - * @memberof google.protobuf.BytesValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BytesValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.BytesValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.BytesValue} BytesValue - */ - BytesValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.BytesValue) - return object; - var message = new $root.google.protobuf.BytesValue(); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length >= 0) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from a BytesValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.BytesValue} message BytesValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BytesValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this BytesValue to JSON. - * @function toJSON - * @memberof google.protobuf.BytesValue - * @instance - * @returns {Object.} JSON object - */ - BytesValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BytesValue - * @function getTypeUrl - * @memberof google.protobuf.BytesValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.BytesValue"; - }; - - return BytesValue; - })(); - - return protobuf; - })(); - - google.longrunning = (function() { - - /** - * Namespace longrunning. - * @memberof google - * @namespace - */ - var longrunning = {}; - - longrunning.Operations = (function() { - - /** - * Constructs a new Operations service. - * @memberof google.longrunning - * @classdesc Represents an Operations - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Operations(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; - - /** - * Creates new Operations service using the specified rpc implementation. - * @function create - * @memberof google.longrunning.Operations - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. - */ - Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.longrunning.Operations|listOperations}. - * @memberof google.longrunning.Operations - * @typedef ListOperationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse - */ - - /** - * Calls ListOperations. - * @function listOperations - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object - * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { - return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); - }, "name", { value: "ListOperations" }); - - /** - * Calls ListOperations. - * @function listOperations - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|getOperation}. - * @memberof google.longrunning.Operations - * @typedef GetOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls GetOperation. - * @function getOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object - * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { - return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "GetOperation" }); - - /** - * Calls GetOperation. - * @function getOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|deleteOperation}. - * @memberof google.longrunning.Operations - * @typedef DeleteOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteOperation. - * @function deleteOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object - * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { - return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteOperation" }); - - /** - * Calls DeleteOperation. - * @function deleteOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|cancelOperation}. - * @memberof google.longrunning.Operations - * @typedef CancelOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls CancelOperation. - * @function cancelOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object - * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { - return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "CancelOperation" }); - - /** - * Calls CancelOperation. - * @function cancelOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|waitOperation}. - * @memberof google.longrunning.Operations - * @typedef WaitOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls WaitOperation. - * @function waitOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object - * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { - return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "WaitOperation" }); - - /** - * Calls WaitOperation. - * @function waitOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Operations; - })(); - - longrunning.Operation = (function() { - - /** - * Properties of an Operation. - * @memberof google.longrunning - * @interface IOperation - * @property {string|null} [name] Operation name - * @property {google.protobuf.IAny|null} [metadata] Operation metadata - * @property {boolean|null} [done] Operation done - * @property {google.rpc.IStatus|null} [error] Operation error - * @property {google.protobuf.IAny|null} [response] Operation response - */ - - /** - * Constructs a new Operation. - * @memberof google.longrunning - * @classdesc Represents an Operation. - * @implements IOperation - * @constructor - * @param {google.longrunning.IOperation=} [properties] Properties to set - */ - function Operation(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - 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.type = (function() { - - /** - * Namespace type. - * @memberof google - * @namespace - */ - var type = {}; - - type.Interval = (function() { - - /** - * Properties of an Interval. - * @memberof google.type - * @interface IInterval - * @property {google.protobuf.ITimestamp|null} [startTime] Interval startTime - * @property {google.protobuf.ITimestamp|null} [endTime] Interval endTime - */ - - /** - * Constructs a new Interval. - * @memberof google.type - * @classdesc Represents an Interval. - * @implements IInterval - * @constructor - * @param {google.type.IInterval=} [properties] Properties to set - */ - function Interval(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Interval startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.type.Interval - * @instance - */ - Interval.prototype.startTime = null; - - /** - * Interval endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.type.Interval - * @instance - */ - Interval.prototype.endTime = null; - - /** - * Creates a new Interval instance using the specified properties. - * @function create - * @memberof google.type.Interval - * @static - * @param {google.type.IInterval=} [properties] Properties to set - * @returns {google.type.Interval} Interval instance - */ - Interval.create = function create(properties) { - return new Interval(properties); - }; - - /** - * Encodes the specified Interval message. Does not implicitly {@link google.type.Interval.verify|verify} messages. - * @function encode - * @memberof google.type.Interval - * @static - * @param {google.type.IInterval} message Interval message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Interval.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Interval message, length delimited. Does not implicitly {@link google.type.Interval.verify|verify} messages. - * @function encodeDelimited - * @memberof google.type.Interval - * @static - * @param {google.type.IInterval} message Interval message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Interval.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Interval message from the specified reader or buffer. - * @function decode - * @memberof google.type.Interval - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.type.Interval} Interval - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Interval.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Interval(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Interval message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.type.Interval - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.type.Interval} Interval - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Interval.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Interval message. - * @function verify - * @memberof google.type.Interval - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Interval.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - return null; - }; - - /** - * Creates an Interval message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.type.Interval - * @static - * @param {Object.} object Plain object - * @returns {google.type.Interval} Interval - */ - Interval.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.Interval) - return object; - var message = new $root.google.type.Interval(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.type.Interval.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.type.Interval.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - return message; - }; - - /** - * Creates a plain object from an Interval message. Also converts values to other types if specified. - * @function toObject - * @memberof google.type.Interval - * @static - * @param {google.type.Interval} message Interval - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Interval.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.startTime = null; - object.endTime = null; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - return object; - }; - - /** - * Converts this Interval to JSON. - * @function toJSON - * @memberof google.type.Interval - * @instance - * @returns {Object.} JSON object - */ - Interval.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Interval - * @function getTypeUrl - * @memberof google.type.Interval - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Interval.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.type.Interval"; - }; - - return Interval; - })(); - - return type; - })(); - - return google; - })(); - - return $root; -}); diff --git a/owl-bot-staging/google-cloud-dataproc/protos/protos.json b/owl-bot-staging/google-cloud-dataproc/protos/protos.json deleted file mode 100644 index 317724581919..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/protos/protos.json +++ /dev/null @@ -1,9294 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "cloud": { - "nested": { - "dataproc": { - "nested": { - "v1": { - "options": { - "go_package": "cloud.google.com/go/dataproc/v2/apiv1/dataprocpb;dataprocpb", - "java_multiple_files": true, - "java_outer_classname": "WorkflowTemplatesProto", - "java_package": "com.google.cloud.dataproc.v1", - "(google.api.resource_definition).type": "dataproc.googleapis.com/ClusterRegion", - "(google.api.resource_definition).pattern": "projects/{project}/regions/{region}/clusters/{cluster}" - }, - "nested": { - "AutoscalingPolicyService": { - "options": { - "(google.api.default_host)": "dataproc.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "CreateAutoscalingPolicy": { - "requestType": "CreateAutoscalingPolicyRequest", - "responseType": "AutoscalingPolicy", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/autoscalingPolicies", - "(google.api.http).body": "policy", - "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*/regions/*}/autoscalingPolicies", - "(google.api.http).additional_bindings.body": "policy", - "(google.api.method_signature)": "parent,policy" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/autoscalingPolicies", - "body": "policy", - "additional_bindings": { - "post": "/v1/{parent=projects/*/regions/*}/autoscalingPolicies", - "body": "policy" - } - } - }, - { - "(google.api.method_signature)": "parent,policy" - } - ] - }, - "UpdateAutoscalingPolicy": { - "requestType": "UpdateAutoscalingPolicyRequest", - "responseType": "AutoscalingPolicy", - "options": { - "(google.api.http).put": "/v1/{policy.name=projects/*/locations/*/autoscalingPolicies/*}", - "(google.api.http).body": "policy", - "(google.api.http).additional_bindings.put": "/v1/{policy.name=projects/*/regions/*/autoscalingPolicies/*}", - "(google.api.http).additional_bindings.body": "policy", - "(google.api.method_signature)": "policy" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "put": "/v1/{policy.name=projects/*/locations/*/autoscalingPolicies/*}", - "body": "policy", - "additional_bindings": { - "put": "/v1/{policy.name=projects/*/regions/*/autoscalingPolicies/*}", - "body": "policy" - } - } - }, - { - "(google.api.method_signature)": "policy" - } - ] - }, - "GetAutoscalingPolicy": { - "requestType": "GetAutoscalingPolicyRequest", - "responseType": "AutoscalingPolicy", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/autoscalingPolicies/*}", - "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/regions/*/autoscalingPolicies/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/autoscalingPolicies/*}", - "additional_bindings": { - "get": "/v1/{name=projects/*/regions/*/autoscalingPolicies/*}" - } - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListAutoscalingPolicies": { - "requestType": "ListAutoscalingPoliciesRequest", - "responseType": "ListAutoscalingPoliciesResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/autoscalingPolicies", - "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*/regions/*}/autoscalingPolicies", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/autoscalingPolicies", - "additional_bindings": { - "get": "/v1/{parent=projects/*/regions/*}/autoscalingPolicies" - } - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "DeleteAutoscalingPolicy": { - "requestType": "DeleteAutoscalingPolicyRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/autoscalingPolicies/*}", - "(google.api.http).additional_bindings.delete": "/v1/{name=projects/*/regions/*/autoscalingPolicies/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/autoscalingPolicies/*}", - "additional_bindings": { - "delete": "/v1/{name=projects/*/regions/*/autoscalingPolicies/*}" - } - } - }, - { - "(google.api.method_signature)": "name" - } - ] - } - } - }, - "AutoscalingPolicy": { - "options": { - "(google.api.resource).type": "dataproc.googleapis.com/AutoscalingPolicy", - "(google.api.resource).pattern": "projects/{project}/regions/{region}/autoscalingPolicies/{autoscaling_policy}" - }, - "oneofs": { - "algorithm": { - "oneof": [ - "basicAlgorithm" - ] - } - }, - "fields": { - "id": { - "type": "string", - "id": 1 - }, - "name": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "basicAlgorithm": { - "type": "BasicAutoscalingAlgorithm", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "workerConfig": { - "type": "InstanceGroupAutoscalingPolicyConfig", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "secondaryWorkerConfig": { - "type": "InstanceGroupAutoscalingPolicyConfig", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "clusterType": { - "type": "ClusterType", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "ClusterType": { - "values": { - "CLUSTER_TYPE_UNSPECIFIED": 0, - "STANDARD": 1, - "ZERO_SCALE": 2 - } - } - } - }, - "BasicAutoscalingAlgorithm": { - "oneofs": { - "config": { - "oneof": [ - "yarnConfig" - ] - } - }, - "fields": { - "yarnConfig": { - "type": "BasicYarnAutoscalingConfig", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "cooldownPeriod": { - "type": "google.protobuf.Duration", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "BasicYarnAutoscalingConfig": { - "fields": { - "gracefulDecommissionTimeout": { - "type": "google.protobuf.Duration", - "id": 5, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "scaleUpFactor": { - "type": "double", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "scaleDownFactor": { - "type": "double", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "scaleUpMinWorkerFraction": { - "type": "double", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "scaleDownMinWorkerFraction": { - "type": "double", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "InstanceGroupAutoscalingPolicyConfig": { - "fields": { - "minInstances": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "maxInstances": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "weight": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CreateAutoscalingPolicyRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dataproc.googleapis.com/AutoscalingPolicy" - } - }, - "policy": { - "type": "AutoscalingPolicy", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "GetAutoscalingPolicyRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dataproc.googleapis.com/AutoscalingPolicy" - } - } - } - }, - "UpdateAutoscalingPolicyRequest": { - "fields": { - "policy": { - "type": "AutoscalingPolicy", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "DeleteAutoscalingPolicyRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dataproc.googleapis.com/AutoscalingPolicy" - } - } - } - }, - "ListAutoscalingPoliciesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dataproc.googleapis.com/AutoscalingPolicy" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListAutoscalingPoliciesResponse": { - "fields": { - "policies": { - "rule": "repeated", - "type": "AutoscalingPolicy", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "nextPageToken": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "BatchController": { - "options": { - "(google.api.default_host)": "dataproc.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "CreateBatch": { - "requestType": "CreateBatchRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/batches", - "(google.api.http).body": "batch", - "(google.api.method_signature)": "parent,batch,batch_id", - "(google.longrunning.operation_info).response_type": "Batch", - "(google.longrunning.operation_info).metadata_type": "google.cloud.dataproc.v1.BatchOperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/batches", - "body": "batch" - } - }, - { - "(google.api.method_signature)": "parent,batch,batch_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Batch", - "metadata_type": "google.cloud.dataproc.v1.BatchOperationMetadata" - } - } - ] - }, - "GetBatch": { - "requestType": "GetBatchRequest", - "responseType": "Batch", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/batches/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/batches/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListBatches": { - "requestType": "ListBatchesRequest", - "responseType": "ListBatchesResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/batches", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/batches" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "DeleteBatch": { - "requestType": "DeleteBatchRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/batches/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/batches/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - } - } - }, - "CreateBatchRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dataproc.googleapis.com/Batch" - } - }, - "batch": { - "type": "Batch", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "batchId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GetBatchRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dataproc.googleapis.com/Batch" - } - } - } - }, - "ListBatchesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dataproc.googleapis.com/Batch" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "filter": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "orderBy": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListBatchesResponse": { - "fields": { - "batches": { - "rule": "repeated", - "type": "Batch", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "DeleteBatchRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dataproc.googleapis.com/Batch" - } - } - } - }, - "Batch": { - "options": { - "(google.api.resource).type": "dataproc.googleapis.com/Batch", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/batches/{batch}" - }, - "oneofs": { - "batchConfig": { - "oneof": [ - "pysparkBatch", - "sparkBatch", - "sparkRBatch", - "sparkSqlBatch", - "pysparkNotebookBatch" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "uuid": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "pysparkBatch": { - "type": "PySparkBatch", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "sparkBatch": { - "type": "SparkBatch", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "sparkRBatch": { - "type": "SparkRBatch", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "sparkSqlBatch": { - "type": "SparkSqlBatch", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pysparkNotebookBatch": { - "type": "PySparkNotebookBatch", - "id": 19, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "runtimeInfo": { - "type": "RuntimeInfo", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "state": { - "type": "State", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "stateMessage": { - "type": "string", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "stateTime": { - "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" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "runtimeConfig": { - "type": "RuntimeConfig", - "id": 14, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "environmentConfig": { - "type": "EnvironmentConfig", - "id": 15, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "operation": { - "type": "string", - "id": 16, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "stateHistory": { - "rule": "repeated", - "type": "StateHistory", - "id": 17, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "PENDING": 1, - "RUNNING": 2, - "CANCELLING": 3, - "CANCELLED": 4, - "SUCCEEDED": 5, - "FAILED": 6 - } - }, - "StateHistory": { - "fields": { - "state": { - "type": "State", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "stateMessage": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "stateStartTime": { - "type": "google.protobuf.Timestamp", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - } - } - }, - "PySparkBatch": { - "fields": { - "mainPythonFileUri": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "args": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pythonFileUris": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "jarFileUris": { - "rule": "repeated", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "fileUris": { - "rule": "repeated", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "archiveUris": { - "rule": "repeated", - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "SparkBatch": { - "oneofs": { - "driver": { - "oneof": [ - "mainJarFileUri", - "mainClass" - ] - } - }, - "fields": { - "mainJarFileUri": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "mainClass": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "args": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "jarFileUris": { - "rule": "repeated", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "fileUris": { - "rule": "repeated", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "archiveUris": { - "rule": "repeated", - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "SparkRBatch": { - "fields": { - "mainRFileUri": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "args": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "fileUris": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "archiveUris": { - "rule": "repeated", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "SparkSqlBatch": { - "fields": { - "queryFileUri": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "queryVariables": { - "keyType": "string", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "jarFileUris": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "PySparkNotebookBatch": { - "fields": { - "notebookFileUri": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "params": { - "keyType": "string", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pythonFileUris": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "jarFileUris": { - "rule": "repeated", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "fileUris": { - "rule": "repeated", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "archiveUris": { - "rule": "repeated", - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "RuntimeConfig": { - "fields": { - "version": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "containerImage": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "properties": { - "keyType": "string", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "repositoryConfig": { - "type": "RepositoryConfig", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "autotuningConfig": { - "type": "AutotuningConfig", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "cohort": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "EnvironmentConfig": { - "fields": { - "executionConfig": { - "type": "ExecutionConfig", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "peripheralsConfig": { - "type": "PeripheralsConfig", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ExecutionConfig": { - "oneofs": { - "network": { - "oneof": [ - "networkUri", - "subnetworkUri" - ] - } - }, - "fields": { - "serviceAccount": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "networkUri": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "subnetworkUri": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "networkTags": { - "rule": "repeated", - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "kmsKey": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "idleTtl": { - "type": "google.protobuf.Duration", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "ttl": { - "type": "google.protobuf.Duration", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "stagingBucket": { - "type": "string", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "authenticationConfig": { - "type": "AuthenticationConfig", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "SparkHistoryServerConfig": { - "fields": { - "dataprocCluster": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "PeripheralsConfig": { - "fields": { - "metastoreService": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "metastore.googleapis.com/Service" - } - }, - "sparkHistoryServerConfig": { - "type": "SparkHistoryServerConfig", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "RuntimeInfo": { - "fields": { - "endpoints": { - "keyType": "string", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "outputUri": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "diagnosticOutputUri": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "approximateUsage": { - "type": "UsageMetrics", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "currentUsage": { - "type": "UsageSnapshot", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "UsageMetrics": { - "fields": { - "milliDcuSeconds": { - "type": "int64", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "shuffleStorageGbSeconds": { - "type": "int64", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "milliAcceleratorSeconds": { - "type": "int64", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "acceleratorType": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "UsageSnapshot": { - "fields": { - "milliDcu": { - "type": "int64", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "shuffleStorageGb": { - "type": "int64", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "milliDcuPremium": { - "type": "int64", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "shuffleStorageGbPremium": { - "type": "int64", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "milliAccelerator": { - "type": "int64", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "acceleratorType": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "snapshotTime": { - "type": "google.protobuf.Timestamp", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GkeClusterConfig": { - "fields": { - "gkeClusterTarget": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "container.googleapis.com/Cluster" - } - }, - "nodePoolTarget": { - "rule": "repeated", - "type": "GkeNodePoolTarget", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "KubernetesClusterConfig": { - "oneofs": { - "config": { - "oneof": [ - "gkeClusterConfig" - ] - } - }, - "fields": { - "kubernetesNamespace": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "gkeClusterConfig": { - "type": "GkeClusterConfig", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "kubernetesSoftwareConfig": { - "type": "KubernetesSoftwareConfig", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "KubernetesSoftwareConfig": { - "fields": { - "componentVersion": { - "keyType": "string", - "type": "string", - "id": 1 - }, - "properties": { - "keyType": "string", - "type": "string", - "id": 2 - } - } - }, - "GkeNodePoolTarget": { - "fields": { - "nodePool": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "roles": { - "rule": "repeated", - "type": "Role", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "nodePoolConfig": { - "type": "GkeNodePoolConfig", - "id": 3, - "options": { - "(google.api.field_behavior)": "INPUT_ONLY" - } - } - }, - "nested": { - "Role": { - "values": { - "ROLE_UNSPECIFIED": 0, - "DEFAULT": 1, - "CONTROLLER": 2, - "SPARK_DRIVER": 3, - "SPARK_EXECUTOR": 4 - } - } - } - }, - "GkeNodePoolConfig": { - "fields": { - "config": { - "type": "GkeNodeConfig", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "locations": { - "rule": "repeated", - "type": "string", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "autoscaling": { - "type": "GkeNodePoolAutoscalingConfig", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "GkeNodeConfig": { - "fields": { - "machineType": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "localSsdCount": { - "type": "int32", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "preemptible": { - "type": "bool", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "accelerators": { - "rule": "repeated", - "type": "GkeNodePoolAcceleratorConfig", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "minCpuPlatform": { - "type": "string", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "bootDiskKmsKey": { - "type": "string", - "id": 23, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "spot": { - "type": "bool", - "id": 32, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GkeNodePoolAcceleratorConfig": { - "fields": { - "acceleratorCount": { - "type": "int64", - "id": 1 - }, - "acceleratorType": { - "type": "string", - "id": 2 - }, - "gpuPartitionSize": { - "type": "string", - "id": 3 - } - } - }, - "GkeNodePoolAutoscalingConfig": { - "fields": { - "minNodeCount": { - "type": "int32", - "id": 2 - }, - "maxNodeCount": { - "type": "int32", - "id": 3 - } - } - } - } - }, - "AuthenticationConfig": { - "fields": { - "userWorkloadAuthenticationType": { - "type": "AuthenticationType", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "AuthenticationType": { - "values": { - "AUTHENTICATION_TYPE_UNSPECIFIED": 0, - "SERVICE_ACCOUNT": 1, - "END_USER_CREDENTIALS": 2 - } - } - } - }, - "AutotuningConfig": { - "fields": { - "scenarios": { - "rule": "repeated", - "type": "Scenario", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "Scenario": { - "values": { - "SCENARIO_UNSPECIFIED": 0, - "SCALING": 2, - "BROADCAST_HASH_JOIN": 3, - "MEMORY": 4, - "NONE": 5, - "AUTO": 6 - } - } - } - }, - "RepositoryConfig": { - "fields": { - "pypiRepositoryConfig": { - "type": "PyPiRepositoryConfig", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "PyPiRepositoryConfig": { - "fields": { - "pypiRepository": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Component": { - "values": { - "COMPONENT_UNSPECIFIED": 0, - "ANACONDA": 5, - "DELTA": 20, - "DOCKER": 13, - "DRUID": 9, - "FLINK": 14, - "HBASE": 11, - "HIVE_WEBHCAT": 3, - "HUDI": 18, - "ICEBERG": 19, - "JUPYTER": 1, - "JUPYTER_KERNEL_GATEWAY": 22, - "PIG": 21, - "PRESTO": 6, - "TRINO": 17, - "RANGER": 12, - "SOLR": 10, - "ZEPPELIN": 4, - "ZOOKEEPER": 8 - } - }, - "FailureAction": { - "values": { - "FAILURE_ACTION_UNSPECIFIED": 0, - "NO_ACTION": 1, - "DELETE": 2 - } - }, - "ClusterController": { - "options": { - "(google.api.default_host)": "dataproc.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "CreateCluster": { - "requestType": "CreateClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/projects/{project_id}/regions/{region}/clusters", - "(google.api.http).body": "cluster", - "(google.api.method_signature)": "project_id,region,cluster", - "(google.longrunning.operation_info).response_type": "Cluster", - "(google.longrunning.operation_info).metadata_type": "google.cloud.dataproc.v1.ClusterOperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/projects/{project_id}/regions/{region}/clusters", - "body": "cluster" - } - }, - { - "(google.api.method_signature)": "project_id,region,cluster" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Cluster", - "metadata_type": "google.cloud.dataproc.v1.ClusterOperationMetadata" - } - } - ] - }, - "UpdateCluster": { - "requestType": "UpdateClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}", - "(google.api.http).body": "cluster", - "(google.api.method_signature)": "project_id,region,cluster_name,cluster,update_mask", - "(google.longrunning.operation_info).response_type": "Cluster", - "(google.longrunning.operation_info).metadata_type": "google.cloud.dataproc.v1.ClusterOperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}", - "body": "cluster" - } - }, - { - "(google.api.method_signature)": "project_id,region,cluster_name,cluster,update_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Cluster", - "metadata_type": "google.cloud.dataproc.v1.ClusterOperationMetadata" - } - } - ] - }, - "StopCluster": { - "requestType": "StopClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:stop", - "(google.api.http).body": "*", - "(google.longrunning.operation_info).response_type": "Cluster", - "(google.longrunning.operation_info).metadata_type": "google.cloud.dataproc.v1.ClusterOperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:stop", - "body": "*" - } - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Cluster", - "metadata_type": "google.cloud.dataproc.v1.ClusterOperationMetadata" - } - } - ] - }, - "StartCluster": { - "requestType": "StartClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:start", - "(google.api.http).body": "*", - "(google.longrunning.operation_info).response_type": "Cluster", - "(google.longrunning.operation_info).metadata_type": "google.cloud.dataproc.v1.ClusterOperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:start", - "body": "*" - } - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Cluster", - "metadata_type": "google.cloud.dataproc.v1.ClusterOperationMetadata" - } - } - ] - }, - "DeleteCluster": { - "requestType": "DeleteClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}", - "(google.api.method_signature)": "project_id,region,cluster_name", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "google.cloud.dataproc.v1.ClusterOperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}" - } - }, - { - "(google.api.method_signature)": "project_id,region,cluster_name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "google.cloud.dataproc.v1.ClusterOperationMetadata" - } - } - ] - }, - "GetCluster": { - "requestType": "GetClusterRequest", - "responseType": "Cluster", - "options": { - "(google.api.http).get": "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}", - "(google.api.method_signature)": "project_id,region,cluster_name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}" - } - }, - { - "(google.api.method_signature)": "project_id,region,cluster_name" - } - ] - }, - "ListClusters": { - "requestType": "ListClustersRequest", - "responseType": "ListClustersResponse", - "options": { - "(google.api.http).get": "/v1/projects/{project_id}/regions/{region}/clusters", - "(google.api.method_signature)": "project_id,region,filter" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/projects/{project_id}/regions/{region}/clusters" - } - }, - { - "(google.api.method_signature)": "project_id,region" - }, - { - "(google.api.method_signature)": "project_id,region,filter" - } - ] - }, - "DiagnoseCluster": { - "requestType": "DiagnoseClusterRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:diagnose", - "(google.api.http).body": "*", - "(google.api.method_signature)": "project_id,region,cluster_name", - "(google.longrunning.operation_info).response_type": "DiagnoseClusterResults", - "(google.longrunning.operation_info).metadata_type": "google.cloud.dataproc.v1.ClusterOperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/projects/{project_id}/regions/{region}/clusters/{cluster_name}:diagnose", - "body": "*" - } - }, - { - "(google.api.method_signature)": "project_id,region,cluster_name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "DiagnoseClusterResults", - "metadata_type": "google.cloud.dataproc.v1.ClusterOperationMetadata" - } - } - ] - } - } - }, - "Cluster": { - "fields": { - "projectId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "clusterName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "config": { - "type": "ClusterConfig", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "virtualClusterConfig": { - "type": "VirtualClusterConfig", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "status": { - "type": "ClusterStatus", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "statusHistory": { - "rule": "repeated", - "type": "ClusterStatus", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "clusterUuid": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "metrics": { - "type": "ClusterMetrics", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "ClusterConfig": { - "fields": { - "clusterType": { - "type": "ClusterType", - "id": 27, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "clusterTier": { - "type": "ClusterTier", - "id": 29, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "engine": { - "type": "Engine", - "id": 30, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "configBucket": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "tempBucket": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "gceClusterConfig": { - "type": "GceClusterConfig", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "masterConfig": { - "type": "InstanceGroupConfig", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "workerConfig": { - "type": "InstanceGroupConfig", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "secondaryWorkerConfig": { - "type": "InstanceGroupConfig", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "softwareConfig": { - "type": "SoftwareConfig", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "initializationActions": { - "rule": "repeated", - "type": "NodeInitializationAction", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "encryptionConfig": { - "type": "EncryptionConfig", - "id": 15, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "autoscalingConfig": { - "type": "AutoscalingConfig", - "id": 18, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "securityConfig": { - "type": "SecurityConfig", - "id": 16, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "lifecycleConfig": { - "type": "LifecycleConfig", - "id": 17, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "endpointConfig": { - "type": "EndpointConfig", - "id": 19, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "metastoreConfig": { - "type": "MetastoreConfig", - "id": 20, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "dataprocMetricConfig": { - "type": "DataprocMetricConfig", - "id": 23, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "auxiliaryNodeGroups": { - "rule": "repeated", - "type": "AuxiliaryNodeGroup", - "id": 25, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "ClusterType": { - "values": { - "CLUSTER_TYPE_UNSPECIFIED": 0, - "STANDARD": 1, - "SINGLE_NODE": 2, - "ZERO_SCALE": 3 - } - }, - "ClusterTier": { - "values": { - "CLUSTER_TIER_UNSPECIFIED": 0, - "CLUSTER_TIER_STANDARD": 1, - "CLUSTER_TIER_PREMIUM": 2 - } - }, - "Engine": { - "values": { - "ENGINE_UNSPECIFIED": 0, - "DEFAULT": 1, - "LIGHTNING": 2 - } - } - } - }, - "VirtualClusterConfig": { - "oneofs": { - "infrastructureConfig": { - "oneof": [ - "kubernetesClusterConfig" - ] - } - }, - "fields": { - "stagingBucket": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "kubernetesClusterConfig": { - "type": "KubernetesClusterConfig", - "id": 6, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "auxiliaryServicesConfig": { - "type": "AuxiliaryServicesConfig", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "AuxiliaryServicesConfig": { - "fields": { - "metastoreConfig": { - "type": "MetastoreConfig", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "sparkHistoryServerConfig": { - "type": "SparkHistoryServerConfig", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "EndpointConfig": { - "fields": { - "httpPorts": { - "keyType": "string", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "enableHttpPortAccess": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "AutoscalingConfig": { - "fields": { - "policyUri": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "EncryptionConfig": { - "fields": { - "gcePdKmsKeyName": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "kmsKey": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - } - } - }, - "GceClusterConfig": { - "oneofs": { - "_internalIpOnly": { - "oneof": [ - "internalIpOnly" - ] - } - }, - "fields": { - "zoneUri": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "networkUri": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "subnetworkUri": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "internalIpOnly": { - "type": "bool", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "privateIpv6GoogleAccess": { - "type": "PrivateIpv6GoogleAccess", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serviceAccount": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "serviceAccountScopes": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "tags": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "metadata": { - "keyType": "string", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "reservationAffinity": { - "type": "ReservationAffinity", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "nodeGroupAffinity": { - "type": "NodeGroupAffinity", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "shieldedInstanceConfig": { - "type": "ShieldedInstanceConfig", - "id": 14, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "confidentialInstanceConfig": { - "type": "ConfidentialInstanceConfig", - "id": 15, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "PrivateIpv6GoogleAccess": { - "values": { - "PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED": 0, - "INHERIT_FROM_SUBNETWORK": 1, - "OUTBOUND": 2, - "BIDIRECTIONAL": 3 - } - } - } - }, - "NodeGroupAffinity": { - "fields": { - "nodeGroupUri": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ShieldedInstanceConfig": { - "oneofs": { - "_enableSecureBoot": { - "oneof": [ - "enableSecureBoot" - ] - }, - "_enableVtpm": { - "oneof": [ - "enableVtpm" - ] - }, - "_enableIntegrityMonitoring": { - "oneof": [ - "enableIntegrityMonitoring" - ] - } - }, - "fields": { - "enableSecureBoot": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "enableVtpm": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "enableIntegrityMonitoring": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - }, - "ConfidentialInstanceConfig": { - "fields": { - "enableConfidentialCompute": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "InstanceGroupConfig": { - "fields": { - "numInstances": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "instanceNames": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "instanceReferences": { - "rule": "repeated", - "type": "InstanceReference", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "imageUri": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "machineTypeUri": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "diskConfig": { - "type": "DiskConfig", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "isPreemptible": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "preemptibility": { - "type": "Preemptibility", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "managedGroupConfig": { - "type": "ManagedGroupConfig", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "accelerators": { - "rule": "repeated", - "type": "AcceleratorConfig", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "minCpuPlatform": { - "type": "string", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "minNumInstances": { - "type": "int32", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "instanceFlexibilityPolicy": { - "type": "InstanceFlexibilityPolicy", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "startupConfig": { - "type": "StartupConfig", - "id": 14, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "Preemptibility": { - "values": { - "PREEMPTIBILITY_UNSPECIFIED": 0, - "NON_PREEMPTIBLE": 1, - "PREEMPTIBLE": 2, - "SPOT": 3 - } - } - } - }, - "StartupConfig": { - "oneofs": { - "_requiredRegistrationFraction": { - "oneof": [ - "requiredRegistrationFraction" - ] - } - }, - "fields": { - "requiredRegistrationFraction": { - "type": "double", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - }, - "InstanceReference": { - "fields": { - "instanceName": { - "type": "string", - "id": 1 - }, - "instanceId": { - "type": "string", - "id": 2 - }, - "publicKey": { - "type": "string", - "id": 3 - }, - "publicEciesKey": { - "type": "string", - "id": 4 - } - } - }, - "ManagedGroupConfig": { - "fields": { - "instanceTemplateName": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "instanceGroupManagerName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "instanceGroupManagerUri": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "InstanceFlexibilityPolicy": { - "fields": { - "provisioningModelMix": { - "type": "ProvisioningModelMix", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "instanceSelectionList": { - "rule": "repeated", - "type": "InstanceSelection", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "instanceSelectionResults": { - "rule": "repeated", - "type": "InstanceSelectionResult", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "ProvisioningModelMix": { - "oneofs": { - "_standardCapacityBase": { - "oneof": [ - "standardCapacityBase" - ] - }, - "_standardCapacityPercentAboveBase": { - "oneof": [ - "standardCapacityPercentAboveBase" - ] - } - }, - "fields": { - "standardCapacityBase": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "standardCapacityPercentAboveBase": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - }, - "InstanceSelection": { - "fields": { - "machineTypes": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "rank": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "InstanceSelectionResult": { - "oneofs": { - "_machineType": { - "oneof": [ - "machineType" - ] - }, - "_vmCount": { - "oneof": [ - "vmCount" - ] - } - }, - "fields": { - "machineType": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "vmCount": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - } - } - } - } - }, - "AcceleratorConfig": { - "fields": { - "acceleratorTypeUri": { - "type": "string", - "id": 1 - }, - "acceleratorCount": { - "type": "int32", - "id": 2 - } - } - }, - "DiskConfig": { - "oneofs": { - "_bootDiskProvisionedIops": { - "oneof": [ - "bootDiskProvisionedIops" - ] - }, - "_bootDiskProvisionedThroughput": { - "oneof": [ - "bootDiskProvisionedThroughput" - ] - } - }, - "fields": { - "bootDiskType": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "bootDiskSizeGb": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "numLocalSsds": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "localSsdInterface": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "bootDiskProvisionedIops": { - "type": "int64", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "bootDiskProvisionedThroughput": { - "type": "int64", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - }, - "AuxiliaryNodeGroup": { - "fields": { - "nodeGroup": { - "type": "NodeGroup", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "nodeGroupId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "NodeGroup": { - "options": { - "(google.api.resource).type": "dataproc.googleapis.com/NodeGroup", - "(google.api.resource).pattern": "projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{node_group}" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "roles": { - "rule": "repeated", - "type": "Role", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "nodeGroupConfig": { - "type": "InstanceGroupConfig", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "Role": { - "values": { - "ROLE_UNSPECIFIED": 0, - "DRIVER": 1 - } - } - } - }, - "NodeInitializationAction": { - "fields": { - "executableFile": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "executionTimeout": { - "type": "google.protobuf.Duration", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ClusterStatus": { - "fields": { - "state": { - "type": "State", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "detail": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "stateStartTime": { - "type": "google.protobuf.Timestamp", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "substate": { - "type": "Substate", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "State": { - "values": { - "UNKNOWN": 0, - "CREATING": 1, - "RUNNING": 2, - "ERROR": 3, - "ERROR_DUE_TO_UPDATE": 9, - "DELETING": 4, - "UPDATING": 5, - "STOPPING": 6, - "STOPPED": 7, - "STARTING": 8, - "REPAIRING": 10 - } - }, - "Substate": { - "values": { - "UNSPECIFIED": 0, - "UNHEALTHY": 1, - "STALE_STATUS": 2 - } - } - } - }, - "SecurityConfig": { - "fields": { - "kerberosConfig": { - "type": "KerberosConfig", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "identityConfig": { - "type": "IdentityConfig", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "KerberosConfig": { - "fields": { - "enableKerberos": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "rootPrincipalPasswordUri": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "kmsKeyUri": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "keystoreUri": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "truststoreUri": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "keystorePasswordUri": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "keyPasswordUri": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "truststorePasswordUri": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "crossRealmTrustRealm": { - "type": "string", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "crossRealmTrustKdc": { - "type": "string", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "crossRealmTrustAdminServer": { - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "crossRealmTrustSharedPasswordUri": { - "type": "string", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "kdcDbKeyUri": { - "type": "string", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "tgtLifetimeHours": { - "type": "int32", - "id": 14, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "realm": { - "type": "string", - "id": 15, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "IdentityConfig": { - "fields": { - "userServiceAccountMapping": { - "keyType": "string", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "SoftwareConfig": { - "fields": { - "imageVersion": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "properties": { - "keyType": "string", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "optionalComponents": { - "rule": "repeated", - "type": "Component", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "LifecycleConfig": { - "oneofs": { - "ttl": { - "oneof": [ - "autoDeleteTime", - "autoDeleteTtl" - ] - }, - "stopTtl": { - "oneof": [ - "autoStopTime", - "autoStopTtl" - ] - } - }, - "fields": { - "idleDeleteTtl": { - "type": "google.protobuf.Duration", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "autoDeleteTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "autoDeleteTtl": { - "type": "google.protobuf.Duration", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "idleStopTtl": { - "type": "google.protobuf.Duration", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "autoStopTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "autoStopTtl": { - "type": "google.protobuf.Duration", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "idleStartTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "MetastoreConfig": { - "fields": { - "dataprocMetastoreService": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "metastore.googleapis.com/Service" - } - } - } - }, - "ClusterMetrics": { - "fields": { - "hdfsMetrics": { - "keyType": "string", - "type": "int64", - "id": 1 - }, - "yarnMetrics": { - "keyType": "string", - "type": "int64", - "id": 2 - } - } - }, - "DataprocMetricConfig": { - "fields": { - "metrics": { - "rule": "repeated", - "type": "Metric", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "MetricSource": { - "values": { - "METRIC_SOURCE_UNSPECIFIED": 0, - "MONITORING_AGENT_DEFAULTS": 1, - "HDFS": 2, - "SPARK": 3, - "YARN": 4, - "SPARK_HISTORY_SERVER": 5, - "HIVESERVER2": 6, - "HIVEMETASTORE": 7, - "FLINK": 8 - } - }, - "Metric": { - "fields": { - "metricSource": { - "type": "MetricSource", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "metricOverrides": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - }, - "CreateClusterRequest": { - "fields": { - "projectId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "region": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "cluster": { - "type": "Cluster", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "actionOnFailedPrimaryWorkers": { - "type": "FailureAction", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "UpdateClusterRequest": { - "fields": { - "projectId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "region": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "clusterName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "cluster": { - "type": "Cluster", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "gracefulDecommissionTimeout": { - "type": "google.protobuf.Duration", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "StopClusterRequest": { - "fields": { - "projectId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "region": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "clusterName": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "clusterUuid": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "requestId": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "StartClusterRequest": { - "fields": { - "projectId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "region": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "clusterName": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "clusterUuid": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "requestId": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteClusterRequest": { - "fields": { - "projectId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "region": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "clusterName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "clusterUuid": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "requestId": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GetClusterRequest": { - "fields": { - "projectId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "region": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "clusterName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ListClustersRequest": { - "fields": { - "projectId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "region": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "filter": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListClustersResponse": { - "fields": { - "clusters": { - "rule": "repeated", - "type": "Cluster", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "nextPageToken": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "DiagnoseClusterRequest": { - "fields": { - "projectId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "region": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "clusterName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "tarballGcsDir": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "tarballAccess": { - "type": "TarballAccess", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "diagnosisInterval": { - "type": "google.type.Interval", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "jobs": { - "rule": "repeated", - "type": "string", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "yarnApplicationIds": { - "rule": "repeated", - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "TarballAccess": { - "values": { - "TARBALL_ACCESS_UNSPECIFIED": 0, - "GOOGLE_CLOUD_SUPPORT": 1, - "GOOGLE_DATAPROC_DIAGNOSE": 2 - } - } - } - }, - "DiagnoseClusterResults": { - "fields": { - "outputUri": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "ReservationAffinity": { - "fields": { - "consumeReservationType": { - "type": "Type", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "key": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "values": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "NO_RESERVATION": 1, - "ANY_RESERVATION": 2, - "SPECIFIC_RESERVATION": 3 - } - } - } - }, - "BatchOperationMetadata": { - "fields": { - "batch": { - "type": "string", - "id": 1 - }, - "batchUuid": { - "type": "string", - "id": 2 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "doneTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - }, - "operationType": { - "type": "BatchOperationType", - "id": 6 - }, - "description": { - "type": "string", - "id": 7 - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 8 - }, - "warnings": { - "rule": "repeated", - "type": "string", - "id": 9 - } - }, - "nested": { - "BatchOperationType": { - "values": { - "BATCH_OPERATION_TYPE_UNSPECIFIED": 0, - "BATCH": 1 - } - } - } - }, - "SessionOperationMetadata": { - "fields": { - "session": { - "type": "string", - "id": 1 - }, - "sessionUuid": { - "type": "string", - "id": 2 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - }, - "doneTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - }, - "operationType": { - "type": "SessionOperationType", - "id": 6 - }, - "description": { - "type": "string", - "id": 7 - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 8 - }, - "warnings": { - "rule": "repeated", - "type": "string", - "id": 9 - } - }, - "nested": { - "SessionOperationType": { - "values": { - "SESSION_OPERATION_TYPE_UNSPECIFIED": 0, - "CREATE": 1, - "TERMINATE": 2, - "DELETE": 3 - } - } - } - }, - "ClusterOperationStatus": { - "fields": { - "state": { - "type": "State", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "innerState": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "details": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "stateStartTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "State": { - "values": { - "UNKNOWN": 0, - "PENDING": 1, - "RUNNING": 2, - "DONE": 3 - } - } - } - }, - "ClusterOperationMetadata": { - "fields": { - "clusterName": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "clusterUuid": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "status": { - "type": "ClusterOperationStatus", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "statusHistory": { - "rule": "repeated", - "type": "ClusterOperationStatus", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "operationType": { - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "description": { - "type": "string", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "warnings": { - "rule": "repeated", - "type": "string", - "id": 14, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "childOperationIds": { - "rule": "repeated", - "type": "string", - "id": 15, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "NodeGroupOperationMetadata": { - "fields": { - "nodeGroupId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "clusterUuid": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "status": { - "type": "ClusterOperationStatus", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "statusHistory": { - "rule": "repeated", - "type": "ClusterOperationStatus", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "operationType": { - "type": "NodeGroupOperationType", - "id": 5 - }, - "description": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "warnings": { - "rule": "repeated", - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "NodeGroupOperationType": { - "values": { - "NODE_GROUP_OPERATION_TYPE_UNSPECIFIED": 0, - "CREATE": 1, - "UPDATE": 2, - "DELETE": 3, - "RESIZE": 4 - } - } - } - }, - "JobController": { - "options": { - "(google.api.default_host)": "dataproc.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "SubmitJob": { - "requestType": "SubmitJobRequest", - "responseType": "Job", - "options": { - "(google.api.http).post": "/v1/projects/{project_id}/regions/{region}/jobs:submit", - "(google.api.http).body": "*", - "(google.api.method_signature)": "project_id,region,job" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/projects/{project_id}/regions/{region}/jobs:submit", - "body": "*" - } - }, - { - "(google.api.method_signature)": "project_id,region,job" - } - ] - }, - "SubmitJobAsOperation": { - "requestType": "SubmitJobRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/projects/{project_id}/regions/{region}/jobs:submitAsOperation", - "(google.api.http).body": "*", - "(google.api.method_signature)": "project_id, region, job", - "(google.longrunning.operation_info).response_type": "Job", - "(google.longrunning.operation_info).metadata_type": "JobMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/projects/{project_id}/regions/{region}/jobs:submitAsOperation", - "body": "*" - } - }, - { - "(google.api.method_signature)": "project_id, region, job" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Job", - "metadata_type": "JobMetadata" - } - } - ] - }, - "GetJob": { - "requestType": "GetJobRequest", - "responseType": "Job", - "options": { - "(google.api.http).get": "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}", - "(google.api.method_signature)": "project_id,region,job_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}" - } - }, - { - "(google.api.method_signature)": "project_id,region,job_id" - } - ] - }, - "ListJobs": { - "requestType": "ListJobsRequest", - "responseType": "ListJobsResponse", - "options": { - "(google.api.http).get": "/v1/projects/{project_id}/regions/{region}/jobs", - "(google.api.method_signature)": "project_id,region,filter" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/projects/{project_id}/regions/{region}/jobs" - } - }, - { - "(google.api.method_signature)": "project_id,region" - }, - { - "(google.api.method_signature)": "project_id,region,filter" - } - ] - }, - "UpdateJob": { - "requestType": "UpdateJobRequest", - "responseType": "Job", - "options": { - "(google.api.http).patch": "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}", - "(google.api.http).body": "job" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}", - "body": "job" - } - } - ] - }, - "CancelJob": { - "requestType": "CancelJobRequest", - "responseType": "Job", - "options": { - "(google.api.http).post": "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}:cancel", - "(google.api.http).body": "*", - "(google.api.method_signature)": "project_id,region,job_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}:cancel", - "body": "*" - } - }, - { - "(google.api.method_signature)": "project_id,region,job_id" - } - ] - }, - "DeleteJob": { - "requestType": "DeleteJobRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}", - "(google.api.method_signature)": "project_id,region,job_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/projects/{project_id}/regions/{region}/jobs/{job_id}" - } - }, - { - "(google.api.method_signature)": "project_id,region,job_id" - } - ] - } - } - }, - "LoggingConfig": { - "fields": { - "driverLogLevels": { - "keyType": "string", - "type": "Level", - "id": 2 - } - }, - "nested": { - "Level": { - "values": { - "LEVEL_UNSPECIFIED": 0, - "ALL": 1, - "TRACE": 2, - "DEBUG": 3, - "INFO": 4, - "WARN": 5, - "ERROR": 6, - "FATAL": 7, - "OFF": 8 - } - } - } - }, - "HadoopJob": { - "oneofs": { - "driver": { - "oneof": [ - "mainJarFileUri", - "mainClass" - ] - } - }, - "fields": { - "mainJarFileUri": { - "type": "string", - "id": 1 - }, - "mainClass": { - "type": "string", - "id": 2 - }, - "args": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "jarFileUris": { - "rule": "repeated", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "fileUris": { - "rule": "repeated", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "archiveUris": { - "rule": "repeated", - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "properties": { - "keyType": "string", - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "loggingConfig": { - "type": "LoggingConfig", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "SparkJob": { - "oneofs": { - "driver": { - "oneof": [ - "mainJarFileUri", - "mainClass" - ] - } - }, - "fields": { - "mainJarFileUri": { - "type": "string", - "id": 1 - }, - "mainClass": { - "type": "string", - "id": 2 - }, - "args": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "jarFileUris": { - "rule": "repeated", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "fileUris": { - "rule": "repeated", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "archiveUris": { - "rule": "repeated", - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "properties": { - "keyType": "string", - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "loggingConfig": { - "type": "LoggingConfig", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "PySparkJob": { - "fields": { - "mainPythonFileUri": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "args": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pythonFileUris": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "jarFileUris": { - "rule": "repeated", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "fileUris": { - "rule": "repeated", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "archiveUris": { - "rule": "repeated", - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "properties": { - "keyType": "string", - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "loggingConfig": { - "type": "LoggingConfig", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "QueryList": { - "fields": { - "queries": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "HiveJob": { - "oneofs": { - "queries": { - "oneof": [ - "queryFileUri", - "queryList" - ] - } - }, - "fields": { - "queryFileUri": { - "type": "string", - "id": 1 - }, - "queryList": { - "type": "QueryList", - "id": 2 - }, - "continueOnFailure": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "scriptVariables": { - "keyType": "string", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "properties": { - "keyType": "string", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "jarFileUris": { - "rule": "repeated", - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "SparkSqlJob": { - "oneofs": { - "queries": { - "oneof": [ - "queryFileUri", - "queryList" - ] - } - }, - "fields": { - "queryFileUri": { - "type": "string", - "id": 1 - }, - "queryList": { - "type": "QueryList", - "id": 2 - }, - "scriptVariables": { - "keyType": "string", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "properties": { - "keyType": "string", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "jarFileUris": { - "rule": "repeated", - "type": "string", - "id": 56, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "loggingConfig": { - "type": "LoggingConfig", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "PigJob": { - "oneofs": { - "queries": { - "oneof": [ - "queryFileUri", - "queryList" - ] - } - }, - "fields": { - "queryFileUri": { - "type": "string", - "id": 1 - }, - "queryList": { - "type": "QueryList", - "id": 2 - }, - "continueOnFailure": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "scriptVariables": { - "keyType": "string", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "properties": { - "keyType": "string", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "jarFileUris": { - "rule": "repeated", - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "loggingConfig": { - "type": "LoggingConfig", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "SparkRJob": { - "fields": { - "mainRFileUri": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "args": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "fileUris": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "archiveUris": { - "rule": "repeated", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "properties": { - "keyType": "string", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "loggingConfig": { - "type": "LoggingConfig", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "PrestoJob": { - "oneofs": { - "queries": { - "oneof": [ - "queryFileUri", - "queryList" - ] - } - }, - "fields": { - "queryFileUri": { - "type": "string", - "id": 1 - }, - "queryList": { - "type": "QueryList", - "id": 2 - }, - "continueOnFailure": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "outputFormat": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "clientTags": { - "rule": "repeated", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "properties": { - "keyType": "string", - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "loggingConfig": { - "type": "LoggingConfig", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "TrinoJob": { - "oneofs": { - "queries": { - "oneof": [ - "queryFileUri", - "queryList" - ] - } - }, - "fields": { - "queryFileUri": { - "type": "string", - "id": 1 - }, - "queryList": { - "type": "QueryList", - "id": 2 - }, - "continueOnFailure": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "outputFormat": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "clientTags": { - "rule": "repeated", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "properties": { - "keyType": "string", - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "loggingConfig": { - "type": "LoggingConfig", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "FlinkJob": { - "oneofs": { - "driver": { - "oneof": [ - "mainJarFileUri", - "mainClass" - ] - } - }, - "fields": { - "mainJarFileUri": { - "type": "string", - "id": 1 - }, - "mainClass": { - "type": "string", - "id": 2 - }, - "args": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "jarFileUris": { - "rule": "repeated", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "savepointUri": { - "type": "string", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "properties": { - "keyType": "string", - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "loggingConfig": { - "type": "LoggingConfig", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "JobPlacement": { - "fields": { - "clusterName": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "clusterUuid": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "clusterLabels": { - "keyType": "string", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "JobStatus": { - "fields": { - "state": { - "type": "State", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "details": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "stateStartTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "substate": { - "type": "Substate", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "PENDING": 1, - "SETUP_DONE": 8, - "RUNNING": 2, - "CANCEL_PENDING": 3, - "CANCEL_STARTED": 7, - "CANCELLED": 4, - "DONE": 5, - "ERROR": 6, - "ATTEMPT_FAILURE": 9 - } - }, - "Substate": { - "values": { - "UNSPECIFIED": 0, - "SUBMITTED": 1, - "QUEUED": 2, - "STALE_STATUS": 3 - } - } - } - }, - "JobReference": { - "fields": { - "projectId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "jobId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "YarnApplication": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "state": { - "type": "State", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "progress": { - "type": "float", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "trackingUrl": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "NEW": 1, - "NEW_SAVING": 2, - "SUBMITTED": 3, - "ACCEPTED": 4, - "RUNNING": 5, - "FINISHED": 6, - "FAILED": 7, - "KILLED": 8 - } - } - } - }, - "Job": { - "oneofs": { - "typeJob": { - "oneof": [ - "hadoopJob", - "sparkJob", - "pysparkJob", - "hiveJob", - "pigJob", - "sparkRJob", - "sparkSqlJob", - "prestoJob", - "trinoJob", - "flinkJob" - ] - } - }, - "fields": { - "reference": { - "type": "JobReference", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "placement": { - "type": "JobPlacement", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "hadoopJob": { - "type": "HadoopJob", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "sparkJob": { - "type": "SparkJob", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pysparkJob": { - "type": "PySparkJob", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "hiveJob": { - "type": "HiveJob", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pigJob": { - "type": "PigJob", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "sparkRJob": { - "type": "SparkRJob", - "id": 21, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "sparkSqlJob": { - "type": "SparkSqlJob", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "prestoJob": { - "type": "PrestoJob", - "id": 23, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "trinoJob": { - "type": "TrinoJob", - "id": 28, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "flinkJob": { - "type": "FlinkJob", - "id": 29, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "status": { - "type": "JobStatus", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "statusHistory": { - "rule": "repeated", - "type": "JobStatus", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "yarnApplications": { - "rule": "repeated", - "type": "YarnApplication", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "driverOutputResourceUri": { - "type": "string", - "id": 17, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "driverControlFilesUri": { - "type": "string", - "id": 15, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 18, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "scheduling": { - "type": "JobScheduling", - "id": 20, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "jobUuid": { - "type": "string", - "id": 22, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "done": { - "type": "bool", - "id": 24, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "driverSchedulingConfig": { - "type": "DriverSchedulingConfig", - "id": 27, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DriverSchedulingConfig": { - "fields": { - "memoryMb": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "vcores": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "JobScheduling": { - "fields": { - "maxFailuresPerHour": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "maxFailuresTotal": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "SubmitJobRequest": { - "fields": { - "projectId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "region": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "job": { - "type": "Job", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "JobMetadata": { - "fields": { - "jobId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "status": { - "type": "JobStatus", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "operationType": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "GetJobRequest": { - "fields": { - "projectId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "region": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "jobId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ListJobsRequest": { - "fields": { - "projectId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "region": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "clusterName": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "jobStateMatcher": { - "type": "JobStateMatcher", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "filter": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "JobStateMatcher": { - "values": { - "ALL": 0, - "ACTIVE": 1, - "NON_ACTIVE": 2 - } - } - } - }, - "UpdateJobRequest": { - "fields": { - "projectId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "region": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "jobId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "job": { - "type": "Job", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 5, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ListJobsResponse": { - "fields": { - "jobs": { - "rule": "repeated", - "type": "Job", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "nextPageToken": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "CancelJobRequest": { - "fields": { - "projectId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "region": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "jobId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "DeleteJobRequest": { - "fields": { - "projectId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "region": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "jobId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "NodeGroupController": { - "options": { - "(google.api.default_host)": "dataproc.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "CreateNodeGroup": { - "requestType": "CreateNodeGroupRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/regions/*/clusters/*}/nodeGroups", - "(google.api.http).body": "node_group", - "(google.api.method_signature)": "parent,node_group,node_group_id", - "(google.longrunning.operation_info).response_type": "NodeGroup", - "(google.longrunning.operation_info).metadata_type": "google.cloud.dataproc.v1.NodeGroupOperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/regions/*/clusters/*}/nodeGroups", - "body": "node_group" - } - }, - { - "(google.api.method_signature)": "parent,node_group,node_group_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "NodeGroup", - "metadata_type": "google.cloud.dataproc.v1.NodeGroupOperationMetadata" - } - } - ] - }, - "ResizeNodeGroup": { - "requestType": "ResizeNodeGroupRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/regions/*/clusters/*/nodeGroups/*}:resize", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name,size", - "(google.longrunning.operation_info).response_type": "NodeGroup", - "(google.longrunning.operation_info).metadata_type": "google.cloud.dataproc.v1.NodeGroupOperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/regions/*/clusters/*/nodeGroups/*}:resize", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name,size" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "NodeGroup", - "metadata_type": "google.cloud.dataproc.v1.NodeGroupOperationMetadata" - } - } - ] - }, - "GetNodeGroup": { - "requestType": "GetNodeGroupRequest", - "responseType": "NodeGroup", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/regions/*/clusters/*/nodeGroups/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/regions/*/clusters/*/nodeGroups/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - } - } - }, - "CreateNodeGroupRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dataproc.googleapis.com/NodeGroup" - } - }, - "nodeGroup": { - "type": "NodeGroup", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "nodeGroupId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ResizeNodeGroupRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "size": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "gracefulDecommissionTimeout": { - "type": "google.protobuf.Duration", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GetNodeGroupRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dataproc.googleapis.com/NodeGroup" - } - } - } - }, - "SessionTemplateController": { - "options": { - "(google.api.default_host)": "dataproc.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "CreateSessionTemplate": { - "requestType": "CreateSessionTemplateRequest", - "responseType": "SessionTemplate", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/sessionTemplates", - "(google.api.http).body": "session_template", - "(google.api.method_signature)": "parent,session_template" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/sessionTemplates", - "body": "session_template" - } - }, - { - "(google.api.method_signature)": "parent,session_template" - } - ] - }, - "UpdateSessionTemplate": { - "requestType": "UpdateSessionTemplateRequest", - "responseType": "SessionTemplate", - "options": { - "(google.api.http).patch": "/v1/{session_template.name=projects/*/locations/*/sessionTemplates/*}", - "(google.api.http).body": "session_template", - "(google.api.method_signature)": "session_template" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{session_template.name=projects/*/locations/*/sessionTemplates/*}", - "body": "session_template" - } - }, - { - "(google.api.method_signature)": "session_template" - } - ] - }, - "GetSessionTemplate": { - "requestType": "GetSessionTemplateRequest", - "responseType": "SessionTemplate", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/sessionTemplates/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/sessionTemplates/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListSessionTemplates": { - "requestType": "ListSessionTemplatesRequest", - "responseType": "ListSessionTemplatesResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/sessionTemplates", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/sessionTemplates" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "DeleteSessionTemplate": { - "requestType": "DeleteSessionTemplateRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/sessionTemplates/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/sessionTemplates/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - } - } - }, - "CreateSessionTemplateRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dataproc.googleapis.com/SessionTemplate" - } - }, - "sessionTemplate": { - "type": "SessionTemplate", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpdateSessionTemplateRequest": { - "fields": { - "sessionTemplate": { - "type": "SessionTemplate", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "GetSessionTemplateRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dataproc.googleapis.com/SessionTemplate" - } - } - } - }, - "ListSessionTemplatesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dataproc.googleapis.com/SessionTemplate" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "filter": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListSessionTemplatesResponse": { - "fields": { - "sessionTemplates": { - "rule": "repeated", - "type": "SessionTemplate", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "DeleteSessionTemplateRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dataproc.googleapis.com/SessionTemplate" - } - } - } - }, - "SessionTemplate": { - "options": { - "(google.api.resource).type": "dataproc.googleapis.com/SessionTemplate", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/sessionTemplates/{template}" - }, - "oneofs": { - "sessionConfig": { - "oneof": [ - "jupyterSession", - "sparkConnectSession" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "jupyterSession": { - "type": "JupyterConfig", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "sparkConnectSession": { - "type": "SparkConnectConfig", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "creator": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "runtimeConfig": { - "type": "RuntimeConfig", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "environmentConfig": { - "type": "EnvironmentConfig", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "uuid": { - "type": "string", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "SessionController": { - "options": { - "(google.api.default_host)": "dataproc.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "CreateSession": { - "requestType": "CreateSessionRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/sessions", - "(google.api.http).body": "session", - "(google.api.method_signature)": "parent,session,session_id", - "(google.longrunning.operation_info).response_type": "Session", - "(google.longrunning.operation_info).metadata_type": "google.cloud.dataproc.v1.SessionOperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/sessions", - "body": "session" - } - }, - { - "(google.api.method_signature)": "parent,session,session_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Session", - "metadata_type": "google.cloud.dataproc.v1.SessionOperationMetadata" - } - } - ] - }, - "GetSession": { - "requestType": "GetSessionRequest", - "responseType": "Session", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/sessions/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/sessions/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListSessions": { - "requestType": "ListSessionsRequest", - "responseType": "ListSessionsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/sessions", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/sessions" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "TerminateSession": { - "requestType": "TerminateSessionRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/sessions/*}:terminate", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "Session", - "(google.longrunning.operation_info).metadata_type": "google.cloud.dataproc.v1.SessionOperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/locations/*/sessions/*}:terminate", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Session", - "metadata_type": "google.cloud.dataproc.v1.SessionOperationMetadata" - } - } - ] - }, - "DeleteSession": { - "requestType": "DeleteSessionRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/sessions/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "Session", - "(google.longrunning.operation_info).metadata_type": "google.cloud.dataproc.v1.SessionOperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/sessions/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Session", - "metadata_type": "google.cloud.dataproc.v1.SessionOperationMetadata" - } - } - ] - } - } - }, - "CreateSessionRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dataproc.googleapis.com/Session" - } - }, - "session": { - "type": "Session", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "sessionId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "GetSessionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dataproc.googleapis.com/Session" - } - } - } - }, - "ListSessionsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dataproc.googleapis.com/Session" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "filter": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListSessionsResponse": { - "fields": { - "sessions": { - "rule": "repeated", - "type": "Session", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "TerminateSessionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dataproc.googleapis.com/Session" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteSessionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dataproc.googleapis.com/Session" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Session": { - "options": { - "(google.api.resource).type": "dataproc.googleapis.com/Session", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/sessions/{session}" - }, - "oneofs": { - "sessionConfig": { - "oneof": [ - "jupyterSession", - "sparkConnectSession" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "uuid": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "jupyterSession": { - "type": "JupyterConfig", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "sparkConnectSession": { - "type": "SparkConnectConfig", - "id": 17, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "runtimeInfo": { - "type": "RuntimeInfo", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "state": { - "type": "State", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "stateMessage": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "stateTime": { - "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" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "runtimeConfig": { - "type": "RuntimeConfig", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "environmentConfig": { - "type": "EnvironmentConfig", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "user": { - "type": "string", - "id": 14, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "stateHistory": { - "rule": "repeated", - "type": "SessionStateHistory", - "id": 15, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "sessionTemplate": { - "type": "string", - "id": 16, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "dataproc.googleapis.com/SessionTemplate" - } - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "CREATING": 1, - "ACTIVE": 2, - "TERMINATING": 3, - "TERMINATED": 4, - "FAILED": 5 - } - }, - "SessionStateHistory": { - "fields": { - "state": { - "type": "State", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "stateMessage": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "stateStartTime": { - "type": "google.protobuf.Timestamp", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - } - } - }, - "JupyterConfig": { - "fields": { - "kernel": { - "type": "Kernel", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "Kernel": { - "values": { - "KERNEL_UNSPECIFIED": 0, - "PYTHON": 1, - "SCALA": 2 - } - } - } - }, - "SparkConnectConfig": { - "fields": {} - }, - "WorkflowTemplateService": { - "options": { - "(google.api.default_host)": "dataproc.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "CreateWorkflowTemplate": { - "requestType": "CreateWorkflowTemplateRequest", - "responseType": "WorkflowTemplate", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/workflowTemplates", - "(google.api.http).body": "template", - "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*/regions/*}/workflowTemplates", - "(google.api.http).additional_bindings.body": "template", - "(google.api.method_signature)": "parent,template" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/workflowTemplates", - "body": "template", - "additional_bindings": { - "post": "/v1/{parent=projects/*/regions/*}/workflowTemplates", - "body": "template" - } - } - }, - { - "(google.api.method_signature)": "parent,template" - } - ] - }, - "GetWorkflowTemplate": { - "requestType": "GetWorkflowTemplateRequest", - "responseType": "WorkflowTemplate", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/workflowTemplates/*}", - "(google.api.http).additional_bindings.get": "/v1/{name=projects/*/regions/*/workflowTemplates/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/workflowTemplates/*}", - "additional_bindings": { - "get": "/v1/{name=projects/*/regions/*/workflowTemplates/*}" - } - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "InstantiateWorkflowTemplate": { - "requestType": "InstantiateWorkflowTemplateRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/workflowTemplates/*}:instantiate", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v1/{name=projects/*/regions/*/workflowTemplates/*}:instantiate", - "(google.api.http).additional_bindings.body": "*", - "(google.api.method_signature)": "name,parameters", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "WorkflowMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/locations/*/workflowTemplates/*}:instantiate", - "body": "*", - "additional_bindings": { - "post": "/v1/{name=projects/*/regions/*/workflowTemplates/*}:instantiate", - "body": "*" - } - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.api.method_signature)": "name,parameters" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "WorkflowMetadata" - } - } - ] - }, - "InstantiateInlineWorkflowTemplate": { - "requestType": "InstantiateInlineWorkflowTemplateRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/workflowTemplates:instantiateInline", - "(google.api.http).body": "template", - "(google.api.http).additional_bindings.post": "/v1/{parent=projects/*/regions/*}/workflowTemplates:instantiateInline", - "(google.api.http).additional_bindings.body": "template", - "(google.api.method_signature)": "parent,template", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "WorkflowMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/workflowTemplates:instantiateInline", - "body": "template", - "additional_bindings": { - "post": "/v1/{parent=projects/*/regions/*}/workflowTemplates:instantiateInline", - "body": "template" - } - } - }, - { - "(google.api.method_signature)": "parent,template" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "WorkflowMetadata" - } - } - ] - }, - "UpdateWorkflowTemplate": { - "requestType": "UpdateWorkflowTemplateRequest", - "responseType": "WorkflowTemplate", - "options": { - "(google.api.http).put": "/v1/{template.name=projects/*/locations/*/workflowTemplates/*}", - "(google.api.http).body": "template", - "(google.api.http).additional_bindings.put": "/v1/{template.name=projects/*/regions/*/workflowTemplates/*}", - "(google.api.http).additional_bindings.body": "template", - "(google.api.method_signature)": "template" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "put": "/v1/{template.name=projects/*/locations/*/workflowTemplates/*}", - "body": "template", - "additional_bindings": { - "put": "/v1/{template.name=projects/*/regions/*/workflowTemplates/*}", - "body": "template" - } - } - }, - { - "(google.api.method_signature)": "template" - } - ] - }, - "ListWorkflowTemplates": { - "requestType": "ListWorkflowTemplatesRequest", - "responseType": "ListWorkflowTemplatesResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/workflowTemplates", - "(google.api.http).additional_bindings.get": "/v1/{parent=projects/*/regions/*}/workflowTemplates", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/workflowTemplates", - "additional_bindings": { - "get": "/v1/{parent=projects/*/regions/*}/workflowTemplates" - } - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "DeleteWorkflowTemplate": { - "requestType": "DeleteWorkflowTemplateRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/workflowTemplates/*}", - "(google.api.http).additional_bindings.delete": "/v1/{name=projects/*/regions/*/workflowTemplates/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/workflowTemplates/*}", - "additional_bindings": { - "delete": "/v1/{name=projects/*/regions/*/workflowTemplates/*}" - } - } - }, - { - "(google.api.method_signature)": "name" - } - ] - } - } - }, - "WorkflowTemplate": { - "options": { - "(google.api.resource).type": "dataproc.googleapis.com/WorkflowTemplate", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/workflowTemplates/{workflow_template}", - "(google.api.resource).history": "ORIGINALLY_SINGLE_PATTERN" - }, - "fields": { - "id": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "version": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "placement": { - "type": "WorkflowTemplatePlacement", - "id": 7, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "jobs": { - "rule": "repeated", - "type": "OrderedJob", - "id": 8, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "parameters": { - "rule": "repeated", - "type": "TemplateParameter", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "dagTimeout": { - "type": "google.protobuf.Duration", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "encryptionConfig": { - "type": "EncryptionConfig", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "EncryptionConfig": { - "fields": { - "kmsKey": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" - } - } - } - } - } - }, - "WorkflowTemplatePlacement": { - "oneofs": { - "placement": { - "oneof": [ - "managedCluster", - "clusterSelector" - ] - } - }, - "fields": { - "managedCluster": { - "type": "ManagedCluster", - "id": 1 - }, - "clusterSelector": { - "type": "ClusterSelector", - "id": 2 - } - } - }, - "ManagedCluster": { - "fields": { - "clusterName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "config": { - "type": "ClusterConfig", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ClusterSelector": { - "fields": { - "zone": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "clusterLabels": { - "keyType": "string", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "OrderedJob": { - "oneofs": { - "jobType": { - "oneof": [ - "hadoopJob", - "sparkJob", - "pysparkJob", - "hiveJob", - "pigJob", - "sparkRJob", - "sparkSqlJob", - "prestoJob", - "trinoJob", - "flinkJob" - ] - } - }, - "fields": { - "stepId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "hadoopJob": { - "type": "HadoopJob", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "sparkJob": { - "type": "SparkJob", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pysparkJob": { - "type": "PySparkJob", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "hiveJob": { - "type": "HiveJob", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pigJob": { - "type": "PigJob", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "sparkRJob": { - "type": "SparkRJob", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "sparkSqlJob": { - "type": "SparkSqlJob", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "prestoJob": { - "type": "PrestoJob", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "trinoJob": { - "type": "TrinoJob", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "flinkJob": { - "type": "FlinkJob", - "id": 14, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "scheduling": { - "type": "JobScheduling", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "prerequisiteStepIds": { - "rule": "repeated", - "type": "string", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "TemplateParameter": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "fields": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validation": { - "type": "ParameterValidation", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ParameterValidation": { - "oneofs": { - "validationType": { - "oneof": [ - "regex", - "values" - ] - } - }, - "fields": { - "regex": { - "type": "RegexValidation", - "id": 1 - }, - "values": { - "type": "ValueValidation", - "id": 2 - } - } - }, - "RegexValidation": { - "fields": { - "regexes": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ValueValidation": { - "fields": { - "values": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "WorkflowMetadata": { - "fields": { - "template": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "version": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "createCluster": { - "type": "ClusterOperation", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "graph": { - "type": "WorkflowGraph", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "deleteCluster": { - "type": "ClusterOperation", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "state": { - "type": "State", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "clusterName": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "parameters": { - "keyType": "string", - "type": "string", - "id": 8 - }, - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "clusterUuid": { - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "dagTimeout": { - "type": "google.protobuf.Duration", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "dagStartTime": { - "type": "google.protobuf.Timestamp", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "dagEndTime": { - "type": "google.protobuf.Timestamp", - "id": 14, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "State": { - "values": { - "UNKNOWN": 0, - "PENDING": 1, - "RUNNING": 2, - "DONE": 3 - } - } - } - }, - "ClusterOperation": { - "fields": { - "operationId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "error": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "done": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "WorkflowGraph": { - "fields": { - "nodes": { - "rule": "repeated", - "type": "WorkflowNode", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "WorkflowNode": { - "fields": { - "stepId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "prerequisiteStepIds": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "jobId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "state": { - "type": "NodeState", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "error": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "NodeState": { - "values": { - "NODE_STATE_UNSPECIFIED": 0, - "BLOCKED": 1, - "RUNNABLE": 2, - "RUNNING": 3, - "COMPLETED": 4, - "FAILED": 5 - } - } - } - }, - "CreateWorkflowTemplateRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dataproc.googleapis.com/WorkflowTemplate" - } - }, - "template": { - "type": "WorkflowTemplate", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "GetWorkflowTemplateRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dataproc.googleapis.com/WorkflowTemplate" - } - }, - "version": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "InstantiateWorkflowTemplateRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dataproc.googleapis.com/WorkflowTemplate" - } - }, - "version": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "requestId": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "parameters": { - "keyType": "string", - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "InstantiateInlineWorkflowTemplateRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dataproc.googleapis.com/WorkflowTemplate" - } - }, - "template": { - "type": "WorkflowTemplate", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "UpdateWorkflowTemplateRequest": { - "fields": { - "template": { - "type": "WorkflowTemplate", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ListWorkflowTemplatesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dataproc.googleapis.com/WorkflowTemplate" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListWorkflowTemplatesResponse": { - "fields": { - "templates": { - "rule": "repeated", - "type": "WorkflowTemplate", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "nextPageToken": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "DeleteWorkflowTemplateRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dataproc.googleapis.com/WorkflowTemplate" - } - }, - "version": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - } - } - } - } - }, - "api": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", - "java_multiple_files": true, - "java_outer_classname": "ResourceProto", - "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true - }, - "nested": { - "http": { - "type": "HttpRule", - "id": 72295728, - "extend": "google.protobuf.MethodOptions" - }, - "Http": { - "fields": { - "rules": { - "rule": "repeated", - "type": "HttpRule", - "id": 1 - }, - "fullyDecodeReservedExpansion": { - "type": "bool", - "id": 2 - } - } - }, - "HttpRule": { - "oneofs": { - "pattern": { - "oneof": [ - "get", - "put", - "post", - "delete", - "patch", - "custom" - ] - } - }, - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "get": { - "type": "string", - "id": 2 - }, - "put": { - "type": "string", - "id": 3 - }, - "post": { - "type": "string", - "id": 4 - }, - "delete": { - "type": "string", - "id": 5 - }, - "patch": { - "type": "string", - "id": 6 - }, - "custom": { - "type": "CustomHttpPattern", - "id": 8 - }, - "body": { - "type": "string", - "id": 7 - }, - "responseBody": { - "type": "string", - "id": 12 - }, - "additionalBindings": { - "rule": "repeated", - "type": "HttpRule", - "id": 11 - } - } - }, - "CustomHttpPattern": { - "fields": { - "kind": { - "type": "string", - "id": 1 - }, - "path": { - "type": "string", - "id": 2 - } - } - }, - "methodSignature": { - "rule": "repeated", - "type": "string", - "id": 1051, - "extend": "google.protobuf.MethodOptions" - }, - "defaultHost": { - "type": "string", - "id": 1049, - "extend": "google.protobuf.ServiceOptions" - }, - "oauthScopes": { - "type": "string", - "id": 1050, - "extend": "google.protobuf.ServiceOptions" - }, - "apiVersion": { - "type": "string", - "id": 525000001, - "extend": "google.protobuf.ServiceOptions" - }, - "CommonLanguageSettings": { - "fields": { - "referenceDocsUri": { - "type": "string", - "id": 1, - "options": { - "deprecated": true - } - }, - "destinations": { - "rule": "repeated", - "type": "ClientLibraryDestination", - "id": 2 - } - } - }, - "ClientLibrarySettings": { - "fields": { - "version": { - "type": "string", - "id": 1 - }, - "launchStage": { - "type": "LaunchStage", - "id": 2 - }, - "restNumericEnums": { - "type": "bool", - "id": 3 - }, - "javaSettings": { - "type": "JavaSettings", - "id": 21 - }, - "cppSettings": { - "type": "CppSettings", - "id": 22 - }, - "phpSettings": { - "type": "PhpSettings", - "id": 23 - }, - "pythonSettings": { - "type": "PythonSettings", - "id": 24 - }, - "nodeSettings": { - "type": "NodeSettings", - "id": 25 - }, - "dotnetSettings": { - "type": "DotnetSettings", - "id": 26 - }, - "rubySettings": { - "type": "RubySettings", - "id": 27 - }, - "goSettings": { - "type": "GoSettings", - "id": 28 - } - } - }, - "Publishing": { - "fields": { - "methodSettings": { - "rule": "repeated", - "type": "MethodSettings", - "id": 2 - }, - "newIssueUri": { - "type": "string", - "id": 101 - }, - "documentationUri": { - "type": "string", - "id": 102 - }, - "apiShortName": { - "type": "string", - "id": 103 - }, - "githubLabel": { - "type": "string", - "id": 104 - }, - "codeownerGithubTeams": { - "rule": "repeated", - "type": "string", - "id": 105 - }, - "docTagPrefix": { - "type": "string", - "id": 106 - }, - "organization": { - "type": "ClientLibraryOrganization", - "id": 107 - }, - "librarySettings": { - "rule": "repeated", - "type": "ClientLibrarySettings", - "id": 109 - }, - "protoReferenceDocumentationUri": { - "type": "string", - "id": 110 - }, - "restReferenceDocumentationUri": { - "type": "string", - "id": 111 - } - } - }, - "JavaSettings": { - "fields": { - "libraryPackage": { - "type": "string", - "id": 1 - }, - "serviceClassNames": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "common": { - "type": "CommonLanguageSettings", - "id": 3 - } - } - }, - "CppSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PhpSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PythonSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "NodeSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "DotnetSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - }, - "renamedServices": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "renamedResources": { - "keyType": "string", - "type": "string", - "id": 3 - }, - "ignoredResources": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "forcedNamespaceAliases": { - "rule": "repeated", - "type": "string", - "id": 5 - }, - "handwrittenSignatures": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - }, - "RubySettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "GoSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "MethodSettings": { - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "longRunning": { - "type": "LongRunning", - "id": 2 - }, - "autoPopulatedFields": { - "rule": "repeated", - "type": "string", - "id": 3 - } - }, - "nested": { - "LongRunning": { - "fields": { - "initialPollDelay": { - "type": "google.protobuf.Duration", - "id": 1 - }, - "pollDelayMultiplier": { - "type": "float", - "id": 2 - }, - "maxPollDelay": { - "type": "google.protobuf.Duration", - "id": 3 - }, - "totalPollTimeout": { - "type": "google.protobuf.Duration", - "id": 4 - } - } - } - } - }, - "ClientLibraryOrganization": { - "values": { - "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, - "CLOUD": 1, - "ADS": 2, - "PHOTOS": 3, - "STREET_VIEW": 4, - "SHOPPING": 5, - "GEO": 6, - "GENERATIVE_AI": 7 - } - }, - "ClientLibraryDestination": { - "values": { - "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, - "GITHUB": 10, - "PACKAGE_MANAGER": 20 - } - }, - "LaunchStage": { - "values": { - "LAUNCH_STAGE_UNSPECIFIED": 0, - "UNIMPLEMENTED": 6, - "PRELAUNCH": 7, - "EARLY_ACCESS": 1, - "ALPHA": 2, - "BETA": 3, - "GA": 4, - "DEPRECATED": 5 - } - }, - "fieldBehavior": { - "rule": "repeated", - "type": "google.api.FieldBehavior", - "id": 1052, - "extend": "google.protobuf.FieldOptions", - "options": { - "packed": false - } - }, - "FieldBehavior": { - "values": { - "FIELD_BEHAVIOR_UNSPECIFIED": 0, - "OPTIONAL": 1, - "REQUIRED": 2, - "OUTPUT_ONLY": 3, - "INPUT_ONLY": 4, - "IMMUTABLE": 5, - "UNORDERED_LIST": 6, - "NON_EMPTY_DEFAULT": 7, - "IDENTIFIER": 8 - } - }, - "resourceReference": { - "type": "google.api.ResourceReference", - "id": 1055, - "extend": "google.protobuf.FieldOptions" - }, - "resourceDefinition": { - "rule": "repeated", - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.FileOptions" - }, - "resource": { - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.MessageOptions" - }, - "ResourceDescriptor": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "pattern": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "nameField": { - "type": "string", - "id": 3 - }, - "history": { - "type": "History", - "id": 4 - }, - "plural": { - "type": "string", - "id": 5 - }, - "singular": { - "type": "string", - "id": 6 - }, - "style": { - "rule": "repeated", - "type": "Style", - "id": 10 - } - }, - "nested": { - "History": { - "values": { - "HISTORY_UNSPECIFIED": 0, - "ORIGINALLY_SINGLE_PATTERN": 1, - "FUTURE_MULTI_PATTERN": 2 - } - }, - "Style": { - "values": { - "STYLE_UNSPECIFIED": 0, - "DECLARATIVE_FRIENDLY": 1 - } - } - } - }, - "ResourceReference": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "childType": { - "type": "string", - "id": 2 - } - } - } - } - }, - "protobuf": { - "options": { - "go_package": "google.golang.org/protobuf/types/descriptorpb", - "java_package": "com.google.protobuf", - "java_outer_classname": "DescriptorProtos", - "csharp_namespace": "Google.Protobuf.Reflection", - "objc_class_prefix": "GPB", - "cc_enable_arenas": true, - "optimize_for": "SPEED" - }, - "nested": { - "FileDescriptorSet": { - "edition": "proto2", - "fields": { - "file": { - "rule": "repeated", - "type": "FileDescriptorProto", - "id": 1 - } - } - }, - "Edition": { - "edition": "proto2", - "values": { - "EDITION_UNKNOWN": 0, - "EDITION_PROTO2": 998, - "EDITION_PROTO3": 999, - "EDITION_2023": 1000, - "EDITION_2024": 1001, - "EDITION_1_TEST_ONLY": 1, - "EDITION_2_TEST_ONLY": 2, - "EDITION_99997_TEST_ONLY": 99997, - "EDITION_99998_TEST_ONLY": 99998, - "EDITION_99999_TEST_ONLY": 99999, - "EDITION_MAX": 2147483647 - } - }, - "FileDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "package": { - "type": "string", - "id": 2 - }, - "dependency": { - "rule": "repeated", - "type": "string", - "id": 3 - }, - "publicDependency": { - "rule": "repeated", - "type": "int32", - "id": 10 - }, - "weakDependency": { - "rule": "repeated", - "type": "int32", - "id": 11 - }, - "messageType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 4 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 5 - }, - "service": { - "rule": "repeated", - "type": "ServiceDescriptorProto", - "id": 6 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 7 - }, - "options": { - "type": "FileOptions", - "id": 8 - }, - "sourceCodeInfo": { - "type": "SourceCodeInfo", - "id": 9 - }, - "syntax": { - "type": "string", - "id": 12 - }, - "edition": { - "type": "Edition", - "id": 14 - } - } - }, - "DescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "field": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 2 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 6 - }, - "nestedType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 3 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 4 - }, - "extensionRange": { - "rule": "repeated", - "type": "ExtensionRange", - "id": 5 - }, - "oneofDecl": { - "rule": "repeated", - "type": "OneofDescriptorProto", - "id": 8 - }, - "options": { - "type": "MessageOptions", - "id": 7 - }, - "reservedRange": { - "rule": "repeated", - "type": "ReservedRange", - "id": 9 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 10 - } - }, - "nested": { - "ExtensionRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "ExtensionRangeOptions", - "id": 3 - } - } - }, - "ReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "ExtensionRangeOptions": { - "edition": "proto2", - "fields": { - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - }, - "declaration": { - "rule": "repeated", - "type": "Declaration", - "id": 2, - "options": { - "retention": "RETENTION_SOURCE" - } - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "verification": { - "type": "VerificationState", - "id": 3, - "options": { - "default": "UNVERIFIED", - "retention": "RETENTION_SOURCE" - } - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "nested": { - "Declaration": { - "fields": { - "number": { - "type": "int32", - "id": 1 - }, - "fullName": { - "type": "string", - "id": 2 - }, - "type": { - "type": "string", - "id": 3 - }, - "reserved": { - "type": "bool", - "id": 5 - }, - "repeated": { - "type": "bool", - "id": 6 - } - }, - "reserved": [ - [ - 4, - 4 - ] - ] - }, - "VerificationState": { - "values": { - "DECLARATION": 0, - "UNVERIFIED": 1 - } - } - } - }, - "FieldDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 3 - }, - "label": { - "type": "Label", - "id": 4 - }, - "type": { - "type": "Type", - "id": 5 - }, - "typeName": { - "type": "string", - "id": 6 - }, - "extendee": { - "type": "string", - "id": 2 - }, - "defaultValue": { - "type": "string", - "id": 7 - }, - "oneofIndex": { - "type": "int32", - "id": 9 - }, - "jsonName": { - "type": "string", - "id": 10 - }, - "options": { - "type": "FieldOptions", - "id": 8 - }, - "proto3Optional": { - "type": "bool", - "id": 17 - } - }, - "nested": { - "Type": { - "values": { - "TYPE_DOUBLE": 1, - "TYPE_FLOAT": 2, - "TYPE_INT64": 3, - "TYPE_UINT64": 4, - "TYPE_INT32": 5, - "TYPE_FIXED64": 6, - "TYPE_FIXED32": 7, - "TYPE_BOOL": 8, - "TYPE_STRING": 9, - "TYPE_GROUP": 10, - "TYPE_MESSAGE": 11, - "TYPE_BYTES": 12, - "TYPE_UINT32": 13, - "TYPE_ENUM": 14, - "TYPE_SFIXED32": 15, - "TYPE_SFIXED64": 16, - "TYPE_SINT32": 17, - "TYPE_SINT64": 18 - } - }, - "Label": { - "values": { - "LABEL_OPTIONAL": 1, - "LABEL_REPEATED": 3, - "LABEL_REQUIRED": 2 - } - } - } - }, - "OneofDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "options": { - "type": "OneofOptions", - "id": 2 - } - } - }, - "EnumDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "value": { - "rule": "repeated", - "type": "EnumValueDescriptorProto", - "id": 2 - }, - "options": { - "type": "EnumOptions", - "id": 3 - }, - "reservedRange": { - "rule": "repeated", - "type": "EnumReservedRange", - "id": 4 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 5 - } - }, - "nested": { - "EnumReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "EnumValueDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "EnumValueOptions", - "id": 3 - } - } - }, - "ServiceDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "method": { - "rule": "repeated", - "type": "MethodDescriptorProto", - "id": 2 - }, - "options": { - "type": "ServiceOptions", - "id": 3 - } - } - }, - "MethodDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "inputType": { - "type": "string", - "id": 2 - }, - "outputType": { - "type": "string", - "id": 3 - }, - "options": { - "type": "MethodOptions", - "id": 4 - }, - "clientStreaming": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "serverStreaming": { - "type": "bool", - "id": 6, - "options": { - "default": false - } - } - } - }, - "FileOptions": { - "edition": "proto2", - "fields": { - "javaPackage": { - "type": "string", - "id": 1 - }, - "javaOuterClassname": { - "type": "string", - "id": 8 - }, - "javaMultipleFiles": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "javaGenerateEqualsAndHash": { - "type": "bool", - "id": 20, - "options": { - "deprecated": true - } - }, - "javaStringCheckUtf8": { - "type": "bool", - "id": 27, - "options": { - "default": false - } - }, - "optimizeFor": { - "type": "OptimizeMode", - "id": 9, - "options": { - "default": "SPEED" - } - }, - "goPackage": { - "type": "string", - "id": 11 - }, - "ccGenericServices": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "javaGenericServices": { - "type": "bool", - "id": 17, - "options": { - "default": false - } - }, - "pyGenericServices": { - "type": "bool", - "id": 18, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 23, - "options": { - "default": false - } - }, - "ccEnableArenas": { - "type": "bool", - "id": 31, - "options": { - "default": true - } - }, - "objcClassPrefix": { - "type": "string", - "id": 36 - }, - "csharpNamespace": { - "type": "string", - "id": 37 - }, - "swiftPrefix": { - "type": "string", - "id": 39 - }, - "phpClassPrefix": { - "type": "string", - "id": 40 - }, - "phpNamespace": { - "type": "string", - "id": 41 - }, - "phpMetadataNamespace": { - "type": "string", - "id": 44 - }, - "rubyPackage": { - "type": "string", - "id": 45 - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 42, - 42 - ], - [ - 38, - 38 - ] - ], - "nested": { - "OptimizeMode": { - "values": { - "SPEED": 1, - "CODE_SIZE": 2, - "LITE_RUNTIME": 3 - } - } - } - }, - "MessageOptions": { - "edition": "proto2", - "fields": { - "messageSetWireFormat": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "noStandardDescriptorAccessor": { - "type": "bool", - "id": 2, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "mapEntry": { - "type": "bool", - "id": 7 - }, - "deprecatedLegacyJsonFieldConflicts": { - "type": "bool", - "id": 11, - "options": { - "deprecated": true - } - }, - "features": { - "type": "FeatureSet", - "id": 12 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 5, - 5 - ], - [ - 6, - 6 - ], - [ - 8, - 8 - ], - [ - 9, - 9 - ] - ] - }, - "FieldOptions": { - "edition": "proto2", - "fields": { - "ctype": { - "type": "CType", - "id": 1, - "options": { - "default": "STRING" - } - }, - "packed": { - "type": "bool", - "id": 2 - }, - "jstype": { - "type": "JSType", - "id": 6, - "options": { - "default": "JS_NORMAL" - } - }, - "lazy": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "unverifiedLazy": { - "type": "bool", - "id": 15, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "weak": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "debugRedact": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "retention": { - "type": "OptionRetention", - "id": 17 - }, - "targets": { - "rule": "repeated", - "type": "OptionTargetType", - "id": 19 - }, - "editionDefaults": { - "rule": "repeated", - "type": "EditionDefault", - "id": 20 - }, - "features": { - "type": "FeatureSet", - "id": 21 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 18, - 18 - ] - ], - "nested": { - "CType": { - "values": { - "STRING": 0, - "CORD": 1, - "STRING_PIECE": 2 - } - }, - "JSType": { - "values": { - "JS_NORMAL": 0, - "JS_STRING": 1, - "JS_NUMBER": 2 - } - }, - "OptionRetention": { - "values": { - "RETENTION_UNKNOWN": 0, - "RETENTION_RUNTIME": 1, - "RETENTION_SOURCE": 2 - } - }, - "OptionTargetType": { - "values": { - "TARGET_TYPE_UNKNOWN": 0, - "TARGET_TYPE_FILE": 1, - "TARGET_TYPE_EXTENSION_RANGE": 2, - "TARGET_TYPE_MESSAGE": 3, - "TARGET_TYPE_FIELD": 4, - "TARGET_TYPE_ONEOF": 5, - "TARGET_TYPE_ENUM": 6, - "TARGET_TYPE_ENUM_ENTRY": 7, - "TARGET_TYPE_SERVICE": 8, - "TARGET_TYPE_METHOD": 9 - } - }, - "EditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "value": { - "type": "string", - "id": 2 - } - } - } - } - }, - "OneofOptions": { - "edition": "proto2", - "fields": { - "features": { - "type": "FeatureSet", - "id": 1 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "EnumOptions": { - "edition": "proto2", - "fields": { - "allowAlias": { - "type": "bool", - "id": 2 - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "deprecatedLegacyJsonFieldConflicts": { - "type": "bool", - "id": 6, - "options": { - "deprecated": true - } - }, - "features": { - "type": "FeatureSet", - "id": 7 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 5, - 5 - ] - ] - }, - "EnumValueOptions": { - "edition": "proto2", - "fields": { - "deprecated": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "features": { - "type": "FeatureSet", - "id": 2 - }, - "debugRedact": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "ServiceOptions": { - "edition": "proto2", - "fields": { - "features": { - "type": "FeatureSet", - "id": 34 - }, - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "MethodOptions": { - "edition": "proto2", - "fields": { - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "idempotencyLevel": { - "type": "IdempotencyLevel", - "id": 34, - "options": { - "default": "IDEMPOTENCY_UNKNOWN" - } - }, - "features": { - "type": "FeatureSet", - "id": 35 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "nested": { - "IdempotencyLevel": { - "values": { - "IDEMPOTENCY_UNKNOWN": 0, - "NO_SIDE_EFFECTS": 1, - "IDEMPOTENT": 2 - } - } - } - }, - "UninterpretedOption": { - "edition": "proto2", - "fields": { - "name": { - "rule": "repeated", - "type": "NamePart", - "id": 2 - }, - "identifierValue": { - "type": "string", - "id": 3 - }, - "positiveIntValue": { - "type": "uint64", - "id": 4 - }, - "negativeIntValue": { - "type": "int64", - "id": 5 - }, - "doubleValue": { - "type": "double", - "id": 6 - }, - "stringValue": { - "type": "bytes", - "id": 7 - }, - "aggregateValue": { - "type": "string", - "id": 8 - } - }, - "nested": { - "NamePart": { - "fields": { - "namePart": { - "rule": "required", - "type": "string", - "id": 1 - }, - "isExtension": { - "rule": "required", - "type": "bool", - "id": 2 - } - } - } - } - }, - "FeatureSet": { - "edition": "proto2", - "fields": { - "fieldPresence": { - "type": "FieldPresence", - "id": 1, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_2023", - "edition_defaults.value": "EXPLICIT" - } - }, - "enumType": { - "type": "EnumType", - "id": 2, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "OPEN" - } - }, - "repeatedFieldEncoding": { - "type": "RepeatedFieldEncoding", - "id": 3, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "PACKED" - } - }, - "utf8Validation": { - "type": "Utf8Validation", - "id": 4, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "VERIFY" - } - }, - "messageEncoding": { - "type": "MessageEncoding", - "id": 5, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO2", - "edition_defaults.value": "LENGTH_PREFIXED" - } - }, - "jsonFormat": { - "type": "JsonFormat", - "id": 6, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "ALLOW" - } - } - }, - "extensions": [ - [ - 1000, - 1000 - ], - [ - 1001, - 1001 - ], - [ - 1002, - 1002 - ], - [ - 9990, - 9990 - ], - [ - 9995, - 9999 - ], - [ - 10000, - 10000 - ] - ], - "reserved": [ - [ - 999, - 999 - ] - ], - "nested": { - "FieldPresence": { - "values": { - "FIELD_PRESENCE_UNKNOWN": 0, - "EXPLICIT": 1, - "IMPLICIT": 2, - "LEGACY_REQUIRED": 3 - } - }, - "EnumType": { - "values": { - "ENUM_TYPE_UNKNOWN": 0, - "OPEN": 1, - "CLOSED": 2 - } - }, - "RepeatedFieldEncoding": { - "values": { - "REPEATED_FIELD_ENCODING_UNKNOWN": 0, - "PACKED": 1, - "EXPANDED": 2 - } - }, - "Utf8Validation": { - "values": { - "UTF8_VALIDATION_UNKNOWN": 0, - "VERIFY": 2, - "NONE": 3 - } - }, - "MessageEncoding": { - "values": { - "MESSAGE_ENCODING_UNKNOWN": 0, - "LENGTH_PREFIXED": 1, - "DELIMITED": 2 - } - }, - "JsonFormat": { - "values": { - "JSON_FORMAT_UNKNOWN": 0, - "ALLOW": 1, - "LEGACY_BEST_EFFORT": 2 - } - } - } - }, - "FeatureSetDefaults": { - "edition": "proto2", - "fields": { - "defaults": { - "rule": "repeated", - "type": "FeatureSetEditionDefault", - "id": 1 - }, - "minimumEdition": { - "type": "Edition", - "id": 4 - }, - "maximumEdition": { - "type": "Edition", - "id": 5 - } - }, - "nested": { - "FeatureSetEditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "features": { - "type": "FeatureSet", - "id": 2 - } - } - } - } - }, - "SourceCodeInfo": { - "edition": "proto2", - "fields": { - "location": { - "rule": "repeated", - "type": "Location", - "id": 1 - } - }, - "nested": { - "Location": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1, - "options": { - "packed": true - } - }, - "span": { - "rule": "repeated", - "type": "int32", - "id": 2, - "options": { - "packed": true - } - }, - "leadingComments": { - "type": "string", - "id": 3 - }, - "trailingComments": { - "type": "string", - "id": 4 - }, - "leadingDetachedComments": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - } - } - }, - "GeneratedCodeInfo": { - "edition": "proto2", - "fields": { - "annotation": { - "rule": "repeated", - "type": "Annotation", - "id": 1 - } - }, - "nested": { - "Annotation": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1, - "options": { - "packed": true - } - }, - "sourceFile": { - "type": "string", - "id": 2 - }, - "begin": { - "type": "int32", - "id": 3 - }, - "end": { - "type": "int32", - "id": 4 - }, - "semantic": { - "type": "Semantic", - "id": 5 - } - }, - "nested": { - "Semantic": { - "values": { - "NONE": 0, - "SET": 1, - "ALIAS": 2 - } - } - } - } - } - }, - "Duration": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Empty": { - "fields": {} - }, - "Timestamp": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Any": { - "fields": { - "type_url": { - "type": "string", - "id": 1 - }, - "value": { - "type": "bytes", - "id": 2 - } - } - }, - "FieldMask": { - "fields": { - "paths": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "DoubleValue": { - "fields": { - "value": { - "type": "double", - "id": 1 - } - } - }, - "FloatValue": { - "fields": { - "value": { - "type": "float", - "id": 1 - } - } - }, - "Int64Value": { - "fields": { - "value": { - "type": "int64", - "id": 1 - } - } - }, - "UInt64Value": { - "fields": { - "value": { - "type": "uint64", - "id": 1 - } - } - }, - "Int32Value": { - "fields": { - "value": { - "type": "int32", - "id": 1 - } - } - }, - "UInt32Value": { - "fields": { - "value": { - "type": "uint32", - "id": 1 - } - } - }, - "BoolValue": { - "fields": { - "value": { - "type": "bool", - "id": 1 - } - } - }, - "StringValue": { - "fields": { - "value": { - "type": "string", - "id": 1 - } - } - }, - "BytesValue": { - "fields": { - "value": { - "type": "bytes", - "id": 1 - } - } - } - } - }, - "longrunning": { - "options": { - "cc_enable_arenas": true, - "csharp_namespace": "Google.LongRunning", - "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", - "java_multiple_files": true, - "java_outer_classname": "OperationsProto", - "java_package": "com.google.longrunning", - "php_namespace": "Google\\LongRunning" - }, - "nested": { - "operationInfo": { - "type": "google.longrunning.OperationInfo", - "id": 1049, - "extend": "google.protobuf.MethodOptions" - }, - "Operations": { - "options": { - "(google.api.default_host)": "longrunning.googleapis.com" - }, - "methods": { - "ListOperations": { - "requestType": "ListOperationsRequest", - "responseType": "ListOperationsResponse", - "options": { - "(google.api.http).get": "/v1/{name=operations}", - "(google.api.method_signature)": "name,filter" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=operations}" - } - }, - { - "(google.api.method_signature)": "name,filter" - } - ] - }, - "GetOperation": { - "requestType": "GetOperationRequest", - "responseType": "Operation", - "options": { - "(google.api.http).get": "/v1/{name=operations/**}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=operations/**}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "DeleteOperation": { - "requestType": "DeleteOperationRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=operations/**}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=operations/**}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CancelOperation": { - "requestType": "CancelOperationRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).post": "/v1/{name=operations/**}:cancel", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=operations/**}:cancel", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "WaitOperation": { - "requestType": "WaitOperationRequest", - "responseType": "Operation" - } - } - }, - "Operation": { - "oneofs": { - "result": { - "oneof": [ - "error", - "response" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "metadata": { - "type": "google.protobuf.Any", - "id": 2 - }, - "done": { - "type": "bool", - "id": 3 - }, - "error": { - "type": "google.rpc.Status", - "id": 4 - }, - "response": { - "type": "google.protobuf.Any", - "id": 5 - } - } - }, - "GetOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "ListOperationsRequest": { - "fields": { - "name": { - "type": "string", - "id": 4 - }, - "filter": { - "type": "string", - "id": 1 - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListOperationsResponse": { - "fields": { - "operations": { - "rule": "repeated", - "type": "Operation", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "CancelOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "DeleteOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "WaitOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "timeout": { - "type": "google.protobuf.Duration", - "id": 2 - } - } - }, - "OperationInfo": { - "fields": { - "responseType": { - "type": "string", - "id": 1 - }, - "metadataType": { - "type": "string", - "id": 2 - } - } - } - } - }, - "rpc": { - "options": { - "cc_enable_arenas": true, - "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", - "java_multiple_files": true, - "java_outer_classname": "StatusProto", - "java_package": "com.google.rpc", - "objc_class_prefix": "RPC" - }, - "nested": { - "Status": { - "fields": { - "code": { - "type": "int32", - "id": 1 - }, - "message": { - "type": "string", - "id": 2 - }, - "details": { - "rule": "repeated", - "type": "google.protobuf.Any", - "id": 3 - } - } - } - } - }, - "type": { - "options": { - "cc_enable_arenas": true, - "go_package": "google.golang.org/genproto/googleapis/type/interval;interval", - "java_multiple_files": true, - "java_outer_classname": "IntervalProto", - "java_package": "com.google.type", - "objc_class_prefix": "GTP" - }, - "nested": { - "Interval": { - "fields": { - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - } - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.create_autoscaling_policy.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.create_autoscaling_policy.js deleted file mode 100644 index 3a69b6b6f135..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.create_autoscaling_policy.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(parent, policy) { - // [START dataproc_v1_generated_AutoscalingPolicyService_CreateAutoscalingPolicy_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 name" of the region or location, as described - * in https://cloud.google.com/apis/design/resource_names. - * * For `projects.regions.autoscalingPolicies.create`, the resource name - * of the region has the following format: - * `projects/{project_id}/regions/{region}` - * * For `projects.locations.autoscalingPolicies.create`, the resource name - * of the location has the following format: - * `projects/{project_id}/locations/{location}` - */ - // const parent = 'abc123' - /** - * Required. The autoscaling policy to create. - */ - // const policy = {} - - // Imports the Dataproc library - const {AutoscalingPolicyServiceClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new AutoscalingPolicyServiceClient(); - - async function callCreateAutoscalingPolicy() { - // Construct request - const request = { - parent, - policy, - }; - - // Run request - const response = await dataprocClient.createAutoscalingPolicy(request); - console.log(response); - } - - callCreateAutoscalingPolicy(); - // [END dataproc_v1_generated_AutoscalingPolicyService_CreateAutoscalingPolicy_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-dataproc/samples/generated/v1/autoscaling_policy_service.delete_autoscaling_policy.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.delete_autoscaling_policy.js deleted file mode 100644 index bee4980d59ad..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.delete_autoscaling_policy.js +++ /dev/null @@ -1,68 +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 dataproc_v1_generated_AutoscalingPolicyService_DeleteAutoscalingPolicy_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 name" of the autoscaling policy, as described - * in https://cloud.google.com/apis/design/resource_names. - * * For `projects.regions.autoscalingPolicies.delete`, the resource name - * of the policy has the following format: - * `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` - * * For `projects.locations.autoscalingPolicies.delete`, the resource name - * of the policy has the following format: - * `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` - */ - // const name = 'abc123' - - // Imports the Dataproc library - const {AutoscalingPolicyServiceClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new AutoscalingPolicyServiceClient(); - - async function callDeleteAutoscalingPolicy() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataprocClient.deleteAutoscalingPolicy(request); - console.log(response); - } - - callDeleteAutoscalingPolicy(); - // [END dataproc_v1_generated_AutoscalingPolicyService_DeleteAutoscalingPolicy_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-dataproc/samples/generated/v1/autoscaling_policy_service.get_autoscaling_policy.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.get_autoscaling_policy.js deleted file mode 100644 index 97c0661a0f3a..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.get_autoscaling_policy.js +++ /dev/null @@ -1,68 +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 dataproc_v1_generated_AutoscalingPolicyService_GetAutoscalingPolicy_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 name" of the autoscaling policy, as described - * in https://cloud.google.com/apis/design/resource_names. - * * For `projects.regions.autoscalingPolicies.get`, the resource name - * of the policy has the following format: - * `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` - * * For `projects.locations.autoscalingPolicies.get`, the resource name - * of the policy has the following format: - * `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` - */ - // const name = 'abc123' - - // Imports the Dataproc library - const {AutoscalingPolicyServiceClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new AutoscalingPolicyServiceClient(); - - async function callGetAutoscalingPolicy() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataprocClient.getAutoscalingPolicy(request); - console.log(response); - } - - callGetAutoscalingPolicy(); - // [END dataproc_v1_generated_AutoscalingPolicyService_GetAutoscalingPolicy_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-dataproc/samples/generated/v1/autoscaling_policy_service.list_autoscaling_policies.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.list_autoscaling_policies.js deleted file mode 100644 index fc5376e36647..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.list_autoscaling_policies.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) { - // [START dataproc_v1_generated_AutoscalingPolicyService_ListAutoscalingPolicies_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 name" of the region or location, as described - * in https://cloud.google.com/apis/design/resource_names. - * * For `projects.regions.autoscalingPolicies.list`, the resource name - * of the region has the following format: - * `projects/{project_id}/regions/{region}` - * * For `projects.locations.autoscalingPolicies.list`, the resource name - * of the location has the following format: - * `projects/{project_id}/locations/{location}` - */ - // const parent = 'abc123' - /** - * Optional. The maximum number of results to return in each response. - * Must be less than or equal to 1000. Defaults to 100. - */ - // const pageSize = 1234 - /** - * Optional. The page token, returned by a previous call, to request the - * next page of results. - */ - // const pageToken = 'abc123' - - // Imports the Dataproc library - const {AutoscalingPolicyServiceClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new AutoscalingPolicyServiceClient(); - - async function callListAutoscalingPolicies() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = dataprocClient.listAutoscalingPoliciesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListAutoscalingPolicies(); - // [END dataproc_v1_generated_AutoscalingPolicyService_ListAutoscalingPolicies_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-dataproc/samples/generated/v1/autoscaling_policy_service.update_autoscaling_policy.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.update_autoscaling_policy.js deleted file mode 100644 index f5428f475eb4..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/autoscaling_policy_service.update_autoscaling_policy.js +++ /dev/null @@ -1,61 +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(policy) { - // [START dataproc_v1_generated_AutoscalingPolicyService_UpdateAutoscalingPolicy_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 updated autoscaling policy. - */ - // const policy = {} - - // Imports the Dataproc library - const {AutoscalingPolicyServiceClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new AutoscalingPolicyServiceClient(); - - async function callUpdateAutoscalingPolicy() { - // Construct request - const request = { - policy, - }; - - // Run request - const response = await dataprocClient.updateAutoscalingPolicy(request); - console.log(response); - } - - callUpdateAutoscalingPolicy(); - // [END dataproc_v1_generated_AutoscalingPolicyService_UpdateAutoscalingPolicy_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-dataproc/samples/generated/v1/batch_controller.create_batch.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/batch_controller.create_batch.js deleted file mode 100644 index ffc3ad761b69..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/batch_controller.create_batch.js +++ /dev/null @@ -1,86 +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, batch) { - // [START dataproc_v1_generated_BatchController_CreateBatch_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent resource where this batch will be created. - */ - // const parent = 'abc123' - /** - * Required. The batch to create. - */ - // const batch = {} - /** - * Optional. The ID to use for the batch, which will become the final - * component of the batch's resource name. - * This value must be 4-63 characters. Valid characters are `/[a-z][0-9]-/`. - */ - // const batchId = 'abc123' - /** - * Optional. A unique ID used to identify the request. If the service - * receives two - * CreateBatchRequest (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateBatchRequest)s - * with the same request_id, the second request is ignored and the - * Operation that corresponds to the first Batch created and stored - * in the backend is returned. - * Recommendation: Set this value to a - * UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier). - * The value must contain only letters (a-z, A-Z), numbers (0-9), - * underscores (_), and hyphens (-). The maximum length is 40 characters. - */ - // const requestId = 'abc123' - - // Imports the Dataproc library - const {BatchControllerClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new BatchControllerClient(); - - async function callCreateBatch() { - // Construct request - const request = { - parent, - batch, - }; - - // Run request - const [operation] = await dataprocClient.createBatch(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateBatch(); - // [END dataproc_v1_generated_BatchController_CreateBatch_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-dataproc/samples/generated/v1/batch_controller.delete_batch.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/batch_controller.delete_batch.js deleted file mode 100644 index e86207ee29f6..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/batch_controller.delete_batch.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 dataproc_v1_generated_BatchController_DeleteBatch_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 fully qualified name of the batch to retrieve - * in the format - * "projects/PROJECT_ID/locations/DATAPROC_REGION/batches/BATCH_ID" - */ - // const name = 'abc123' - - // Imports the Dataproc library - const {BatchControllerClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new BatchControllerClient(); - - async function callDeleteBatch() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataprocClient.deleteBatch(request); - console.log(response); - } - - callDeleteBatch(); - // [END dataproc_v1_generated_BatchController_DeleteBatch_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-dataproc/samples/generated/v1/batch_controller.get_batch.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/batch_controller.get_batch.js deleted file mode 100644 index 9c1153d6e9a1..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/batch_controller.get_batch.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 dataproc_v1_generated_BatchController_GetBatch_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 fully qualified name of the batch to retrieve - * in the format - * "projects/PROJECT_ID/locations/DATAPROC_REGION/batches/BATCH_ID" - */ - // const name = 'abc123' - - // Imports the Dataproc library - const {BatchControllerClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new BatchControllerClient(); - - async function callGetBatch() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataprocClient.getBatch(request); - console.log(response); - } - - callGetBatch(); - // [END dataproc_v1_generated_BatchController_GetBatch_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-dataproc/samples/generated/v1/batch_controller.list_batches.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/batch_controller.list_batches.js deleted file mode 100644 index 082aeb5005df..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/batch_controller.list_batches.js +++ /dev/null @@ -1,93 +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 dataproc_v1_generated_BatchController_ListBatches_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent, which owns this collection of batches. - */ - // const parent = 'abc123' - /** - * Optional. The maximum number of batches to return in each response. - * The service may return fewer than this value. - * The default page size is 20; the maximum page size is 1000. - */ - // const pageSize = 1234 - /** - * Optional. A page token received from a previous `ListBatches` call. - * Provide this token to retrieve the subsequent page. - */ - // const pageToken = 'abc123' - /** - * Optional. A filter for the batches to return in the response. - * A filter is a logical expression constraining the values of various fields - * in each batch resource. Filters are case sensitive, and may contain - * multiple clauses combined with logical operators (AND/OR). - * Supported fields are `batch_id`, `batch_uuid`, `state`, and `create_time`. - * e.g. `state = RUNNING and create_time < "2023-01-01T00:00:00Z"` - * filters for batches in state RUNNING that were created before 2023-01-01 - * See https://google.aip.dev/assets/misc/ebnf-filtering.txt for a detailed - * description of the filter syntax and a list of supported comparisons. - */ - // const filter = 'abc123' - /** - * Optional. Field(s) on which to sort the list of batches. - * Currently the only supported sort orders are unspecified (empty) and - * `create_time desc` to sort by most recently created batches first. - * See https://google.aip.dev/132#ordering for more details. - */ - // const orderBy = 'abc123' - - // Imports the Dataproc library - const {BatchControllerClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new BatchControllerClient(); - - async function callListBatches() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = dataprocClient.listBatchesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListBatches(); - // [END dataproc_v1_generated_BatchController_ListBatches_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-dataproc/samples/generated/v1/cluster_controller.create_cluster.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.create_cluster.js deleted file mode 100644 index c21b7266325e..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.create_cluster.js +++ /dev/null @@ -1,90 +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(projectId, region, cluster) { - // [START dataproc_v1_generated_ClusterController_CreateCluster_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 ID of the Google Cloud Platform project that the cluster - * belongs to. - */ - // const projectId = 'abc123' - /** - * Required. The Dataproc region in which to handle the request. - */ - // const region = 'us-central1' - /** - * Required. The cluster to create. - */ - // const cluster = {} - /** - * Optional. A unique ID used to identify the request. If the server receives - * two - * CreateClusterRequest (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateClusterRequest)s - * with the same id, then the second request will be ignored and the - * first google.longrunning.Operation google.longrunning.Operation created - * and stored in the backend is returned. - * It is recommended to always set this value to a - * UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier). - * The ID must contain only letters (a-z, A-Z), numbers (0-9), - * underscores (_), and hyphens (-). The maximum length is 40 characters. - */ - // const requestId = 'abc123' - /** - * Optional. Failure action when primary worker creation fails. - */ - // const actionOnFailedPrimaryWorkers = {} - - // Imports the Dataproc library - const {ClusterControllerClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new ClusterControllerClient(); - - async function callCreateCluster() { - // Construct request - const request = { - projectId, - region, - cluster, - }; - - // Run request - const [operation] = await dataprocClient.createCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateCluster(); - // [END dataproc_v1_generated_ClusterController_CreateCluster_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-dataproc/samples/generated/v1/cluster_controller.delete_cluster.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.delete_cluster.js deleted file mode 100644 index fdbb751717ee..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.delete_cluster.js +++ /dev/null @@ -1,91 +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(projectId, region, clusterName) { - // [START dataproc_v1_generated_ClusterController_DeleteCluster_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 ID of the Google Cloud Platform project that the cluster - * belongs to. - */ - // const projectId = 'abc123' - /** - * Required. The Dataproc region in which to handle the request. - */ - // const region = 'us-central1' - /** - * Required. The cluster name. - */ - // const clusterName = 'abc123' - /** - * Optional. Specifying the `cluster_uuid` means the RPC should fail - * (with error NOT_FOUND) if cluster with specified UUID does not exist. - */ - // const clusterUuid = 'abc123' - /** - * Optional. A unique ID used to identify the request. If the server - * receives two - * DeleteClusterRequest (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteClusterRequest)s - * with the same id, then the second request will be ignored and the - * first google.longrunning.Operation google.longrunning.Operation created - * and stored in the backend is returned. - * It is recommended to always set this value to a - * UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier). - * The ID must contain only letters (a-z, A-Z), numbers (0-9), - * underscores (_), and hyphens (-). The maximum length is 40 characters. - */ - // const requestId = 'abc123' - - // Imports the Dataproc library - const {ClusterControllerClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new ClusterControllerClient(); - - async function callDeleteCluster() { - // Construct request - const request = { - projectId, - region, - clusterName, - }; - - // Run request - const [operation] = await dataprocClient.deleteCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteCluster(); - // [END dataproc_v1_generated_ClusterController_DeleteCluster_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-dataproc/samples/generated/v1/cluster_controller.diagnose_cluster.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.diagnose_cluster.js deleted file mode 100644 index 819d22652184..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.diagnose_cluster.js +++ /dev/null @@ -1,99 +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(projectId, region, clusterName) { - // [START dataproc_v1_generated_ClusterController_DiagnoseCluster_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 ID of the Google Cloud Platform project that the cluster - * belongs to. - */ - // const projectId = 'abc123' - /** - * Required. The Dataproc region in which to handle the request. - */ - // const region = 'us-central1' - /** - * Required. The cluster name. - */ - // const clusterName = 'abc123' - /** - * Optional. (Optional) The output Cloud Storage directory for the diagnostic - * tarball. If not specified, a task-specific directory in the cluster's - * staging bucket will be used. - */ - // const tarballGcsDir = 'abc123' - /** - * Optional. (Optional) The access type to the diagnostic tarball. If not - * specified, falls back to default access of the bucket - */ - // const tarballAccess = {} - /** - * Optional. Time interval in which diagnosis should be carried out on the - * cluster. - */ - // const diagnosisInterval = {} - /** - * Optional. Specifies a list of jobs on which diagnosis is to be performed. - * Format: projects/{project}/regions/{region}/jobs/{job} - */ - // const jobs = ['abc','def'] - /** - * Optional. Specifies a list of yarn applications on which diagnosis is to be - * performed. - */ - // const yarnApplicationIds = ['abc','def'] - - // Imports the Dataproc library - const {ClusterControllerClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new ClusterControllerClient(); - - async function callDiagnoseCluster() { - // Construct request - const request = { - projectId, - region, - clusterName, - }; - - // Run request - const [operation] = await dataprocClient.diagnoseCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDiagnoseCluster(); - // [END dataproc_v1_generated_ClusterController_DiagnoseCluster_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-dataproc/samples/generated/v1/cluster_controller.get_cluster.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.get_cluster.js deleted file mode 100644 index 4c362577eb27..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.get_cluster.js +++ /dev/null @@ -1,72 +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(projectId, region, clusterName) { - // [START dataproc_v1_generated_ClusterController_GetCluster_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 ID of the Google Cloud Platform project that the cluster - * belongs to. - */ - // const projectId = 'abc123' - /** - * Required. The Dataproc region in which to handle the request. - */ - // const region = 'us-central1' - /** - * Required. The cluster name. - */ - // const clusterName = 'abc123' - - // Imports the Dataproc library - const {ClusterControllerClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new ClusterControllerClient(); - - async function callGetCluster() { - // Construct request - const request = { - projectId, - region, - clusterName, - }; - - // Run request - const response = await dataprocClient.getCluster(request); - console.log(response); - } - - callGetCluster(); - // [END dataproc_v1_generated_ClusterController_GetCluster_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-dataproc/samples/generated/v1/cluster_controller.list_clusters.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.list_clusters.js deleted file mode 100644 index 25dc003b89fc..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.list_clusters.js +++ /dev/null @@ -1,95 +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(projectId, region) { - // [START dataproc_v1_generated_ClusterController_ListClusters_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 ID of the Google Cloud Platform project that the cluster - * belongs to. - */ - // const projectId = 'abc123' - /** - * Required. The Dataproc region in which to handle the request. - */ - // const region = 'us-central1' - /** - * Optional. A filter constraining the clusters to list. Filters are - * case-sensitive and have the following syntax: - * field = value AND field = value ... - * where **field** is one of `status.state`, `clusterName`, or `labels.KEY`, - * and `[KEY]` is a label key. **value** can be `*` to match all values. - * `status.state` can be one of the following: `ACTIVE`, `INACTIVE`, - * `CREATING`, `RUNNING`, `ERROR`, `DELETING`, `UPDATING`, `STOPPING`, or - * `STOPPED`. `ACTIVE` contains the `CREATING`, `UPDATING`, and `RUNNING` - * states. `INACTIVE` contains the `DELETING`, `ERROR`, `STOPPING`, and - * `STOPPED` states. `clusterName` is the name of the cluster provided at - * creation time. Only the logical `AND` operator is supported; - * space-separated items are treated as having an implicit `AND` operator. - * Example filter: - * status.state = ACTIVE AND clusterName = mycluster - * AND labels.env = staging AND labels.starred = * - */ - // const filter = 'abc123' - /** - * Optional. The standard List page size. - */ - // const pageSize = 1234 - /** - * Optional. The standard List page token. - */ - // const pageToken = 'abc123' - - // Imports the Dataproc library - const {ClusterControllerClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new ClusterControllerClient(); - - async function callListClusters() { - // Construct request - const request = { - projectId, - region, - }; - - // Run request - const iterable = dataprocClient.listClustersAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListClusters(); - // [END dataproc_v1_generated_ClusterController_ListClusters_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-dataproc/samples/generated/v1/cluster_controller.start_cluster.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.start_cluster.js deleted file mode 100644 index 22b3429f3604..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.start_cluster.js +++ /dev/null @@ -1,91 +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(projectId, region, clusterName) { - // [START dataproc_v1_generated_ClusterController_StartCluster_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 ID of the Google Cloud Platform project the - * cluster belongs to. - */ - // const projectId = 'abc123' - /** - * Required. The Dataproc region in which to handle the request. - */ - // const region = 'us-central1' - /** - * Required. The cluster name. - */ - // const clusterName = 'abc123' - /** - * Optional. Specifying the `cluster_uuid` means the RPC will fail - * (with error NOT_FOUND) if a cluster with the specified UUID does not exist. - */ - // const clusterUuid = 'abc123' - /** - * Optional. A unique ID used to identify the request. If the server - * receives two - * StartClusterRequest (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StartClusterRequest)s - * with the same id, then the second request will be ignored and the - * first google.longrunning.Operation google.longrunning.Operation created - * and stored in the backend is returned. - * Recommendation: Set this value to a - * UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier). - * The ID must contain only letters (a-z, A-Z), numbers (0-9), - * underscores (_), and hyphens (-). The maximum length is 40 characters. - */ - // const requestId = 'abc123' - - // Imports the Dataproc library - const {ClusterControllerClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new ClusterControllerClient(); - - async function callStartCluster() { - // Construct request - const request = { - projectId, - region, - clusterName, - }; - - // Run request - const [operation] = await dataprocClient.startCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callStartCluster(); - // [END dataproc_v1_generated_ClusterController_StartCluster_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-dataproc/samples/generated/v1/cluster_controller.stop_cluster.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.stop_cluster.js deleted file mode 100644 index 09423acbc08f..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.stop_cluster.js +++ /dev/null @@ -1,91 +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(projectId, region, clusterName) { - // [START dataproc_v1_generated_ClusterController_StopCluster_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 ID of the Google Cloud Platform project the - * cluster belongs to. - */ - // const projectId = 'abc123' - /** - * Required. The Dataproc region in which to handle the request. - */ - // const region = 'us-central1' - /** - * Required. The cluster name. - */ - // const clusterName = 'abc123' - /** - * Optional. Specifying the `cluster_uuid` means the RPC will fail - * (with error NOT_FOUND) if a cluster with the specified UUID does not exist. - */ - // const clusterUuid = 'abc123' - /** - * Optional. A unique ID used to identify the request. If the server - * receives two - * StopClusterRequest (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StopClusterRequest)s - * with the same id, then the second request will be ignored and the - * first google.longrunning.Operation google.longrunning.Operation created - * and stored in the backend is returned. - * Recommendation: Set this value to a - * UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier). - * The ID must contain only letters (a-z, A-Z), numbers (0-9), - * underscores (_), and hyphens (-). The maximum length is 40 characters. - */ - // const requestId = 'abc123' - - // Imports the Dataproc library - const {ClusterControllerClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new ClusterControllerClient(); - - async function callStopCluster() { - // Construct request - const request = { - projectId, - region, - clusterName, - }; - - // Run request - const [operation] = await dataprocClient.stopCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callStopCluster(); - // [END dataproc_v1_generated_ClusterController_StopCluster_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-dataproc/samples/generated/v1/cluster_controller.update_cluster.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.update_cluster.js deleted file mode 100644 index 929840553e32..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/cluster_controller.update_cluster.js +++ /dev/null @@ -1,154 +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(projectId, region, clusterName, cluster, updateMask) { - // [START dataproc_v1_generated_ClusterController_UpdateCluster_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 ID of the Google Cloud Platform project the - * cluster belongs to. - */ - // const projectId = 'abc123' - /** - * Required. The Dataproc region in which to handle the request. - */ - // const region = 'us-central1' - /** - * Required. The cluster name. - */ - // const clusterName = 'abc123' - /** - * Required. The changes to the cluster. - */ - // const cluster = {} - /** - * Optional. Timeout for graceful YARN decommissioning. Graceful - * decommissioning allows removing nodes from the cluster without - * interrupting jobs in progress. Timeout specifies how long to wait for jobs - * in progress to finish before forcefully removing nodes (and potentially - * interrupting jobs). Default timeout is 0 (for forceful decommission), and - * the maximum allowed timeout is 1 day. (see JSON representation of - * Duration (https://developers.google.com/protocol-buffers/docs/proto3#json)). - * Only supported on Dataproc image versions 1.2 and higher. - */ - // const gracefulDecommissionTimeout = {} - /** - * Required. Specifies the path, relative to `Cluster`, of - * the field to update. For example, to change the number of workers - * in a cluster to 5, the `update_mask` parameter would be - * specified as `config.worker_config.num_instances`, - * and the `PATCH` request body would specify the new value, as follows: - * { - * "config":{ - * "workerConfig":{ - * "numInstances":"5" - * } - * } - * } - * Similarly, to change the number of preemptible workers in a cluster to 5, - * the `update_mask` parameter would be - * `config.secondary_worker_config.num_instances`, and the `PATCH` request - * body would be set as follows: - * { - * "config":{ - * "secondaryWorkerConfig":{ - * "numInstances":"5" - * } - * } - * } - * Note: Currently, only the following fields can be updated: - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
MaskPurpose
labelsUpdate labels
config.worker_config.num_instancesResize primary worker group
config.secondary_worker_config.num_instancesResize secondary worker group
config.autoscaling_config.policy_uriUse, stop using, or - * change autoscaling policies
- */ - // const updateMask = {} - /** - * Optional. A unique ID used to identify the request. If the server - * receives two - * UpdateClusterRequest (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.UpdateClusterRequest)s - * with the same id, then the second request will be ignored and the - * first google.longrunning.Operation google.longrunning.Operation created - * and stored in the backend is returned. - * It is recommended to always set this value to a - * UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier). - * The ID must contain only letters (a-z, A-Z), numbers (0-9), - * underscores (_), and hyphens (-). The maximum length is 40 characters. - */ - // const requestId = 'abc123' - - // Imports the Dataproc library - const {ClusterControllerClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new ClusterControllerClient(); - - async function callUpdateCluster() { - // Construct request - const request = { - projectId, - region, - clusterName, - cluster, - updateMask, - }; - - // Run request - const [operation] = await dataprocClient.updateCluster(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateCluster(); - // [END dataproc_v1_generated_ClusterController_UpdateCluster_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-dataproc/samples/generated/v1/job_controller.cancel_job.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.cancel_job.js deleted file mode 100644 index 61b6c15af96d..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.cancel_job.js +++ /dev/null @@ -1,72 +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(projectId, region, jobId) { - // [START dataproc_v1_generated_JobController_CancelJob_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The ID of the Google Cloud Platform project that the job - * belongs to. - */ - // const projectId = 'abc123' - /** - * Required. The Dataproc region in which to handle the request. - */ - // const region = 'us-central1' - /** - * Required. The job ID. - */ - // const jobId = 'abc123' - - // Imports the Dataproc library - const {JobControllerClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new JobControllerClient(); - - async function callCancelJob() { - // Construct request - const request = { - projectId, - region, - jobId, - }; - - // Run request - const response = await dataprocClient.cancelJob(request); - console.log(response); - } - - callCancelJob(); - // [END dataproc_v1_generated_JobController_CancelJob_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.delete_job.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.delete_job.js deleted file mode 100644 index 0958dd95e4cd..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.delete_job.js +++ /dev/null @@ -1,72 +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(projectId, region, jobId) { - // [START dataproc_v1_generated_JobController_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 ID of the Google Cloud Platform project that the job - * belongs to. - */ - // const projectId = 'abc123' - /** - * Required. The Dataproc region in which to handle the request. - */ - // const region = 'us-central1' - /** - * Required. The job ID. - */ - // const jobId = 'abc123' - - // Imports the Dataproc library - const {JobControllerClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new JobControllerClient(); - - async function callDeleteJob() { - // Construct request - const request = { - projectId, - region, - jobId, - }; - - // Run request - const response = await dataprocClient.deleteJob(request); - console.log(response); - } - - callDeleteJob(); - // [END dataproc_v1_generated_JobController_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-dataproc/samples/generated/v1/job_controller.get_job.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.get_job.js deleted file mode 100644 index 68d65573fcc8..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.get_job.js +++ /dev/null @@ -1,72 +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(projectId, region, jobId) { - // [START dataproc_v1_generated_JobController_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 ID of the Google Cloud Platform project that the job - * belongs to. - */ - // const projectId = 'abc123' - /** - * Required. The Dataproc region in which to handle the request. - */ - // const region = 'us-central1' - /** - * Required. The job ID. - */ - // const jobId = 'abc123' - - // Imports the Dataproc library - const {JobControllerClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new JobControllerClient(); - - async function callGetJob() { - // Construct request - const request = { - projectId, - region, - jobId, - }; - - // Run request - const response = await dataprocClient.getJob(request); - console.log(response); - } - - callGetJob(); - // [END dataproc_v1_generated_JobController_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-dataproc/samples/generated/v1/job_controller.list_jobs.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.list_jobs.js deleted file mode 100644 index c30212bd4cfc..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.list_jobs.js +++ /dev/null @@ -1,102 +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(projectId, region) { - // [START dataproc_v1_generated_JobController_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 ID of the Google Cloud Platform project that the job - * belongs to. - */ - // const projectId = 'abc123' - /** - * Required. The Dataproc region in which to handle the request. - */ - // const region = 'us-central1' - /** - * Optional. The number of results to return in each response. - */ - // const pageSize = 1234 - /** - * Optional. The page token, returned by a previous call, to request the - * next page of results. - */ - // const pageToken = 'abc123' - /** - * Optional. If set, the returned jobs list includes only jobs that were - * submitted to the named cluster. - */ - // const clusterName = 'abc123' - /** - * Optional. Specifies enumerated categories of jobs to list. - * (default = match ALL jobs). - * If `filter` is provided, `jobStateMatcher` will be ignored. - */ - // const jobStateMatcher = {} - /** - * Optional. A filter constraining the jobs to list. Filters are - * case-sensitive and have the following syntax: - * field = value AND field = value ... - * where **field** is `status.state` or `labels.[KEY]`, and `[KEY]` is a label - * key. **value** can be `*` to match all values. - * `status.state` can be either `ACTIVE` or `NON_ACTIVE`. - * Only the logical `AND` operator is supported; space-separated items are - * treated as having an implicit `AND` operator. - * Example filter: - * status.state = ACTIVE AND labels.env = staging AND labels.starred = * - */ - // const filter = 'abc123' - - // Imports the Dataproc library - const {JobControllerClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new JobControllerClient(); - - async function callListJobs() { - // Construct request - const request = { - projectId, - region, - }; - - // Run request - const iterable = dataprocClient.listJobsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListJobs(); - // [END dataproc_v1_generated_JobController_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-dataproc/samples/generated/v1/job_controller.submit_job.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.submit_job.js deleted file mode 100644 index 832168732636..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.submit_job.js +++ /dev/null @@ -1,85 +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(projectId, region, job) { - // [START dataproc_v1_generated_JobController_SubmitJob_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 ID of the Google Cloud Platform project that the job - * belongs to. - */ - // const projectId = 'abc123' - /** - * Required. The Dataproc region in which to handle the request. - */ - // const region = 'us-central1' - /** - * Required. The job resource. - */ - // const job = {} - /** - * Optional. A unique id used to identify the request. If the server - * receives two - * SubmitJobRequest (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.SubmitJobRequest)s - * with the same id, then the second request will be ignored and the - * first Job google.cloud.dataproc.v1.Job created and stored in the backend - * is returned. - * It is recommended to always set this value to a - * UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier). - * The id must contain only letters (a-z, A-Z), numbers (0-9), - * underscores (_), and hyphens (-). The maximum length is 40 characters. - */ - // const requestId = 'abc123' - - // Imports the Dataproc library - const {JobControllerClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new JobControllerClient(); - - async function callSubmitJob() { - // Construct request - const request = { - projectId, - region, - job, - }; - - // Run request - const response = await dataprocClient.submitJob(request); - console.log(response); - } - - callSubmitJob(); - // [END dataproc_v1_generated_JobController_SubmitJob_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-dataproc/samples/generated/v1/job_controller.submit_job_as_operation.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.submit_job_as_operation.js deleted file mode 100644 index 588ed2ad0aa3..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.submit_job_as_operation.js +++ /dev/null @@ -1,86 +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(projectId, region, job) { - // [START dataproc_v1_generated_JobController_SubmitJobAsOperation_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 ID of the Google Cloud Platform project that the job - * belongs to. - */ - // const projectId = 'abc123' - /** - * Required. The Dataproc region in which to handle the request. - */ - // const region = 'us-central1' - /** - * Required. The job resource. - */ - // const job = {} - /** - * Optional. A unique id used to identify the request. If the server - * receives two - * SubmitJobRequest (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.SubmitJobRequest)s - * with the same id, then the second request will be ignored and the - * first Job google.cloud.dataproc.v1.Job created and stored in the backend - * is returned. - * It is recommended to always set this value to a - * UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier). - * The id must contain only letters (a-z, A-Z), numbers (0-9), - * underscores (_), and hyphens (-). The maximum length is 40 characters. - */ - // const requestId = 'abc123' - - // Imports the Dataproc library - const {JobControllerClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new JobControllerClient(); - - async function callSubmitJobAsOperation() { - // Construct request - const request = { - projectId, - region, - job, - }; - - // Run request - const [operation] = await dataprocClient.submitJobAsOperation(request); - const [response] = await operation.promise(); - console.log(response); - } - - callSubmitJobAsOperation(); - // [END dataproc_v1_generated_JobController_SubmitJobAsOperation_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-dataproc/samples/generated/v1/job_controller.update_job.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.update_job.js deleted file mode 100644 index ab81cc3dc4be..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/job_controller.update_job.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(projectId, region, jobId, job, updateMask) { - // [START dataproc_v1_generated_JobController_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 ID of the Google Cloud Platform project that the job - * belongs to. - */ - // const projectId = 'abc123' - /** - * Required. The Dataproc region in which to handle the request. - */ - // const region = 'us-central1' - /** - * Required. The job ID. - */ - // const jobId = 'abc123' - /** - * Required. The changes to the job. - */ - // const job = {} - /** - * Required. Specifies the path, relative to Job, of - * the field to update. For example, to update the labels of a Job the - * update_mask parameter would be specified as - * labels, and the `PATCH` request body would specify the new - * value. Note: Currently, labels is the only - * field that can be updated. - */ - // const updateMask = {} - - // Imports the Dataproc library - const {JobControllerClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new JobControllerClient(); - - async function callUpdateJob() { - // Construct request - const request = { - projectId, - region, - jobId, - job, - updateMask, - }; - - // Run request - const response = await dataprocClient.updateJob(request); - console.log(response); - } - - callUpdateJob(); - // [END dataproc_v1_generated_JobController_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-dataproc/samples/generated/v1/node_group_controller.create_node_group.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/node_group_controller.create_node_group.js deleted file mode 100644 index dca50a784ced..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/node_group_controller.create_node_group.js +++ /dev/null @@ -1,88 +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, nodeGroup) { - // [START dataproc_v1_generated_NodeGroupController_CreateNodeGroup_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent resource where this node group will be created. - * Format: `projects/{project}/regions/{region}/clusters/{cluster}` - */ - // const parent = 'abc123' - /** - * Required. The node group to create. - */ - // const nodeGroup = {} - /** - * Optional. An optional node group ID. Generated if not specified. - * The ID must contain only letters (a-z, A-Z), numbers (0-9), - * underscores (_), and hyphens (-). Cannot begin or end with underscore - * or hyphen. Must consist of from 3 to 33 characters. - */ - // const nodeGroupId = 'abc123' - /** - * Optional. A unique ID used to identify the request. If the server receives - * two - * CreateNodeGroupRequest (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateNodeGroupRequests) - * with the same ID, the second request is ignored and the - * first google.longrunning.Operation google.longrunning.Operation created - * and stored in the backend is returned. - * Recommendation: Set this value to a - * UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier). - * The ID must contain only letters (a-z, A-Z), numbers (0-9), - * underscores (_), and hyphens (-). The maximum length is 40 characters. - */ - // const requestId = 'abc123' - - // Imports the Dataproc library - const {NodeGroupControllerClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new NodeGroupControllerClient(); - - async function callCreateNodeGroup() { - // Construct request - const request = { - parent, - nodeGroup, - }; - - // Run request - const [operation] = await dataprocClient.createNodeGroup(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateNodeGroup(); - // [END dataproc_v1_generated_NodeGroupController_CreateNodeGroup_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-dataproc/samples/generated/v1/node_group_controller.get_node_group.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/node_group_controller.get_node_group.js deleted file mode 100644 index a51727868edd..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/node_group_controller.get_node_group.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 dataproc_v1_generated_NodeGroupController_GetNodeGroup_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 node group to retrieve. - * Format: - * `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` - */ - // const name = 'abc123' - - // Imports the Dataproc library - const {NodeGroupControllerClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new NodeGroupControllerClient(); - - async function callGetNodeGroup() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataprocClient.getNodeGroup(request); - console.log(response); - } - - callGetNodeGroup(); - // [END dataproc_v1_generated_NodeGroupController_GetNodeGroup_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-dataproc/samples/generated/v1/node_group_controller.resize_node_group.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/node_group_controller.resize_node_group.js deleted file mode 100644 index ecb1e402befb..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/node_group_controller.resize_node_group.js +++ /dev/null @@ -1,98 +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, size) { - // [START dataproc_v1_generated_NodeGroupController_ResizeNodeGroup_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 node group to resize. - * Format: - * `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` - */ - // const name = 'abc123' - /** - * Required. The number of running instances for the node group to maintain. - * The group adds or removes instances to maintain the number of instances - * specified by this parameter. - */ - // const size = 1234 - /** - * Optional. A unique ID used to identify the request. If the server receives - * two - * ResizeNodeGroupRequest (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.ResizeNodeGroupRequests) - * with the same ID, the second request is ignored and the - * first google.longrunning.Operation google.longrunning.Operation created - * and stored in the backend is returned. - * Recommendation: Set this value to a - * UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier). - * The ID must contain only letters (a-z, A-Z), numbers (0-9), - * underscores (_), and hyphens (-). The maximum length is 40 characters. - */ - // const requestId = 'abc123' - /** - * Optional. Timeout for graceful YARN decommissioning. Graceful - * decommissioning - * (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/scaling-clusters#graceful_decommissioning) - * allows the removal of nodes from the Compute Engine node group - * without interrupting jobs in progress. This timeout specifies how long to - * wait for jobs in progress to finish before forcefully removing nodes (and - * potentially interrupting jobs). Default timeout is 0 (for forceful - * decommission), and the maximum allowed timeout is 1 day. (see JSON - * representation of - * Duration (https://developers.google.com/protocol-buffers/docs/proto3#json)). - * Only supported on Dataproc image versions 1.2 and higher. - */ - // const gracefulDecommissionTimeout = {} - - // Imports the Dataproc library - const {NodeGroupControllerClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new NodeGroupControllerClient(); - - async function callResizeNodeGroup() { - // Construct request - const request = { - name, - size, - }; - - // Run request - const [operation] = await dataprocClient.resizeNodeGroup(request); - const [response] = await operation.promise(); - console.log(response); - } - - callResizeNodeGroup(); - // [END dataproc_v1_generated_NodeGroupController_ResizeNodeGroup_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-dataproc/samples/generated/v1/session_controller.create_session.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_controller.create_session.js deleted file mode 100644 index 08791edce4b7..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_controller.create_session.js +++ /dev/null @@ -1,88 +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, session, sessionId) { - // [START dataproc_v1_generated_SessionController_CreateSession_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent resource where this session will be created. - */ - // const parent = 'abc123' - /** - * Required. The interactive session to create. - */ - // const session = {} - /** - * Required. The ID to use for the session, which becomes the final component - * of the session's resource name. - * This value must be 4-63 characters. Valid characters - * are /[a-z][0-9]-/. - */ - // const sessionId = 'abc123' - /** - * Optional. A unique ID used to identify the request. If the service - * receives two - * CreateSessionRequests (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateSessionRequest)s - * with the same ID, the second request is ignored, and the - * first Session google.cloud.dataproc.v1.Session is created and stored in - * the backend. - * Recommendation: Set this value to a - * UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier). - * The value must contain only letters (a-z, A-Z), numbers (0-9), - * underscores (_), and hyphens (-). The maximum length is 40 characters. - */ - // const requestId = 'abc123' - - // Imports the Dataproc library - const {SessionControllerClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new SessionControllerClient(); - - async function callCreateSession() { - // Construct request - const request = { - parent, - session, - sessionId, - }; - - // Run request - const [operation] = await dataprocClient.createSession(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateSession(); - // [END dataproc_v1_generated_SessionController_CreateSession_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-dataproc/samples/generated/v1/session_controller.delete_session.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_controller.delete_session.js deleted file mode 100644 index 7cd1617d688c..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_controller.delete_session.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(name) { - // [START dataproc_v1_generated_SessionController_DeleteSession_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 session resource to delete. - */ - // const name = 'abc123' - /** - * Optional. A unique ID used to identify the request. If the service - * receives two - * DeleteSessionRequest (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteSessionRequest)s - * with the same ID, the second request is ignored. - * Recommendation: Set this value to a - * UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier). - * The value must contain only letters (a-z, A-Z), numbers (0-9), - * underscores (_), and hyphens (-). The maximum length is 40 characters. - */ - // const requestId = 'abc123' - - // Imports the Dataproc library - const {SessionControllerClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new SessionControllerClient(); - - async function callDeleteSession() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await dataprocClient.deleteSession(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteSession(); - // [END dataproc_v1_generated_SessionController_DeleteSession_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-dataproc/samples/generated/v1/session_controller.get_session.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_controller.get_session.js deleted file mode 100644 index dad5a788dd37..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_controller.get_session.js +++ /dev/null @@ -1,61 +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 dataproc_v1_generated_SessionController_GetSession_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 session to retrieve. - */ - // const name = 'abc123' - - // Imports the Dataproc library - const {SessionControllerClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new SessionControllerClient(); - - async function callGetSession() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataprocClient.getSession(request); - console.log(response); - } - - callGetSession(); - // [END dataproc_v1_generated_SessionController_GetSession_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-dataproc/samples/generated/v1/session_controller.list_sessions.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_controller.list_sessions.js deleted file mode 100644 index e38c22717c0b..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_controller.list_sessions.js +++ /dev/null @@ -1,88 +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 dataproc_v1_generated_SessionController_ListSessions_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent, which owns this collection of sessions. - */ - // const parent = 'abc123' - /** - * Optional. The maximum number of sessions to return in each response. - * The service may return fewer than this value. - */ - // const pageSize = 1234 - /** - * Optional. A page token received from a previous `ListSessions` call. - * Provide this token to retrieve the subsequent page. - */ - // const pageToken = 'abc123' - /** - * Optional. A filter for the sessions to return in the response. - * A filter is a logical expression constraining the values of various fields - * in each session resource. Filters are case sensitive, and may contain - * multiple clauses combined with logical operators (AND, OR). - * Supported fields are `session_id`, `session_uuid`, `state`, `create_time`, - * and `labels`. - * Example: `state = ACTIVE and create_time < "2023-01-01T00:00:00Z"` - * is a filter for sessions in an ACTIVE state that were created before - * 2023-01-01. `state = ACTIVE and labels.environment=production` is a filter - * for sessions in an ACTIVE state that have a production environment label. - * See https://google.aip.dev/assets/misc/ebnf-filtering.txt for a detailed - * description of the filter syntax and a list of supported comparators. - */ - // const filter = 'abc123' - - // Imports the Dataproc library - const {SessionControllerClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new SessionControllerClient(); - - async function callListSessions() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = dataprocClient.listSessionsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListSessions(); - // [END dataproc_v1_generated_SessionController_ListSessions_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-dataproc/samples/generated/v1/session_controller.terminate_session.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_controller.terminate_session.js deleted file mode 100644 index e8e73468f82c..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_controller.terminate_session.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(name) { - // [START dataproc_v1_generated_SessionController_TerminateSession_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 session resource to terminate. - */ - // const name = 'abc123' - /** - * Optional. A unique ID used to identify the request. If the service - * receives two - * TerminateSessionRequest (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.TerminateSessionRequest)s - * with the same ID, the second request is ignored. - * Recommendation: Set this value to a - * UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier). - * The value must contain only letters (a-z, A-Z), numbers (0-9), - * underscores (_), and hyphens (-). The maximum length is 40 characters. - */ - // const requestId = 'abc123' - - // Imports the Dataproc library - const {SessionControllerClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new SessionControllerClient(); - - async function callTerminateSession() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await dataprocClient.terminateSession(request); - const [response] = await operation.promise(); - console.log(response); - } - - callTerminateSession(); - // [END dataproc_v1_generated_SessionController_TerminateSession_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-dataproc/samples/generated/v1/session_template_controller.create_session_template.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_template_controller.create_session_template.js deleted file mode 100644 index a1755cd7f7a6..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_template_controller.create_session_template.js +++ /dev/null @@ -1,66 +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, sessionTemplate) { - // [START dataproc_v1_generated_SessionTemplateController_CreateSessionTemplate_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent resource where this session template will be created. - */ - // const parent = 'abc123' - /** - * Required. The session template to create. - */ - // const sessionTemplate = {} - - // Imports the Dataproc library - const {SessionTemplateControllerClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new SessionTemplateControllerClient(); - - async function callCreateSessionTemplate() { - // Construct request - const request = { - parent, - sessionTemplate, - }; - - // Run request - const response = await dataprocClient.createSessionTemplate(request); - console.log(response); - } - - callCreateSessionTemplate(); - // [END dataproc_v1_generated_SessionTemplateController_CreateSessionTemplate_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-dataproc/samples/generated/v1/session_template_controller.delete_session_template.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_template_controller.delete_session_template.js deleted file mode 100644 index db600358bcdd..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_template_controller.delete_session_template.js +++ /dev/null @@ -1,61 +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 dataproc_v1_generated_SessionTemplateController_DeleteSessionTemplate_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 session template resource to delete. - */ - // const name = 'abc123' - - // Imports the Dataproc library - const {SessionTemplateControllerClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new SessionTemplateControllerClient(); - - async function callDeleteSessionTemplate() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataprocClient.deleteSessionTemplate(request); - console.log(response); - } - - callDeleteSessionTemplate(); - // [END dataproc_v1_generated_SessionTemplateController_DeleteSessionTemplate_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-dataproc/samples/generated/v1/session_template_controller.get_session_template.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_template_controller.get_session_template.js deleted file mode 100644 index 1ed1f24b2c0e..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_template_controller.get_session_template.js +++ /dev/null @@ -1,61 +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 dataproc_v1_generated_SessionTemplateController_GetSessionTemplate_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 session template to retrieve. - */ - // const name = 'abc123' - - // Imports the Dataproc library - const {SessionTemplateControllerClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new SessionTemplateControllerClient(); - - async function callGetSessionTemplate() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataprocClient.getSessionTemplate(request); - console.log(response); - } - - callGetSessionTemplate(); - // [END dataproc_v1_generated_SessionTemplateController_GetSessionTemplate_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-dataproc/samples/generated/v1/session_template_controller.list_session_templates.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_template_controller.list_session_templates.js deleted file mode 100644 index 2f4cbe0c06c9..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_template_controller.list_session_templates.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 dataproc_v1_generated_SessionTemplateController_ListSessionTemplates_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent that owns this collection of session templates. - */ - // const parent = 'abc123' - /** - * Optional. The maximum number of sessions to return in each response. - * The service may return fewer than this value. - */ - // const pageSize = 1234 - /** - * Optional. A page token received from a previous `ListSessions` call. - * Provide this token to retrieve the subsequent page. - */ - // const pageToken = 'abc123' - /** - * Optional. A filter for the session templates to return in the response. - * Filters are case sensitive and have the following syntax: - * field = value AND field = value ... - */ - // const filter = 'abc123' - - // Imports the Dataproc library - const {SessionTemplateControllerClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new SessionTemplateControllerClient(); - - async function callListSessionTemplates() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = dataprocClient.listSessionTemplatesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListSessionTemplates(); - // [END dataproc_v1_generated_SessionTemplateController_ListSessionTemplates_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-dataproc/samples/generated/v1/session_template_controller.update_session_template.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_template_controller.update_session_template.js deleted file mode 100644 index 3382ef7da002..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/session_template_controller.update_session_template.js +++ /dev/null @@ -1,61 +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(sessionTemplate) { - // [START dataproc_v1_generated_SessionTemplateController_UpdateSessionTemplate_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 updated session template. - */ - // const sessionTemplate = {} - - // Imports the Dataproc library - const {SessionTemplateControllerClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new SessionTemplateControllerClient(); - - async function callUpdateSessionTemplate() { - // Construct request - const request = { - sessionTemplate, - }; - - // Run request - const response = await dataprocClient.updateSessionTemplate(request); - console.log(response); - } - - callUpdateSessionTemplate(); - // [END dataproc_v1_generated_SessionTemplateController_UpdateSessionTemplate_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-dataproc/samples/generated/v1/snippet_metadata_google.cloud.dataproc.v1.json b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/snippet_metadata_google.cloud.dataproc.v1.json deleted file mode 100644 index 6e8593086d41..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/snippet_metadata_google.cloud.dataproc.v1.json +++ /dev/null @@ -1,2155 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-dataproc", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.dataproc.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "regionTag": "dataproc_v1_generated_AutoscalingPolicyService_CreateAutoscalingPolicy_async", - "title": "dataproc createAutoscalingPolicy Sample", - "origin": "API_DEFINITION", - "description": " Creates new autoscaling policy.", - "canonical": true, - "file": "autoscaling_policy_service.create_autoscaling_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 65, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateAutoscalingPolicy", - "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyService.CreateAutoscalingPolicy", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "policy", - "type": ".google.cloud.dataproc.v1.AutoscalingPolicy" - } - ], - "resultType": ".google.cloud.dataproc.v1.AutoscalingPolicy", - "client": { - "shortName": "AutoscalingPolicyServiceClient", - "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyServiceClient" - }, - "method": { - "shortName": "CreateAutoscalingPolicy", - "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyService.CreateAutoscalingPolicy", - "service": { - "shortName": "AutoscalingPolicyService", - "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyService" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_AutoscalingPolicyService_UpdateAutoscalingPolicy_async", - "title": "dataproc updateAutoscalingPolicy Sample", - "origin": "API_DEFINITION", - "description": " Updates (replaces) autoscaling policy. Disabled check for update_mask, because all updates will be full replacements.", - "canonical": true, - "file": "autoscaling_policy_service.update_autoscaling_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateAutoscalingPolicy", - "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyService.UpdateAutoscalingPolicy", - "async": true, - "parameters": [ - { - "name": "policy", - "type": ".google.cloud.dataproc.v1.AutoscalingPolicy" - } - ], - "resultType": ".google.cloud.dataproc.v1.AutoscalingPolicy", - "client": { - "shortName": "AutoscalingPolicyServiceClient", - "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyServiceClient" - }, - "method": { - "shortName": "UpdateAutoscalingPolicy", - "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyService.UpdateAutoscalingPolicy", - "service": { - "shortName": "AutoscalingPolicyService", - "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyService" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_AutoscalingPolicyService_GetAutoscalingPolicy_async", - "title": "dataproc getAutoscalingPolicy Sample", - "origin": "API_DEFINITION", - "description": " Retrieves autoscaling policy.", - "canonical": true, - "file": "autoscaling_policy_service.get_autoscaling_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetAutoscalingPolicy", - "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyService.GetAutoscalingPolicy", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataproc.v1.AutoscalingPolicy", - "client": { - "shortName": "AutoscalingPolicyServiceClient", - "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyServiceClient" - }, - "method": { - "shortName": "GetAutoscalingPolicy", - "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyService.GetAutoscalingPolicy", - "service": { - "shortName": "AutoscalingPolicyService", - "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyService" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_AutoscalingPolicyService_ListAutoscalingPolicies_async", - "title": "dataproc listAutoscalingPolicies Sample", - "origin": "API_DEFINITION", - "description": " Lists autoscaling policies in the project.", - "canonical": true, - "file": "autoscaling_policy_service.list_autoscaling_policies.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 72, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListAutoscalingPolicies", - "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyService.ListAutoscalingPolicies", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataproc.v1.ListAutoscalingPoliciesResponse", - "client": { - "shortName": "AutoscalingPolicyServiceClient", - "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyServiceClient" - }, - "method": { - "shortName": "ListAutoscalingPolicies", - "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyService.ListAutoscalingPolicies", - "service": { - "shortName": "AutoscalingPolicyService", - "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyService" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_AutoscalingPolicyService_DeleteAutoscalingPolicy_async", - "title": "dataproc deleteAutoscalingPolicy Sample", - "origin": "API_DEFINITION", - "description": " Deletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by one or more clusters.", - "canonical": true, - "file": "autoscaling_policy_service.delete_autoscaling_policy.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteAutoscalingPolicy", - "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyService.DeleteAutoscalingPolicy", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "AutoscalingPolicyServiceClient", - "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyServiceClient" - }, - "method": { - "shortName": "DeleteAutoscalingPolicy", - "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyService.DeleteAutoscalingPolicy", - "service": { - "shortName": "AutoscalingPolicyService", - "fullName": "google.cloud.dataproc.v1.AutoscalingPolicyService" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_BatchController_CreateBatch_async", - "title": "dataproc createBatch Sample", - "origin": "API_DEFINITION", - "description": " Creates a batch workload that executes asynchronously.", - "canonical": true, - "file": "batch_controller.create_batch.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 78, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateBatch", - "fullName": "google.cloud.dataproc.v1.BatchController.CreateBatch", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "batch", - "type": ".google.cloud.dataproc.v1.Batch" - }, - { - "name": "batch_id", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BatchControllerClient", - "fullName": "google.cloud.dataproc.v1.BatchControllerClient" - }, - "method": { - "shortName": "CreateBatch", - "fullName": "google.cloud.dataproc.v1.BatchController.CreateBatch", - "service": { - "shortName": "BatchController", - "fullName": "google.cloud.dataproc.v1.BatchController" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_BatchController_GetBatch_async", - "title": "dataproc getBatch Sample", - "origin": "API_DEFINITION", - "description": " Gets the batch workload resource representation.", - "canonical": true, - "file": "batch_controller.get_batch.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetBatch", - "fullName": "google.cloud.dataproc.v1.BatchController.GetBatch", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataproc.v1.Batch", - "client": { - "shortName": "BatchControllerClient", - "fullName": "google.cloud.dataproc.v1.BatchControllerClient" - }, - "method": { - "shortName": "GetBatch", - "fullName": "google.cloud.dataproc.v1.BatchController.GetBatch", - "service": { - "shortName": "BatchController", - "fullName": "google.cloud.dataproc.v1.BatchController" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_BatchController_ListBatches_async", - "title": "dataproc listBatches Sample", - "origin": "API_DEFINITION", - "description": " Lists batch workloads.", - "canonical": true, - "file": "batch_controller.list_batches.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 85, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListBatches", - "fullName": "google.cloud.dataproc.v1.BatchController.ListBatches", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataproc.v1.ListBatchesResponse", - "client": { - "shortName": "BatchControllerClient", - "fullName": "google.cloud.dataproc.v1.BatchControllerClient" - }, - "method": { - "shortName": "ListBatches", - "fullName": "google.cloud.dataproc.v1.BatchController.ListBatches", - "service": { - "shortName": "BatchController", - "fullName": "google.cloud.dataproc.v1.BatchController" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_BatchController_DeleteBatch_async", - "title": "dataproc deleteBatch Sample", - "origin": "API_DEFINITION", - "description": " Deletes the batch workload resource. If the batch is not in terminal state, the delete fails and the response returns `FAILED_PRECONDITION`.", - "canonical": true, - "file": "batch_controller.delete_batch.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteBatch", - "fullName": "google.cloud.dataproc.v1.BatchController.DeleteBatch", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "BatchControllerClient", - "fullName": "google.cloud.dataproc.v1.BatchControllerClient" - }, - "method": { - "shortName": "DeleteBatch", - "fullName": "google.cloud.dataproc.v1.BatchController.DeleteBatch", - "service": { - "shortName": "BatchController", - "fullName": "google.cloud.dataproc.v1.BatchController" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_ClusterController_CreateCluster_async", - "title": "dataproc createCluster Sample", - "origin": "API_DEFINITION", - "description": " Creates a cluster in a project. The returned [Operation.metadata][google.longrunning.Operation.metadata] will be [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata).", - "canonical": true, - "file": "cluster_controller.create_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 82, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateCluster", - "fullName": "google.cloud.dataproc.v1.ClusterController.CreateCluster", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "region", - "type": "TYPE_STRING" - }, - { - "name": "cluster", - "type": ".google.cloud.dataproc.v1.Cluster" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "action_on_failed_primary_workers", - "type": ".google.cloud.dataproc.v1.FailureAction" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "ClusterControllerClient", - "fullName": "google.cloud.dataproc.v1.ClusterControllerClient" - }, - "method": { - "shortName": "CreateCluster", - "fullName": "google.cloud.dataproc.v1.ClusterController.CreateCluster", - "service": { - "shortName": "ClusterController", - "fullName": "google.cloud.dataproc.v1.ClusterController" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_ClusterController_UpdateCluster_async", - "title": "dataproc updateCluster Sample", - "origin": "API_DEFINITION", - "description": " Updates a cluster in a project. The returned [Operation.metadata][google.longrunning.Operation.metadata] will be [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). The cluster must be in a [`RUNNING`][google.cloud.dataproc.v1.ClusterStatus.State] state or an error is returned.", - "canonical": true, - "file": "cluster_controller.update_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 146, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateCluster", - "fullName": "google.cloud.dataproc.v1.ClusterController.UpdateCluster", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "region", - "type": "TYPE_STRING" - }, - { - "name": "cluster_name", - "type": "TYPE_STRING" - }, - { - "name": "cluster", - "type": ".google.cloud.dataproc.v1.Cluster" - }, - { - "name": "graceful_decommission_timeout", - "type": ".google.protobuf.Duration" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "ClusterControllerClient", - "fullName": "google.cloud.dataproc.v1.ClusterControllerClient" - }, - "method": { - "shortName": "UpdateCluster", - "fullName": "google.cloud.dataproc.v1.ClusterController.UpdateCluster", - "service": { - "shortName": "ClusterController", - "fullName": "google.cloud.dataproc.v1.ClusterController" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_ClusterController_StopCluster_async", - "title": "dataproc stopCluster Sample", - "origin": "API_DEFINITION", - "description": " Stops a cluster in a project.", - "canonical": true, - "file": "cluster_controller.stop_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 83, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "StopCluster", - "fullName": "google.cloud.dataproc.v1.ClusterController.StopCluster", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "region", - "type": "TYPE_STRING" - }, - { - "name": "cluster_name", - "type": "TYPE_STRING" - }, - { - "name": "cluster_uuid", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "ClusterControllerClient", - "fullName": "google.cloud.dataproc.v1.ClusterControllerClient" - }, - "method": { - "shortName": "StopCluster", - "fullName": "google.cloud.dataproc.v1.ClusterController.StopCluster", - "service": { - "shortName": "ClusterController", - "fullName": "google.cloud.dataproc.v1.ClusterController" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_ClusterController_StartCluster_async", - "title": "dataproc startCluster Sample", - "origin": "API_DEFINITION", - "description": " Starts a cluster in a project.", - "canonical": true, - "file": "cluster_controller.start_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 83, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "StartCluster", - "fullName": "google.cloud.dataproc.v1.ClusterController.StartCluster", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "region", - "type": "TYPE_STRING" - }, - { - "name": "cluster_name", - "type": "TYPE_STRING" - }, - { - "name": "cluster_uuid", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "ClusterControllerClient", - "fullName": "google.cloud.dataproc.v1.ClusterControllerClient" - }, - "method": { - "shortName": "StartCluster", - "fullName": "google.cloud.dataproc.v1.ClusterController.StartCluster", - "service": { - "shortName": "ClusterController", - "fullName": "google.cloud.dataproc.v1.ClusterController" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_ClusterController_DeleteCluster_async", - "title": "dataproc deleteCluster Sample", - "origin": "API_DEFINITION", - "description": " Deletes a cluster in a project. The returned [Operation.metadata][google.longrunning.Operation.metadata] will be [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata).", - "canonical": true, - "file": "cluster_controller.delete_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 83, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteCluster", - "fullName": "google.cloud.dataproc.v1.ClusterController.DeleteCluster", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "region", - "type": "TYPE_STRING" - }, - { - "name": "cluster_name", - "type": "TYPE_STRING" - }, - { - "name": "cluster_uuid", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "ClusterControllerClient", - "fullName": "google.cloud.dataproc.v1.ClusterControllerClient" - }, - "method": { - "shortName": "DeleteCluster", - "fullName": "google.cloud.dataproc.v1.ClusterController.DeleteCluster", - "service": { - "shortName": "ClusterController", - "fullName": "google.cloud.dataproc.v1.ClusterController" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_ClusterController_GetCluster_async", - "title": "dataproc getCluster Sample", - "origin": "API_DEFINITION", - "description": " Gets the resource representation for a cluster in a project.", - "canonical": true, - "file": "cluster_controller.get_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetCluster", - "fullName": "google.cloud.dataproc.v1.ClusterController.GetCluster", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "region", - "type": "TYPE_STRING" - }, - { - "name": "cluster_name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataproc.v1.Cluster", - "client": { - "shortName": "ClusterControllerClient", - "fullName": "google.cloud.dataproc.v1.ClusterControllerClient" - }, - "method": { - "shortName": "GetCluster", - "fullName": "google.cloud.dataproc.v1.ClusterController.GetCluster", - "service": { - "shortName": "ClusterController", - "fullName": "google.cloud.dataproc.v1.ClusterController" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_ClusterController_ListClusters_async", - "title": "dataproc listClusters Sample", - "origin": "API_DEFINITION", - "description": " Lists all regions/{region}/clusters in a project alphabetically.", - "canonical": true, - "file": "cluster_controller.list_clusters.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 87, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListClusters", - "fullName": "google.cloud.dataproc.v1.ClusterController.ListClusters", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "region", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataproc.v1.ListClustersResponse", - "client": { - "shortName": "ClusterControllerClient", - "fullName": "google.cloud.dataproc.v1.ClusterControllerClient" - }, - "method": { - "shortName": "ListClusters", - "fullName": "google.cloud.dataproc.v1.ClusterController.ListClusters", - "service": { - "shortName": "ClusterController", - "fullName": "google.cloud.dataproc.v1.ClusterController" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_ClusterController_DiagnoseCluster_async", - "title": "dataproc diagnoseCluster Sample", - "origin": "API_DEFINITION", - "description": " Gets cluster diagnostic information. The returned [Operation.metadata][google.longrunning.Operation.metadata] will be [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). After the operation completes, [Operation.response][google.longrunning.Operation.response] contains [DiagnoseClusterResults](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults).", - "canonical": true, - "file": "cluster_controller.diagnose_cluster.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 91, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DiagnoseCluster", - "fullName": "google.cloud.dataproc.v1.ClusterController.DiagnoseCluster", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "region", - "type": "TYPE_STRING" - }, - { - "name": "cluster_name", - "type": "TYPE_STRING" - }, - { - "name": "tarball_gcs_dir", - "type": "TYPE_STRING" - }, - { - "name": "tarball_access", - "type": ".google.cloud.dataproc.v1.DiagnoseClusterRequest.TarballAccess" - }, - { - "name": "diagnosis_interval", - "type": ".google.type.Interval" - }, - { - "name": "jobs", - "type": "TYPE_STRING[]" - }, - { - "name": "yarn_application_ids", - "type": "TYPE_STRING[]" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "ClusterControllerClient", - "fullName": "google.cloud.dataproc.v1.ClusterControllerClient" - }, - "method": { - "shortName": "DiagnoseCluster", - "fullName": "google.cloud.dataproc.v1.ClusterController.DiagnoseCluster", - "service": { - "shortName": "ClusterController", - "fullName": "google.cloud.dataproc.v1.ClusterController" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_JobController_SubmitJob_async", - "title": "dataproc submitJob Sample", - "origin": "API_DEFINITION", - "description": " Submits a job to a cluster.", - "canonical": true, - "file": "job_controller.submit_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 77, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SubmitJob", - "fullName": "google.cloud.dataproc.v1.JobController.SubmitJob", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "region", - "type": "TYPE_STRING" - }, - { - "name": "job", - "type": ".google.cloud.dataproc.v1.Job" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataproc.v1.Job", - "client": { - "shortName": "JobControllerClient", - "fullName": "google.cloud.dataproc.v1.JobControllerClient" - }, - "method": { - "shortName": "SubmitJob", - "fullName": "google.cloud.dataproc.v1.JobController.SubmitJob", - "service": { - "shortName": "JobController", - "fullName": "google.cloud.dataproc.v1.JobController" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_JobController_SubmitJobAsOperation_async", - "title": "dataproc submitJobAsOperation Sample", - "origin": "API_DEFINITION", - "description": " Submits job to a cluster.", - "canonical": true, - "file": "job_controller.submit_job_as_operation.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 78, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "SubmitJobAsOperation", - "fullName": "google.cloud.dataproc.v1.JobController.SubmitJobAsOperation", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "region", - "type": "TYPE_STRING" - }, - { - "name": "job", - "type": ".google.cloud.dataproc.v1.Job" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "JobControllerClient", - "fullName": "google.cloud.dataproc.v1.JobControllerClient" - }, - "method": { - "shortName": "SubmitJobAsOperation", - "fullName": "google.cloud.dataproc.v1.JobController.SubmitJobAsOperation", - "service": { - "shortName": "JobController", - "fullName": "google.cloud.dataproc.v1.JobController" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_JobController_GetJob_async", - "title": "dataproc getJob Sample", - "origin": "API_DEFINITION", - "description": " Gets the resource representation for a job in a project.", - "canonical": true, - "file": "job_controller.get_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetJob", - "fullName": "google.cloud.dataproc.v1.JobController.GetJob", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "region", - "type": "TYPE_STRING" - }, - { - "name": "job_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataproc.v1.Job", - "client": { - "shortName": "JobControllerClient", - "fullName": "google.cloud.dataproc.v1.JobControllerClient" - }, - "method": { - "shortName": "GetJob", - "fullName": "google.cloud.dataproc.v1.JobController.GetJob", - "service": { - "shortName": "JobController", - "fullName": "google.cloud.dataproc.v1.JobController" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_JobController_ListJobs_async", - "title": "dataproc listJobs Sample", - "origin": "API_DEFINITION", - "description": " Lists regions/{region}/jobs in a project.", - "canonical": true, - "file": "job_controller.list_jobs.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 94, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListJobs", - "fullName": "google.cloud.dataproc.v1.JobController.ListJobs", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "region", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "cluster_name", - "type": "TYPE_STRING" - }, - { - "name": "job_state_matcher", - "type": ".google.cloud.dataproc.v1.ListJobsRequest.JobStateMatcher" - }, - { - "name": "filter", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataproc.v1.ListJobsResponse", - "client": { - "shortName": "JobControllerClient", - "fullName": "google.cloud.dataproc.v1.JobControllerClient" - }, - "method": { - "shortName": "ListJobs", - "fullName": "google.cloud.dataproc.v1.JobController.ListJobs", - "service": { - "shortName": "JobController", - "fullName": "google.cloud.dataproc.v1.JobController" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_JobController_UpdateJob_async", - "title": "dataproc updateJob Sample", - "origin": "API_DEFINITION", - "description": " Updates a job in a project.", - "canonical": true, - "file": "job_controller.update_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 79, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateJob", - "fullName": "google.cloud.dataproc.v1.JobController.UpdateJob", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "region", - "type": "TYPE_STRING" - }, - { - "name": "job_id", - "type": "TYPE_STRING" - }, - { - "name": "job", - "type": ".google.cloud.dataproc.v1.Job" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.cloud.dataproc.v1.Job", - "client": { - "shortName": "JobControllerClient", - "fullName": "google.cloud.dataproc.v1.JobControllerClient" - }, - "method": { - "shortName": "UpdateJob", - "fullName": "google.cloud.dataproc.v1.JobController.UpdateJob", - "service": { - "shortName": "JobController", - "fullName": "google.cloud.dataproc.v1.JobController" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_JobController_CancelJob_async", - "title": "dataproc cancelJob Sample", - "origin": "API_DEFINITION", - "description": " Starts a job cancellation request. To access the job resource after cancellation, call [regions/{region}/jobs.list](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/list) or [regions/{region}/jobs.get](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/get).", - "canonical": true, - "file": "job_controller.cancel_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CancelJob", - "fullName": "google.cloud.dataproc.v1.JobController.CancelJob", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "region", - "type": "TYPE_STRING" - }, - { - "name": "job_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataproc.v1.Job", - "client": { - "shortName": "JobControllerClient", - "fullName": "google.cloud.dataproc.v1.JobControllerClient" - }, - "method": { - "shortName": "CancelJob", - "fullName": "google.cloud.dataproc.v1.JobController.CancelJob", - "service": { - "shortName": "JobController", - "fullName": "google.cloud.dataproc.v1.JobController" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_JobController_DeleteJob_async", - "title": "dataproc deleteJob Sample", - "origin": "API_DEFINITION", - "description": " Deletes the job from the project. If the job is active, the delete fails, and the response returns `FAILED_PRECONDITION`.", - "canonical": true, - "file": "job_controller.delete_job.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteJob", - "fullName": "google.cloud.dataproc.v1.JobController.DeleteJob", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "region", - "type": "TYPE_STRING" - }, - { - "name": "job_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "JobControllerClient", - "fullName": "google.cloud.dataproc.v1.JobControllerClient" - }, - "method": { - "shortName": "DeleteJob", - "fullName": "google.cloud.dataproc.v1.JobController.DeleteJob", - "service": { - "shortName": "JobController", - "fullName": "google.cloud.dataproc.v1.JobController" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_NodeGroupController_CreateNodeGroup_async", - "title": "dataproc createNodeGroup Sample", - "origin": "API_DEFINITION", - "description": " Creates a node group in a cluster. The returned [Operation.metadata][google.longrunning.Operation.metadata] is [NodeGroupOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata).", - "canonical": true, - "file": "node_group_controller.create_node_group.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 80, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateNodeGroup", - "fullName": "google.cloud.dataproc.v1.NodeGroupController.CreateNodeGroup", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "node_group", - "type": ".google.cloud.dataproc.v1.NodeGroup" - }, - { - "name": "node_group_id", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "NodeGroupControllerClient", - "fullName": "google.cloud.dataproc.v1.NodeGroupControllerClient" - }, - "method": { - "shortName": "CreateNodeGroup", - "fullName": "google.cloud.dataproc.v1.NodeGroupController.CreateNodeGroup", - "service": { - "shortName": "NodeGroupController", - "fullName": "google.cloud.dataproc.v1.NodeGroupController" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_NodeGroupController_ResizeNodeGroup_async", - "title": "dataproc resizeNodeGroup Sample", - "origin": "API_DEFINITION", - "description": " Resizes a node group in a cluster. The returned [Operation.metadata][google.longrunning.Operation.metadata] is [NodeGroupOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata).", - "canonical": true, - "file": "node_group_controller.resize_node_group.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 90, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ResizeNodeGroup", - "fullName": "google.cloud.dataproc.v1.NodeGroupController.ResizeNodeGroup", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "size", - "type": "TYPE_INT32" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "graceful_decommission_timeout", - "type": ".google.protobuf.Duration" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "NodeGroupControllerClient", - "fullName": "google.cloud.dataproc.v1.NodeGroupControllerClient" - }, - "method": { - "shortName": "ResizeNodeGroup", - "fullName": "google.cloud.dataproc.v1.NodeGroupController.ResizeNodeGroup", - "service": { - "shortName": "NodeGroupController", - "fullName": "google.cloud.dataproc.v1.NodeGroupController" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_NodeGroupController_GetNodeGroup_async", - "title": "dataproc getNodeGroup Sample", - "origin": "API_DEFINITION", - "description": " Gets the resource representation for a node group in a cluster.", - "canonical": true, - "file": "node_group_controller.get_node_group.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetNodeGroup", - "fullName": "google.cloud.dataproc.v1.NodeGroupController.GetNodeGroup", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataproc.v1.NodeGroup", - "client": { - "shortName": "NodeGroupControllerClient", - "fullName": "google.cloud.dataproc.v1.NodeGroupControllerClient" - }, - "method": { - "shortName": "GetNodeGroup", - "fullName": "google.cloud.dataproc.v1.NodeGroupController.GetNodeGroup", - "service": { - "shortName": "NodeGroupController", - "fullName": "google.cloud.dataproc.v1.NodeGroupController" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_SessionController_CreateSession_async", - "title": "dataproc createSession Sample", - "origin": "API_DEFINITION", - "description": " Create an interactive session asynchronously.", - "canonical": true, - "file": "session_controller.create_session.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 80, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateSession", - "fullName": "google.cloud.dataproc.v1.SessionController.CreateSession", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "session", - "type": ".google.cloud.dataproc.v1.Session" - }, - { - "name": "session_id", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "SessionControllerClient", - "fullName": "google.cloud.dataproc.v1.SessionControllerClient" - }, - "method": { - "shortName": "CreateSession", - "fullName": "google.cloud.dataproc.v1.SessionController.CreateSession", - "service": { - "shortName": "SessionController", - "fullName": "google.cloud.dataproc.v1.SessionController" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_SessionController_GetSession_async", - "title": "dataproc getSession Sample", - "origin": "API_DEFINITION", - "description": " Gets the resource representation for an interactive session.", - "canonical": true, - "file": "session_controller.get_session.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetSession", - "fullName": "google.cloud.dataproc.v1.SessionController.GetSession", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataproc.v1.Session", - "client": { - "shortName": "SessionControllerClient", - "fullName": "google.cloud.dataproc.v1.SessionControllerClient" - }, - "method": { - "shortName": "GetSession", - "fullName": "google.cloud.dataproc.v1.SessionController.GetSession", - "service": { - "shortName": "SessionController", - "fullName": "google.cloud.dataproc.v1.SessionController" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_SessionController_ListSessions_async", - "title": "dataproc listSessions Sample", - "origin": "API_DEFINITION", - "description": " Lists interactive sessions.", - "canonical": true, - "file": "session_controller.list_sessions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 80, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListSessions", - "fullName": "google.cloud.dataproc.v1.SessionController.ListSessions", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataproc.v1.ListSessionsResponse", - "client": { - "shortName": "SessionControllerClient", - "fullName": "google.cloud.dataproc.v1.SessionControllerClient" - }, - "method": { - "shortName": "ListSessions", - "fullName": "google.cloud.dataproc.v1.SessionController.ListSessions", - "service": { - "shortName": "SessionController", - "fullName": "google.cloud.dataproc.v1.SessionController" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_SessionController_TerminateSession_async", - "title": "dataproc terminateSession Sample", - "origin": "API_DEFINITION", - "description": " Terminates the interactive session.", - "canonical": true, - "file": "session_controller.terminate_session.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 65, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "TerminateSession", - "fullName": "google.cloud.dataproc.v1.SessionController.TerminateSession", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "SessionControllerClient", - "fullName": "google.cloud.dataproc.v1.SessionControllerClient" - }, - "method": { - "shortName": "TerminateSession", - "fullName": "google.cloud.dataproc.v1.SessionController.TerminateSession", - "service": { - "shortName": "SessionController", - "fullName": "google.cloud.dataproc.v1.SessionController" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_SessionController_DeleteSession_async", - "title": "dataproc deleteSession Sample", - "origin": "API_DEFINITION", - "description": " Deletes the interactive session resource. If the session is not in terminal state, it is terminated, and then deleted.", - "canonical": true, - "file": "session_controller.delete_session.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 65, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteSession", - "fullName": "google.cloud.dataproc.v1.SessionController.DeleteSession", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "SessionControllerClient", - "fullName": "google.cloud.dataproc.v1.SessionControllerClient" - }, - "method": { - "shortName": "DeleteSession", - "fullName": "google.cloud.dataproc.v1.SessionController.DeleteSession", - "service": { - "shortName": "SessionController", - "fullName": "google.cloud.dataproc.v1.SessionController" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_SessionTemplateController_CreateSessionTemplate_async", - "title": "dataproc createSessionTemplate Sample", - "origin": "API_DEFINITION", - "description": " Create a session template synchronously.", - "canonical": true, - "file": "session_template_controller.create_session_template.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 58, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateSessionTemplate", - "fullName": "google.cloud.dataproc.v1.SessionTemplateController.CreateSessionTemplate", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "session_template", - "type": ".google.cloud.dataproc.v1.SessionTemplate" - } - ], - "resultType": ".google.cloud.dataproc.v1.SessionTemplate", - "client": { - "shortName": "SessionTemplateControllerClient", - "fullName": "google.cloud.dataproc.v1.SessionTemplateControllerClient" - }, - "method": { - "shortName": "CreateSessionTemplate", - "fullName": "google.cloud.dataproc.v1.SessionTemplateController.CreateSessionTemplate", - "service": { - "shortName": "SessionTemplateController", - "fullName": "google.cloud.dataproc.v1.SessionTemplateController" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_SessionTemplateController_UpdateSessionTemplate_async", - "title": "dataproc updateSessionTemplate Sample", - "origin": "API_DEFINITION", - "description": " Updates the session template synchronously.", - "canonical": true, - "file": "session_template_controller.update_session_template.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateSessionTemplate", - "fullName": "google.cloud.dataproc.v1.SessionTemplateController.UpdateSessionTemplate", - "async": true, - "parameters": [ - { - "name": "session_template", - "type": ".google.cloud.dataproc.v1.SessionTemplate" - } - ], - "resultType": ".google.cloud.dataproc.v1.SessionTemplate", - "client": { - "shortName": "SessionTemplateControllerClient", - "fullName": "google.cloud.dataproc.v1.SessionTemplateControllerClient" - }, - "method": { - "shortName": "UpdateSessionTemplate", - "fullName": "google.cloud.dataproc.v1.SessionTemplateController.UpdateSessionTemplate", - "service": { - "shortName": "SessionTemplateController", - "fullName": "google.cloud.dataproc.v1.SessionTemplateController" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_SessionTemplateController_GetSessionTemplate_async", - "title": "dataproc getSessionTemplate Sample", - "origin": "API_DEFINITION", - "description": " Gets the resource representation for a session template.", - "canonical": true, - "file": "session_template_controller.get_session_template.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetSessionTemplate", - "fullName": "google.cloud.dataproc.v1.SessionTemplateController.GetSessionTemplate", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataproc.v1.SessionTemplate", - "client": { - "shortName": "SessionTemplateControllerClient", - "fullName": "google.cloud.dataproc.v1.SessionTemplateControllerClient" - }, - "method": { - "shortName": "GetSessionTemplate", - "fullName": "google.cloud.dataproc.v1.SessionTemplateController.GetSessionTemplate", - "service": { - "shortName": "SessionTemplateController", - "fullName": "google.cloud.dataproc.v1.SessionTemplateController" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_SessionTemplateController_ListSessionTemplates_async", - "title": "dataproc listSessionTemplates Sample", - "origin": "API_DEFINITION", - "description": " Lists session templates.", - "canonical": true, - "file": "session_template_controller.list_session_templates.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListSessionTemplates", - "fullName": "google.cloud.dataproc.v1.SessionTemplateController.ListSessionTemplates", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataproc.v1.ListSessionTemplatesResponse", - "client": { - "shortName": "SessionTemplateControllerClient", - "fullName": "google.cloud.dataproc.v1.SessionTemplateControllerClient" - }, - "method": { - "shortName": "ListSessionTemplates", - "fullName": "google.cloud.dataproc.v1.SessionTemplateController.ListSessionTemplates", - "service": { - "shortName": "SessionTemplateController", - "fullName": "google.cloud.dataproc.v1.SessionTemplateController" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_SessionTemplateController_DeleteSessionTemplate_async", - "title": "dataproc deleteSessionTemplate Sample", - "origin": "API_DEFINITION", - "description": " Deletes a session template.", - "canonical": true, - "file": "session_template_controller.delete_session_template.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 53, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteSessionTemplate", - "fullName": "google.cloud.dataproc.v1.SessionTemplateController.DeleteSessionTemplate", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "SessionTemplateControllerClient", - "fullName": "google.cloud.dataproc.v1.SessionTemplateControllerClient" - }, - "method": { - "shortName": "DeleteSessionTemplate", - "fullName": "google.cloud.dataproc.v1.SessionTemplateController.DeleteSessionTemplate", - "service": { - "shortName": "SessionTemplateController", - "fullName": "google.cloud.dataproc.v1.SessionTemplateController" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_WorkflowTemplateService_CreateWorkflowTemplate_async", - "title": "dataproc createWorkflowTemplate Sample", - "origin": "API_DEFINITION", - "description": " Creates new workflow template.", - "canonical": true, - "file": "workflow_template_service.create_workflow_template.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 65, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateWorkflowTemplate", - "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "template", - "type": ".google.cloud.dataproc.v1.WorkflowTemplate" - } - ], - "resultType": ".google.cloud.dataproc.v1.WorkflowTemplate", - "client": { - "shortName": "WorkflowTemplateServiceClient", - "fullName": "google.cloud.dataproc.v1.WorkflowTemplateServiceClient" - }, - "method": { - "shortName": "CreateWorkflowTemplate", - "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate", - "service": { - "shortName": "WorkflowTemplateService", - "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_WorkflowTemplateService_GetWorkflowTemplate_async", - "title": "dataproc getWorkflowTemplate Sample", - "origin": "API_DEFINITION", - "description": " Retrieves the latest workflow template. Can retrieve previously instantiated template by specifying optional version parameter.", - "canonical": true, - "file": "workflow_template_service.get_workflow_template.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetWorkflowTemplate", - "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService.GetWorkflowTemplate", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "version", - "type": "TYPE_INT32" - } - ], - "resultType": ".google.cloud.dataproc.v1.WorkflowTemplate", - "client": { - "shortName": "WorkflowTemplateServiceClient", - "fullName": "google.cloud.dataproc.v1.WorkflowTemplateServiceClient" - }, - "method": { - "shortName": "GetWorkflowTemplate", - "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService.GetWorkflowTemplate", - "service": { - "shortName": "WorkflowTemplateService", - "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_WorkflowTemplateService_InstantiateWorkflowTemplate_async", - "title": "dataproc instantiateWorkflowTemplate Sample", - "origin": "API_DEFINITION", - "description": " Instantiates a template and begins execution. The returned Operation can be used to track execution of workflow by polling [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when entire workflow is finished. The running workflow can be aborted via [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted. The [Operation.metadata][google.longrunning.Operation.metadata] will be [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see [Using WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). On successful completion, [Operation.response][google.longrunning.Operation.response] will be [Empty][google.protobuf.Empty].", - "canonical": true, - "file": "workflow_template_service.instantiate_workflow_template.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 84, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "InstantiateWorkflowTemplate", - "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "version", - "type": "TYPE_INT32" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "parameters", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "WorkflowTemplateServiceClient", - "fullName": "google.cloud.dataproc.v1.WorkflowTemplateServiceClient" - }, - "method": { - "shortName": "InstantiateWorkflowTemplate", - "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate", - "service": { - "shortName": "WorkflowTemplateService", - "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_WorkflowTemplateService_InstantiateInlineWorkflowTemplate_async", - "title": "dataproc instantiateInlineWorkflowTemplate Sample", - "origin": "API_DEFINITION", - "description": " Instantiates a template and begins execution. This method is equivalent to executing the sequence [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate], [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate], [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate]. The returned Operation can be used to track execution of workflow by polling [operations.get][google.longrunning.Operations.GetOperation]. The Operation will complete when entire workflow is finished. The running workflow can be aborted via [operations.cancel][google.longrunning.Operations.CancelOperation]. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted. The [Operation.metadata][google.longrunning.Operation.metadata] will be [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see [Using WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). On successful completion, [Operation.response][google.longrunning.Operation.response] will be [Empty][google.protobuf.Empty].", - "canonical": true, - "file": "workflow_template_service.instantiate_inline_workflow_template.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 76, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "InstantiateInlineWorkflowTemplate", - "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateInlineWorkflowTemplate", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "template", - "type": ".google.cloud.dataproc.v1.WorkflowTemplate" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "WorkflowTemplateServiceClient", - "fullName": "google.cloud.dataproc.v1.WorkflowTemplateServiceClient" - }, - "method": { - "shortName": "InstantiateInlineWorkflowTemplate", - "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateInlineWorkflowTemplate", - "service": { - "shortName": "WorkflowTemplateService", - "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_WorkflowTemplateService_UpdateWorkflowTemplate_async", - "title": "dataproc updateWorkflowTemplate Sample", - "origin": "API_DEFINITION", - "description": " Updates (replaces) workflow template. The updated template must contain version that matches the current server version.", - "canonical": true, - "file": "workflow_template_service.update_workflow_template.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateWorkflowTemplate", - "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService.UpdateWorkflowTemplate", - "async": true, - "parameters": [ - { - "name": "template", - "type": ".google.cloud.dataproc.v1.WorkflowTemplate" - } - ], - "resultType": ".google.cloud.dataproc.v1.WorkflowTemplate", - "client": { - "shortName": "WorkflowTemplateServiceClient", - "fullName": "google.cloud.dataproc.v1.WorkflowTemplateServiceClient" - }, - "method": { - "shortName": "UpdateWorkflowTemplate", - "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService.UpdateWorkflowTemplate", - "service": { - "shortName": "WorkflowTemplateService", - "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_WorkflowTemplateService_ListWorkflowTemplates_async", - "title": "dataproc listWorkflowTemplates Sample", - "origin": "API_DEFINITION", - "description": " Lists workflows that match the specified filter in the request.", - "canonical": true, - "file": "workflow_template_service.list_workflow_templates.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 71, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListWorkflowTemplates", - "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService.ListWorkflowTemplates", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.dataproc.v1.ListWorkflowTemplatesResponse", - "client": { - "shortName": "WorkflowTemplateServiceClient", - "fullName": "google.cloud.dataproc.v1.WorkflowTemplateServiceClient" - }, - "method": { - "shortName": "ListWorkflowTemplates", - "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService.ListWorkflowTemplates", - "service": { - "shortName": "WorkflowTemplateService", - "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService" - } - } - } - }, - { - "regionTag": "dataproc_v1_generated_WorkflowTemplateService_DeleteWorkflowTemplate_async", - "title": "dataproc deleteWorkflowTemplate Sample", - "origin": "API_DEFINITION", - "description": " Deletes a workflow template. It does not cancel in-progress workflows.", - "canonical": true, - "file": "workflow_template_service.delete_workflow_template.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteWorkflowTemplate", - "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "version", - "type": "TYPE_INT32" - } - ], - "resultType": ".google.protobuf.Empty", - "client": { - "shortName": "WorkflowTemplateServiceClient", - "fullName": "google.cloud.dataproc.v1.WorkflowTemplateServiceClient" - }, - "method": { - "shortName": "DeleteWorkflowTemplate", - "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate", - "service": { - "shortName": "WorkflowTemplateService", - "fullName": "google.cloud.dataproc.v1.WorkflowTemplateService" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.create_workflow_template.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.create_workflow_template.js deleted file mode 100644 index abb7e20e3bd2..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.create_workflow_template.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(parent, template) { - // [START dataproc_v1_generated_WorkflowTemplateService_CreateWorkflowTemplate_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 name of the region or location, as described - * in https://cloud.google.com/apis/design/resource_names. - * * For `projects.regions.workflowTemplates.create`, the resource name of the - * region has the following format: - * `projects/{project_id}/regions/{region}` - * * For `projects.locations.workflowTemplates.create`, the resource name of - * the location has the following format: - * `projects/{project_id}/locations/{location}` - */ - // const parent = 'abc123' - /** - * Required. The Dataproc workflow template to create. - */ - // const template = {} - - // Imports the Dataproc library - const {WorkflowTemplateServiceClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new WorkflowTemplateServiceClient(); - - async function callCreateWorkflowTemplate() { - // Construct request - const request = { - parent, - template, - }; - - // Run request - const response = await dataprocClient.createWorkflowTemplate(request); - console.log(response); - } - - callCreateWorkflowTemplate(); - // [END dataproc_v1_generated_WorkflowTemplateService_CreateWorkflowTemplate_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-dataproc/samples/generated/v1/workflow_template_service.delete_workflow_template.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.delete_workflow_template.js deleted file mode 100644 index 4dc811740332..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.delete_workflow_template.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 dataproc_v1_generated_WorkflowTemplateService_DeleteWorkflowTemplate_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 name of the workflow template, as described - * in https://cloud.google.com/apis/design/resource_names. - * * For `projects.regions.workflowTemplates.delete`, the resource name - * of the template has the following format: - * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` - * * For `projects.locations.workflowTemplates.instantiate`, the resource name - * of the template has the following format: - * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` - */ - // const name = 'abc123' - /** - * Optional. The version of workflow template to delete. If specified, - * will only delete the template if the current server version matches - * specified version. - */ - // const version = 1234 - - // Imports the Dataproc library - const {WorkflowTemplateServiceClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new WorkflowTemplateServiceClient(); - - async function callDeleteWorkflowTemplate() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataprocClient.deleteWorkflowTemplate(request); - console.log(response); - } - - callDeleteWorkflowTemplate(); - // [END dataproc_v1_generated_WorkflowTemplateService_DeleteWorkflowTemplate_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-dataproc/samples/generated/v1/workflow_template_service.get_workflow_template.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.get_workflow_template.js deleted file mode 100644 index ae08acc46bb1..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.get_workflow_template.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 dataproc_v1_generated_WorkflowTemplateService_GetWorkflowTemplate_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 name of the workflow template, as described - * in https://cloud.google.com/apis/design/resource_names. - * * For `projects.regions.workflowTemplates.get`, the resource name of the - * template has the following format: - * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` - * * For `projects.locations.workflowTemplates.get`, the resource name of the - * template has the following format: - * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` - */ - // const name = 'abc123' - /** - * Optional. The version of workflow template to retrieve. Only previously - * instantiated versions can be retrieved. - * If unspecified, retrieves the current version. - */ - // const version = 1234 - - // Imports the Dataproc library - const {WorkflowTemplateServiceClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new WorkflowTemplateServiceClient(); - - async function callGetWorkflowTemplate() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await dataprocClient.getWorkflowTemplate(request); - console.log(response); - } - - callGetWorkflowTemplate(); - // [END dataproc_v1_generated_WorkflowTemplateService_GetWorkflowTemplate_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-dataproc/samples/generated/v1/workflow_template_service.instantiate_inline_workflow_template.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.instantiate_inline_workflow_template.js deleted file mode 100644 index f26c9ff34ea9..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.instantiate_inline_workflow_template.js +++ /dev/null @@ -1,84 +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, template) { - // [START dataproc_v1_generated_WorkflowTemplateService_InstantiateInlineWorkflowTemplate_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 name of the region or location, as described - * in https://cloud.google.com/apis/design/resource_names. - * * For `projects.regions.workflowTemplates,instantiateinline`, the resource - * name of the region has the following format: - * `projects/{project_id}/regions/{region}` - * * For `projects.locations.workflowTemplates.instantiateinline`, the - * resource name of the location has the following format: - * `projects/{project_id}/locations/{location}` - */ - // const parent = 'abc123' - /** - * Required. The workflow template to instantiate. - */ - // const template = {} - /** - * Optional. A tag that prevents multiple concurrent workflow - * instances with the same tag from running. This mitigates risk of - * concurrent instances started due to retries. - * It is recommended to always set this value to a - * UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier). - * The tag must contain only letters (a-z, A-Z), numbers (0-9), - * underscores (_), and hyphens (-). The maximum length is 40 characters. - */ - // const requestId = 'abc123' - - // Imports the Dataproc library - const {WorkflowTemplateServiceClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new WorkflowTemplateServiceClient(); - - async function callInstantiateInlineWorkflowTemplate() { - // Construct request - const request = { - parent, - template, - }; - - // Run request - const [operation] = await dataprocClient.instantiateInlineWorkflowTemplate(request); - const [response] = await operation.promise(); - console.log(response); - } - - callInstantiateInlineWorkflowTemplate(); - // [END dataproc_v1_generated_WorkflowTemplateService_InstantiateInlineWorkflowTemplate_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-dataproc/samples/generated/v1/workflow_template_service.instantiate_workflow_template.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.instantiate_workflow_template.js deleted file mode 100644 index 3024a20ab9f6..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.instantiate_workflow_template.js +++ /dev/null @@ -1,92 +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 dataproc_v1_generated_WorkflowTemplateService_InstantiateWorkflowTemplate_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 name of the workflow template, as described - * in https://cloud.google.com/apis/design/resource_names. - * * For `projects.regions.workflowTemplates.instantiate`, the resource name - * of the template has the following format: - * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` - * * For `projects.locations.workflowTemplates.instantiate`, the resource name - * of the template has the following format: - * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` - */ - // const name = 'abc123' - /** - * Optional. The version of workflow template to instantiate. If specified, - * the workflow will be instantiated only if the current version of - * the workflow template has the supplied version. - * This option cannot be used to instantiate a previous version of - * workflow template. - */ - // const version = 1234 - /** - * Optional. A tag that prevents multiple concurrent workflow - * instances with the same tag from running. This mitigates risk of - * concurrent instances started due to retries. - * It is recommended to always set this value to a - * UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier). - * The tag must contain only letters (a-z, A-Z), numbers (0-9), - * underscores (_), and hyphens (-). The maximum length is 40 characters. - */ - // const requestId = 'abc123' - /** - * Optional. Map from parameter names to values that should be used for those - * parameters. Values may not exceed 1000 characters. - */ - // const parameters = [1,2,3,4] - - // Imports the Dataproc library - const {WorkflowTemplateServiceClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new WorkflowTemplateServiceClient(); - - async function callInstantiateWorkflowTemplate() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await dataprocClient.instantiateWorkflowTemplate(request); - const [response] = await operation.promise(); - console.log(response); - } - - callInstantiateWorkflowTemplate(); - // [END dataproc_v1_generated_WorkflowTemplateService_InstantiateWorkflowTemplate_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-dataproc/samples/generated/v1/workflow_template_service.list_workflow_templates.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.list_workflow_templates.js deleted file mode 100644 index 24f5dc549461..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.list_workflow_templates.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 dataproc_v1_generated_WorkflowTemplateService_ListWorkflowTemplates_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 name of the region or location, as described - * in https://cloud.google.com/apis/design/resource_names. - * * For `projects.regions.workflowTemplates,list`, the resource - * name of the region has the following format: - * `projects/{project_id}/regions/{region}` - * * For `projects.locations.workflowTemplates.list`, the - * resource name of the location has the following format: - * `projects/{project_id}/locations/{location}` - */ - // const parent = 'abc123' - /** - * Optional. The maximum number of results to return in each response. - */ - // const pageSize = 1234 - /** - * Optional. The page token, returned by a previous call, to request the - * next page of results. - */ - // const pageToken = 'abc123' - - // Imports the Dataproc library - const {WorkflowTemplateServiceClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new WorkflowTemplateServiceClient(); - - async function callListWorkflowTemplates() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = dataprocClient.listWorkflowTemplatesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListWorkflowTemplates(); - // [END dataproc_v1_generated_WorkflowTemplateService_ListWorkflowTemplates_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-dataproc/samples/generated/v1/workflow_template_service.update_workflow_template.js b/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.update_workflow_template.js deleted file mode 100644 index f9d2e24d2c95..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/samples/generated/v1/workflow_template_service.update_workflow_template.js +++ /dev/null @@ -1,62 +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(template) { - // [START dataproc_v1_generated_WorkflowTemplateService_UpdateWorkflowTemplate_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 updated workflow template. - * The `template.version` field must match the current version. - */ - // const template = {} - - // Imports the Dataproc library - const {WorkflowTemplateServiceClient} = require('@google-cloud/dataproc').v1; - - // Instantiates a client - const dataprocClient = new WorkflowTemplateServiceClient(); - - async function callUpdateWorkflowTemplate() { - // Construct request - const request = { - template, - }; - - // Run request - const response = await dataprocClient.updateWorkflowTemplate(request); - console.log(response); - } - - callUpdateWorkflowTemplate(); - // [END dataproc_v1_generated_WorkflowTemplateService_UpdateWorkflowTemplate_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-dataproc/src/index.ts b/owl-bot-staging/google-cloud-dataproc/src/index.ts deleted file mode 100644 index 49417fe6517c..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/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 v1 from './v1'; - -const AutoscalingPolicyServiceClient = v1.AutoscalingPolicyServiceClient; -type AutoscalingPolicyServiceClient = v1.AutoscalingPolicyServiceClient; -const BatchControllerClient = v1.BatchControllerClient; -type BatchControllerClient = v1.BatchControllerClient; -const ClusterControllerClient = v1.ClusterControllerClient; -type ClusterControllerClient = v1.ClusterControllerClient; -const JobControllerClient = v1.JobControllerClient; -type JobControllerClient = v1.JobControllerClient; -const NodeGroupControllerClient = v1.NodeGroupControllerClient; -type NodeGroupControllerClient = v1.NodeGroupControllerClient; -const SessionControllerClient = v1.SessionControllerClient; -type SessionControllerClient = v1.SessionControllerClient; -const SessionTemplateControllerClient = v1.SessionTemplateControllerClient; -type SessionTemplateControllerClient = v1.SessionTemplateControllerClient; -const WorkflowTemplateServiceClient = v1.WorkflowTemplateServiceClient; -type WorkflowTemplateServiceClient = v1.WorkflowTemplateServiceClient; - -export {v1, AutoscalingPolicyServiceClient, BatchControllerClient, ClusterControllerClient, JobControllerClient, NodeGroupControllerClient, SessionControllerClient, SessionTemplateControllerClient, WorkflowTemplateServiceClient}; -export default {v1, AutoscalingPolicyServiceClient, BatchControllerClient, ClusterControllerClient, JobControllerClient, NodeGroupControllerClient, SessionControllerClient, SessionTemplateControllerClient, WorkflowTemplateServiceClient}; -import * as protos from '../protos/protos'; -export {protos}; diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/autoscaling_policy_service_client.ts b/owl-bot-staging/google-cloud-dataproc/src/v1/autoscaling_policy_service_client.ts deleted file mode 100644 index 0c01e0777c56..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/src/v1/autoscaling_policy_service_client.ts +++ /dev/null @@ -1,1627 +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, IamClient, IamProtos} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v1/autoscaling_policy_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './autoscaling_policy_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * The API interface for managing autoscaling policies in the - * Dataproc API. - * @class - * @memberof v1 - */ -export class AutoscalingPolicyServiceClient { - 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('dataproc'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - iamClient: IamClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - autoscalingPolicyServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of AutoscalingPolicyServiceClient. - * - * @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 AutoscalingPolicyServiceClient({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 AutoscalingPolicyServiceClient; - 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 = 'dataproc.' + 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.iamClient = new this._gaxModule.IamClient(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 = { - batchPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batches/{batch}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - nodeGroupPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{node_group}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - projectLocationAutoscalingPolicyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/autoscalingPolicies/{autoscaling_policy}' - ), - projectLocationWorkflowTemplatePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/workflowTemplates/{workflow_template}' - ), - projectRegionAutoscalingPolicyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/regions/{region}/autoscalingPolicies/{autoscaling_policy}' - ), - projectRegionWorkflowTemplatePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/regions/{region}/workflowTemplates/{workflow_template}' - ), - sessionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/sessions/{session}' - ), - sessionTemplatePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/sessionTemplates/{template}' - ), - }; - - // 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 = { - listAutoscalingPolicies: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'policies') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.dataproc.v1.AutoscalingPolicyService', 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.autoscalingPolicyServiceStub) { - return this.autoscalingPolicyServiceStub; - } - - // Put together the "service stub" for - // google.cloud.dataproc.v1.AutoscalingPolicyService. - this.autoscalingPolicyServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.dataproc.v1.AutoscalingPolicyService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.dataproc.v1.AutoscalingPolicyService, - 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 autoscalingPolicyServiceStubMethods = - ['createAutoscalingPolicy', 'updateAutoscalingPolicy', 'getAutoscalingPolicy', 'listAutoscalingPolicies', 'deleteAutoscalingPolicy']; - for (const methodName of autoscalingPolicyServiceStubMethods) { - const callPromise = this.autoscalingPolicyServiceStub.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.autoscalingPolicyServiceStub; - } - - /** - * 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 'dataproc.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 'dataproc.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 -- - // ------------------- -/** - * Creates new autoscaling policy. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The "resource name" of the region or location, as described - * in https://cloud.google.com/apis/design/resource_names. - * - * * For `projects.regions.autoscalingPolicies.create`, the resource name - * of the region has the following format: - * `projects/{project_id}/regions/{region}` - * - * * For `projects.locations.autoscalingPolicies.create`, the resource name - * of the location has the following format: - * `projects/{project_id}/locations/{location}` - * @param {google.cloud.dataproc.v1.AutoscalingPolicy} request.policy - * Required. The autoscaling policy to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.dataproc.v1.AutoscalingPolicy|AutoscalingPolicy}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/autoscaling_policy_service.create_autoscaling_policy.js - * region_tag:dataproc_v1_generated_AutoscalingPolicyService_CreateAutoscalingPolicy_async - */ - createAutoscalingPolicy( - request?: protos.google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataproc.v1.IAutoscalingPolicy, - protos.google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest|undefined, {}|undefined - ]>; - createAutoscalingPolicy( - request: protos.google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataproc.v1.IAutoscalingPolicy, - protos.google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest|null|undefined, - {}|null|undefined>): void; - createAutoscalingPolicy( - request: protos.google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest, - callback: Callback< - protos.google.cloud.dataproc.v1.IAutoscalingPolicy, - protos.google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest|null|undefined, - {}|null|undefined>): void; - createAutoscalingPolicy( - request?: protos.google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataproc.v1.IAutoscalingPolicy, - protos.google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataproc.v1.IAutoscalingPolicy, - protos.google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataproc.v1.IAutoscalingPolicy, - protos.google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof 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('createAutoscalingPolicy request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.dataproc.v1.IAutoscalingPolicy, - protos.google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createAutoscalingPolicy response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createAutoscalingPolicy(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.dataproc.v1.IAutoscalingPolicy, - protos.google.cloud.dataproc.v1.ICreateAutoscalingPolicyRequest|undefined, - {}|undefined - ]) => { - this._log.info('createAutoscalingPolicy response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Updates (replaces) autoscaling policy. - * - * Disabled check for update_mask, because all updates will be full - * replacements. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.dataproc.v1.AutoscalingPolicy} request.policy - * Required. The updated autoscaling policy. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.dataproc.v1.AutoscalingPolicy|AutoscalingPolicy}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/autoscaling_policy_service.update_autoscaling_policy.js - * region_tag:dataproc_v1_generated_AutoscalingPolicyService_UpdateAutoscalingPolicy_async - */ - updateAutoscalingPolicy( - request?: protos.google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataproc.v1.IAutoscalingPolicy, - protos.google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest|undefined, {}|undefined - ]>; - updateAutoscalingPolicy( - request: protos.google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataproc.v1.IAutoscalingPolicy, - protos.google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest|null|undefined, - {}|null|undefined>): void; - updateAutoscalingPolicy( - request: protos.google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest, - callback: Callback< - protos.google.cloud.dataproc.v1.IAutoscalingPolicy, - protos.google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest|null|undefined, - {}|null|undefined>): void; - updateAutoscalingPolicy( - request?: protos.google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataproc.v1.IAutoscalingPolicy, - protos.google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataproc.v1.IAutoscalingPolicy, - protos.google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataproc.v1.IAutoscalingPolicy, - protos.google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof 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({ - 'policy.name': request.policy!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateAutoscalingPolicy request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.dataproc.v1.IAutoscalingPolicy, - protos.google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateAutoscalingPolicy response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateAutoscalingPolicy(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.dataproc.v1.IAutoscalingPolicy, - protos.google.cloud.dataproc.v1.IUpdateAutoscalingPolicyRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateAutoscalingPolicy 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; - }); - } -/** - * Retrieves autoscaling policy. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The "resource name" of the autoscaling policy, as described - * in https://cloud.google.com/apis/design/resource_names. - * - * * For `projects.regions.autoscalingPolicies.get`, the resource name - * of the policy has the following format: - * `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` - * - * * For `projects.locations.autoscalingPolicies.get`, the resource name - * of the policy has the following format: - * `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.dataproc.v1.AutoscalingPolicy|AutoscalingPolicy}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/autoscaling_policy_service.get_autoscaling_policy.js - * region_tag:dataproc_v1_generated_AutoscalingPolicyService_GetAutoscalingPolicy_async - */ - getAutoscalingPolicy( - request?: protos.google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataproc.v1.IAutoscalingPolicy, - protos.google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest|undefined, {}|undefined - ]>; - getAutoscalingPolicy( - request: protos.google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataproc.v1.IAutoscalingPolicy, - protos.google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest|null|undefined, - {}|null|undefined>): void; - getAutoscalingPolicy( - request: protos.google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest, - callback: Callback< - protos.google.cloud.dataproc.v1.IAutoscalingPolicy, - protos.google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest|null|undefined, - {}|null|undefined>): void; - getAutoscalingPolicy( - request?: protos.google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataproc.v1.IAutoscalingPolicy, - protos.google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataproc.v1.IAutoscalingPolicy, - protos.google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataproc.v1.IAutoscalingPolicy, - protos.google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof 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('getAutoscalingPolicy request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.dataproc.v1.IAutoscalingPolicy, - protos.google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getAutoscalingPolicy response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getAutoscalingPolicy(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.dataproc.v1.IAutoscalingPolicy, - protos.google.cloud.dataproc.v1.IGetAutoscalingPolicyRequest|undefined, - {}|undefined - ]) => { - this._log.info('getAutoscalingPolicy 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 autoscaling policy. It is an error to delete an autoscaling - * policy that is in use by one or more clusters. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The "resource name" of the autoscaling policy, as described - * in https://cloud.google.com/apis/design/resource_names. - * - * * For `projects.regions.autoscalingPolicies.delete`, the resource name - * of the policy has the following format: - * `projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}` - * - * * For `projects.locations.autoscalingPolicies.delete`, the resource name - * of the policy has the following format: - * `projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/autoscaling_policy_service.delete_autoscaling_policy.js - * region_tag:dataproc_v1_generated_AutoscalingPolicyService_DeleteAutoscalingPolicy_async - */ - deleteAutoscalingPolicy( - request?: protos.google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest|undefined, {}|undefined - ]>; - deleteAutoscalingPolicy( - request: protos.google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest|null|undefined, - {}|null|undefined>): void; - deleteAutoscalingPolicy( - request: protos.google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest|null|undefined, - {}|null|undefined>): void; - deleteAutoscalingPolicy( - request?: protos.google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof 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('deleteAutoscalingPolicy request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteAutoscalingPolicy response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteAutoscalingPolicy(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteAutoscalingPolicyRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteAutoscalingPolicy 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 autoscaling policies in the project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The "resource name" of the region or location, as described - * in https://cloud.google.com/apis/design/resource_names. - * - * * For `projects.regions.autoscalingPolicies.list`, the resource name - * of the region has the following format: - * `projects/{project_id}/regions/{region}` - * - * * For `projects.locations.autoscalingPolicies.list`, the resource name - * of the location has the following format: - * `projects/{project_id}/locations/{location}` - * @param {number} [request.pageSize] - * Optional. The maximum number of results to return in each response. - * Must be less than or equal to 1000. Defaults to 100. - * @param {string} [request.pageToken] - * Optional. The page token, returned by a previous call, to request the - * next page of results. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.dataproc.v1.AutoscalingPolicy|AutoscalingPolicy}. - * 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 `listAutoscalingPoliciesAsync()` - * 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. - */ - listAutoscalingPolicies( - request?: protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataproc.v1.IAutoscalingPolicy[], - protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest|null, - protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse - ]>; - listAutoscalingPolicies( - request: protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest, - protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse|null|undefined, - protos.google.cloud.dataproc.v1.IAutoscalingPolicy>): void; - listAutoscalingPolicies( - request: protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest, - callback: PaginationCallback< - protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest, - protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse|null|undefined, - protos.google.cloud.dataproc.v1.IAutoscalingPolicy>): void; - listAutoscalingPolicies( - request?: protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest, - protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse|null|undefined, - protos.google.cloud.dataproc.v1.IAutoscalingPolicy>, - callback?: PaginationCallback< - protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest, - protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse|null|undefined, - protos.google.cloud.dataproc.v1.IAutoscalingPolicy>): - Promise<[ - protos.google.cloud.dataproc.v1.IAutoscalingPolicy[], - protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest|null, - protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof 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.dataproc.v1.IListAutoscalingPoliciesRequest, - protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse|null|undefined, - protos.google.cloud.dataproc.v1.IAutoscalingPolicy>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listAutoscalingPolicies values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listAutoscalingPolicies request %j', request); - return this.innerApiCalls - .listAutoscalingPolicies(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.dataproc.v1.IAutoscalingPolicy[], - protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest|null, - protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesResponse - ]) => { - this._log.info('listAutoscalingPolicies values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listAutoscalingPolicies`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The "resource name" of the region or location, as described - * in https://cloud.google.com/apis/design/resource_names. - * - * * For `projects.regions.autoscalingPolicies.list`, the resource name - * of the region has the following format: - * `projects/{project_id}/regions/{region}` - * - * * For `projects.locations.autoscalingPolicies.list`, the resource name - * of the location has the following format: - * `projects/{project_id}/locations/{location}` - * @param {number} [request.pageSize] - * Optional. The maximum number of results to return in each response. - * Must be less than or equal to 1000. Defaults to 100. - * @param {string} [request.pageToken] - * Optional. The page token, returned by a previous call, to request the - * next page of results. - * @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.dataproc.v1.AutoscalingPolicy|AutoscalingPolicy} 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 `listAutoscalingPoliciesAsync()` - * 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. - */ - listAutoscalingPoliciesStream( - request?: protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest, - 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['listAutoscalingPolicies']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listAutoscalingPolicies stream %j', request); - return this.descriptors.page.listAutoscalingPolicies.createStream( - this.innerApiCalls.listAutoscalingPolicies as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listAutoscalingPolicies`, 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 "resource name" of the region or location, as described - * in https://cloud.google.com/apis/design/resource_names. - * - * * For `projects.regions.autoscalingPolicies.list`, the resource name - * of the region has the following format: - * `projects/{project_id}/regions/{region}` - * - * * For `projects.locations.autoscalingPolicies.list`, the resource name - * of the location has the following format: - * `projects/{project_id}/locations/{location}` - * @param {number} [request.pageSize] - * Optional. The maximum number of results to return in each response. - * Must be less than or equal to 1000. Defaults to 100. - * @param {string} [request.pageToken] - * Optional. The page token, returned by a previous call, to request the - * next page of results. - * @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.dataproc.v1.AutoscalingPolicy|AutoscalingPolicy}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/autoscaling_policy_service.list_autoscaling_policies.js - * region_tag:dataproc_v1_generated_AutoscalingPolicyService_ListAutoscalingPolicies_async - */ - listAutoscalingPoliciesAsync( - request?: protos.google.cloud.dataproc.v1.IListAutoscalingPoliciesRequest, - 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['listAutoscalingPolicies']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listAutoscalingPolicies iterate %j', request); - return this.descriptors.page.listAutoscalingPolicies.asyncIterate( - this.innerApiCalls['listAutoscalingPolicies'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @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 {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @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/interfaces/CallOptions.html | 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.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { - return this.iamClient.testIamPermissions(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified batch resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch - * @returns {string} Resource name string. - */ - batchPath(project:string,location:string,batch:string) { - return this.pathTemplates.batchPathTemplate.render({ - project: project, - location: location, - batch: batch, - }); - } - - /** - * Parse the project from Batch resource. - * - * @param {string} batchName - * A fully-qualified path representing Batch resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchName(batchName: string) { - return this.pathTemplates.batchPathTemplate.match(batchName).project; - } - - /** - * Parse the location from Batch resource. - * - * @param {string} batchName - * A fully-qualified path representing Batch resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchName(batchName: string) { - return this.pathTemplates.batchPathTemplate.match(batchName).location; - } - - /** - * Parse the batch from Batch resource. - * - * @param {string} batchName - * A fully-qualified path representing Batch resource. - * @returns {string} A string representing the batch. - */ - matchBatchFromBatchName(batchName: string) { - return this.pathTemplates.batchPathTemplate.match(batchName).batch; - } - - /** - * 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 nodeGroup resource name string. - * - * @param {string} project - * @param {string} region - * @param {string} cluster - * @param {string} node_group - * @returns {string} Resource name string. - */ - nodeGroupPath(project:string,region:string,cluster:string,nodeGroup:string) { - return this.pathTemplates.nodeGroupPathTemplate.render({ - project: project, - region: region, - cluster: cluster, - node_group: nodeGroup, - }); - } - - /** - * Parse the project from NodeGroup resource. - * - * @param {string} nodeGroupName - * A fully-qualified path representing NodeGroup resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNodeGroupName(nodeGroupName: string) { - return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).project; - } - - /** - * Parse the region from NodeGroup resource. - * - * @param {string} nodeGroupName - * A fully-qualified path representing NodeGroup resource. - * @returns {string} A string representing the region. - */ - matchRegionFromNodeGroupName(nodeGroupName: string) { - return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).region; - } - - /** - * Parse the cluster from NodeGroup resource. - * - * @param {string} nodeGroupName - * A fully-qualified path representing NodeGroup resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromNodeGroupName(nodeGroupName: string) { - return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).cluster; - } - - /** - * Parse the node_group from NodeGroup resource. - * - * @param {string} nodeGroupName - * A fully-qualified path representing NodeGroup resource. - * @returns {string} A string representing the node_group. - */ - matchNodeGroupFromNodeGroupName(nodeGroupName: string) { - return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).node_group; - } - - /** - * 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 projectLocationAutoscalingPolicy resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} autoscaling_policy - * @returns {string} Resource name string. - */ - projectLocationAutoscalingPolicyPath(project:string,location:string,autoscalingPolicy:string) { - return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render({ - project: project, - location: location, - autoscaling_policy: autoscalingPolicy, - }); - } - - /** - * Parse the project from ProjectLocationAutoscalingPolicy resource. - * - * @param {string} projectLocationAutoscalingPolicyName - * A fully-qualified path representing project_location_autoscaling_policy resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { - return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).project; - } - - /** - * Parse the location from ProjectLocationAutoscalingPolicy resource. - * - * @param {string} projectLocationAutoscalingPolicyName - * A fully-qualified path representing project_location_autoscaling_policy resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { - return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).location; - } - - /** - * Parse the autoscaling_policy from ProjectLocationAutoscalingPolicy resource. - * - * @param {string} projectLocationAutoscalingPolicyName - * A fully-qualified path representing project_location_autoscaling_policy resource. - * @returns {string} A string representing the autoscaling_policy. - */ - matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { - return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).autoscaling_policy; - } - - /** - * Return a fully-qualified projectLocationWorkflowTemplate resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} workflow_template - * @returns {string} Resource name string. - */ - projectLocationWorkflowTemplatePath(project:string,location:string,workflowTemplate:string) { - return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render({ - project: project, - location: location, - workflow_template: workflowTemplate, - }); - } - - /** - * Parse the project from ProjectLocationWorkflowTemplate resource. - * - * @param {string} projectLocationWorkflowTemplateName - * A fully-qualified path representing project_location_workflow_template resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { - return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).project; - } - - /** - * Parse the location from ProjectLocationWorkflowTemplate resource. - * - * @param {string} projectLocationWorkflowTemplateName - * A fully-qualified path representing project_location_workflow_template resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { - return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).location; - } - - /** - * Parse the workflow_template from ProjectLocationWorkflowTemplate resource. - * - * @param {string} projectLocationWorkflowTemplateName - * A fully-qualified path representing project_location_workflow_template resource. - * @returns {string} A string representing the workflow_template. - */ - matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { - return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).workflow_template; - } - - /** - * Return a fully-qualified projectRegionAutoscalingPolicy resource name string. - * - * @param {string} project - * @param {string} region - * @param {string} autoscaling_policy - * @returns {string} Resource name string. - */ - projectRegionAutoscalingPolicyPath(project:string,region:string,autoscalingPolicy:string) { - return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render({ - project: project, - region: region, - autoscaling_policy: autoscalingPolicy, - }); - } - - /** - * Parse the project from ProjectRegionAutoscalingPolicy resource. - * - * @param {string} projectRegionAutoscalingPolicyName - * A fully-qualified path representing project_region_autoscaling_policy resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { - return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).project; - } - - /** - * Parse the region from ProjectRegionAutoscalingPolicy resource. - * - * @param {string} projectRegionAutoscalingPolicyName - * A fully-qualified path representing project_region_autoscaling_policy resource. - * @returns {string} A string representing the region. - */ - matchRegionFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { - return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).region; - } - - /** - * Parse the autoscaling_policy from ProjectRegionAutoscalingPolicy resource. - * - * @param {string} projectRegionAutoscalingPolicyName - * A fully-qualified path representing project_region_autoscaling_policy resource. - * @returns {string} A string representing the autoscaling_policy. - */ - matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { - return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).autoscaling_policy; - } - - /** - * Return a fully-qualified projectRegionWorkflowTemplate resource name string. - * - * @param {string} project - * @param {string} region - * @param {string} workflow_template - * @returns {string} Resource name string. - */ - projectRegionWorkflowTemplatePath(project:string,region:string,workflowTemplate:string) { - return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render({ - project: project, - region: region, - workflow_template: workflowTemplate, - }); - } - - /** - * Parse the project from ProjectRegionWorkflowTemplate resource. - * - * @param {string} projectRegionWorkflowTemplateName - * A fully-qualified path representing project_region_workflow_template resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { - return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).project; - } - - /** - * Parse the region from ProjectRegionWorkflowTemplate resource. - * - * @param {string} projectRegionWorkflowTemplateName - * A fully-qualified path representing project_region_workflow_template resource. - * @returns {string} A string representing the region. - */ - matchRegionFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { - return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).region; - } - - /** - * Parse the workflow_template from ProjectRegionWorkflowTemplate resource. - * - * @param {string} projectRegionWorkflowTemplateName - * A fully-qualified path representing project_region_workflow_template resource. - * @returns {string} A string representing the workflow_template. - */ - matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { - return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).workflow_template; - } - - /** - * Return a fully-qualified session resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} session - * @returns {string} Resource name string. - */ - sessionPath(project:string,location:string,session:string) { - return this.pathTemplates.sessionPathTemplate.render({ - project: project, - location: location, - session: session, - }); - } - - /** - * Parse the project from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).project; - } - - /** - * Parse the location from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).location; - } - - /** - * Parse the session from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the session. - */ - matchSessionFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).session; - } - - /** - * Return a fully-qualified sessionTemplate resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} template - * @returns {string} Resource name string. - */ - sessionTemplatePath(project:string,location:string,template:string) { - return this.pathTemplates.sessionTemplatePathTemplate.render({ - project: project, - location: location, - template: template, - }); - } - - /** - * Parse the project from SessionTemplate resource. - * - * @param {string} sessionTemplateName - * A fully-qualified path representing SessionTemplate resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSessionTemplateName(sessionTemplateName: string) { - return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).project; - } - - /** - * Parse the location from SessionTemplate resource. - * - * @param {string} sessionTemplateName - * A fully-qualified path representing SessionTemplate resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSessionTemplateName(sessionTemplateName: string) { - return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).location; - } - - /** - * Parse the template from SessionTemplate resource. - * - * @param {string} sessionTemplateName - * A fully-qualified path representing SessionTemplate resource. - * @returns {string} A string representing the template. - */ - matchTemplateFromSessionTemplateName(sessionTemplateName: string) { - return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).template; - } - - /** - * 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.autoscalingPolicyServiceStub && !this._terminated) { - return this.autoscalingPolicyServiceStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.iamClient.close().catch(err => {throw err}); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/autoscaling_policy_service_client_config.json b/owl-bot-staging/google-cloud-dataproc/src/v1/autoscaling_policy_service_client_config.json deleted file mode 100644 index 09bd892268fc..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/src/v1/autoscaling_policy_service_client_config.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "interfaces": { - "google.cloud.dataproc.v1.AutoscalingPolicyService": { - "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": { - "CreateAutoscalingPolicy": { - "timeout_millis": 600000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateAutoscalingPolicy": { - "timeout_millis": 600000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "GetAutoscalingPolicy": { - "timeout_millis": 600000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListAutoscalingPolicies": { - "timeout_millis": 600000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "DeleteAutoscalingPolicy": { - "timeout_millis": 600000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/autoscaling_policy_service_proto_list.json b/owl-bot-staging/google-cloud-dataproc/src/v1/autoscaling_policy_service_proto_list.json deleted file mode 100644 index d6798f50ae7c..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/src/v1/autoscaling_policy_service_proto_list.json +++ /dev/null @@ -1,12 +0,0 @@ -[ - "../../protos/google/cloud/dataproc/v1/autoscaling_policies.proto", - "../../protos/google/cloud/dataproc/v1/batches.proto", - "../../protos/google/cloud/dataproc/v1/clusters.proto", - "../../protos/google/cloud/dataproc/v1/jobs.proto", - "../../protos/google/cloud/dataproc/v1/node_groups.proto", - "../../protos/google/cloud/dataproc/v1/operations.proto", - "../../protos/google/cloud/dataproc/v1/session_templates.proto", - "../../protos/google/cloud/dataproc/v1/sessions.proto", - "../../protos/google/cloud/dataproc/v1/shared.proto", - "../../protos/google/cloud/dataproc/v1/workflow_templates.proto" -] diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/batch_controller_client.ts b/owl-bot-staging/google-cloud-dataproc/src/v1/batch_controller_client.ts deleted file mode 100644 index 2e9ea824d9d8..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/src/v1/batch_controller_client.ts +++ /dev/null @@ -1,1832 +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, IamClient, IamProtos} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v1/batch_controller_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './batch_controller_client_config.json'; -const version = require('../../../package.json').version; - -/** - * The BatchController provides methods to manage batch workloads. - * @class - * @memberof v1 - */ -export class BatchControllerClient { - 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('dataproc'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - iamClient: IamClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - batchControllerStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of BatchControllerClient. - * - * @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 BatchControllerClient({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 BatchControllerClient; - 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 = 'dataproc.' + 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.iamClient = new this._gaxModule.IamClient(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 = { - batchPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batches/{batch}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - nodeGroupPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{node_group}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - projectLocationAutoscalingPolicyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/autoscalingPolicies/{autoscaling_policy}' - ), - projectLocationWorkflowTemplatePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/workflowTemplates/{workflow_template}' - ), - projectRegionAutoscalingPolicyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/regions/{region}/autoscalingPolicies/{autoscaling_policy}' - ), - projectRegionWorkflowTemplatePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/regions/{region}/workflowTemplates/{workflow_template}' - ), - sessionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/sessions/{session}' - ), - sessionTemplatePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/sessionTemplates/{template}' - ), - }; - - // 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 = { - listBatches: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'batches') - }; - - 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.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1/{resource=projects/*/regions/*/clusters/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:getIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/regions/*/clusters/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/regions/*/clusters/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:testIamPermissions',body: '*',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/regions/*/operations/*}:cancel',additional_bindings: [{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/regions/*/operations/*}',additional_bindings: [{delete: '/v1/{name=projects/*/locations/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/regions/*/operations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/regions/*/operations}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*/operations}',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const createBatchResponse = protoFilesRoot.lookup( - '.google.cloud.dataproc.v1.Batch') as gax.protobuf.Type; - const createBatchMetadata = protoFilesRoot.lookup( - '.google.cloud.dataproc.v1.BatchOperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createBatch: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createBatchResponse.decode.bind(createBatchResponse), - createBatchMetadata.decode.bind(createBatchMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.dataproc.v1.BatchController', 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.batchControllerStub) { - return this.batchControllerStub; - } - - // Put together the "service stub" for - // google.cloud.dataproc.v1.BatchController. - this.batchControllerStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.dataproc.v1.BatchController') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.dataproc.v1.BatchController, - 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 batchControllerStubMethods = - ['createBatch', 'getBatch', 'listBatches', 'deleteBatch']; - for (const methodName of batchControllerStubMethods) { - const callPromise = this.batchControllerStub.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.batchControllerStub; - } - - /** - * 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 'dataproc.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 'dataproc.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 the batch workload resource representation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The fully qualified name of the batch to retrieve - * in the format - * "projects/PROJECT_ID/locations/DATAPROC_REGION/batches/BATCH_ID" - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.dataproc.v1.Batch|Batch}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/batch_controller.get_batch.js - * region_tag:dataproc_v1_generated_BatchController_GetBatch_async - */ - getBatch( - request?: protos.google.cloud.dataproc.v1.IGetBatchRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataproc.v1.IBatch, - protos.google.cloud.dataproc.v1.IGetBatchRequest|undefined, {}|undefined - ]>; - getBatch( - request: protos.google.cloud.dataproc.v1.IGetBatchRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataproc.v1.IBatch, - protos.google.cloud.dataproc.v1.IGetBatchRequest|null|undefined, - {}|null|undefined>): void; - getBatch( - request: protos.google.cloud.dataproc.v1.IGetBatchRequest, - callback: Callback< - protos.google.cloud.dataproc.v1.IBatch, - protos.google.cloud.dataproc.v1.IGetBatchRequest|null|undefined, - {}|null|undefined>): void; - getBatch( - request?: protos.google.cloud.dataproc.v1.IGetBatchRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataproc.v1.IBatch, - protos.google.cloud.dataproc.v1.IGetBatchRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataproc.v1.IBatch, - protos.google.cloud.dataproc.v1.IGetBatchRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataproc.v1.IBatch, - protos.google.cloud.dataproc.v1.IGetBatchRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof 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('getBatch request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.dataproc.v1.IBatch, - protos.google.cloud.dataproc.v1.IGetBatchRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getBatch response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getBatch(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.dataproc.v1.IBatch, - protos.google.cloud.dataproc.v1.IGetBatchRequest|undefined, - {}|undefined - ]) => { - this._log.info('getBatch response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Deletes the batch workload resource. If the batch is not in terminal state, - * the delete fails and the response returns `FAILED_PRECONDITION`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The fully qualified name of the batch to retrieve - * in the format - * "projects/PROJECT_ID/locations/DATAPROC_REGION/batches/BATCH_ID" - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/batch_controller.delete_batch.js - * region_tag:dataproc_v1_generated_BatchController_DeleteBatch_async - */ - deleteBatch( - request?: protos.google.cloud.dataproc.v1.IDeleteBatchRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteBatchRequest|undefined, {}|undefined - ]>; - deleteBatch( - request: protos.google.cloud.dataproc.v1.IDeleteBatchRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteBatchRequest|null|undefined, - {}|null|undefined>): void; - deleteBatch( - request: protos.google.cloud.dataproc.v1.IDeleteBatchRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteBatchRequest|null|undefined, - {}|null|undefined>): void; - deleteBatch( - request?: protos.google.cloud.dataproc.v1.IDeleteBatchRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteBatchRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteBatchRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteBatchRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof 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('deleteBatch request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteBatchRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteBatch response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteBatch(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteBatchRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteBatch 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 batch workload that executes asynchronously. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource where this batch will be created. - * @param {google.cloud.dataproc.v1.Batch} request.batch - * Required. The batch to create. - * @param {string} [request.batchId] - * Optional. The ID to use for the batch, which will become the final - * component of the batch's resource name. - * - * This value must be 4-63 characters. Valid characters are `/{@link protos.0-9|a-z}-/`. - * @param {string} [request.requestId] - * Optional. A unique ID used to identify the request. If the service - * receives two - * [CreateBatchRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateBatchRequest)s - * with the same request_id, the second request is ignored and the - * Operation that corresponds to the first Batch created and stored - * in the backend is returned. - * - * Recommendation: Set this value to a - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - * - * The value must contain only letters (a-z, A-Z), numbers (0-9), - * underscores (_), and hyphens (-). The maximum length is 40 characters. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/batch_controller.create_batch.js - * region_tag:dataproc_v1_generated_BatchController_CreateBatch_async - */ - createBatch( - request?: protos.google.cloud.dataproc.v1.ICreateBatchRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createBatch( - request: protos.google.cloud.dataproc.v1.ICreateBatchRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createBatch( - request: protos.google.cloud.dataproc.v1.ICreateBatchRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createBatch( - request?: protos.google.cloud.dataproc.v1.ICreateBatchRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createBatch response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createBatch request %j', request); - return this.innerApiCalls.createBatch(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createBatch response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createBatch()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/batch_controller.create_batch.js - * region_tag:dataproc_v1_generated_BatchController_CreateBatch_async - */ - async checkCreateBatchProgress(name: string): Promise>{ - this._log.info('createBatch 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.createBatch, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists batch workloads. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of batches. - * @param {number} [request.pageSize] - * Optional. The maximum number of batches to return in each response. - * The service may return fewer than this value. - * The default page size is 20; the maximum page size is 1000. - * @param {string} [request.pageToken] - * Optional. A page token received from a previous `ListBatches` call. - * Provide this token to retrieve the subsequent page. - * @param {string} [request.filter] - * Optional. A filter for the batches to return in the response. - * - * A filter is a logical expression constraining the values of various fields - * in each batch resource. Filters are case sensitive, and may contain - * multiple clauses combined with logical operators (AND/OR). - * Supported fields are `batch_id`, `batch_uuid`, `state`, and `create_time`. - * - * e.g. `state = RUNNING and create_time < "2023-01-01T00:00:00Z"` - * filters for batches in state RUNNING that were created before 2023-01-01 - * - * See https://google.aip.dev/assets/misc/ebnf-filtering.txt for a detailed - * description of the filter syntax and a list of supported comparisons. - * @param {string} [request.orderBy] - * Optional. Field(s) on which to sort the list of batches. - * - * Currently the only supported sort orders are unspecified (empty) and - * `create_time desc` to sort by most recently created batches first. - * - * See https://google.aip.dev/132#ordering for more details. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.dataproc.v1.Batch|Batch}. - * 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 `listBatchesAsync()` - * 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. - */ - listBatches( - request?: protos.google.cloud.dataproc.v1.IListBatchesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataproc.v1.IBatch[], - protos.google.cloud.dataproc.v1.IListBatchesRequest|null, - protos.google.cloud.dataproc.v1.IListBatchesResponse - ]>; - listBatches( - request: protos.google.cloud.dataproc.v1.IListBatchesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dataproc.v1.IListBatchesRequest, - protos.google.cloud.dataproc.v1.IListBatchesResponse|null|undefined, - protos.google.cloud.dataproc.v1.IBatch>): void; - listBatches( - request: protos.google.cloud.dataproc.v1.IListBatchesRequest, - callback: PaginationCallback< - protos.google.cloud.dataproc.v1.IListBatchesRequest, - protos.google.cloud.dataproc.v1.IListBatchesResponse|null|undefined, - protos.google.cloud.dataproc.v1.IBatch>): void; - listBatches( - request?: protos.google.cloud.dataproc.v1.IListBatchesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.dataproc.v1.IListBatchesRequest, - protos.google.cloud.dataproc.v1.IListBatchesResponse|null|undefined, - protos.google.cloud.dataproc.v1.IBatch>, - callback?: PaginationCallback< - protos.google.cloud.dataproc.v1.IListBatchesRequest, - protos.google.cloud.dataproc.v1.IListBatchesResponse|null|undefined, - protos.google.cloud.dataproc.v1.IBatch>): - Promise<[ - protos.google.cloud.dataproc.v1.IBatch[], - protos.google.cloud.dataproc.v1.IListBatchesRequest|null, - protos.google.cloud.dataproc.v1.IListBatchesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof 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.dataproc.v1.IListBatchesRequest, - protos.google.cloud.dataproc.v1.IListBatchesResponse|null|undefined, - protos.google.cloud.dataproc.v1.IBatch>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listBatches values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listBatches request %j', request); - return this.innerApiCalls - .listBatches(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.dataproc.v1.IBatch[], - protos.google.cloud.dataproc.v1.IListBatchesRequest|null, - protos.google.cloud.dataproc.v1.IListBatchesResponse - ]) => { - this._log.info('listBatches values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listBatches`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of batches. - * @param {number} [request.pageSize] - * Optional. The maximum number of batches to return in each response. - * The service may return fewer than this value. - * The default page size is 20; the maximum page size is 1000. - * @param {string} [request.pageToken] - * Optional. A page token received from a previous `ListBatches` call. - * Provide this token to retrieve the subsequent page. - * @param {string} [request.filter] - * Optional. A filter for the batches to return in the response. - * - * A filter is a logical expression constraining the values of various fields - * in each batch resource. Filters are case sensitive, and may contain - * multiple clauses combined with logical operators (AND/OR). - * Supported fields are `batch_id`, `batch_uuid`, `state`, and `create_time`. - * - * e.g. `state = RUNNING and create_time < "2023-01-01T00:00:00Z"` - * filters for batches in state RUNNING that were created before 2023-01-01 - * - * See https://google.aip.dev/assets/misc/ebnf-filtering.txt for a detailed - * description of the filter syntax and a list of supported comparisons. - * @param {string} [request.orderBy] - * Optional. Field(s) on which to sort the list of batches. - * - * Currently the only supported sort orders are unspecified (empty) and - * `create_time desc` to sort by most recently created batches first. - * - * See https://google.aip.dev/132#ordering for more details. - * @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.dataproc.v1.Batch|Batch} 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 `listBatchesAsync()` - * 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. - */ - listBatchesStream( - request?: protos.google.cloud.dataproc.v1.IListBatchesRequest, - 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['listBatches']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listBatches stream %j', request); - return this.descriptors.page.listBatches.createStream( - this.innerApiCalls.listBatches as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listBatches`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of batches. - * @param {number} [request.pageSize] - * Optional. The maximum number of batches to return in each response. - * The service may return fewer than this value. - * The default page size is 20; the maximum page size is 1000. - * @param {string} [request.pageToken] - * Optional. A page token received from a previous `ListBatches` call. - * Provide this token to retrieve the subsequent page. - * @param {string} [request.filter] - * Optional. A filter for the batches to return in the response. - * - * A filter is a logical expression constraining the values of various fields - * in each batch resource. Filters are case sensitive, and may contain - * multiple clauses combined with logical operators (AND/OR). - * Supported fields are `batch_id`, `batch_uuid`, `state`, and `create_time`. - * - * e.g. `state = RUNNING and create_time < "2023-01-01T00:00:00Z"` - * filters for batches in state RUNNING that were created before 2023-01-01 - * - * See https://google.aip.dev/assets/misc/ebnf-filtering.txt for a detailed - * description of the filter syntax and a list of supported comparisons. - * @param {string} [request.orderBy] - * Optional. Field(s) on which to sort the list of batches. - * - * Currently the only supported sort orders are unspecified (empty) and - * `create_time desc` to sort by most recently created batches first. - * - * See https://google.aip.dev/132#ordering for more details. - * @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.dataproc.v1.Batch|Batch}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/batch_controller.list_batches.js - * region_tag:dataproc_v1_generated_BatchController_ListBatches_async - */ - listBatchesAsync( - request?: protos.google.cloud.dataproc.v1.IListBatchesRequest, - 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['listBatches']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listBatches iterate %j', request); - return this.descriptors.page.listBatches.asyncIterate( - this.innerApiCalls['listBatches'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @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 {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @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/interfaces/CallOptions.html | 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.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@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 batch resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch - * @returns {string} Resource name string. - */ - batchPath(project:string,location:string,batch:string) { - return this.pathTemplates.batchPathTemplate.render({ - project: project, - location: location, - batch: batch, - }); - } - - /** - * Parse the project from Batch resource. - * - * @param {string} batchName - * A fully-qualified path representing Batch resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchName(batchName: string) { - return this.pathTemplates.batchPathTemplate.match(batchName).project; - } - - /** - * Parse the location from Batch resource. - * - * @param {string} batchName - * A fully-qualified path representing Batch resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchName(batchName: string) { - return this.pathTemplates.batchPathTemplate.match(batchName).location; - } - - /** - * Parse the batch from Batch resource. - * - * @param {string} batchName - * A fully-qualified path representing Batch resource. - * @returns {string} A string representing the batch. - */ - matchBatchFromBatchName(batchName: string) { - return this.pathTemplates.batchPathTemplate.match(batchName).batch; - } - - /** - * 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 nodeGroup resource name string. - * - * @param {string} project - * @param {string} region - * @param {string} cluster - * @param {string} node_group - * @returns {string} Resource name string. - */ - nodeGroupPath(project:string,region:string,cluster:string,nodeGroup:string) { - return this.pathTemplates.nodeGroupPathTemplate.render({ - project: project, - region: region, - cluster: cluster, - node_group: nodeGroup, - }); - } - - /** - * Parse the project from NodeGroup resource. - * - * @param {string} nodeGroupName - * A fully-qualified path representing NodeGroup resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNodeGroupName(nodeGroupName: string) { - return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).project; - } - - /** - * Parse the region from NodeGroup resource. - * - * @param {string} nodeGroupName - * A fully-qualified path representing NodeGroup resource. - * @returns {string} A string representing the region. - */ - matchRegionFromNodeGroupName(nodeGroupName: string) { - return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).region; - } - - /** - * Parse the cluster from NodeGroup resource. - * - * @param {string} nodeGroupName - * A fully-qualified path representing NodeGroup resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromNodeGroupName(nodeGroupName: string) { - return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).cluster; - } - - /** - * Parse the node_group from NodeGroup resource. - * - * @param {string} nodeGroupName - * A fully-qualified path representing NodeGroup resource. - * @returns {string} A string representing the node_group. - */ - matchNodeGroupFromNodeGroupName(nodeGroupName: string) { - return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).node_group; - } - - /** - * 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 projectLocationAutoscalingPolicy resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} autoscaling_policy - * @returns {string} Resource name string. - */ - projectLocationAutoscalingPolicyPath(project:string,location:string,autoscalingPolicy:string) { - return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render({ - project: project, - location: location, - autoscaling_policy: autoscalingPolicy, - }); - } - - /** - * Parse the project from ProjectLocationAutoscalingPolicy resource. - * - * @param {string} projectLocationAutoscalingPolicyName - * A fully-qualified path representing project_location_autoscaling_policy resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { - return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).project; - } - - /** - * Parse the location from ProjectLocationAutoscalingPolicy resource. - * - * @param {string} projectLocationAutoscalingPolicyName - * A fully-qualified path representing project_location_autoscaling_policy resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { - return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).location; - } - - /** - * Parse the autoscaling_policy from ProjectLocationAutoscalingPolicy resource. - * - * @param {string} projectLocationAutoscalingPolicyName - * A fully-qualified path representing project_location_autoscaling_policy resource. - * @returns {string} A string representing the autoscaling_policy. - */ - matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { - return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).autoscaling_policy; - } - - /** - * Return a fully-qualified projectLocationWorkflowTemplate resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} workflow_template - * @returns {string} Resource name string. - */ - projectLocationWorkflowTemplatePath(project:string,location:string,workflowTemplate:string) { - return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render({ - project: project, - location: location, - workflow_template: workflowTemplate, - }); - } - - /** - * Parse the project from ProjectLocationWorkflowTemplate resource. - * - * @param {string} projectLocationWorkflowTemplateName - * A fully-qualified path representing project_location_workflow_template resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { - return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).project; - } - - /** - * Parse the location from ProjectLocationWorkflowTemplate resource. - * - * @param {string} projectLocationWorkflowTemplateName - * A fully-qualified path representing project_location_workflow_template resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { - return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).location; - } - - /** - * Parse the workflow_template from ProjectLocationWorkflowTemplate resource. - * - * @param {string} projectLocationWorkflowTemplateName - * A fully-qualified path representing project_location_workflow_template resource. - * @returns {string} A string representing the workflow_template. - */ - matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { - return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).workflow_template; - } - - /** - * Return a fully-qualified projectRegionAutoscalingPolicy resource name string. - * - * @param {string} project - * @param {string} region - * @param {string} autoscaling_policy - * @returns {string} Resource name string. - */ - projectRegionAutoscalingPolicyPath(project:string,region:string,autoscalingPolicy:string) { - return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render({ - project: project, - region: region, - autoscaling_policy: autoscalingPolicy, - }); - } - - /** - * Parse the project from ProjectRegionAutoscalingPolicy resource. - * - * @param {string} projectRegionAutoscalingPolicyName - * A fully-qualified path representing project_region_autoscaling_policy resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { - return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).project; - } - - /** - * Parse the region from ProjectRegionAutoscalingPolicy resource. - * - * @param {string} projectRegionAutoscalingPolicyName - * A fully-qualified path representing project_region_autoscaling_policy resource. - * @returns {string} A string representing the region. - */ - matchRegionFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { - return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).region; - } - - /** - * Parse the autoscaling_policy from ProjectRegionAutoscalingPolicy resource. - * - * @param {string} projectRegionAutoscalingPolicyName - * A fully-qualified path representing project_region_autoscaling_policy resource. - * @returns {string} A string representing the autoscaling_policy. - */ - matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { - return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).autoscaling_policy; - } - - /** - * Return a fully-qualified projectRegionWorkflowTemplate resource name string. - * - * @param {string} project - * @param {string} region - * @param {string} workflow_template - * @returns {string} Resource name string. - */ - projectRegionWorkflowTemplatePath(project:string,region:string,workflowTemplate:string) { - return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render({ - project: project, - region: region, - workflow_template: workflowTemplate, - }); - } - - /** - * Parse the project from ProjectRegionWorkflowTemplate resource. - * - * @param {string} projectRegionWorkflowTemplateName - * A fully-qualified path representing project_region_workflow_template resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { - return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).project; - } - - /** - * Parse the region from ProjectRegionWorkflowTemplate resource. - * - * @param {string} projectRegionWorkflowTemplateName - * A fully-qualified path representing project_region_workflow_template resource. - * @returns {string} A string representing the region. - */ - matchRegionFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { - return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).region; - } - - /** - * Parse the workflow_template from ProjectRegionWorkflowTemplate resource. - * - * @param {string} projectRegionWorkflowTemplateName - * A fully-qualified path representing project_region_workflow_template resource. - * @returns {string} A string representing the workflow_template. - */ - matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { - return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).workflow_template; - } - - /** - * Return a fully-qualified session resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} session - * @returns {string} Resource name string. - */ - sessionPath(project:string,location:string,session:string) { - return this.pathTemplates.sessionPathTemplate.render({ - project: project, - location: location, - session: session, - }); - } - - /** - * Parse the project from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).project; - } - - /** - * Parse the location from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).location; - } - - /** - * Parse the session from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the session. - */ - matchSessionFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).session; - } - - /** - * Return a fully-qualified sessionTemplate resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} template - * @returns {string} Resource name string. - */ - sessionTemplatePath(project:string,location:string,template:string) { - return this.pathTemplates.sessionTemplatePathTemplate.render({ - project: project, - location: location, - template: template, - }); - } - - /** - * Parse the project from SessionTemplate resource. - * - * @param {string} sessionTemplateName - * A fully-qualified path representing SessionTemplate resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSessionTemplateName(sessionTemplateName: string) { - return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).project; - } - - /** - * Parse the location from SessionTemplate resource. - * - * @param {string} sessionTemplateName - * A fully-qualified path representing SessionTemplate resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSessionTemplateName(sessionTemplateName: string) { - return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).location; - } - - /** - * Parse the template from SessionTemplate resource. - * - * @param {string} sessionTemplateName - * A fully-qualified path representing SessionTemplate resource. - * @returns {string} A string representing the template. - */ - matchTemplateFromSessionTemplateName(sessionTemplateName: string) { - return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).template; - } - - /** - * 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.batchControllerStub && !this._terminated) { - return this.batchControllerStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.iamClient.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-dataproc/src/v1/batch_controller_client_config.json b/owl-bot-staging/google-cloud-dataproc/src/v1/batch_controller_client_config.json deleted file mode 100644 index a451087cbb21..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/src/v1/batch_controller_client_config.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "interfaces": { - "google.cloud.dataproc.v1.BatchController": { - "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": { - "CreateBatch": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetBatch": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListBatches": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteBatch": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/batch_controller_proto_list.json b/owl-bot-staging/google-cloud-dataproc/src/v1/batch_controller_proto_list.json deleted file mode 100644 index d6798f50ae7c..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/src/v1/batch_controller_proto_list.json +++ /dev/null @@ -1,12 +0,0 @@ -[ - "../../protos/google/cloud/dataproc/v1/autoscaling_policies.proto", - "../../protos/google/cloud/dataproc/v1/batches.proto", - "../../protos/google/cloud/dataproc/v1/clusters.proto", - "../../protos/google/cloud/dataproc/v1/jobs.proto", - "../../protos/google/cloud/dataproc/v1/node_groups.proto", - "../../protos/google/cloud/dataproc/v1/operations.proto", - "../../protos/google/cloud/dataproc/v1/session_templates.proto", - "../../protos/google/cloud/dataproc/v1/sessions.proto", - "../../protos/google/cloud/dataproc/v1/shared.proto", - "../../protos/google/cloud/dataproc/v1/workflow_templates.proto" -] diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/cluster_controller_client.ts b/owl-bot-staging/google-cloud-dataproc/src/v1/cluster_controller_client.ts deleted file mode 100644 index 5427df49e68c..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/src/v1/cluster_controller_client.ts +++ /dev/null @@ -1,2563 +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, IamClient, IamProtos} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v1/cluster_controller_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './cluster_controller_client_config.json'; -const version = require('../../../package.json').version; - -/** - * The ClusterControllerService provides methods to manage clusters - * of Compute Engine instances. - * @class - * @memberof v1 - */ -export class ClusterControllerClient { - 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('dataproc'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - iamClient: IamClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - clusterControllerStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of ClusterControllerClient. - * - * @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 ClusterControllerClient({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 ClusterControllerClient; - 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 = 'dataproc.' + 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.iamClient = new this._gaxModule.IamClient(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 = { - batchPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batches/{batch}' - ), - cryptoKeyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}' - ), - nodeGroupPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{node_group}' - ), - projectLocationAutoscalingPolicyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/autoscalingPolicies/{autoscaling_policy}' - ), - projectLocationWorkflowTemplatePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/workflowTemplates/{workflow_template}' - ), - projectRegionAutoscalingPolicyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/regions/{region}/autoscalingPolicies/{autoscaling_policy}' - ), - projectRegionWorkflowTemplatePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/regions/{region}/workflowTemplates/{workflow_template}' - ), - servicePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/services/{service}' - ), - sessionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/sessions/{session}' - ), - sessionTemplatePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/sessionTemplates/{template}' - ), - }; - - // 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 = { - listClusters: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'clusters') - }; - - 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.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1/{resource=projects/*/regions/*/clusters/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:getIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/regions/*/clusters/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/regions/*/clusters/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:testIamPermissions',body: '*',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/regions/*/operations/*}:cancel',additional_bindings: [{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/regions/*/operations/*}',additional_bindings: [{delete: '/v1/{name=projects/*/locations/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/regions/*/operations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/regions/*/operations}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*/operations}',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const createClusterResponse = protoFilesRoot.lookup( - '.google.cloud.dataproc.v1.Cluster') as gax.protobuf.Type; - const createClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.dataproc.v1.ClusterOperationMetadata') as gax.protobuf.Type; - const updateClusterResponse = protoFilesRoot.lookup( - '.google.cloud.dataproc.v1.Cluster') as gax.protobuf.Type; - const updateClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.dataproc.v1.ClusterOperationMetadata') as gax.protobuf.Type; - const stopClusterResponse = protoFilesRoot.lookup( - '.google.cloud.dataproc.v1.Cluster') as gax.protobuf.Type; - const stopClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.dataproc.v1.ClusterOperationMetadata') as gax.protobuf.Type; - const startClusterResponse = protoFilesRoot.lookup( - '.google.cloud.dataproc.v1.Cluster') as gax.protobuf.Type; - const startClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.dataproc.v1.ClusterOperationMetadata') as gax.protobuf.Type; - const deleteClusterResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.dataproc.v1.ClusterOperationMetadata') as gax.protobuf.Type; - const diagnoseClusterResponse = protoFilesRoot.lookup( - '.google.cloud.dataproc.v1.DiagnoseClusterResults') as gax.protobuf.Type; - const diagnoseClusterMetadata = protoFilesRoot.lookup( - '.google.cloud.dataproc.v1.ClusterOperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createClusterResponse.decode.bind(createClusterResponse), - createClusterMetadata.decode.bind(createClusterMetadata)), - updateCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateClusterResponse.decode.bind(updateClusterResponse), - updateClusterMetadata.decode.bind(updateClusterMetadata)), - stopCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - stopClusterResponse.decode.bind(stopClusterResponse), - stopClusterMetadata.decode.bind(stopClusterMetadata)), - startCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - startClusterResponse.decode.bind(startClusterResponse), - startClusterMetadata.decode.bind(startClusterMetadata)), - deleteCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteClusterResponse.decode.bind(deleteClusterResponse), - deleteClusterMetadata.decode.bind(deleteClusterMetadata)), - diagnoseCluster: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - diagnoseClusterResponse.decode.bind(diagnoseClusterResponse), - diagnoseClusterMetadata.decode.bind(diagnoseClusterMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.dataproc.v1.ClusterController', 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.clusterControllerStub) { - return this.clusterControllerStub; - } - - // Put together the "service stub" for - // google.cloud.dataproc.v1.ClusterController. - this.clusterControllerStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.dataproc.v1.ClusterController') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.dataproc.v1.ClusterController, - 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 clusterControllerStubMethods = - ['createCluster', 'updateCluster', 'stopCluster', 'startCluster', 'deleteCluster', 'getCluster', 'listClusters', 'diagnoseCluster']; - for (const methodName of clusterControllerStubMethods) { - const callPromise = this.clusterControllerStub.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.clusterControllerStub; - } - - /** - * 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 'dataproc.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 'dataproc.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 the resource representation for a cluster in a project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The ID of the Google Cloud Platform project that the cluster - * belongs to. - * @param {string} request.region - * Required. The Dataproc region in which to handle the request. - * @param {string} request.clusterName - * Required. The cluster 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.dataproc.v1.Cluster|Cluster}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/cluster_controller.get_cluster.js - * region_tag:dataproc_v1_generated_ClusterController_GetCluster_async - */ - getCluster( - request?: protos.google.cloud.dataproc.v1.IGetClusterRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataproc.v1.ICluster, - protos.google.cloud.dataproc.v1.IGetClusterRequest|undefined, {}|undefined - ]>; - getCluster( - request: protos.google.cloud.dataproc.v1.IGetClusterRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataproc.v1.ICluster, - protos.google.cloud.dataproc.v1.IGetClusterRequest|null|undefined, - {}|null|undefined>): void; - getCluster( - request: protos.google.cloud.dataproc.v1.IGetClusterRequest, - callback: Callback< - protos.google.cloud.dataproc.v1.ICluster, - protos.google.cloud.dataproc.v1.IGetClusterRequest|null|undefined, - {}|null|undefined>): void; - getCluster( - request?: protos.google.cloud.dataproc.v1.IGetClusterRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataproc.v1.ICluster, - protos.google.cloud.dataproc.v1.IGetClusterRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataproc.v1.ICluster, - protos.google.cloud.dataproc.v1.IGetClusterRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataproc.v1.ICluster, - protos.google.cloud.dataproc.v1.IGetClusterRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'project_id': request.projectId?.toString() ?? '', - 'region': request.region ?? '', - 'cluster_name': request.clusterName ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getCluster request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.dataproc.v1.ICluster, - protos.google.cloud.dataproc.v1.IGetClusterRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getCluster response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getCluster(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.dataproc.v1.ICluster, - protos.google.cloud.dataproc.v1.IGetClusterRequest|undefined, - {}|undefined - ]) => { - this._log.info('getCluster 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 cluster in a project. The returned - * {@link protos.google.longrunning.Operation.metadata|Operation.metadata} will be - * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The ID of the Google Cloud Platform project that the cluster - * belongs to. - * @param {string} request.region - * Required. The Dataproc region in which to handle the request. - * @param {google.cloud.dataproc.v1.Cluster} request.cluster - * Required. The cluster to create. - * @param {string} [request.requestId] - * Optional. A unique ID used to identify the request. If the server receives - * two - * [CreateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateClusterRequest)s - * with the same id, then the second request will be ignored and the - * first {@link protos.google.longrunning.Operation|google.longrunning.Operation} created - * and stored in the backend is returned. - * - * It is recommended to always set this value to a - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - * - * The ID must contain only letters (a-z, A-Z), numbers (0-9), - * underscores (_), and hyphens (-). The maximum length is 40 characters. - * @param {google.cloud.dataproc.v1.FailureAction} [request.actionOnFailedPrimaryWorkers] - * Optional. Failure action when primary worker creation fails. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/cluster_controller.create_cluster.js - * region_tag:dataproc_v1_generated_ClusterController_CreateCluster_async - */ - createCluster( - request?: protos.google.cloud.dataproc.v1.ICreateClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createCluster( - request: protos.google.cloud.dataproc.v1.ICreateClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createCluster( - request: protos.google.cloud.dataproc.v1.ICreateClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createCluster( - request?: protos.google.cloud.dataproc.v1.ICreateClusterRequest, - 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({ - 'project_id': request.projectId?.toString() ?? '', - 'region': request.region ?? '', - }); - 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('createCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createCluster request %j', request); - return this.innerApiCalls.createCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/cluster_controller.create_cluster.js - * region_tag:dataproc_v1_generated_ClusterController_CreateCluster_async - */ - async checkCreateClusterProgress(name: string): Promise>{ - this._log.info('createCluster 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.createCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates a cluster in a project. The returned - * {@link protos.google.longrunning.Operation.metadata|Operation.metadata} will be - * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). - * The cluster must be in a - * {@link protos.google.cloud.dataproc.v1.ClusterStatus.State|`RUNNING`} state or an error - * is returned. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The ID of the Google Cloud Platform project the - * cluster belongs to. - * @param {string} request.region - * Required. The Dataproc region in which to handle the request. - * @param {string} request.clusterName - * Required. The cluster name. - * @param {google.cloud.dataproc.v1.Cluster} request.cluster - * Required. The changes to the cluster. - * @param {google.protobuf.Duration} [request.gracefulDecommissionTimeout] - * Optional. Timeout for graceful YARN decommissioning. Graceful - * decommissioning allows removing nodes from the cluster without - * interrupting jobs in progress. Timeout specifies how long to wait for jobs - * in progress to finish before forcefully removing nodes (and potentially - * interrupting jobs). Default timeout is 0 (for forceful decommission), and - * the maximum allowed timeout is 1 day. (see JSON representation of - * [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). - * - * Only supported on Dataproc image versions 1.2 and higher. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Specifies the path, relative to `Cluster`, of - * the field to update. For example, to change the number of workers - * in a cluster to 5, the `update_mask` parameter would be - * specified as `config.worker_config.num_instances`, - * and the `PATCH` request body would specify the new value, as follows: - * - * { - * "config":{ - * "workerConfig":{ - * "numInstances":"5" - * } - * } - * } - * Similarly, to change the number of preemptible workers in a cluster to 5, - * the `update_mask` parameter would be - * `config.secondary_worker_config.num_instances`, and the `PATCH` request - * body would be set as follows: - * - * { - * "config":{ - * "secondaryWorkerConfig":{ - * "numInstances":"5" - * } - * } - * } - * Note: Currently, only the following fields can be updated: - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
MaskPurpose
labelsUpdate labels
config.worker_config.num_instancesResize primary worker group
config.secondary_worker_config.num_instancesResize secondary worker group
config.autoscaling_config.policy_uriUse, stop using, or - * change autoscaling policies
- * @param {string} [request.requestId] - * Optional. A unique ID used to identify the request. If the server - * receives two - * [UpdateClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.UpdateClusterRequest)s - * with the same id, then the second request will be ignored and the - * first {@link protos.google.longrunning.Operation|google.longrunning.Operation} created - * and stored in the backend is returned. - * - * It is recommended to always set this value to a - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - * - * The ID must contain only letters (a-z, A-Z), numbers (0-9), - * underscores (_), and hyphens (-). The maximum length is 40 characters. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/cluster_controller.update_cluster.js - * region_tag:dataproc_v1_generated_ClusterController_UpdateCluster_async - */ - updateCluster( - request?: protos.google.cloud.dataproc.v1.IUpdateClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateCluster( - request: protos.google.cloud.dataproc.v1.IUpdateClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateCluster( - request: protos.google.cloud.dataproc.v1.IUpdateClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateCluster( - request?: protos.google.cloud.dataproc.v1.IUpdateClusterRequest, - 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({ - 'project_id': request.projectId?.toString() ?? '', - 'region': request.region ?? '', - 'cluster_name': request.clusterName ?? '', - }); - 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('updateCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('updateCluster request %j', request); - return this.innerApiCalls.updateCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('updateCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `updateCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/cluster_controller.update_cluster.js - * region_tag:dataproc_v1_generated_ClusterController_UpdateCluster_async - */ - async checkUpdateClusterProgress(name: string): Promise>{ - this._log.info('updateCluster 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.updateCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Stops a cluster in a project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The ID of the Google Cloud Platform project the - * cluster belongs to. - * @param {string} request.region - * Required. The Dataproc region in which to handle the request. - * @param {string} request.clusterName - * Required. The cluster name. - * @param {string} [request.clusterUuid] - * Optional. Specifying the `cluster_uuid` means the RPC will fail - * (with error NOT_FOUND) if a cluster with the specified UUID does not exist. - * @param {string} [request.requestId] - * Optional. A unique ID used to identify the request. If the server - * receives two - * [StopClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StopClusterRequest)s - * with the same id, then the second request will be ignored and the - * first {@link protos.google.longrunning.Operation|google.longrunning.Operation} created - * and stored in the backend is returned. - * - * Recommendation: Set this value to a - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - * - * The ID must contain only letters (a-z, A-Z), numbers (0-9), - * underscores (_), and hyphens (-). The maximum length is 40 characters. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/cluster_controller.stop_cluster.js - * region_tag:dataproc_v1_generated_ClusterController_StopCluster_async - */ - stopCluster( - request?: protos.google.cloud.dataproc.v1.IStopClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - stopCluster( - request: protos.google.cloud.dataproc.v1.IStopClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - stopCluster( - request: protos.google.cloud.dataproc.v1.IStopClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - stopCluster( - request?: protos.google.cloud.dataproc.v1.IStopClusterRequest, - 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({ - 'project_id': request.projectId?.toString() ?? '', - 'region': request.region ?? '', - 'cluster_name': request.clusterName ?? '', - }); - 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('stopCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('stopCluster request %j', request); - return this.innerApiCalls.stopCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('stopCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `stopCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/cluster_controller.stop_cluster.js - * region_tag:dataproc_v1_generated_ClusterController_StopCluster_async - */ - async checkStopClusterProgress(name: string): Promise>{ - this._log.info('stopCluster 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.stopCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Starts a cluster in a project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The ID of the Google Cloud Platform project the - * cluster belongs to. - * @param {string} request.region - * Required. The Dataproc region in which to handle the request. - * @param {string} request.clusterName - * Required. The cluster name. - * @param {string} [request.clusterUuid] - * Optional. Specifying the `cluster_uuid` means the RPC will fail - * (with error NOT_FOUND) if a cluster with the specified UUID does not exist. - * @param {string} [request.requestId] - * Optional. A unique ID used to identify the request. If the server - * receives two - * [StartClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StartClusterRequest)s - * with the same id, then the second request will be ignored and the - * first {@link protos.google.longrunning.Operation|google.longrunning.Operation} created - * and stored in the backend is returned. - * - * Recommendation: Set this value to a - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - * - * The ID must contain only letters (a-z, A-Z), numbers (0-9), - * underscores (_), and hyphens (-). The maximum length is 40 characters. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/cluster_controller.start_cluster.js - * region_tag:dataproc_v1_generated_ClusterController_StartCluster_async - */ - startCluster( - request?: protos.google.cloud.dataproc.v1.IStartClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - startCluster( - request: protos.google.cloud.dataproc.v1.IStartClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - startCluster( - request: protos.google.cloud.dataproc.v1.IStartClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - startCluster( - request?: protos.google.cloud.dataproc.v1.IStartClusterRequest, - 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({ - 'project_id': request.projectId?.toString() ?? '', - 'region': request.region ?? '', - 'cluster_name': request.clusterName ?? '', - }); - 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('startCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('startCluster request %j', request); - return this.innerApiCalls.startCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('startCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `startCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/cluster_controller.start_cluster.js - * region_tag:dataproc_v1_generated_ClusterController_StartCluster_async - */ - async checkStartClusterProgress(name: string): Promise>{ - this._log.info('startCluster 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.startCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a cluster in a project. The returned - * {@link protos.google.longrunning.Operation.metadata|Operation.metadata} will be - * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The ID of the Google Cloud Platform project that the cluster - * belongs to. - * @param {string} request.region - * Required. The Dataproc region in which to handle the request. - * @param {string} request.clusterName - * Required. The cluster name. - * @param {string} [request.clusterUuid] - * Optional. Specifying the `cluster_uuid` means the RPC should fail - * (with error NOT_FOUND) if cluster with specified UUID does not exist. - * @param {string} [request.requestId] - * Optional. A unique ID used to identify the request. If the server - * receives two - * [DeleteClusterRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteClusterRequest)s - * with the same id, then the second request will be ignored and the - * first {@link protos.google.longrunning.Operation|google.longrunning.Operation} created - * and stored in the backend is returned. - * - * It is recommended to always set this value to a - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - * - * The ID must contain only letters (a-z, A-Z), numbers (0-9), - * underscores (_), and hyphens (-). The maximum length is 40 characters. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/cluster_controller.delete_cluster.js - * region_tag:dataproc_v1_generated_ClusterController_DeleteCluster_async - */ - deleteCluster( - request?: protos.google.cloud.dataproc.v1.IDeleteClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteCluster( - request: protos.google.cloud.dataproc.v1.IDeleteClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteCluster( - request: protos.google.cloud.dataproc.v1.IDeleteClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteCluster( - request?: protos.google.cloud.dataproc.v1.IDeleteClusterRequest, - 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({ - 'project_id': request.projectId?.toString() ?? '', - 'region': request.region ?? '', - 'cluster_name': request.clusterName ?? '', - }); - 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('deleteCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deleteCluster request %j', request); - return this.innerApiCalls.deleteCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('deleteCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `deleteCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/cluster_controller.delete_cluster.js - * region_tag:dataproc_v1_generated_ClusterController_DeleteCluster_async - */ - async checkDeleteClusterProgress(name: string): Promise>{ - this._log.info('deleteCluster 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.deleteCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Gets cluster diagnostic information. The returned - * {@link protos.google.longrunning.Operation.metadata|Operation.metadata} will be - * [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). - * After the operation completes, - * {@link protos.google.longrunning.Operation.response|Operation.response} - * contains - * [DiagnoseClusterResults](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The ID of the Google Cloud Platform project that the cluster - * belongs to. - * @param {string} request.region - * Required. The Dataproc region in which to handle the request. - * @param {string} request.clusterName - * Required. The cluster name. - * @param {string} [request.tarballGcsDir] - * Optional. (Optional) The output Cloud Storage directory for the diagnostic - * tarball. If not specified, a task-specific directory in the cluster's - * staging bucket will be used. - * @param {google.cloud.dataproc.v1.DiagnoseClusterRequest.TarballAccess} [request.tarballAccess] - * Optional. (Optional) The access type to the diagnostic tarball. If not - * specified, falls back to default access of the bucket - * @param {google.type.Interval} [request.diagnosisInterval] - * Optional. Time interval in which diagnosis should be carried out on the - * cluster. - * @param {string[]} [request.jobs] - * Optional. Specifies a list of jobs on which diagnosis is to be performed. - * Format: projects/{project}/regions/{region}/jobs/{job} - * @param {string[]} [request.yarnApplicationIds] - * Optional. Specifies a list of yarn applications on which diagnosis is to be - * performed. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/cluster_controller.diagnose_cluster.js - * region_tag:dataproc_v1_generated_ClusterController_DiagnoseCluster_async - */ - diagnoseCluster( - request?: protos.google.cloud.dataproc.v1.IDiagnoseClusterRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - diagnoseCluster( - request: protos.google.cloud.dataproc.v1.IDiagnoseClusterRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - diagnoseCluster( - request: protos.google.cloud.dataproc.v1.IDiagnoseClusterRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - diagnoseCluster( - request?: protos.google.cloud.dataproc.v1.IDiagnoseClusterRequest, - 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({ - 'project_id': request.projectId?.toString() ?? '', - 'region': request.region ?? '', - 'cluster_name': request.clusterName ?? '', - }); - 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('diagnoseCluster response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('diagnoseCluster request %j', request); - return this.innerApiCalls.diagnoseCluster(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('diagnoseCluster response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `diagnoseCluster()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/cluster_controller.diagnose_cluster.js - * region_tag:dataproc_v1_generated_ClusterController_DiagnoseCluster_async - */ - async checkDiagnoseClusterProgress(name: string): Promise>{ - this._log.info('diagnoseCluster 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.diagnoseCluster, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists all regions/{region}/clusters in a project alphabetically. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The ID of the Google Cloud Platform project that the cluster - * belongs to. - * @param {string} request.region - * Required. The Dataproc region in which to handle the request. - * @param {string} [request.filter] - * Optional. A filter constraining the clusters to list. Filters are - * case-sensitive and have the following syntax: - * - * field = value [AND [field = value]] ... - * - * where **field** is one of `status.state`, `clusterName`, or `labels.[KEY]`, - * and `[KEY]` is a label key. **value** can be `*` to match all values. - * `status.state` can be one of the following: `ACTIVE`, `INACTIVE`, - * `CREATING`, `RUNNING`, `ERROR`, `DELETING`, `UPDATING`, `STOPPING`, or - * `STOPPED`. `ACTIVE` contains the `CREATING`, `UPDATING`, and `RUNNING` - * states. `INACTIVE` contains the `DELETING`, `ERROR`, `STOPPING`, and - * `STOPPED` states. `clusterName` is the name of the cluster provided at - * creation time. Only the logical `AND` operator is supported; - * space-separated items are treated as having an implicit `AND` operator. - * - * Example filter: - * - * status.state = ACTIVE AND clusterName = mycluster - * AND labels.env = staging AND labels.starred = * - * @param {number} [request.pageSize] - * Optional. The standard List page size. - * @param {string} [request.pageToken] - * Optional. 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 {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.dataproc.v1.Cluster|Cluster}. - * 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 `listClustersAsync()` - * 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. - */ - listClusters( - request?: protos.google.cloud.dataproc.v1.IListClustersRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataproc.v1.ICluster[], - protos.google.cloud.dataproc.v1.IListClustersRequest|null, - protos.google.cloud.dataproc.v1.IListClustersResponse - ]>; - listClusters( - request: protos.google.cloud.dataproc.v1.IListClustersRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dataproc.v1.IListClustersRequest, - protos.google.cloud.dataproc.v1.IListClustersResponse|null|undefined, - protos.google.cloud.dataproc.v1.ICluster>): void; - listClusters( - request: protos.google.cloud.dataproc.v1.IListClustersRequest, - callback: PaginationCallback< - protos.google.cloud.dataproc.v1.IListClustersRequest, - protos.google.cloud.dataproc.v1.IListClustersResponse|null|undefined, - protos.google.cloud.dataproc.v1.ICluster>): void; - listClusters( - request?: protos.google.cloud.dataproc.v1.IListClustersRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.dataproc.v1.IListClustersRequest, - protos.google.cloud.dataproc.v1.IListClustersResponse|null|undefined, - protos.google.cloud.dataproc.v1.ICluster>, - callback?: PaginationCallback< - protos.google.cloud.dataproc.v1.IListClustersRequest, - protos.google.cloud.dataproc.v1.IListClustersResponse|null|undefined, - protos.google.cloud.dataproc.v1.ICluster>): - Promise<[ - protos.google.cloud.dataproc.v1.ICluster[], - protos.google.cloud.dataproc.v1.IListClustersRequest|null, - protos.google.cloud.dataproc.v1.IListClustersResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'project_id': request.projectId?.toString() ?? '', - 'region': request.region ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.dataproc.v1.IListClustersRequest, - protos.google.cloud.dataproc.v1.IListClustersResponse|null|undefined, - protos.google.cloud.dataproc.v1.ICluster>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listClusters values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listClusters request %j', request); - return this.innerApiCalls - .listClusters(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.dataproc.v1.ICluster[], - protos.google.cloud.dataproc.v1.IListClustersRequest|null, - protos.google.cloud.dataproc.v1.IListClustersResponse - ]) => { - this._log.info('listClusters values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listClusters`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The ID of the Google Cloud Platform project that the cluster - * belongs to. - * @param {string} request.region - * Required. The Dataproc region in which to handle the request. - * @param {string} [request.filter] - * Optional. A filter constraining the clusters to list. Filters are - * case-sensitive and have the following syntax: - * - * field = value [AND [field = value]] ... - * - * where **field** is one of `status.state`, `clusterName`, or `labels.[KEY]`, - * and `[KEY]` is a label key. **value** can be `*` to match all values. - * `status.state` can be one of the following: `ACTIVE`, `INACTIVE`, - * `CREATING`, `RUNNING`, `ERROR`, `DELETING`, `UPDATING`, `STOPPING`, or - * `STOPPED`. `ACTIVE` contains the `CREATING`, `UPDATING`, and `RUNNING` - * states. `INACTIVE` contains the `DELETING`, `ERROR`, `STOPPING`, and - * `STOPPED` states. `clusterName` is the name of the cluster provided at - * creation time. Only the logical `AND` operator is supported; - * space-separated items are treated as having an implicit `AND` operator. - * - * Example filter: - * - * status.state = ACTIVE AND clusterName = mycluster - * AND labels.env = staging AND labels.starred = * - * @param {number} [request.pageSize] - * Optional. The standard List page size. - * @param {string} [request.pageToken] - * Optional. 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 {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.dataproc.v1.Cluster|Cluster} 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 `listClustersAsync()` - * 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. - */ - listClustersStream( - request?: protos.google.cloud.dataproc.v1.IListClustersRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'project_id': request.projectId?.toString() ?? '', - 'region': request.region ?? '', - }); - const defaultCallSettings = this._defaults['listClusters']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listClusters stream %j', request); - return this.descriptors.page.listClusters.createStream( - this.innerApiCalls.listClusters as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listClusters`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The ID of the Google Cloud Platform project that the cluster - * belongs to. - * @param {string} request.region - * Required. The Dataproc region in which to handle the request. - * @param {string} [request.filter] - * Optional. A filter constraining the clusters to list. Filters are - * case-sensitive and have the following syntax: - * - * field = value [AND [field = value]] ... - * - * where **field** is one of `status.state`, `clusterName`, or `labels.[KEY]`, - * and `[KEY]` is a label key. **value** can be `*` to match all values. - * `status.state` can be one of the following: `ACTIVE`, `INACTIVE`, - * `CREATING`, `RUNNING`, `ERROR`, `DELETING`, `UPDATING`, `STOPPING`, or - * `STOPPED`. `ACTIVE` contains the `CREATING`, `UPDATING`, and `RUNNING` - * states. `INACTIVE` contains the `DELETING`, `ERROR`, `STOPPING`, and - * `STOPPED` states. `clusterName` is the name of the cluster provided at - * creation time. Only the logical `AND` operator is supported; - * space-separated items are treated as having an implicit `AND` operator. - * - * Example filter: - * - * status.state = ACTIVE AND clusterName = mycluster - * AND labels.env = staging AND labels.starred = * - * @param {number} [request.pageSize] - * Optional. The standard List page size. - * @param {string} [request.pageToken] - * Optional. 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 protos.google.cloud.dataproc.v1.Cluster|Cluster}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/cluster_controller.list_clusters.js - * region_tag:dataproc_v1_generated_ClusterController_ListClusters_async - */ - listClustersAsync( - request?: protos.google.cloud.dataproc.v1.IListClustersRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'project_id': request.projectId?.toString() ?? '', - 'region': request.region ?? '', - }); - const defaultCallSettings = this._defaults['listClusters']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listClusters iterate %j', request); - return this.descriptors.page.listClusters.asyncIterate( - this.innerApiCalls['listClusters'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @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 {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @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/interfaces/CallOptions.html | 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.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@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 batch resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch - * @returns {string} Resource name string. - */ - batchPath(project:string,location:string,batch:string) { - return this.pathTemplates.batchPathTemplate.render({ - project: project, - location: location, - batch: batch, - }); - } - - /** - * Parse the project from Batch resource. - * - * @param {string} batchName - * A fully-qualified path representing Batch resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchName(batchName: string) { - return this.pathTemplates.batchPathTemplate.match(batchName).project; - } - - /** - * Parse the location from Batch resource. - * - * @param {string} batchName - * A fully-qualified path representing Batch resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchName(batchName: string) { - return this.pathTemplates.batchPathTemplate.match(batchName).location; - } - - /** - * Parse the batch from Batch resource. - * - * @param {string} batchName - * A fully-qualified path representing Batch resource. - * @returns {string} A string representing the batch. - */ - matchBatchFromBatchName(batchName: string) { - return this.pathTemplates.batchPathTemplate.match(batchName).batch; - } - - /** - * 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 nodeGroup resource name string. - * - * @param {string} project - * @param {string} region - * @param {string} cluster - * @param {string} node_group - * @returns {string} Resource name string. - */ - nodeGroupPath(project:string,region:string,cluster:string,nodeGroup:string) { - return this.pathTemplates.nodeGroupPathTemplate.render({ - project: project, - region: region, - cluster: cluster, - node_group: nodeGroup, - }); - } - - /** - * Parse the project from NodeGroup resource. - * - * @param {string} nodeGroupName - * A fully-qualified path representing NodeGroup resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNodeGroupName(nodeGroupName: string) { - return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).project; - } - - /** - * Parse the region from NodeGroup resource. - * - * @param {string} nodeGroupName - * A fully-qualified path representing NodeGroup resource. - * @returns {string} A string representing the region. - */ - matchRegionFromNodeGroupName(nodeGroupName: string) { - return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).region; - } - - /** - * Parse the cluster from NodeGroup resource. - * - * @param {string} nodeGroupName - * A fully-qualified path representing NodeGroup resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromNodeGroupName(nodeGroupName: string) { - return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).cluster; - } - - /** - * Parse the node_group from NodeGroup resource. - * - * @param {string} nodeGroupName - * A fully-qualified path representing NodeGroup resource. - * @returns {string} A string representing the node_group. - */ - matchNodeGroupFromNodeGroupName(nodeGroupName: string) { - return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).node_group; - } - - /** - * Return a fully-qualified projectLocationAutoscalingPolicy resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} autoscaling_policy - * @returns {string} Resource name string. - */ - projectLocationAutoscalingPolicyPath(project:string,location:string,autoscalingPolicy:string) { - return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render({ - project: project, - location: location, - autoscaling_policy: autoscalingPolicy, - }); - } - - /** - * Parse the project from ProjectLocationAutoscalingPolicy resource. - * - * @param {string} projectLocationAutoscalingPolicyName - * A fully-qualified path representing project_location_autoscaling_policy resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { - return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).project; - } - - /** - * Parse the location from ProjectLocationAutoscalingPolicy resource. - * - * @param {string} projectLocationAutoscalingPolicyName - * A fully-qualified path representing project_location_autoscaling_policy resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { - return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).location; - } - - /** - * Parse the autoscaling_policy from ProjectLocationAutoscalingPolicy resource. - * - * @param {string} projectLocationAutoscalingPolicyName - * A fully-qualified path representing project_location_autoscaling_policy resource. - * @returns {string} A string representing the autoscaling_policy. - */ - matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { - return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).autoscaling_policy; - } - - /** - * Return a fully-qualified projectLocationWorkflowTemplate resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} workflow_template - * @returns {string} Resource name string. - */ - projectLocationWorkflowTemplatePath(project:string,location:string,workflowTemplate:string) { - return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render({ - project: project, - location: location, - workflow_template: workflowTemplate, - }); - } - - /** - * Parse the project from ProjectLocationWorkflowTemplate resource. - * - * @param {string} projectLocationWorkflowTemplateName - * A fully-qualified path representing project_location_workflow_template resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { - return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).project; - } - - /** - * Parse the location from ProjectLocationWorkflowTemplate resource. - * - * @param {string} projectLocationWorkflowTemplateName - * A fully-qualified path representing project_location_workflow_template resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { - return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).location; - } - - /** - * Parse the workflow_template from ProjectLocationWorkflowTemplate resource. - * - * @param {string} projectLocationWorkflowTemplateName - * A fully-qualified path representing project_location_workflow_template resource. - * @returns {string} A string representing the workflow_template. - */ - matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { - return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).workflow_template; - } - - /** - * Return a fully-qualified projectRegionAutoscalingPolicy resource name string. - * - * @param {string} project - * @param {string} region - * @param {string} autoscaling_policy - * @returns {string} Resource name string. - */ - projectRegionAutoscalingPolicyPath(project:string,region:string,autoscalingPolicy:string) { - return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render({ - project: project, - region: region, - autoscaling_policy: autoscalingPolicy, - }); - } - - /** - * Parse the project from ProjectRegionAutoscalingPolicy resource. - * - * @param {string} projectRegionAutoscalingPolicyName - * A fully-qualified path representing project_region_autoscaling_policy resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { - return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).project; - } - - /** - * Parse the region from ProjectRegionAutoscalingPolicy resource. - * - * @param {string} projectRegionAutoscalingPolicyName - * A fully-qualified path representing project_region_autoscaling_policy resource. - * @returns {string} A string representing the region. - */ - matchRegionFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { - return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).region; - } - - /** - * Parse the autoscaling_policy from ProjectRegionAutoscalingPolicy resource. - * - * @param {string} projectRegionAutoscalingPolicyName - * A fully-qualified path representing project_region_autoscaling_policy resource. - * @returns {string} A string representing the autoscaling_policy. - */ - matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { - return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).autoscaling_policy; - } - - /** - * Return a fully-qualified projectRegionWorkflowTemplate resource name string. - * - * @param {string} project - * @param {string} region - * @param {string} workflow_template - * @returns {string} Resource name string. - */ - projectRegionWorkflowTemplatePath(project:string,region:string,workflowTemplate:string) { - return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render({ - project: project, - region: region, - workflow_template: workflowTemplate, - }); - } - - /** - * Parse the project from ProjectRegionWorkflowTemplate resource. - * - * @param {string} projectRegionWorkflowTemplateName - * A fully-qualified path representing project_region_workflow_template resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { - return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).project; - } - - /** - * Parse the region from ProjectRegionWorkflowTemplate resource. - * - * @param {string} projectRegionWorkflowTemplateName - * A fully-qualified path representing project_region_workflow_template resource. - * @returns {string} A string representing the region. - */ - matchRegionFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { - return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).region; - } - - /** - * Parse the workflow_template from ProjectRegionWorkflowTemplate resource. - * - * @param {string} projectRegionWorkflowTemplateName - * A fully-qualified path representing project_region_workflow_template resource. - * @returns {string} A string representing the workflow_template. - */ - matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { - return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).workflow_template; - } - - /** - * 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 session resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} session - * @returns {string} Resource name string. - */ - sessionPath(project:string,location:string,session:string) { - return this.pathTemplates.sessionPathTemplate.render({ - project: project, - location: location, - session: session, - }); - } - - /** - * Parse the project from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).project; - } - - /** - * Parse the location from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).location; - } - - /** - * Parse the session from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the session. - */ - matchSessionFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).session; - } - - /** - * Return a fully-qualified sessionTemplate resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} template - * @returns {string} Resource name string. - */ - sessionTemplatePath(project:string,location:string,template:string) { - return this.pathTemplates.sessionTemplatePathTemplate.render({ - project: project, - location: location, - template: template, - }); - } - - /** - * Parse the project from SessionTemplate resource. - * - * @param {string} sessionTemplateName - * A fully-qualified path representing SessionTemplate resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSessionTemplateName(sessionTemplateName: string) { - return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).project; - } - - /** - * Parse the location from SessionTemplate resource. - * - * @param {string} sessionTemplateName - * A fully-qualified path representing SessionTemplate resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSessionTemplateName(sessionTemplateName: string) { - return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).location; - } - - /** - * Parse the template from SessionTemplate resource. - * - * @param {string} sessionTemplateName - * A fully-qualified path representing SessionTemplate resource. - * @returns {string} A string representing the template. - */ - matchTemplateFromSessionTemplateName(sessionTemplateName: string) { - return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).template; - } - - /** - * 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.clusterControllerStub && !this._terminated) { - return this.clusterControllerStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.iamClient.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-dataproc/src/v1/cluster_controller_client_config.json b/owl-bot-staging/google-cloud-dataproc/src/v1/cluster_controller_client_config.json deleted file mode 100644 index 6f5f5f3dd1d9..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/src/v1/cluster_controller_client_config.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "interfaces": { - "google.cloud.dataproc.v1.ClusterController": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "unavailable": [ - "UNAVAILABLE" - ], - "deadline_exceeded_internal_unavailable": [ - "DEADLINE_EXCEEDED", - "INTERNAL", - "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": { - "CreateCluster": { - "timeout_millis": 300000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - }, - "UpdateCluster": { - "timeout_millis": 300000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - }, - "StopCluster": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "StartCluster": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteCluster": { - "timeout_millis": 300000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - }, - "GetCluster": { - "timeout_millis": 300000, - "retry_codes_name": "deadline_exceeded_internal_unavailable", - "retry_params_name": "default" - }, - "ListClusters": { - "timeout_millis": 300000, - "retry_codes_name": "deadline_exceeded_internal_unavailable", - "retry_params_name": "default" - }, - "DiagnoseCluster": { - "timeout_millis": 300000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/cluster_controller_proto_list.json b/owl-bot-staging/google-cloud-dataproc/src/v1/cluster_controller_proto_list.json deleted file mode 100644 index d6798f50ae7c..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/src/v1/cluster_controller_proto_list.json +++ /dev/null @@ -1,12 +0,0 @@ -[ - "../../protos/google/cloud/dataproc/v1/autoscaling_policies.proto", - "../../protos/google/cloud/dataproc/v1/batches.proto", - "../../protos/google/cloud/dataproc/v1/clusters.proto", - "../../protos/google/cloud/dataproc/v1/jobs.proto", - "../../protos/google/cloud/dataproc/v1/node_groups.proto", - "../../protos/google/cloud/dataproc/v1/operations.proto", - "../../protos/google/cloud/dataproc/v1/session_templates.proto", - "../../protos/google/cloud/dataproc/v1/sessions.proto", - "../../protos/google/cloud/dataproc/v1/shared.proto", - "../../protos/google/cloud/dataproc/v1/workflow_templates.proto" -] diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-dataproc/src/v1/gapic_metadata.json deleted file mode 100644 index ff5385074eb9..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/src/v1/gapic_metadata.json +++ /dev/null @@ -1,589 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.dataproc.v1", - "libraryPackage": "@google-cloud/dataproc", - "services": { - "AutoscalingPolicyService": { - "clients": { - "grpc": { - "libraryClient": "AutoscalingPolicyServiceClient", - "rpcs": { - "CreateAutoscalingPolicy": { - "methods": [ - "createAutoscalingPolicy" - ] - }, - "UpdateAutoscalingPolicy": { - "methods": [ - "updateAutoscalingPolicy" - ] - }, - "GetAutoscalingPolicy": { - "methods": [ - "getAutoscalingPolicy" - ] - }, - "DeleteAutoscalingPolicy": { - "methods": [ - "deleteAutoscalingPolicy" - ] - }, - "ListAutoscalingPolicies": { - "methods": [ - "listAutoscalingPolicies", - "listAutoscalingPoliciesStream", - "listAutoscalingPoliciesAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "AutoscalingPolicyServiceClient", - "rpcs": { - "CreateAutoscalingPolicy": { - "methods": [ - "createAutoscalingPolicy" - ] - }, - "UpdateAutoscalingPolicy": { - "methods": [ - "updateAutoscalingPolicy" - ] - }, - "GetAutoscalingPolicy": { - "methods": [ - "getAutoscalingPolicy" - ] - }, - "DeleteAutoscalingPolicy": { - "methods": [ - "deleteAutoscalingPolicy" - ] - }, - "ListAutoscalingPolicies": { - "methods": [ - "listAutoscalingPolicies", - "listAutoscalingPoliciesStream", - "listAutoscalingPoliciesAsync" - ] - } - } - } - } - }, - "BatchController": { - "clients": { - "grpc": { - "libraryClient": "BatchControllerClient", - "rpcs": { - "GetBatch": { - "methods": [ - "getBatch" - ] - }, - "DeleteBatch": { - "methods": [ - "deleteBatch" - ] - }, - "CreateBatch": { - "methods": [ - "createBatch" - ] - }, - "ListBatches": { - "methods": [ - "listBatches", - "listBatchesStream", - "listBatchesAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "BatchControllerClient", - "rpcs": { - "GetBatch": { - "methods": [ - "getBatch" - ] - }, - "DeleteBatch": { - "methods": [ - "deleteBatch" - ] - }, - "CreateBatch": { - "methods": [ - "createBatch" - ] - }, - "ListBatches": { - "methods": [ - "listBatches", - "listBatchesStream", - "listBatchesAsync" - ] - } - } - } - } - }, - "ClusterController": { - "clients": { - "grpc": { - "libraryClient": "ClusterControllerClient", - "rpcs": { - "GetCluster": { - "methods": [ - "getCluster" - ] - }, - "CreateCluster": { - "methods": [ - "createCluster" - ] - }, - "UpdateCluster": { - "methods": [ - "updateCluster" - ] - }, - "StopCluster": { - "methods": [ - "stopCluster" - ] - }, - "StartCluster": { - "methods": [ - "startCluster" - ] - }, - "DeleteCluster": { - "methods": [ - "deleteCluster" - ] - }, - "DiagnoseCluster": { - "methods": [ - "diagnoseCluster" - ] - }, - "ListClusters": { - "methods": [ - "listClusters", - "listClustersStream", - "listClustersAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "ClusterControllerClient", - "rpcs": { - "GetCluster": { - "methods": [ - "getCluster" - ] - }, - "CreateCluster": { - "methods": [ - "createCluster" - ] - }, - "UpdateCluster": { - "methods": [ - "updateCluster" - ] - }, - "StopCluster": { - "methods": [ - "stopCluster" - ] - }, - "StartCluster": { - "methods": [ - "startCluster" - ] - }, - "DeleteCluster": { - "methods": [ - "deleteCluster" - ] - }, - "DiagnoseCluster": { - "methods": [ - "diagnoseCluster" - ] - }, - "ListClusters": { - "methods": [ - "listClusters", - "listClustersStream", - "listClustersAsync" - ] - } - } - } - } - }, - "JobController": { - "clients": { - "grpc": { - "libraryClient": "JobControllerClient", - "rpcs": { - "SubmitJob": { - "methods": [ - "submitJob" - ] - }, - "GetJob": { - "methods": [ - "getJob" - ] - }, - "UpdateJob": { - "methods": [ - "updateJob" - ] - }, - "CancelJob": { - "methods": [ - "cancelJob" - ] - }, - "DeleteJob": { - "methods": [ - "deleteJob" - ] - }, - "SubmitJobAsOperation": { - "methods": [ - "submitJobAsOperation" - ] - }, - "ListJobs": { - "methods": [ - "listJobs", - "listJobsStream", - "listJobsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "JobControllerClient", - "rpcs": { - "SubmitJob": { - "methods": [ - "submitJob" - ] - }, - "GetJob": { - "methods": [ - "getJob" - ] - }, - "UpdateJob": { - "methods": [ - "updateJob" - ] - }, - "CancelJob": { - "methods": [ - "cancelJob" - ] - }, - "DeleteJob": { - "methods": [ - "deleteJob" - ] - }, - "SubmitJobAsOperation": { - "methods": [ - "submitJobAsOperation" - ] - }, - "ListJobs": { - "methods": [ - "listJobs", - "listJobsStream", - "listJobsAsync" - ] - } - } - } - } - }, - "NodeGroupController": { - "clients": { - "grpc": { - "libraryClient": "NodeGroupControllerClient", - "rpcs": { - "GetNodeGroup": { - "methods": [ - "getNodeGroup" - ] - }, - "CreateNodeGroup": { - "methods": [ - "createNodeGroup" - ] - }, - "ResizeNodeGroup": { - "methods": [ - "resizeNodeGroup" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "NodeGroupControllerClient", - "rpcs": { - "GetNodeGroup": { - "methods": [ - "getNodeGroup" - ] - }, - "CreateNodeGroup": { - "methods": [ - "createNodeGroup" - ] - }, - "ResizeNodeGroup": { - "methods": [ - "resizeNodeGroup" - ] - } - } - } - } - }, - "SessionController": { - "clients": { - "grpc": { - "libraryClient": "SessionControllerClient", - "rpcs": { - "GetSession": { - "methods": [ - "getSession" - ] - }, - "CreateSession": { - "methods": [ - "createSession" - ] - }, - "TerminateSession": { - "methods": [ - "terminateSession" - ] - }, - "DeleteSession": { - "methods": [ - "deleteSession" - ] - }, - "ListSessions": { - "methods": [ - "listSessions", - "listSessionsStream", - "listSessionsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "SessionControllerClient", - "rpcs": { - "GetSession": { - "methods": [ - "getSession" - ] - }, - "CreateSession": { - "methods": [ - "createSession" - ] - }, - "TerminateSession": { - "methods": [ - "terminateSession" - ] - }, - "DeleteSession": { - "methods": [ - "deleteSession" - ] - }, - "ListSessions": { - "methods": [ - "listSessions", - "listSessionsStream", - "listSessionsAsync" - ] - } - } - } - } - }, - "SessionTemplateController": { - "clients": { - "grpc": { - "libraryClient": "SessionTemplateControllerClient", - "rpcs": { - "CreateSessionTemplate": { - "methods": [ - "createSessionTemplate" - ] - }, - "UpdateSessionTemplate": { - "methods": [ - "updateSessionTemplate" - ] - }, - "GetSessionTemplate": { - "methods": [ - "getSessionTemplate" - ] - }, - "DeleteSessionTemplate": { - "methods": [ - "deleteSessionTemplate" - ] - }, - "ListSessionTemplates": { - "methods": [ - "listSessionTemplates", - "listSessionTemplatesStream", - "listSessionTemplatesAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "SessionTemplateControllerClient", - "rpcs": { - "CreateSessionTemplate": { - "methods": [ - "createSessionTemplate" - ] - }, - "UpdateSessionTemplate": { - "methods": [ - "updateSessionTemplate" - ] - }, - "GetSessionTemplate": { - "methods": [ - "getSessionTemplate" - ] - }, - "DeleteSessionTemplate": { - "methods": [ - "deleteSessionTemplate" - ] - }, - "ListSessionTemplates": { - "methods": [ - "listSessionTemplates", - "listSessionTemplatesStream", - "listSessionTemplatesAsync" - ] - } - } - } - } - }, - "WorkflowTemplateService": { - "clients": { - "grpc": { - "libraryClient": "WorkflowTemplateServiceClient", - "rpcs": { - "CreateWorkflowTemplate": { - "methods": [ - "createWorkflowTemplate" - ] - }, - "GetWorkflowTemplate": { - "methods": [ - "getWorkflowTemplate" - ] - }, - "UpdateWorkflowTemplate": { - "methods": [ - "updateWorkflowTemplate" - ] - }, - "DeleteWorkflowTemplate": { - "methods": [ - "deleteWorkflowTemplate" - ] - }, - "InstantiateWorkflowTemplate": { - "methods": [ - "instantiateWorkflowTemplate" - ] - }, - "InstantiateInlineWorkflowTemplate": { - "methods": [ - "instantiateInlineWorkflowTemplate" - ] - }, - "ListWorkflowTemplates": { - "methods": [ - "listWorkflowTemplates", - "listWorkflowTemplatesStream", - "listWorkflowTemplatesAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "WorkflowTemplateServiceClient", - "rpcs": { - "CreateWorkflowTemplate": { - "methods": [ - "createWorkflowTemplate" - ] - }, - "GetWorkflowTemplate": { - "methods": [ - "getWorkflowTemplate" - ] - }, - "UpdateWorkflowTemplate": { - "methods": [ - "updateWorkflowTemplate" - ] - }, - "DeleteWorkflowTemplate": { - "methods": [ - "deleteWorkflowTemplate" - ] - }, - "InstantiateWorkflowTemplate": { - "methods": [ - "instantiateWorkflowTemplate" - ] - }, - "InstantiateInlineWorkflowTemplate": { - "methods": [ - "instantiateInlineWorkflowTemplate" - ] - }, - "ListWorkflowTemplates": { - "methods": [ - "listWorkflowTemplates", - "listWorkflowTemplatesStream", - "listWorkflowTemplatesAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/index.ts b/owl-bot-staging/google-cloud-dataproc/src/v1/index.ts deleted file mode 100644 index 1bc375b71d76..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/src/v1/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 {AutoscalingPolicyServiceClient} from './autoscaling_policy_service_client'; -export {BatchControllerClient} from './batch_controller_client'; -export {ClusterControllerClient} from './cluster_controller_client'; -export {JobControllerClient} from './job_controller_client'; -export {NodeGroupControllerClient} from './node_group_controller_client'; -export {SessionControllerClient} from './session_controller_client'; -export {SessionTemplateControllerClient} from './session_template_controller_client'; -export {WorkflowTemplateServiceClient} from './workflow_template_service_client'; diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/job_controller_client.ts b/owl-bot-staging/google-cloud-dataproc/src/v1/job_controller_client.ts deleted file mode 100644 index 75640d4b5c86..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/src/v1/job_controller_client.ts +++ /dev/null @@ -1,2119 +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, IamClient, IamProtos} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v1/job_controller_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './job_controller_client_config.json'; -const version = require('../../../package.json').version; - -/** - * The JobController provides methods to manage jobs. - * @class - * @memberof v1 - */ -export class JobControllerClient { - 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('dataproc'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - iamClient: IamClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - jobControllerStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of JobControllerClient. - * - * @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 JobControllerClient({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 JobControllerClient; - 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 = 'dataproc.' + 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.iamClient = new this._gaxModule.IamClient(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 = { - batchPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batches/{batch}' - ), - nodeGroupPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{node_group}' - ), - projectLocationAutoscalingPolicyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/autoscalingPolicies/{autoscaling_policy}' - ), - projectLocationWorkflowTemplatePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/workflowTemplates/{workflow_template}' - ), - projectRegionAutoscalingPolicyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/regions/{region}/autoscalingPolicies/{autoscaling_policy}' - ), - projectRegionWorkflowTemplatePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/regions/{region}/workflowTemplates/{workflow_template}' - ), - sessionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/sessions/{session}' - ), - sessionTemplatePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/sessionTemplates/{template}' - ), - }; - - // 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.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1/{resource=projects/*/regions/*/clusters/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:getIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/regions/*/clusters/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/regions/*/clusters/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:testIamPermissions',body: '*',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/regions/*/operations/*}:cancel',additional_bindings: [{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/regions/*/operations/*}',additional_bindings: [{delete: '/v1/{name=projects/*/locations/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/regions/*/operations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/regions/*/operations}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*/operations}',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const submitJobAsOperationResponse = protoFilesRoot.lookup( - '.google.cloud.dataproc.v1.Job') as gax.protobuf.Type; - const submitJobAsOperationMetadata = protoFilesRoot.lookup( - '.google.cloud.dataproc.v1.JobMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - submitJobAsOperation: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - submitJobAsOperationResponse.decode.bind(submitJobAsOperationResponse), - submitJobAsOperationMetadata.decode.bind(submitJobAsOperationMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.dataproc.v1.JobController', 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.jobControllerStub) { - return this.jobControllerStub; - } - - // Put together the "service stub" for - // google.cloud.dataproc.v1.JobController. - this.jobControllerStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.dataproc.v1.JobController') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.dataproc.v1.JobController, - 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 jobControllerStubMethods = - ['submitJob', 'submitJobAsOperation', 'getJob', 'listJobs', 'updateJob', 'cancelJob', 'deleteJob']; - for (const methodName of jobControllerStubMethods) { - const callPromise = this.jobControllerStub.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.jobControllerStub; - } - - /** - * 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 'dataproc.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 'dataproc.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 job to a cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The ID of the Google Cloud Platform project that the job - * belongs to. - * @param {string} request.region - * Required. The Dataproc region in which to handle the request. - * @param {google.cloud.dataproc.v1.Job} request.job - * Required. The job resource. - * @param {string} [request.requestId] - * Optional. A unique id used to identify the request. If the server - * receives two - * [SubmitJobRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.SubmitJobRequest)s - * with the same id, then the second request will be ignored and the - * first {@link protos.google.cloud.dataproc.v1.Job|Job} created and stored in the backend - * is returned. - * - * It is recommended to always set this value to a - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - * - * The id must contain only letters (a-z, A-Z), numbers (0-9), - * underscores (_), and hyphens (-). The maximum length is 40 characters. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.dataproc.v1.Job|Job}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/job_controller.submit_job.js - * region_tag:dataproc_v1_generated_JobController_SubmitJob_async - */ - submitJob( - request?: protos.google.cloud.dataproc.v1.ISubmitJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataproc.v1.IJob, - protos.google.cloud.dataproc.v1.ISubmitJobRequest|undefined, {}|undefined - ]>; - submitJob( - request: protos.google.cloud.dataproc.v1.ISubmitJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataproc.v1.IJob, - protos.google.cloud.dataproc.v1.ISubmitJobRequest|null|undefined, - {}|null|undefined>): void; - submitJob( - request: protos.google.cloud.dataproc.v1.ISubmitJobRequest, - callback: Callback< - protos.google.cloud.dataproc.v1.IJob, - protos.google.cloud.dataproc.v1.ISubmitJobRequest|null|undefined, - {}|null|undefined>): void; - submitJob( - request?: protos.google.cloud.dataproc.v1.ISubmitJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataproc.v1.IJob, - protos.google.cloud.dataproc.v1.ISubmitJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataproc.v1.IJob, - protos.google.cloud.dataproc.v1.ISubmitJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataproc.v1.IJob, - protos.google.cloud.dataproc.v1.ISubmitJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'project_id': request.projectId?.toString() ?? '', - 'region': request.region ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('submitJob request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.dataproc.v1.IJob, - protos.google.cloud.dataproc.v1.ISubmitJobRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('submitJob response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.submitJob(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.dataproc.v1.IJob, - protos.google.cloud.dataproc.v1.ISubmitJobRequest|undefined, - {}|undefined - ]) => { - this._log.info('submitJob 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 resource representation for a job in a project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The ID of the Google Cloud Platform project that the job - * belongs to. - * @param {string} request.region - * Required. The Dataproc region in which to handle the request. - * @param {string} request.jobId - * Required. The job ID. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.dataproc.v1.Job|Job}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/job_controller.get_job.js - * region_tag:dataproc_v1_generated_JobController_GetJob_async - */ - getJob( - request?: protos.google.cloud.dataproc.v1.IGetJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataproc.v1.IJob, - protos.google.cloud.dataproc.v1.IGetJobRequest|undefined, {}|undefined - ]>; - getJob( - request: protos.google.cloud.dataproc.v1.IGetJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataproc.v1.IJob, - protos.google.cloud.dataproc.v1.IGetJobRequest|null|undefined, - {}|null|undefined>): void; - getJob( - request: protos.google.cloud.dataproc.v1.IGetJobRequest, - callback: Callback< - protos.google.cloud.dataproc.v1.IJob, - protos.google.cloud.dataproc.v1.IGetJobRequest|null|undefined, - {}|null|undefined>): void; - getJob( - request?: protos.google.cloud.dataproc.v1.IGetJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataproc.v1.IJob, - protos.google.cloud.dataproc.v1.IGetJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataproc.v1.IJob, - protos.google.cloud.dataproc.v1.IGetJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataproc.v1.IJob, - protos.google.cloud.dataproc.v1.IGetJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'project_id': request.projectId?.toString() ?? '', - 'region': request.region ?? '', - 'job_id': request.jobId?.toString() ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getJob request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.dataproc.v1.IJob, - protos.google.cloud.dataproc.v1.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.dataproc.v1.IJob, - protos.google.cloud.dataproc.v1.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; - }); - } -/** - * Updates a job in a project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The ID of the Google Cloud Platform project that the job - * belongs to. - * @param {string} request.region - * Required. The Dataproc region in which to handle the request. - * @param {string} request.jobId - * Required. The job ID. - * @param {google.cloud.dataproc.v1.Job} request.job - * Required. The changes to the job. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Specifies the path, relative to Job, of - * the field to update. For example, to update the labels of a Job the - * update_mask parameter would be specified as - * labels, and the `PATCH` request body would specify the new - * value. Note: Currently, labels is the only - * field that can be updated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.dataproc.v1.Job|Job}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/job_controller.update_job.js - * region_tag:dataproc_v1_generated_JobController_UpdateJob_async - */ - updateJob( - request?: protos.google.cloud.dataproc.v1.IUpdateJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataproc.v1.IJob, - protos.google.cloud.dataproc.v1.IUpdateJobRequest|undefined, {}|undefined - ]>; - updateJob( - request: protos.google.cloud.dataproc.v1.IUpdateJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataproc.v1.IJob, - protos.google.cloud.dataproc.v1.IUpdateJobRequest|null|undefined, - {}|null|undefined>): void; - updateJob( - request: protos.google.cloud.dataproc.v1.IUpdateJobRequest, - callback: Callback< - protos.google.cloud.dataproc.v1.IJob, - protos.google.cloud.dataproc.v1.IUpdateJobRequest|null|undefined, - {}|null|undefined>): void; - updateJob( - request?: protos.google.cloud.dataproc.v1.IUpdateJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataproc.v1.IJob, - protos.google.cloud.dataproc.v1.IUpdateJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataproc.v1.IJob, - protos.google.cloud.dataproc.v1.IUpdateJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataproc.v1.IJob, - protos.google.cloud.dataproc.v1.IUpdateJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'project_id': request.projectId?.toString() ?? '', - 'region': request.region ?? '', - 'job_id': request.jobId?.toString() ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateJob request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.dataproc.v1.IJob, - protos.google.cloud.dataproc.v1.IUpdateJobRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateJob response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateJob(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.dataproc.v1.IJob, - protos.google.cloud.dataproc.v1.IUpdateJobRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateJob 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; - }); - } -/** - * Starts a job cancellation request. To access the job resource - * after cancellation, call - * [regions/{region}/jobs.list](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/list) - * or - * [regions/{region}/jobs.get](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/get). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The ID of the Google Cloud Platform project that the job - * belongs to. - * @param {string} request.region - * Required. The Dataproc region in which to handle the request. - * @param {string} request.jobId - * Required. The job ID. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.dataproc.v1.Job|Job}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/job_controller.cancel_job.js - * region_tag:dataproc_v1_generated_JobController_CancelJob_async - */ - cancelJob( - request?: protos.google.cloud.dataproc.v1.ICancelJobRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataproc.v1.IJob, - protos.google.cloud.dataproc.v1.ICancelJobRequest|undefined, {}|undefined - ]>; - cancelJob( - request: protos.google.cloud.dataproc.v1.ICancelJobRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataproc.v1.IJob, - protos.google.cloud.dataproc.v1.ICancelJobRequest|null|undefined, - {}|null|undefined>): void; - cancelJob( - request: protos.google.cloud.dataproc.v1.ICancelJobRequest, - callback: Callback< - protos.google.cloud.dataproc.v1.IJob, - protos.google.cloud.dataproc.v1.ICancelJobRequest|null|undefined, - {}|null|undefined>): void; - cancelJob( - request?: protos.google.cloud.dataproc.v1.ICancelJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataproc.v1.IJob, - protos.google.cloud.dataproc.v1.ICancelJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataproc.v1.IJob, - protos.google.cloud.dataproc.v1.ICancelJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataproc.v1.IJob, - protos.google.cloud.dataproc.v1.ICancelJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'project_id': request.projectId?.toString() ?? '', - 'region': request.region ?? '', - 'job_id': request.jobId?.toString() ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('cancelJob request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.dataproc.v1.IJob, - protos.google.cloud.dataproc.v1.ICancelJobRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('cancelJob response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.cancelJob(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.dataproc.v1.IJob, - protos.google.cloud.dataproc.v1.ICancelJobRequest|undefined, - {}|undefined - ]) => { - this._log.info('cancelJob response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Deletes the job from the project. If the job is active, the delete fails, - * and the response returns `FAILED_PRECONDITION`. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The ID of the Google Cloud Platform project that the job - * belongs to. - * @param {string} request.region - * Required. The Dataproc region in which to handle the request. - * @param {string} request.jobId - * Required. The job ID. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/job_controller.delete_job.js - * region_tag:dataproc_v1_generated_JobController_DeleteJob_async - */ - deleteJob( - request?: protos.google.cloud.dataproc.v1.IDeleteJobRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteJobRequest|undefined, {}|undefined - ]>; - deleteJob( - request: protos.google.cloud.dataproc.v1.IDeleteJobRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteJobRequest|null|undefined, - {}|null|undefined>): void; - deleteJob( - request: protos.google.cloud.dataproc.v1.IDeleteJobRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteJobRequest|null|undefined, - {}|null|undefined>): void; - deleteJob( - request?: protos.google.cloud.dataproc.v1.IDeleteJobRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteJobRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteJobRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteJobRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'project_id': request.projectId?.toString() ?? '', - 'region': request.region ?? '', - 'job_id': request.jobId?.toString() ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('deleteJob request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteJobRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteJob response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteJob(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteJobRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteJob 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; - }); - } - -/** - * Submits job to a cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The ID of the Google Cloud Platform project that the job - * belongs to. - * @param {string} request.region - * Required. The Dataproc region in which to handle the request. - * @param {google.cloud.dataproc.v1.Job} request.job - * Required. The job resource. - * @param {string} [request.requestId] - * Optional. A unique id used to identify the request. If the server - * receives two - * [SubmitJobRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.SubmitJobRequest)s - * with the same id, then the second request will be ignored and the - * first {@link protos.google.cloud.dataproc.v1.Job|Job} created and stored in the backend - * is returned. - * - * It is recommended to always set this value to a - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - * - * The id must contain only letters (a-z, A-Z), numbers (0-9), - * underscores (_), and hyphens (-). The maximum length is 40 characters. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/job_controller.submit_job_as_operation.js - * region_tag:dataproc_v1_generated_JobController_SubmitJobAsOperation_async - */ - submitJobAsOperation( - request?: protos.google.cloud.dataproc.v1.ISubmitJobRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - submitJobAsOperation( - request: protos.google.cloud.dataproc.v1.ISubmitJobRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - submitJobAsOperation( - request: protos.google.cloud.dataproc.v1.ISubmitJobRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - submitJobAsOperation( - request?: protos.google.cloud.dataproc.v1.ISubmitJobRequest, - 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({ - 'project_id': request.projectId?.toString() ?? '', - 'region': request.region ?? '', - }); - 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('submitJobAsOperation response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('submitJobAsOperation request %j', request); - return this.innerApiCalls.submitJobAsOperation(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('submitJobAsOperation response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `submitJobAsOperation()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/job_controller.submit_job_as_operation.js - * region_tag:dataproc_v1_generated_JobController_SubmitJobAsOperation_async - */ - async checkSubmitJobAsOperationProgress(name: string): Promise>{ - this._log.info('submitJobAsOperation 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.submitJobAsOperation, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists regions/{region}/jobs in a project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The ID of the Google Cloud Platform project that the job - * belongs to. - * @param {string} request.region - * Required. The Dataproc region in which to handle the request. - * @param {number} [request.pageSize] - * Optional. The number of results to return in each response. - * @param {string} [request.pageToken] - * Optional. The page token, returned by a previous call, to request the - * next page of results. - * @param {string} [request.clusterName] - * Optional. If set, the returned jobs list includes only jobs that were - * submitted to the named cluster. - * @param {google.cloud.dataproc.v1.ListJobsRequest.JobStateMatcher} [request.jobStateMatcher] - * Optional. Specifies enumerated categories of jobs to list. - * (default = match ALL jobs). - * - * If `filter` is provided, `jobStateMatcher` will be ignored. - * @param {string} [request.filter] - * Optional. A filter constraining the jobs to list. Filters are - * case-sensitive and have the following syntax: - * - * [field = value] AND [field [= value]] ... - * - * where **field** is `status.state` or `labels.[KEY]`, and `[KEY]` is a label - * key. **value** can be `*` to match all values. - * `status.state` can be either `ACTIVE` or `NON_ACTIVE`. - * Only the logical `AND` operator is supported; space-separated items are - * treated as having an implicit `AND` operator. - * - * Example filter: - * - * status.state = ACTIVE AND labels.env = staging AND labels.starred = * - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.dataproc.v1.Job|Job}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listJobsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listJobs( - request?: protos.google.cloud.dataproc.v1.IListJobsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataproc.v1.IJob[], - protos.google.cloud.dataproc.v1.IListJobsRequest|null, - protos.google.cloud.dataproc.v1.IListJobsResponse - ]>; - listJobs( - request: protos.google.cloud.dataproc.v1.IListJobsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dataproc.v1.IListJobsRequest, - protos.google.cloud.dataproc.v1.IListJobsResponse|null|undefined, - protos.google.cloud.dataproc.v1.IJob>): void; - listJobs( - request: protos.google.cloud.dataproc.v1.IListJobsRequest, - callback: PaginationCallback< - protos.google.cloud.dataproc.v1.IListJobsRequest, - protos.google.cloud.dataproc.v1.IListJobsResponse|null|undefined, - protos.google.cloud.dataproc.v1.IJob>): void; - listJobs( - request?: protos.google.cloud.dataproc.v1.IListJobsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.dataproc.v1.IListJobsRequest, - protos.google.cloud.dataproc.v1.IListJobsResponse|null|undefined, - protos.google.cloud.dataproc.v1.IJob>, - callback?: PaginationCallback< - protos.google.cloud.dataproc.v1.IListJobsRequest, - protos.google.cloud.dataproc.v1.IListJobsResponse|null|undefined, - protos.google.cloud.dataproc.v1.IJob>): - Promise<[ - protos.google.cloud.dataproc.v1.IJob[], - protos.google.cloud.dataproc.v1.IListJobsRequest|null, - protos.google.cloud.dataproc.v1.IListJobsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'project_id': request.projectId?.toString() ?? '', - 'region': request.region ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.dataproc.v1.IListJobsRequest, - protos.google.cloud.dataproc.v1.IListJobsResponse|null|undefined, - protos.google.cloud.dataproc.v1.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.dataproc.v1.IJob[], - protos.google.cloud.dataproc.v1.IListJobsRequest|null, - protos.google.cloud.dataproc.v1.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.projectId - * Required. The ID of the Google Cloud Platform project that the job - * belongs to. - * @param {string} request.region - * Required. The Dataproc region in which to handle the request. - * @param {number} [request.pageSize] - * Optional. The number of results to return in each response. - * @param {string} [request.pageToken] - * Optional. The page token, returned by a previous call, to request the - * next page of results. - * @param {string} [request.clusterName] - * Optional. If set, the returned jobs list includes only jobs that were - * submitted to the named cluster. - * @param {google.cloud.dataproc.v1.ListJobsRequest.JobStateMatcher} [request.jobStateMatcher] - * Optional. Specifies enumerated categories of jobs to list. - * (default = match ALL jobs). - * - * If `filter` is provided, `jobStateMatcher` will be ignored. - * @param {string} [request.filter] - * Optional. A filter constraining the jobs to list. Filters are - * case-sensitive and have the following syntax: - * - * [field = value] AND [field [= value]] ... - * - * where **field** is `status.state` or `labels.[KEY]`, and `[KEY]` is a label - * key. **value** can be `*` to match all values. - * `status.state` can be either `ACTIVE` or `NON_ACTIVE`. - * Only the logical `AND` operator is supported; space-separated items are - * treated as having an implicit `AND` operator. - * - * Example filter: - * - * status.state = ACTIVE AND labels.env = staging AND labels.starred = * - * @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.dataproc.v1.Job|Job} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listJobsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listJobsStream( - request?: protos.google.cloud.dataproc.v1.IListJobsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'project_id': request.projectId?.toString() ?? '', - 'region': request.region ?? '', - }); - 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.projectId - * Required. The ID of the Google Cloud Platform project that the job - * belongs to. - * @param {string} request.region - * Required. The Dataproc region in which to handle the request. - * @param {number} [request.pageSize] - * Optional. The number of results to return in each response. - * @param {string} [request.pageToken] - * Optional. The page token, returned by a previous call, to request the - * next page of results. - * @param {string} [request.clusterName] - * Optional. If set, the returned jobs list includes only jobs that were - * submitted to the named cluster. - * @param {google.cloud.dataproc.v1.ListJobsRequest.JobStateMatcher} [request.jobStateMatcher] - * Optional. Specifies enumerated categories of jobs to list. - * (default = match ALL jobs). - * - * If `filter` is provided, `jobStateMatcher` will be ignored. - * @param {string} [request.filter] - * Optional. A filter constraining the jobs to list. Filters are - * case-sensitive and have the following syntax: - * - * [field = value] AND [field [= value]] ... - * - * where **field** is `status.state` or `labels.[KEY]`, and `[KEY]` is a label - * key. **value** can be `*` to match all values. - * `status.state` can be either `ACTIVE` or `NON_ACTIVE`. - * Only the logical `AND` operator is supported; space-separated items are - * treated as having an implicit `AND` operator. - * - * Example filter: - * - * status.state = ACTIVE AND labels.env = staging AND labels.starred = * - * @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.dataproc.v1.Job|Job}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/job_controller.list_jobs.js - * region_tag:dataproc_v1_generated_JobController_ListJobs_async - */ - listJobsAsync( - request?: protos.google.cloud.dataproc.v1.IListJobsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'project_id': request.projectId?.toString() ?? '', - 'region': request.region ?? '', - }); - 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 the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @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 {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @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/interfaces/CallOptions.html | 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.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@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 batch resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch - * @returns {string} Resource name string. - */ - batchPath(project:string,location:string,batch:string) { - return this.pathTemplates.batchPathTemplate.render({ - project: project, - location: location, - batch: batch, - }); - } - - /** - * Parse the project from Batch resource. - * - * @param {string} batchName - * A fully-qualified path representing Batch resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchName(batchName: string) { - return this.pathTemplates.batchPathTemplate.match(batchName).project; - } - - /** - * Parse the location from Batch resource. - * - * @param {string} batchName - * A fully-qualified path representing Batch resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchName(batchName: string) { - return this.pathTemplates.batchPathTemplate.match(batchName).location; - } - - /** - * Parse the batch from Batch resource. - * - * @param {string} batchName - * A fully-qualified path representing Batch resource. - * @returns {string} A string representing the batch. - */ - matchBatchFromBatchName(batchName: string) { - return this.pathTemplates.batchPathTemplate.match(batchName).batch; - } - - /** - * Return a fully-qualified nodeGroup resource name string. - * - * @param {string} project - * @param {string} region - * @param {string} cluster - * @param {string} node_group - * @returns {string} Resource name string. - */ - nodeGroupPath(project:string,region:string,cluster:string,nodeGroup:string) { - return this.pathTemplates.nodeGroupPathTemplate.render({ - project: project, - region: region, - cluster: cluster, - node_group: nodeGroup, - }); - } - - /** - * Parse the project from NodeGroup resource. - * - * @param {string} nodeGroupName - * A fully-qualified path representing NodeGroup resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNodeGroupName(nodeGroupName: string) { - return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).project; - } - - /** - * Parse the region from NodeGroup resource. - * - * @param {string} nodeGroupName - * A fully-qualified path representing NodeGroup resource. - * @returns {string} A string representing the region. - */ - matchRegionFromNodeGroupName(nodeGroupName: string) { - return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).region; - } - - /** - * Parse the cluster from NodeGroup resource. - * - * @param {string} nodeGroupName - * A fully-qualified path representing NodeGroup resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromNodeGroupName(nodeGroupName: string) { - return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).cluster; - } - - /** - * Parse the node_group from NodeGroup resource. - * - * @param {string} nodeGroupName - * A fully-qualified path representing NodeGroup resource. - * @returns {string} A string representing the node_group. - */ - matchNodeGroupFromNodeGroupName(nodeGroupName: string) { - return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).node_group; - } - - /** - * Return a fully-qualified projectLocationAutoscalingPolicy resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} autoscaling_policy - * @returns {string} Resource name string. - */ - projectLocationAutoscalingPolicyPath(project:string,location:string,autoscalingPolicy:string) { - return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render({ - project: project, - location: location, - autoscaling_policy: autoscalingPolicy, - }); - } - - /** - * Parse the project from ProjectLocationAutoscalingPolicy resource. - * - * @param {string} projectLocationAutoscalingPolicyName - * A fully-qualified path representing project_location_autoscaling_policy resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { - return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).project; - } - - /** - * Parse the location from ProjectLocationAutoscalingPolicy resource. - * - * @param {string} projectLocationAutoscalingPolicyName - * A fully-qualified path representing project_location_autoscaling_policy resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { - return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).location; - } - - /** - * Parse the autoscaling_policy from ProjectLocationAutoscalingPolicy resource. - * - * @param {string} projectLocationAutoscalingPolicyName - * A fully-qualified path representing project_location_autoscaling_policy resource. - * @returns {string} A string representing the autoscaling_policy. - */ - matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { - return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).autoscaling_policy; - } - - /** - * Return a fully-qualified projectLocationWorkflowTemplate resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} workflow_template - * @returns {string} Resource name string. - */ - projectLocationWorkflowTemplatePath(project:string,location:string,workflowTemplate:string) { - return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render({ - project: project, - location: location, - workflow_template: workflowTemplate, - }); - } - - /** - * Parse the project from ProjectLocationWorkflowTemplate resource. - * - * @param {string} projectLocationWorkflowTemplateName - * A fully-qualified path representing project_location_workflow_template resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { - return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).project; - } - - /** - * Parse the location from ProjectLocationWorkflowTemplate resource. - * - * @param {string} projectLocationWorkflowTemplateName - * A fully-qualified path representing project_location_workflow_template resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { - return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).location; - } - - /** - * Parse the workflow_template from ProjectLocationWorkflowTemplate resource. - * - * @param {string} projectLocationWorkflowTemplateName - * A fully-qualified path representing project_location_workflow_template resource. - * @returns {string} A string representing the workflow_template. - */ - matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { - return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).workflow_template; - } - - /** - * Return a fully-qualified projectRegionAutoscalingPolicy resource name string. - * - * @param {string} project - * @param {string} region - * @param {string} autoscaling_policy - * @returns {string} Resource name string. - */ - projectRegionAutoscalingPolicyPath(project:string,region:string,autoscalingPolicy:string) { - return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render({ - project: project, - region: region, - autoscaling_policy: autoscalingPolicy, - }); - } - - /** - * Parse the project from ProjectRegionAutoscalingPolicy resource. - * - * @param {string} projectRegionAutoscalingPolicyName - * A fully-qualified path representing project_region_autoscaling_policy resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { - return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).project; - } - - /** - * Parse the region from ProjectRegionAutoscalingPolicy resource. - * - * @param {string} projectRegionAutoscalingPolicyName - * A fully-qualified path representing project_region_autoscaling_policy resource. - * @returns {string} A string representing the region. - */ - matchRegionFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { - return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).region; - } - - /** - * Parse the autoscaling_policy from ProjectRegionAutoscalingPolicy resource. - * - * @param {string} projectRegionAutoscalingPolicyName - * A fully-qualified path representing project_region_autoscaling_policy resource. - * @returns {string} A string representing the autoscaling_policy. - */ - matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { - return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).autoscaling_policy; - } - - /** - * Return a fully-qualified projectRegionWorkflowTemplate resource name string. - * - * @param {string} project - * @param {string} region - * @param {string} workflow_template - * @returns {string} Resource name string. - */ - projectRegionWorkflowTemplatePath(project:string,region:string,workflowTemplate:string) { - return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render({ - project: project, - region: region, - workflow_template: workflowTemplate, - }); - } - - /** - * Parse the project from ProjectRegionWorkflowTemplate resource. - * - * @param {string} projectRegionWorkflowTemplateName - * A fully-qualified path representing project_region_workflow_template resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { - return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).project; - } - - /** - * Parse the region from ProjectRegionWorkflowTemplate resource. - * - * @param {string} projectRegionWorkflowTemplateName - * A fully-qualified path representing project_region_workflow_template resource. - * @returns {string} A string representing the region. - */ - matchRegionFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { - return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).region; - } - - /** - * Parse the workflow_template from ProjectRegionWorkflowTemplate resource. - * - * @param {string} projectRegionWorkflowTemplateName - * A fully-qualified path representing project_region_workflow_template resource. - * @returns {string} A string representing the workflow_template. - */ - matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { - return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).workflow_template; - } - - /** - * Return a fully-qualified session resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} session - * @returns {string} Resource name string. - */ - sessionPath(project:string,location:string,session:string) { - return this.pathTemplates.sessionPathTemplate.render({ - project: project, - location: location, - session: session, - }); - } - - /** - * Parse the project from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).project; - } - - /** - * Parse the location from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).location; - } - - /** - * Parse the session from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the session. - */ - matchSessionFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).session; - } - - /** - * Return a fully-qualified sessionTemplate resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} template - * @returns {string} Resource name string. - */ - sessionTemplatePath(project:string,location:string,template:string) { - return this.pathTemplates.sessionTemplatePathTemplate.render({ - project: project, - location: location, - template: template, - }); - } - - /** - * Parse the project from SessionTemplate resource. - * - * @param {string} sessionTemplateName - * A fully-qualified path representing SessionTemplate resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSessionTemplateName(sessionTemplateName: string) { - return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).project; - } - - /** - * Parse the location from SessionTemplate resource. - * - * @param {string} sessionTemplateName - * A fully-qualified path representing SessionTemplate resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSessionTemplateName(sessionTemplateName: string) { - return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).location; - } - - /** - * Parse the template from SessionTemplate resource. - * - * @param {string} sessionTemplateName - * A fully-qualified path representing SessionTemplate resource. - * @returns {string} A string representing the template. - */ - matchTemplateFromSessionTemplateName(sessionTemplateName: string) { - return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).template; - } - - /** - * 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.jobControllerStub && !this._terminated) { - return this.jobControllerStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.iamClient.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-dataproc/src/v1/job_controller_client_config.json b/owl-bot-staging/google-cloud-dataproc/src/v1/job_controller_client_config.json deleted file mode 100644 index 5d75711034e7..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/src/v1/job_controller_client_config.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "interfaces": { - "google.cloud.dataproc.v1.JobController": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "unavailable": [ - "UNAVAILABLE" - ], - "deadline_exceeded_internal_unavailable": [ - "DEADLINE_EXCEEDED", - "INTERNAL", - "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": { - "SubmitJob": { - "timeout_millis": 900000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - }, - "SubmitJobAsOperation": { - "timeout_millis": 900000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - }, - "GetJob": { - "timeout_millis": 900000, - "retry_codes_name": "deadline_exceeded_internal_unavailable", - "retry_params_name": "default" - }, - "ListJobs": { - "timeout_millis": 900000, - "retry_codes_name": "deadline_exceeded_internal_unavailable", - "retry_params_name": "default" - }, - "UpdateJob": { - "timeout_millis": 900000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - }, - "CancelJob": { - "timeout_millis": 900000, - "retry_codes_name": "deadline_exceeded_internal_unavailable", - "retry_params_name": "default" - }, - "DeleteJob": { - "timeout_millis": 900000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/job_controller_proto_list.json b/owl-bot-staging/google-cloud-dataproc/src/v1/job_controller_proto_list.json deleted file mode 100644 index d6798f50ae7c..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/src/v1/job_controller_proto_list.json +++ /dev/null @@ -1,12 +0,0 @@ -[ - "../../protos/google/cloud/dataproc/v1/autoscaling_policies.proto", - "../../protos/google/cloud/dataproc/v1/batches.proto", - "../../protos/google/cloud/dataproc/v1/clusters.proto", - "../../protos/google/cloud/dataproc/v1/jobs.proto", - "../../protos/google/cloud/dataproc/v1/node_groups.proto", - "../../protos/google/cloud/dataproc/v1/operations.proto", - "../../protos/google/cloud/dataproc/v1/session_templates.proto", - "../../protos/google/cloud/dataproc/v1/sessions.proto", - "../../protos/google/cloud/dataproc/v1/shared.proto", - "../../protos/google/cloud/dataproc/v1/workflow_templates.proto" -] diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/node_group_controller_client.ts b/owl-bot-staging/google-cloud-dataproc/src/v1/node_group_controller_client.ts deleted file mode 100644 index 9f4b7faf3085..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/src/v1/node_group_controller_client.ts +++ /dev/null @@ -1,1673 +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, IamClient, IamProtos} from 'google-gax'; - -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v1/node_group_controller_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './node_group_controller_client_config.json'; -const version = require('../../../package.json').version; - -/** - * The `NodeGroupControllerService` provides methods to manage node groups - * of Compute Engine managed instances. - * @class - * @memberof v1 - */ -export class NodeGroupControllerClient { - 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('dataproc'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - iamClient: IamClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - nodeGroupControllerStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of NodeGroupControllerClient. - * - * @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 NodeGroupControllerClient({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 NodeGroupControllerClient; - 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 = 'dataproc.' + 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.iamClient = new this._gaxModule.IamClient(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 = { - batchPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batches/{batch}' - ), - clusterRegionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/regions/{region}/clusters/{cluster}' - ), - nodeGroupPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{node_group}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - projectLocationAutoscalingPolicyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/autoscalingPolicies/{autoscaling_policy}' - ), - projectLocationWorkflowTemplatePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/workflowTemplates/{workflow_template}' - ), - projectRegionAutoscalingPolicyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/regions/{region}/autoscalingPolicies/{autoscaling_policy}' - ), - projectRegionWorkflowTemplatePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/regions/{region}/workflowTemplates/{workflow_template}' - ), - regionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/regions/{region}' - ), - sessionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/sessions/{session}' - ), - sessionTemplatePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/sessionTemplates/{template}' - ), - }; - - 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.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1/{resource=projects/*/regions/*/clusters/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:getIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/regions/*/clusters/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/regions/*/clusters/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:testIamPermissions',body: '*',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/regions/*/operations/*}:cancel',additional_bindings: [{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/regions/*/operations/*}',additional_bindings: [{delete: '/v1/{name=projects/*/locations/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/regions/*/operations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/regions/*/operations}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*/operations}',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const createNodeGroupResponse = protoFilesRoot.lookup( - '.google.cloud.dataproc.v1.NodeGroup') as gax.protobuf.Type; - const createNodeGroupMetadata = protoFilesRoot.lookup( - '.google.cloud.dataproc.v1.NodeGroupOperationMetadata') as gax.protobuf.Type; - const resizeNodeGroupResponse = protoFilesRoot.lookup( - '.google.cloud.dataproc.v1.NodeGroup') as gax.protobuf.Type; - const resizeNodeGroupMetadata = protoFilesRoot.lookup( - '.google.cloud.dataproc.v1.NodeGroupOperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createNodeGroup: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createNodeGroupResponse.decode.bind(createNodeGroupResponse), - createNodeGroupMetadata.decode.bind(createNodeGroupMetadata)), - resizeNodeGroup: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - resizeNodeGroupResponse.decode.bind(resizeNodeGroupResponse), - resizeNodeGroupMetadata.decode.bind(resizeNodeGroupMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.dataproc.v1.NodeGroupController', 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.nodeGroupControllerStub) { - return this.nodeGroupControllerStub; - } - - // Put together the "service stub" for - // google.cloud.dataproc.v1.NodeGroupController. - this.nodeGroupControllerStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.dataproc.v1.NodeGroupController') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.dataproc.v1.NodeGroupController, - 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 nodeGroupControllerStubMethods = - ['createNodeGroup', 'resizeNodeGroup', 'getNodeGroup']; - for (const methodName of nodeGroupControllerStubMethods) { - const callPromise = this.nodeGroupControllerStub.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.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.nodeGroupControllerStub; - } - - /** - * 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 'dataproc.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 'dataproc.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 the resource representation for a node group in a - * cluster. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the node group to retrieve. - * Format: - * `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.dataproc.v1.NodeGroup|NodeGroup}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/node_group_controller.get_node_group.js - * region_tag:dataproc_v1_generated_NodeGroupController_GetNodeGroup_async - */ - getNodeGroup( - request?: protos.google.cloud.dataproc.v1.IGetNodeGroupRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataproc.v1.INodeGroup, - protos.google.cloud.dataproc.v1.IGetNodeGroupRequest|undefined, {}|undefined - ]>; - getNodeGroup( - request: protos.google.cloud.dataproc.v1.IGetNodeGroupRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataproc.v1.INodeGroup, - protos.google.cloud.dataproc.v1.IGetNodeGroupRequest|null|undefined, - {}|null|undefined>): void; - getNodeGroup( - request: protos.google.cloud.dataproc.v1.IGetNodeGroupRequest, - callback: Callback< - protos.google.cloud.dataproc.v1.INodeGroup, - protos.google.cloud.dataproc.v1.IGetNodeGroupRequest|null|undefined, - {}|null|undefined>): void; - getNodeGroup( - request?: protos.google.cloud.dataproc.v1.IGetNodeGroupRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataproc.v1.INodeGroup, - protos.google.cloud.dataproc.v1.IGetNodeGroupRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataproc.v1.INodeGroup, - protos.google.cloud.dataproc.v1.IGetNodeGroupRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataproc.v1.INodeGroup, - protos.google.cloud.dataproc.v1.IGetNodeGroupRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof 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('getNodeGroup request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.dataproc.v1.INodeGroup, - protos.google.cloud.dataproc.v1.IGetNodeGroupRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getNodeGroup response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getNodeGroup(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.dataproc.v1.INodeGroup, - protos.google.cloud.dataproc.v1.IGetNodeGroupRequest|undefined, - {}|undefined - ]) => { - this._log.info('getNodeGroup 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 node group in a cluster. The returned - * {@link protos.google.longrunning.Operation.metadata|Operation.metadata} is - * [NodeGroupOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource where this node group will be created. - * Format: `projects/{project}/regions/{region}/clusters/{cluster}` - * @param {google.cloud.dataproc.v1.NodeGroup} request.nodeGroup - * Required. The node group to create. - * @param {string} [request.nodeGroupId] - * Optional. An optional node group ID. Generated if not specified. - * - * The ID must contain only letters (a-z, A-Z), numbers (0-9), - * underscores (_), and hyphens (-). Cannot begin or end with underscore - * or hyphen. Must consist of from 3 to 33 characters. - * @param {string} [request.requestId] - * Optional. A unique ID used to identify the request. If the server receives - * two - * [CreateNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateNodeGroupRequests) - * with the same ID, the second request is ignored and the - * first {@link protos.google.longrunning.Operation|google.longrunning.Operation} created - * and stored in the backend is returned. - * - * Recommendation: Set this value to a - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - * - * The ID must contain only letters (a-z, A-Z), numbers (0-9), - * underscores (_), and hyphens (-). The maximum length is 40 characters. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/node_group_controller.create_node_group.js - * region_tag:dataproc_v1_generated_NodeGroupController_CreateNodeGroup_async - */ - createNodeGroup( - request?: protos.google.cloud.dataproc.v1.ICreateNodeGroupRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createNodeGroup( - request: protos.google.cloud.dataproc.v1.ICreateNodeGroupRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createNodeGroup( - request: protos.google.cloud.dataproc.v1.ICreateNodeGroupRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createNodeGroup( - request?: protos.google.cloud.dataproc.v1.ICreateNodeGroupRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createNodeGroup response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createNodeGroup request %j', request); - return this.innerApiCalls.createNodeGroup(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createNodeGroup response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createNodeGroup()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/node_group_controller.create_node_group.js - * region_tag:dataproc_v1_generated_NodeGroupController_CreateNodeGroup_async - */ - async checkCreateNodeGroupProgress(name: string): Promise>{ - this._log.info('createNodeGroup 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.createNodeGroup, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Resizes a node group in a cluster. The returned - * {@link protos.google.longrunning.Operation.metadata|Operation.metadata} is - * [NodeGroupOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the node group to resize. - * Format: - * `projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{nodeGroup}` - * @param {number} request.size - * Required. The number of running instances for the node group to maintain. - * The group adds or removes instances to maintain the number of instances - * specified by this parameter. - * @param {string} [request.requestId] - * Optional. A unique ID used to identify the request. If the server receives - * two - * [ResizeNodeGroupRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.ResizeNodeGroupRequests) - * with the same ID, the second request is ignored and the - * first {@link protos.google.longrunning.Operation|google.longrunning.Operation} created - * and stored in the backend is returned. - * - * Recommendation: Set this value to a - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - * - * The ID must contain only letters (a-z, A-Z), numbers (0-9), - * underscores (_), and hyphens (-). The maximum length is 40 characters. - * @param {google.protobuf.Duration} [request.gracefulDecommissionTimeout] - * Optional. Timeout for graceful YARN decommissioning. [Graceful - * decommissioning] - * (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/scaling-clusters#graceful_decommissioning) - * allows the removal of nodes from the Compute Engine node group - * without interrupting jobs in progress. This timeout specifies how long to - * wait for jobs in progress to finish before forcefully removing nodes (and - * potentially interrupting jobs). Default timeout is 0 (for forceful - * decommission), and the maximum allowed timeout is 1 day. (see JSON - * representation of - * [Duration](https://developers.google.com/protocol-buffers/docs/proto3#json)). - * - * Only supported on Dataproc image versions 1.2 and higher. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/node_group_controller.resize_node_group.js - * region_tag:dataproc_v1_generated_NodeGroupController_ResizeNodeGroup_async - */ - resizeNodeGroup( - request?: protos.google.cloud.dataproc.v1.IResizeNodeGroupRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - resizeNodeGroup( - request: protos.google.cloud.dataproc.v1.IResizeNodeGroupRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - resizeNodeGroup( - request: protos.google.cloud.dataproc.v1.IResizeNodeGroupRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - resizeNodeGroup( - request?: protos.google.cloud.dataproc.v1.IResizeNodeGroupRequest, - 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('resizeNodeGroup response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('resizeNodeGroup request %j', request); - return this.innerApiCalls.resizeNodeGroup(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('resizeNodeGroup response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `resizeNodeGroup()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/node_group_controller.resize_node_group.js - * region_tag:dataproc_v1_generated_NodeGroupController_ResizeNodeGroup_async - */ - async checkResizeNodeGroupProgress(name: string): Promise>{ - this._log.info('resizeNodeGroup 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.resizeNodeGroup, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @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 {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @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/interfaces/CallOptions.html | 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.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@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 batch resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch - * @returns {string} Resource name string. - */ - batchPath(project:string,location:string,batch:string) { - return this.pathTemplates.batchPathTemplate.render({ - project: project, - location: location, - batch: batch, - }); - } - - /** - * Parse the project from Batch resource. - * - * @param {string} batchName - * A fully-qualified path representing Batch resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchName(batchName: string) { - return this.pathTemplates.batchPathTemplate.match(batchName).project; - } - - /** - * Parse the location from Batch resource. - * - * @param {string} batchName - * A fully-qualified path representing Batch resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchName(batchName: string) { - return this.pathTemplates.batchPathTemplate.match(batchName).location; - } - - /** - * Parse the batch from Batch resource. - * - * @param {string} batchName - * A fully-qualified path representing Batch resource. - * @returns {string} A string representing the batch. - */ - matchBatchFromBatchName(batchName: string) { - return this.pathTemplates.batchPathTemplate.match(batchName).batch; - } - - /** - * Return a fully-qualified clusterRegion resource name string. - * - * @param {string} project - * @param {string} region - * @param {string} cluster - * @returns {string} Resource name string. - */ - clusterRegionPath(project:string,region:string,cluster:string) { - return this.pathTemplates.clusterRegionPathTemplate.render({ - project: project, - region: region, - cluster: cluster, - }); - } - - /** - * Parse the project from ClusterRegion resource. - * - * @param {string} clusterRegionName - * A fully-qualified path representing ClusterRegion resource. - * @returns {string} A string representing the project. - */ - matchProjectFromClusterRegionName(clusterRegionName: string) { - return this.pathTemplates.clusterRegionPathTemplate.match(clusterRegionName).project; - } - - /** - * Parse the region from ClusterRegion resource. - * - * @param {string} clusterRegionName - * A fully-qualified path representing ClusterRegion resource. - * @returns {string} A string representing the region. - */ - matchRegionFromClusterRegionName(clusterRegionName: string) { - return this.pathTemplates.clusterRegionPathTemplate.match(clusterRegionName).region; - } - - /** - * Parse the cluster from ClusterRegion resource. - * - * @param {string} clusterRegionName - * A fully-qualified path representing ClusterRegion resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromClusterRegionName(clusterRegionName: string) { - return this.pathTemplates.clusterRegionPathTemplate.match(clusterRegionName).cluster; - } - - /** - * Return a fully-qualified nodeGroup resource name string. - * - * @param {string} project - * @param {string} region - * @param {string} cluster - * @param {string} node_group - * @returns {string} Resource name string. - */ - nodeGroupPath(project:string,region:string,cluster:string,nodeGroup:string) { - return this.pathTemplates.nodeGroupPathTemplate.render({ - project: project, - region: region, - cluster: cluster, - node_group: nodeGroup, - }); - } - - /** - * Parse the project from NodeGroup resource. - * - * @param {string} nodeGroupName - * A fully-qualified path representing NodeGroup resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNodeGroupName(nodeGroupName: string) { - return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).project; - } - - /** - * Parse the region from NodeGroup resource. - * - * @param {string} nodeGroupName - * A fully-qualified path representing NodeGroup resource. - * @returns {string} A string representing the region. - */ - matchRegionFromNodeGroupName(nodeGroupName: string) { - return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).region; - } - - /** - * Parse the cluster from NodeGroup resource. - * - * @param {string} nodeGroupName - * A fully-qualified path representing NodeGroup resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromNodeGroupName(nodeGroupName: string) { - return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).cluster; - } - - /** - * Parse the node_group from NodeGroup resource. - * - * @param {string} nodeGroupName - * A fully-qualified path representing NodeGroup resource. - * @returns {string} A string representing the node_group. - */ - matchNodeGroupFromNodeGroupName(nodeGroupName: string) { - return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).node_group; - } - - /** - * 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 projectLocationAutoscalingPolicy resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} autoscaling_policy - * @returns {string} Resource name string. - */ - projectLocationAutoscalingPolicyPath(project:string,location:string,autoscalingPolicy:string) { - return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render({ - project: project, - location: location, - autoscaling_policy: autoscalingPolicy, - }); - } - - /** - * Parse the project from ProjectLocationAutoscalingPolicy resource. - * - * @param {string} projectLocationAutoscalingPolicyName - * A fully-qualified path representing project_location_autoscaling_policy resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { - return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).project; - } - - /** - * Parse the location from ProjectLocationAutoscalingPolicy resource. - * - * @param {string} projectLocationAutoscalingPolicyName - * A fully-qualified path representing project_location_autoscaling_policy resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { - return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).location; - } - - /** - * Parse the autoscaling_policy from ProjectLocationAutoscalingPolicy resource. - * - * @param {string} projectLocationAutoscalingPolicyName - * A fully-qualified path representing project_location_autoscaling_policy resource. - * @returns {string} A string representing the autoscaling_policy. - */ - matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { - return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).autoscaling_policy; - } - - /** - * Return a fully-qualified projectLocationWorkflowTemplate resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} workflow_template - * @returns {string} Resource name string. - */ - projectLocationWorkflowTemplatePath(project:string,location:string,workflowTemplate:string) { - return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render({ - project: project, - location: location, - workflow_template: workflowTemplate, - }); - } - - /** - * Parse the project from ProjectLocationWorkflowTemplate resource. - * - * @param {string} projectLocationWorkflowTemplateName - * A fully-qualified path representing project_location_workflow_template resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { - return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).project; - } - - /** - * Parse the location from ProjectLocationWorkflowTemplate resource. - * - * @param {string} projectLocationWorkflowTemplateName - * A fully-qualified path representing project_location_workflow_template resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { - return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).location; - } - - /** - * Parse the workflow_template from ProjectLocationWorkflowTemplate resource. - * - * @param {string} projectLocationWorkflowTemplateName - * A fully-qualified path representing project_location_workflow_template resource. - * @returns {string} A string representing the workflow_template. - */ - matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { - return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).workflow_template; - } - - /** - * Return a fully-qualified projectRegionAutoscalingPolicy resource name string. - * - * @param {string} project - * @param {string} region - * @param {string} autoscaling_policy - * @returns {string} Resource name string. - */ - projectRegionAutoscalingPolicyPath(project:string,region:string,autoscalingPolicy:string) { - return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render({ - project: project, - region: region, - autoscaling_policy: autoscalingPolicy, - }); - } - - /** - * Parse the project from ProjectRegionAutoscalingPolicy resource. - * - * @param {string} projectRegionAutoscalingPolicyName - * A fully-qualified path representing project_region_autoscaling_policy resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { - return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).project; - } - - /** - * Parse the region from ProjectRegionAutoscalingPolicy resource. - * - * @param {string} projectRegionAutoscalingPolicyName - * A fully-qualified path representing project_region_autoscaling_policy resource. - * @returns {string} A string representing the region. - */ - matchRegionFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { - return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).region; - } - - /** - * Parse the autoscaling_policy from ProjectRegionAutoscalingPolicy resource. - * - * @param {string} projectRegionAutoscalingPolicyName - * A fully-qualified path representing project_region_autoscaling_policy resource. - * @returns {string} A string representing the autoscaling_policy. - */ - matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { - return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).autoscaling_policy; - } - - /** - * Return a fully-qualified projectRegionWorkflowTemplate resource name string. - * - * @param {string} project - * @param {string} region - * @param {string} workflow_template - * @returns {string} Resource name string. - */ - projectRegionWorkflowTemplatePath(project:string,region:string,workflowTemplate:string) { - return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render({ - project: project, - region: region, - workflow_template: workflowTemplate, - }); - } - - /** - * Parse the project from ProjectRegionWorkflowTemplate resource. - * - * @param {string} projectRegionWorkflowTemplateName - * A fully-qualified path representing project_region_workflow_template resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { - return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).project; - } - - /** - * Parse the region from ProjectRegionWorkflowTemplate resource. - * - * @param {string} projectRegionWorkflowTemplateName - * A fully-qualified path representing project_region_workflow_template resource. - * @returns {string} A string representing the region. - */ - matchRegionFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { - return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).region; - } - - /** - * Parse the workflow_template from ProjectRegionWorkflowTemplate resource. - * - * @param {string} projectRegionWorkflowTemplateName - * A fully-qualified path representing project_region_workflow_template resource. - * @returns {string} A string representing the workflow_template. - */ - matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { - return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).workflow_template; - } - - /** - * Return a fully-qualified region resource name string. - * - * @param {string} project - * @param {string} region - * @returns {string} Resource name string. - */ - regionPath(project:string,region:string) { - return this.pathTemplates.regionPathTemplate.render({ - project: project, - region: region, - }); - } - - /** - * Parse the project from Region resource. - * - * @param {string} regionName - * A fully-qualified path representing Region resource. - * @returns {string} A string representing the project. - */ - matchProjectFromRegionName(regionName: string) { - return this.pathTemplates.regionPathTemplate.match(regionName).project; - } - - /** - * Parse the region from Region resource. - * - * @param {string} regionName - * A fully-qualified path representing Region resource. - * @returns {string} A string representing the region. - */ - matchRegionFromRegionName(regionName: string) { - return this.pathTemplates.regionPathTemplate.match(regionName).region; - } - - /** - * Return a fully-qualified session resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} session - * @returns {string} Resource name string. - */ - sessionPath(project:string,location:string,session:string) { - return this.pathTemplates.sessionPathTemplate.render({ - project: project, - location: location, - session: session, - }); - } - - /** - * Parse the project from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).project; - } - - /** - * Parse the location from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).location; - } - - /** - * Parse the session from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the session. - */ - matchSessionFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).session; - } - - /** - * Return a fully-qualified sessionTemplate resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} template - * @returns {string} Resource name string. - */ - sessionTemplatePath(project:string,location:string,template:string) { - return this.pathTemplates.sessionTemplatePathTemplate.render({ - project: project, - location: location, - template: template, - }); - } - - /** - * Parse the project from SessionTemplate resource. - * - * @param {string} sessionTemplateName - * A fully-qualified path representing SessionTemplate resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSessionTemplateName(sessionTemplateName: string) { - return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).project; - } - - /** - * Parse the location from SessionTemplate resource. - * - * @param {string} sessionTemplateName - * A fully-qualified path representing SessionTemplate resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSessionTemplateName(sessionTemplateName: string) { - return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).location; - } - - /** - * Parse the template from SessionTemplate resource. - * - * @param {string} sessionTemplateName - * A fully-qualified path representing SessionTemplate resource. - * @returns {string} A string representing the template. - */ - matchTemplateFromSessionTemplateName(sessionTemplateName: string) { - return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).template; - } - - /** - * 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.nodeGroupControllerStub && !this._terminated) { - return this.nodeGroupControllerStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.iamClient.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-dataproc/src/v1/node_group_controller_client_config.json b/owl-bot-staging/google-cloud-dataproc/src/v1/node_group_controller_client_config.json deleted file mode 100644 index 3e7761ab670f..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/src/v1/node_group_controller_client_config.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "interfaces": { - "google.cloud.dataproc.v1.NodeGroupController": { - "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": { - "CreateNodeGroup": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ResizeNodeGroup": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetNodeGroup": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/node_group_controller_proto_list.json b/owl-bot-staging/google-cloud-dataproc/src/v1/node_group_controller_proto_list.json deleted file mode 100644 index d6798f50ae7c..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/src/v1/node_group_controller_proto_list.json +++ /dev/null @@ -1,12 +0,0 @@ -[ - "../../protos/google/cloud/dataproc/v1/autoscaling_policies.proto", - "../../protos/google/cloud/dataproc/v1/batches.proto", - "../../protos/google/cloud/dataproc/v1/clusters.proto", - "../../protos/google/cloud/dataproc/v1/jobs.proto", - "../../protos/google/cloud/dataproc/v1/node_groups.proto", - "../../protos/google/cloud/dataproc/v1/operations.proto", - "../../protos/google/cloud/dataproc/v1/session_templates.proto", - "../../protos/google/cloud/dataproc/v1/sessions.proto", - "../../protos/google/cloud/dataproc/v1/shared.proto", - "../../protos/google/cloud/dataproc/v1/workflow_templates.proto" -] diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/session_controller_client.ts b/owl-bot-staging/google-cloud-dataproc/src/v1/session_controller_client.ts deleted file mode 100644 index 4bd0dc14e797..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/src/v1/session_controller_client.ts +++ /dev/null @@ -1,1972 +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, IamClient, IamProtos} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v1/session_controller_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './session_controller_client_config.json'; -const version = require('../../../package.json').version; - -/** - * The `SessionController` provides methods to manage interactive sessions. - * @class - * @memberof v1 - */ -export class SessionControllerClient { - 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('dataproc'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - iamClient: IamClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - sessionControllerStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of SessionControllerClient. - * - * @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 SessionControllerClient({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 SessionControllerClient; - 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 = 'dataproc.' + 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.iamClient = new this._gaxModule.IamClient(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 = { - batchPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batches/{batch}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - nodeGroupPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{node_group}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - projectLocationAutoscalingPolicyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/autoscalingPolicies/{autoscaling_policy}' - ), - projectLocationWorkflowTemplatePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/workflowTemplates/{workflow_template}' - ), - projectRegionAutoscalingPolicyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/regions/{region}/autoscalingPolicies/{autoscaling_policy}' - ), - projectRegionWorkflowTemplatePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/regions/{region}/workflowTemplates/{workflow_template}' - ), - sessionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/sessions/{session}' - ), - sessionTemplatePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/sessionTemplates/{template}' - ), - }; - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listSessions: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'sessions') - }; - - 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.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1/{resource=projects/*/regions/*/clusters/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:getIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/regions/*/clusters/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/regions/*/clusters/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:testIamPermissions',body: '*',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/regions/*/operations/*}:cancel',additional_bindings: [{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/regions/*/operations/*}',additional_bindings: [{delete: '/v1/{name=projects/*/locations/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/regions/*/operations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/regions/*/operations}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*/operations}',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const createSessionResponse = protoFilesRoot.lookup( - '.google.cloud.dataproc.v1.Session') as gax.protobuf.Type; - const createSessionMetadata = protoFilesRoot.lookup( - '.google.cloud.dataproc.v1.SessionOperationMetadata') as gax.protobuf.Type; - const terminateSessionResponse = protoFilesRoot.lookup( - '.google.cloud.dataproc.v1.Session') as gax.protobuf.Type; - const terminateSessionMetadata = protoFilesRoot.lookup( - '.google.cloud.dataproc.v1.SessionOperationMetadata') as gax.protobuf.Type; - const deleteSessionResponse = protoFilesRoot.lookup( - '.google.cloud.dataproc.v1.Session') as gax.protobuf.Type; - const deleteSessionMetadata = protoFilesRoot.lookup( - '.google.cloud.dataproc.v1.SessionOperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createSession: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createSessionResponse.decode.bind(createSessionResponse), - createSessionMetadata.decode.bind(createSessionMetadata)), - terminateSession: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - terminateSessionResponse.decode.bind(terminateSessionResponse), - terminateSessionMetadata.decode.bind(terminateSessionMetadata)), - deleteSession: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteSessionResponse.decode.bind(deleteSessionResponse), - deleteSessionMetadata.decode.bind(deleteSessionMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.dataproc.v1.SessionController', 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.sessionControllerStub) { - return this.sessionControllerStub; - } - - // Put together the "service stub" for - // google.cloud.dataproc.v1.SessionController. - this.sessionControllerStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.dataproc.v1.SessionController') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.dataproc.v1.SessionController, - 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 sessionControllerStubMethods = - ['createSession', 'getSession', 'listSessions', 'terminateSession', 'deleteSession']; - for (const methodName of sessionControllerStubMethods) { - const callPromise = this.sessionControllerStub.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.sessionControllerStub; - } - - /** - * 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 'dataproc.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 'dataproc.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 the resource representation for an interactive session. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the session to retrieve. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.dataproc.v1.Session|Session}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/session_controller.get_session.js - * region_tag:dataproc_v1_generated_SessionController_GetSession_async - */ - getSession( - request?: protos.google.cloud.dataproc.v1.IGetSessionRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataproc.v1.ISession, - protos.google.cloud.dataproc.v1.IGetSessionRequest|undefined, {}|undefined - ]>; - getSession( - request: protos.google.cloud.dataproc.v1.IGetSessionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataproc.v1.ISession, - protos.google.cloud.dataproc.v1.IGetSessionRequest|null|undefined, - {}|null|undefined>): void; - getSession( - request: protos.google.cloud.dataproc.v1.IGetSessionRequest, - callback: Callback< - protos.google.cloud.dataproc.v1.ISession, - protos.google.cloud.dataproc.v1.IGetSessionRequest|null|undefined, - {}|null|undefined>): void; - getSession( - request?: protos.google.cloud.dataproc.v1.IGetSessionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataproc.v1.ISession, - protos.google.cloud.dataproc.v1.IGetSessionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataproc.v1.ISession, - protos.google.cloud.dataproc.v1.IGetSessionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataproc.v1.ISession, - protos.google.cloud.dataproc.v1.IGetSessionRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'name': request.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('getSession request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.dataproc.v1.ISession, - protos.google.cloud.dataproc.v1.IGetSessionRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getSession response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getSession(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.dataproc.v1.ISession, - protos.google.cloud.dataproc.v1.IGetSessionRequest|undefined, - {}|undefined - ]) => { - this._log.info('getSession response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - -/** - * Create an interactive session asynchronously. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource where this session will be created. - * @param {google.cloud.dataproc.v1.Session} request.session - * Required. The interactive session to create. - * @param {string} request.sessionId - * Required. The ID to use for the session, which becomes the final component - * of the session's resource name. - * - * This value must be 4-63 characters. Valid characters - * are /{@link protos.0-9|a-z}-/. - * @param {string} [request.requestId] - * Optional. A unique ID used to identify the request. If the service - * receives two - * [CreateSessionRequests](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateSessionRequest)s - * with the same ID, the second request is ignored, and the - * first {@link protos.google.cloud.dataproc.v1.Session|Session} is created and stored in - * the backend. - * - * Recommendation: Set this value to a - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - * - * The value must contain only letters (a-z, A-Z), numbers (0-9), - * underscores (_), and hyphens (-). The maximum length is 40 characters. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/session_controller.create_session.js - * region_tag:dataproc_v1_generated_SessionController_CreateSession_async - */ - createSession( - request?: protos.google.cloud.dataproc.v1.ICreateSessionRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createSession( - request: protos.google.cloud.dataproc.v1.ICreateSessionRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createSession( - request: protos.google.cloud.dataproc.v1.ICreateSessionRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createSession( - request?: protos.google.cloud.dataproc.v1.ICreateSessionRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createSession response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createSession request %j', request); - return this.innerApiCalls.createSession(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createSession response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createSession()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/session_controller.create_session.js - * region_tag:dataproc_v1_generated_SessionController_CreateSession_async - */ - async checkCreateSessionProgress(name: string): Promise>{ - this._log.info('createSession 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.createSession, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Terminates the interactive session. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the session resource to terminate. - * @param {string} [request.requestId] - * Optional. A unique ID used to identify the request. If the service - * receives two - * [TerminateSessionRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.TerminateSessionRequest)s - * with the same ID, the second request is ignored. - * - * Recommendation: Set this value to a - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - * - * The value must contain only letters (a-z, A-Z), numbers (0-9), - * underscores (_), and hyphens (-). The maximum length is 40 characters. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/session_controller.terminate_session.js - * region_tag:dataproc_v1_generated_SessionController_TerminateSession_async - */ - terminateSession( - request?: protos.google.cloud.dataproc.v1.ITerminateSessionRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - terminateSession( - request: protos.google.cloud.dataproc.v1.ITerminateSessionRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - terminateSession( - request: protos.google.cloud.dataproc.v1.ITerminateSessionRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - terminateSession( - request?: protos.google.cloud.dataproc.v1.ITerminateSessionRequest, - 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('terminateSession response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('terminateSession request %j', request); - return this.innerApiCalls.terminateSession(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('terminateSession response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `terminateSession()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/session_controller.terminate_session.js - * region_tag:dataproc_v1_generated_SessionController_TerminateSession_async - */ - async checkTerminateSessionProgress(name: string): Promise>{ - this._log.info('terminateSession 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.terminateSession, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes the interactive session resource. If the session is not in terminal - * state, it is terminated, and then deleted. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the session resource to delete. - * @param {string} [request.requestId] - * Optional. A unique ID used to identify the request. If the service - * receives two - * [DeleteSessionRequest](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteSessionRequest)s - * with the same ID, the second request is ignored. - * - * Recommendation: Set this value to a - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - * - * The value must contain only letters (a-z, A-Z), numbers (0-9), - * underscores (_), and hyphens (-). The maximum length is 40 characters. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/session_controller.delete_session.js - * region_tag:dataproc_v1_generated_SessionController_DeleteSession_async - */ - deleteSession( - request?: protos.google.cloud.dataproc.v1.IDeleteSessionRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteSession( - request: protos.google.cloud.dataproc.v1.IDeleteSessionRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteSession( - request: protos.google.cloud.dataproc.v1.IDeleteSessionRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteSession( - request?: protos.google.cloud.dataproc.v1.IDeleteSessionRequest, - 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('deleteSession response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deleteSession request %j', request); - return this.innerApiCalls.deleteSession(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('deleteSession response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `deleteSession()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/session_controller.delete_session.js - * region_tag:dataproc_v1_generated_SessionController_DeleteSession_async - */ - async checkDeleteSessionProgress(name: string): Promise>{ - this._log.info('deleteSession 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.deleteSession, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists interactive sessions. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of sessions. - * @param {number} [request.pageSize] - * Optional. The maximum number of sessions to return in each response. - * The service may return fewer than this value. - * @param {string} [request.pageToken] - * Optional. A page token received from a previous `ListSessions` call. - * Provide this token to retrieve the subsequent page. - * @param {string} [request.filter] - * Optional. A filter for the sessions to return in the response. - * - * A filter is a logical expression constraining the values of various fields - * in each session resource. Filters are case sensitive, and may contain - * multiple clauses combined with logical operators (AND, OR). - * Supported fields are `session_id`, `session_uuid`, `state`, `create_time`, - * and `labels`. - * - * Example: `state = ACTIVE and create_time < "2023-01-01T00:00:00Z"` - * is a filter for sessions in an ACTIVE state that were created before - * 2023-01-01. `state = ACTIVE and labels.environment=production` is a filter - * for sessions in an ACTIVE state that have a production environment label. - * - * See https://google.aip.dev/assets/misc/ebnf-filtering.txt for a detailed - * description of the filter syntax and a list of supported comparators. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.dataproc.v1.Session|Session}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listSessionsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSessions( - request?: protos.google.cloud.dataproc.v1.IListSessionsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataproc.v1.ISession[], - protos.google.cloud.dataproc.v1.IListSessionsRequest|null, - protos.google.cloud.dataproc.v1.IListSessionsResponse - ]>; - listSessions( - request: protos.google.cloud.dataproc.v1.IListSessionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dataproc.v1.IListSessionsRequest, - protos.google.cloud.dataproc.v1.IListSessionsResponse|null|undefined, - protos.google.cloud.dataproc.v1.ISession>): void; - listSessions( - request: protos.google.cloud.dataproc.v1.IListSessionsRequest, - callback: PaginationCallback< - protos.google.cloud.dataproc.v1.IListSessionsRequest, - protos.google.cloud.dataproc.v1.IListSessionsResponse|null|undefined, - protos.google.cloud.dataproc.v1.ISession>): void; - listSessions( - request?: protos.google.cloud.dataproc.v1.IListSessionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.dataproc.v1.IListSessionsRequest, - protos.google.cloud.dataproc.v1.IListSessionsResponse|null|undefined, - protos.google.cloud.dataproc.v1.ISession>, - callback?: PaginationCallback< - protos.google.cloud.dataproc.v1.IListSessionsRequest, - protos.google.cloud.dataproc.v1.IListSessionsResponse|null|undefined, - protos.google.cloud.dataproc.v1.ISession>): - Promise<[ - protos.google.cloud.dataproc.v1.ISession[], - protos.google.cloud.dataproc.v1.IListSessionsRequest|null, - protos.google.cloud.dataproc.v1.IListSessionsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: PaginationCallback< - protos.google.cloud.dataproc.v1.IListSessionsRequest, - protos.google.cloud.dataproc.v1.IListSessionsResponse|null|undefined, - protos.google.cloud.dataproc.v1.ISession>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listSessions values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listSessions request %j', request); - return this.innerApiCalls - .listSessions(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.dataproc.v1.ISession[], - protos.google.cloud.dataproc.v1.IListSessionsRequest|null, - protos.google.cloud.dataproc.v1.IListSessionsResponse - ]) => { - this._log.info('listSessions values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listSessions`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of sessions. - * @param {number} [request.pageSize] - * Optional. The maximum number of sessions to return in each response. - * The service may return fewer than this value. - * @param {string} [request.pageToken] - * Optional. A page token received from a previous `ListSessions` call. - * Provide this token to retrieve the subsequent page. - * @param {string} [request.filter] - * Optional. A filter for the sessions to return in the response. - * - * A filter is a logical expression constraining the values of various fields - * in each session resource. Filters are case sensitive, and may contain - * multiple clauses combined with logical operators (AND, OR). - * Supported fields are `session_id`, `session_uuid`, `state`, `create_time`, - * and `labels`. - * - * Example: `state = ACTIVE and create_time < "2023-01-01T00:00:00Z"` - * is a filter for sessions in an ACTIVE state that were created before - * 2023-01-01. `state = ACTIVE and labels.environment=production` is a filter - * for sessions in an ACTIVE state that have a production environment label. - * - * See https://google.aip.dev/assets/misc/ebnf-filtering.txt for a detailed - * description of the filter syntax and a list of supported comparators. - * @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.dataproc.v1.Session|Session} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listSessionsAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listSessionsStream( - request?: protos.google.cloud.dataproc.v1.IListSessionsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listSessions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listSessions stream %j', request); - return this.descriptors.page.listSessions.createStream( - this.innerApiCalls.listSessions as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listSessions`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent, which owns this collection of sessions. - * @param {number} [request.pageSize] - * Optional. The maximum number of sessions to return in each response. - * The service may return fewer than this value. - * @param {string} [request.pageToken] - * Optional. A page token received from a previous `ListSessions` call. - * Provide this token to retrieve the subsequent page. - * @param {string} [request.filter] - * Optional. A filter for the sessions to return in the response. - * - * A filter is a logical expression constraining the values of various fields - * in each session resource. Filters are case sensitive, and may contain - * multiple clauses combined with logical operators (AND, OR). - * Supported fields are `session_id`, `session_uuid`, `state`, `create_time`, - * and `labels`. - * - * Example: `state = ACTIVE and create_time < "2023-01-01T00:00:00Z"` - * is a filter for sessions in an ACTIVE state that were created before - * 2023-01-01. `state = ACTIVE and labels.environment=production` is a filter - * for sessions in an ACTIVE state that have a production environment label. - * - * See https://google.aip.dev/assets/misc/ebnf-filtering.txt for a detailed - * description of the filter syntax and a list of supported comparators. - * @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.dataproc.v1.Session|Session}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/session_controller.list_sessions.js - * region_tag:dataproc_v1_generated_SessionController_ListSessions_async - */ - listSessionsAsync( - request?: protos.google.cloud.dataproc.v1.IListSessionsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - const defaultCallSettings = this._defaults['listSessions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listSessions iterate %j', request); - return this.descriptors.page.listSessions.asyncIterate( - this.innerApiCalls['listSessions'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @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 {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @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/interfaces/CallOptions.html | 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.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@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 batch resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch - * @returns {string} Resource name string. - */ - batchPath(project:string,location:string,batch:string) { - return this.pathTemplates.batchPathTemplate.render({ - project: project, - location: location, - batch: batch, - }); - } - - /** - * Parse the project from Batch resource. - * - * @param {string} batchName - * A fully-qualified path representing Batch resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchName(batchName: string) { - return this.pathTemplates.batchPathTemplate.match(batchName).project; - } - - /** - * Parse the location from Batch resource. - * - * @param {string} batchName - * A fully-qualified path representing Batch resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchName(batchName: string) { - return this.pathTemplates.batchPathTemplate.match(batchName).location; - } - - /** - * Parse the batch from Batch resource. - * - * @param {string} batchName - * A fully-qualified path representing Batch resource. - * @returns {string} A string representing the batch. - */ - matchBatchFromBatchName(batchName: string) { - return this.pathTemplates.batchPathTemplate.match(batchName).batch; - } - - /** - * 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 nodeGroup resource name string. - * - * @param {string} project - * @param {string} region - * @param {string} cluster - * @param {string} node_group - * @returns {string} Resource name string. - */ - nodeGroupPath(project:string,region:string,cluster:string,nodeGroup:string) { - return this.pathTemplates.nodeGroupPathTemplate.render({ - project: project, - region: region, - cluster: cluster, - node_group: nodeGroup, - }); - } - - /** - * Parse the project from NodeGroup resource. - * - * @param {string} nodeGroupName - * A fully-qualified path representing NodeGroup resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNodeGroupName(nodeGroupName: string) { - return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).project; - } - - /** - * Parse the region from NodeGroup resource. - * - * @param {string} nodeGroupName - * A fully-qualified path representing NodeGroup resource. - * @returns {string} A string representing the region. - */ - matchRegionFromNodeGroupName(nodeGroupName: string) { - return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).region; - } - - /** - * Parse the cluster from NodeGroup resource. - * - * @param {string} nodeGroupName - * A fully-qualified path representing NodeGroup resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromNodeGroupName(nodeGroupName: string) { - return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).cluster; - } - - /** - * Parse the node_group from NodeGroup resource. - * - * @param {string} nodeGroupName - * A fully-qualified path representing NodeGroup resource. - * @returns {string} A string representing the node_group. - */ - matchNodeGroupFromNodeGroupName(nodeGroupName: string) { - return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).node_group; - } - - /** - * 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 projectLocationAutoscalingPolicy resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} autoscaling_policy - * @returns {string} Resource name string. - */ - projectLocationAutoscalingPolicyPath(project:string,location:string,autoscalingPolicy:string) { - return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render({ - project: project, - location: location, - autoscaling_policy: autoscalingPolicy, - }); - } - - /** - * Parse the project from ProjectLocationAutoscalingPolicy resource. - * - * @param {string} projectLocationAutoscalingPolicyName - * A fully-qualified path representing project_location_autoscaling_policy resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { - return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).project; - } - - /** - * Parse the location from ProjectLocationAutoscalingPolicy resource. - * - * @param {string} projectLocationAutoscalingPolicyName - * A fully-qualified path representing project_location_autoscaling_policy resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { - return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).location; - } - - /** - * Parse the autoscaling_policy from ProjectLocationAutoscalingPolicy resource. - * - * @param {string} projectLocationAutoscalingPolicyName - * A fully-qualified path representing project_location_autoscaling_policy resource. - * @returns {string} A string representing the autoscaling_policy. - */ - matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { - return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).autoscaling_policy; - } - - /** - * Return a fully-qualified projectLocationWorkflowTemplate resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} workflow_template - * @returns {string} Resource name string. - */ - projectLocationWorkflowTemplatePath(project:string,location:string,workflowTemplate:string) { - return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render({ - project: project, - location: location, - workflow_template: workflowTemplate, - }); - } - - /** - * Parse the project from ProjectLocationWorkflowTemplate resource. - * - * @param {string} projectLocationWorkflowTemplateName - * A fully-qualified path representing project_location_workflow_template resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { - return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).project; - } - - /** - * Parse the location from ProjectLocationWorkflowTemplate resource. - * - * @param {string} projectLocationWorkflowTemplateName - * A fully-qualified path representing project_location_workflow_template resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { - return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).location; - } - - /** - * Parse the workflow_template from ProjectLocationWorkflowTemplate resource. - * - * @param {string} projectLocationWorkflowTemplateName - * A fully-qualified path representing project_location_workflow_template resource. - * @returns {string} A string representing the workflow_template. - */ - matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { - return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).workflow_template; - } - - /** - * Return a fully-qualified projectRegionAutoscalingPolicy resource name string. - * - * @param {string} project - * @param {string} region - * @param {string} autoscaling_policy - * @returns {string} Resource name string. - */ - projectRegionAutoscalingPolicyPath(project:string,region:string,autoscalingPolicy:string) { - return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render({ - project: project, - region: region, - autoscaling_policy: autoscalingPolicy, - }); - } - - /** - * Parse the project from ProjectRegionAutoscalingPolicy resource. - * - * @param {string} projectRegionAutoscalingPolicyName - * A fully-qualified path representing project_region_autoscaling_policy resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { - return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).project; - } - - /** - * Parse the region from ProjectRegionAutoscalingPolicy resource. - * - * @param {string} projectRegionAutoscalingPolicyName - * A fully-qualified path representing project_region_autoscaling_policy resource. - * @returns {string} A string representing the region. - */ - matchRegionFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { - return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).region; - } - - /** - * Parse the autoscaling_policy from ProjectRegionAutoscalingPolicy resource. - * - * @param {string} projectRegionAutoscalingPolicyName - * A fully-qualified path representing project_region_autoscaling_policy resource. - * @returns {string} A string representing the autoscaling_policy. - */ - matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { - return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).autoscaling_policy; - } - - /** - * Return a fully-qualified projectRegionWorkflowTemplate resource name string. - * - * @param {string} project - * @param {string} region - * @param {string} workflow_template - * @returns {string} Resource name string. - */ - projectRegionWorkflowTemplatePath(project:string,region:string,workflowTemplate:string) { - return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render({ - project: project, - region: region, - workflow_template: workflowTemplate, - }); - } - - /** - * Parse the project from ProjectRegionWorkflowTemplate resource. - * - * @param {string} projectRegionWorkflowTemplateName - * A fully-qualified path representing project_region_workflow_template resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { - return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).project; - } - - /** - * Parse the region from ProjectRegionWorkflowTemplate resource. - * - * @param {string} projectRegionWorkflowTemplateName - * A fully-qualified path representing project_region_workflow_template resource. - * @returns {string} A string representing the region. - */ - matchRegionFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { - return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).region; - } - - /** - * Parse the workflow_template from ProjectRegionWorkflowTemplate resource. - * - * @param {string} projectRegionWorkflowTemplateName - * A fully-qualified path representing project_region_workflow_template resource. - * @returns {string} A string representing the workflow_template. - */ - matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { - return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).workflow_template; - } - - /** - * Return a fully-qualified session resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} session - * @returns {string} Resource name string. - */ - sessionPath(project:string,location:string,session:string) { - return this.pathTemplates.sessionPathTemplate.render({ - project: project, - location: location, - session: session, - }); - } - - /** - * Parse the project from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).project; - } - - /** - * Parse the location from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).location; - } - - /** - * Parse the session from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the session. - */ - matchSessionFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).session; - } - - /** - * Return a fully-qualified sessionTemplate resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} template - * @returns {string} Resource name string. - */ - sessionTemplatePath(project:string,location:string,template:string) { - return this.pathTemplates.sessionTemplatePathTemplate.render({ - project: project, - location: location, - template: template, - }); - } - - /** - * Parse the project from SessionTemplate resource. - * - * @param {string} sessionTemplateName - * A fully-qualified path representing SessionTemplate resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSessionTemplateName(sessionTemplateName: string) { - return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).project; - } - - /** - * Parse the location from SessionTemplate resource. - * - * @param {string} sessionTemplateName - * A fully-qualified path representing SessionTemplate resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSessionTemplateName(sessionTemplateName: string) { - return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).location; - } - - /** - * Parse the template from SessionTemplate resource. - * - * @param {string} sessionTemplateName - * A fully-qualified path representing SessionTemplate resource. - * @returns {string} A string representing the template. - */ - matchTemplateFromSessionTemplateName(sessionTemplateName: string) { - return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).template; - } - - /** - * 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.sessionControllerStub && !this._terminated) { - return this.sessionControllerStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.iamClient.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-dataproc/src/v1/session_controller_client_config.json b/owl-bot-staging/google-cloud-dataproc/src/v1/session_controller_client_config.json deleted file mode 100644 index df8b2d0cba47..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/src/v1/session_controller_client_config.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "interfaces": { - "google.cloud.dataproc.v1.SessionController": { - "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": { - "CreateSession": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetSession": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListSessions": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "TerminateSession": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteSession": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/session_controller_proto_list.json b/owl-bot-staging/google-cloud-dataproc/src/v1/session_controller_proto_list.json deleted file mode 100644 index d6798f50ae7c..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/src/v1/session_controller_proto_list.json +++ /dev/null @@ -1,12 +0,0 @@ -[ - "../../protos/google/cloud/dataproc/v1/autoscaling_policies.proto", - "../../protos/google/cloud/dataproc/v1/batches.proto", - "../../protos/google/cloud/dataproc/v1/clusters.proto", - "../../protos/google/cloud/dataproc/v1/jobs.proto", - "../../protos/google/cloud/dataproc/v1/node_groups.proto", - "../../protos/google/cloud/dataproc/v1/operations.proto", - "../../protos/google/cloud/dataproc/v1/session_templates.proto", - "../../protos/google/cloud/dataproc/v1/sessions.proto", - "../../protos/google/cloud/dataproc/v1/shared.proto", - "../../protos/google/cloud/dataproc/v1/workflow_templates.proto" -] diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/session_template_controller_client.ts b/owl-bot-staging/google-cloud-dataproc/src/v1/session_template_controller_client.ts deleted file mode 100644 index 3bc0a772c4a1..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/src/v1/session_template_controller_client.ts +++ /dev/null @@ -1,1583 +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, IamClient, IamProtos} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v1/session_template_controller_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './session_template_controller_client_config.json'; -const version = require('../../../package.json').version; - -/** - * The SessionTemplateController provides methods to manage session templates. - * @class - * @memberof v1 - */ -export class SessionTemplateControllerClient { - 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('dataproc'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - iamClient: IamClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - sessionTemplateControllerStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of SessionTemplateControllerClient. - * - * @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 SessionTemplateControllerClient({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 SessionTemplateControllerClient; - 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 = 'dataproc.' + 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.iamClient = new this._gaxModule.IamClient(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 = { - batchPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batches/{batch}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - nodeGroupPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{node_group}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - projectLocationAutoscalingPolicyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/autoscalingPolicies/{autoscaling_policy}' - ), - projectLocationWorkflowTemplatePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/workflowTemplates/{workflow_template}' - ), - projectRegionAutoscalingPolicyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/regions/{region}/autoscalingPolicies/{autoscaling_policy}' - ), - projectRegionWorkflowTemplatePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/regions/{region}/workflowTemplates/{workflow_template}' - ), - sessionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/sessions/{session}' - ), - sessionTemplatePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/sessionTemplates/{template}' - ), - }; - - // 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 = { - listSessionTemplates: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'sessionTemplates') - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.dataproc.v1.SessionTemplateController', 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.sessionTemplateControllerStub) { - return this.sessionTemplateControllerStub; - } - - // Put together the "service stub" for - // google.cloud.dataproc.v1.SessionTemplateController. - this.sessionTemplateControllerStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.dataproc.v1.SessionTemplateController') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.dataproc.v1.SessionTemplateController, - 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 sessionTemplateControllerStubMethods = - ['createSessionTemplate', 'updateSessionTemplate', 'getSessionTemplate', 'listSessionTemplates', 'deleteSessionTemplate']; - for (const methodName of sessionTemplateControllerStubMethods) { - const callPromise = this.sessionTemplateControllerStub.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.sessionTemplateControllerStub; - } - - /** - * 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 'dataproc.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 'dataproc.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- -/** - * Create a session template synchronously. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource where this session template will be created. - * @param {google.cloud.dataproc.v1.SessionTemplate} request.sessionTemplate - * Required. The session template to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.dataproc.v1.SessionTemplate|SessionTemplate}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/session_template_controller.create_session_template.js - * region_tag:dataproc_v1_generated_SessionTemplateController_CreateSessionTemplate_async - */ - createSessionTemplate( - request?: protos.google.cloud.dataproc.v1.ICreateSessionTemplateRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataproc.v1.ISessionTemplate, - protos.google.cloud.dataproc.v1.ICreateSessionTemplateRequest|undefined, {}|undefined - ]>; - createSessionTemplate( - request: protos.google.cloud.dataproc.v1.ICreateSessionTemplateRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataproc.v1.ISessionTemplate, - protos.google.cloud.dataproc.v1.ICreateSessionTemplateRequest|null|undefined, - {}|null|undefined>): void; - createSessionTemplate( - request: protos.google.cloud.dataproc.v1.ICreateSessionTemplateRequest, - callback: Callback< - protos.google.cloud.dataproc.v1.ISessionTemplate, - protos.google.cloud.dataproc.v1.ICreateSessionTemplateRequest|null|undefined, - {}|null|undefined>): void; - createSessionTemplate( - request?: protos.google.cloud.dataproc.v1.ICreateSessionTemplateRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataproc.v1.ISessionTemplate, - protos.google.cloud.dataproc.v1.ICreateSessionTemplateRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataproc.v1.ISessionTemplate, - protos.google.cloud.dataproc.v1.ICreateSessionTemplateRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataproc.v1.ISessionTemplate, - protos.google.cloud.dataproc.v1.ICreateSessionTemplateRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof 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('createSessionTemplate request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.dataproc.v1.ISessionTemplate, - protos.google.cloud.dataproc.v1.ICreateSessionTemplateRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createSessionTemplate response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createSessionTemplate(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.dataproc.v1.ISessionTemplate, - protos.google.cloud.dataproc.v1.ICreateSessionTemplateRequest|undefined, - {}|undefined - ]) => { - this._log.info('createSessionTemplate response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Updates the session template synchronously. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.dataproc.v1.SessionTemplate} request.sessionTemplate - * Required. The updated session template. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.dataproc.v1.SessionTemplate|SessionTemplate}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/session_template_controller.update_session_template.js - * region_tag:dataproc_v1_generated_SessionTemplateController_UpdateSessionTemplate_async - */ - updateSessionTemplate( - request?: protos.google.cloud.dataproc.v1.IUpdateSessionTemplateRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataproc.v1.ISessionTemplate, - protos.google.cloud.dataproc.v1.IUpdateSessionTemplateRequest|undefined, {}|undefined - ]>; - updateSessionTemplate( - request: protos.google.cloud.dataproc.v1.IUpdateSessionTemplateRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataproc.v1.ISessionTemplate, - protos.google.cloud.dataproc.v1.IUpdateSessionTemplateRequest|null|undefined, - {}|null|undefined>): void; - updateSessionTemplate( - request: protos.google.cloud.dataproc.v1.IUpdateSessionTemplateRequest, - callback: Callback< - protos.google.cloud.dataproc.v1.ISessionTemplate, - protos.google.cloud.dataproc.v1.IUpdateSessionTemplateRequest|null|undefined, - {}|null|undefined>): void; - updateSessionTemplate( - request?: protos.google.cloud.dataproc.v1.IUpdateSessionTemplateRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataproc.v1.ISessionTemplate, - protos.google.cloud.dataproc.v1.IUpdateSessionTemplateRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataproc.v1.ISessionTemplate, - protos.google.cloud.dataproc.v1.IUpdateSessionTemplateRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataproc.v1.ISessionTemplate, - protos.google.cloud.dataproc.v1.IUpdateSessionTemplateRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'session_template.name': request.sessionTemplate!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateSessionTemplate request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.dataproc.v1.ISessionTemplate, - protos.google.cloud.dataproc.v1.IUpdateSessionTemplateRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateSessionTemplate response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateSessionTemplate(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.dataproc.v1.ISessionTemplate, - protos.google.cloud.dataproc.v1.IUpdateSessionTemplateRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateSessionTemplate 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 resource representation for a session template. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the session template to retrieve. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.dataproc.v1.SessionTemplate|SessionTemplate}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/session_template_controller.get_session_template.js - * region_tag:dataproc_v1_generated_SessionTemplateController_GetSessionTemplate_async - */ - getSessionTemplate( - request?: protos.google.cloud.dataproc.v1.IGetSessionTemplateRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataproc.v1.ISessionTemplate, - protos.google.cloud.dataproc.v1.IGetSessionTemplateRequest|undefined, {}|undefined - ]>; - getSessionTemplate( - request: protos.google.cloud.dataproc.v1.IGetSessionTemplateRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataproc.v1.ISessionTemplate, - protos.google.cloud.dataproc.v1.IGetSessionTemplateRequest|null|undefined, - {}|null|undefined>): void; - getSessionTemplate( - request: protos.google.cloud.dataproc.v1.IGetSessionTemplateRequest, - callback: Callback< - protos.google.cloud.dataproc.v1.ISessionTemplate, - protos.google.cloud.dataproc.v1.IGetSessionTemplateRequest|null|undefined, - {}|null|undefined>): void; - getSessionTemplate( - request?: protos.google.cloud.dataproc.v1.IGetSessionTemplateRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataproc.v1.ISessionTemplate, - protos.google.cloud.dataproc.v1.IGetSessionTemplateRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataproc.v1.ISessionTemplate, - protos.google.cloud.dataproc.v1.IGetSessionTemplateRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataproc.v1.ISessionTemplate, - protos.google.cloud.dataproc.v1.IGetSessionTemplateRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof 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('getSessionTemplate request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.dataproc.v1.ISessionTemplate, - protos.google.cloud.dataproc.v1.IGetSessionTemplateRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getSessionTemplate response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getSessionTemplate(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.dataproc.v1.ISessionTemplate, - protos.google.cloud.dataproc.v1.IGetSessionTemplateRequest|undefined, - {}|undefined - ]) => { - this._log.info('getSessionTemplate 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 session template. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the session template resource to delete. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/session_template_controller.delete_session_template.js - * region_tag:dataproc_v1_generated_SessionTemplateController_DeleteSessionTemplate_async - */ - deleteSessionTemplate( - request?: protos.google.cloud.dataproc.v1.IDeleteSessionTemplateRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteSessionTemplateRequest|undefined, {}|undefined - ]>; - deleteSessionTemplate( - request: protos.google.cloud.dataproc.v1.IDeleteSessionTemplateRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteSessionTemplateRequest|null|undefined, - {}|null|undefined>): void; - deleteSessionTemplate( - request: protos.google.cloud.dataproc.v1.IDeleteSessionTemplateRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteSessionTemplateRequest|null|undefined, - {}|null|undefined>): void; - deleteSessionTemplate( - request?: protos.google.cloud.dataproc.v1.IDeleteSessionTemplateRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteSessionTemplateRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteSessionTemplateRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteSessionTemplateRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof 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('deleteSessionTemplate request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteSessionTemplateRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteSessionTemplate response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteSessionTemplate(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteSessionTemplateRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteSessionTemplate 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 session templates. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent that owns this collection of session templates. - * @param {number} [request.pageSize] - * Optional. The maximum number of sessions to return in each response. - * The service may return fewer than this value. - * @param {string} [request.pageToken] - * Optional. A page token received from a previous `ListSessions` call. - * Provide this token to retrieve the subsequent page. - * @param {string} [request.filter] - * Optional. A filter for the session templates to return in the response. - * Filters are case sensitive and have the following syntax: - * - * [field = value] AND [field [= value]] ... - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.dataproc.v1.SessionTemplate|SessionTemplate}. - * 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 `listSessionTemplatesAsync()` - * 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. - */ - listSessionTemplates( - request?: protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataproc.v1.ISessionTemplate[], - protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest|null, - protos.google.cloud.dataproc.v1.IListSessionTemplatesResponse - ]>; - listSessionTemplates( - request: protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest, - protos.google.cloud.dataproc.v1.IListSessionTemplatesResponse|null|undefined, - protos.google.cloud.dataproc.v1.ISessionTemplate>): void; - listSessionTemplates( - request: protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest, - callback: PaginationCallback< - protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest, - protos.google.cloud.dataproc.v1.IListSessionTemplatesResponse|null|undefined, - protos.google.cloud.dataproc.v1.ISessionTemplate>): void; - listSessionTemplates( - request?: protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest, - protos.google.cloud.dataproc.v1.IListSessionTemplatesResponse|null|undefined, - protos.google.cloud.dataproc.v1.ISessionTemplate>, - callback?: PaginationCallback< - protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest, - protos.google.cloud.dataproc.v1.IListSessionTemplatesResponse|null|undefined, - protos.google.cloud.dataproc.v1.ISessionTemplate>): - Promise<[ - protos.google.cloud.dataproc.v1.ISessionTemplate[], - protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest|null, - protos.google.cloud.dataproc.v1.IListSessionTemplatesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof 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.dataproc.v1.IListSessionTemplatesRequest, - protos.google.cloud.dataproc.v1.IListSessionTemplatesResponse|null|undefined, - protos.google.cloud.dataproc.v1.ISessionTemplate>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listSessionTemplates values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listSessionTemplates request %j', request); - return this.innerApiCalls - .listSessionTemplates(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.dataproc.v1.ISessionTemplate[], - protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest|null, - protos.google.cloud.dataproc.v1.IListSessionTemplatesResponse - ]) => { - this._log.info('listSessionTemplates values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listSessionTemplates`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent that owns this collection of session templates. - * @param {number} [request.pageSize] - * Optional. The maximum number of sessions to return in each response. - * The service may return fewer than this value. - * @param {string} [request.pageToken] - * Optional. A page token received from a previous `ListSessions` call. - * Provide this token to retrieve the subsequent page. - * @param {string} [request.filter] - * Optional. A filter for the session templates to return in the response. - * Filters are case sensitive and have the following syntax: - * - * [field = value] AND [field [= value]] ... - * @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.dataproc.v1.SessionTemplate|SessionTemplate} 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 `listSessionTemplatesAsync()` - * 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. - */ - listSessionTemplatesStream( - request?: protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest, - 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['listSessionTemplates']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listSessionTemplates stream %j', request); - return this.descriptors.page.listSessionTemplates.createStream( - this.innerApiCalls.listSessionTemplates as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listSessionTemplates`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent that owns this collection of session templates. - * @param {number} [request.pageSize] - * Optional. The maximum number of sessions to return in each response. - * The service may return fewer than this value. - * @param {string} [request.pageToken] - * Optional. A page token received from a previous `ListSessions` call. - * Provide this token to retrieve the subsequent page. - * @param {string} [request.filter] - * Optional. A filter for the session templates to return in the response. - * Filters are case sensitive and have the following syntax: - * - * [field = value] AND [field [= value]] ... - * @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.dataproc.v1.SessionTemplate|SessionTemplate}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/session_template_controller.list_session_templates.js - * region_tag:dataproc_v1_generated_SessionTemplateController_ListSessionTemplates_async - */ - listSessionTemplatesAsync( - request?: protos.google.cloud.dataproc.v1.IListSessionTemplatesRequest, - 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['listSessionTemplates']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listSessionTemplates iterate %j', request); - return this.descriptors.page.listSessionTemplates.asyncIterate( - this.innerApiCalls['listSessionTemplates'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @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 {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @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/interfaces/CallOptions.html | 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.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { - return this.iamClient.testIamPermissions(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified batch resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch - * @returns {string} Resource name string. - */ - batchPath(project:string,location:string,batch:string) { - return this.pathTemplates.batchPathTemplate.render({ - project: project, - location: location, - batch: batch, - }); - } - - /** - * Parse the project from Batch resource. - * - * @param {string} batchName - * A fully-qualified path representing Batch resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchName(batchName: string) { - return this.pathTemplates.batchPathTemplate.match(batchName).project; - } - - /** - * Parse the location from Batch resource. - * - * @param {string} batchName - * A fully-qualified path representing Batch resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchName(batchName: string) { - return this.pathTemplates.batchPathTemplate.match(batchName).location; - } - - /** - * Parse the batch from Batch resource. - * - * @param {string} batchName - * A fully-qualified path representing Batch resource. - * @returns {string} A string representing the batch. - */ - matchBatchFromBatchName(batchName: string) { - return this.pathTemplates.batchPathTemplate.match(batchName).batch; - } - - /** - * 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 nodeGroup resource name string. - * - * @param {string} project - * @param {string} region - * @param {string} cluster - * @param {string} node_group - * @returns {string} Resource name string. - */ - nodeGroupPath(project:string,region:string,cluster:string,nodeGroup:string) { - return this.pathTemplates.nodeGroupPathTemplate.render({ - project: project, - region: region, - cluster: cluster, - node_group: nodeGroup, - }); - } - - /** - * Parse the project from NodeGroup resource. - * - * @param {string} nodeGroupName - * A fully-qualified path representing NodeGroup resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNodeGroupName(nodeGroupName: string) { - return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).project; - } - - /** - * Parse the region from NodeGroup resource. - * - * @param {string} nodeGroupName - * A fully-qualified path representing NodeGroup resource. - * @returns {string} A string representing the region. - */ - matchRegionFromNodeGroupName(nodeGroupName: string) { - return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).region; - } - - /** - * Parse the cluster from NodeGroup resource. - * - * @param {string} nodeGroupName - * A fully-qualified path representing NodeGroup resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromNodeGroupName(nodeGroupName: string) { - return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).cluster; - } - - /** - * Parse the node_group from NodeGroup resource. - * - * @param {string} nodeGroupName - * A fully-qualified path representing NodeGroup resource. - * @returns {string} A string representing the node_group. - */ - matchNodeGroupFromNodeGroupName(nodeGroupName: string) { - return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).node_group; - } - - /** - * 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 projectLocationAutoscalingPolicy resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} autoscaling_policy - * @returns {string} Resource name string. - */ - projectLocationAutoscalingPolicyPath(project:string,location:string,autoscalingPolicy:string) { - return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render({ - project: project, - location: location, - autoscaling_policy: autoscalingPolicy, - }); - } - - /** - * Parse the project from ProjectLocationAutoscalingPolicy resource. - * - * @param {string} projectLocationAutoscalingPolicyName - * A fully-qualified path representing project_location_autoscaling_policy resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { - return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).project; - } - - /** - * Parse the location from ProjectLocationAutoscalingPolicy resource. - * - * @param {string} projectLocationAutoscalingPolicyName - * A fully-qualified path representing project_location_autoscaling_policy resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { - return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).location; - } - - /** - * Parse the autoscaling_policy from ProjectLocationAutoscalingPolicy resource. - * - * @param {string} projectLocationAutoscalingPolicyName - * A fully-qualified path representing project_location_autoscaling_policy resource. - * @returns {string} A string representing the autoscaling_policy. - */ - matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { - return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).autoscaling_policy; - } - - /** - * Return a fully-qualified projectLocationWorkflowTemplate resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} workflow_template - * @returns {string} Resource name string. - */ - projectLocationWorkflowTemplatePath(project:string,location:string,workflowTemplate:string) { - return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render({ - project: project, - location: location, - workflow_template: workflowTemplate, - }); - } - - /** - * Parse the project from ProjectLocationWorkflowTemplate resource. - * - * @param {string} projectLocationWorkflowTemplateName - * A fully-qualified path representing project_location_workflow_template resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { - return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).project; - } - - /** - * Parse the location from ProjectLocationWorkflowTemplate resource. - * - * @param {string} projectLocationWorkflowTemplateName - * A fully-qualified path representing project_location_workflow_template resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { - return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).location; - } - - /** - * Parse the workflow_template from ProjectLocationWorkflowTemplate resource. - * - * @param {string} projectLocationWorkflowTemplateName - * A fully-qualified path representing project_location_workflow_template resource. - * @returns {string} A string representing the workflow_template. - */ - matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { - return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).workflow_template; - } - - /** - * Return a fully-qualified projectRegionAutoscalingPolicy resource name string. - * - * @param {string} project - * @param {string} region - * @param {string} autoscaling_policy - * @returns {string} Resource name string. - */ - projectRegionAutoscalingPolicyPath(project:string,region:string,autoscalingPolicy:string) { - return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render({ - project: project, - region: region, - autoscaling_policy: autoscalingPolicy, - }); - } - - /** - * Parse the project from ProjectRegionAutoscalingPolicy resource. - * - * @param {string} projectRegionAutoscalingPolicyName - * A fully-qualified path representing project_region_autoscaling_policy resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { - return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).project; - } - - /** - * Parse the region from ProjectRegionAutoscalingPolicy resource. - * - * @param {string} projectRegionAutoscalingPolicyName - * A fully-qualified path representing project_region_autoscaling_policy resource. - * @returns {string} A string representing the region. - */ - matchRegionFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { - return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).region; - } - - /** - * Parse the autoscaling_policy from ProjectRegionAutoscalingPolicy resource. - * - * @param {string} projectRegionAutoscalingPolicyName - * A fully-qualified path representing project_region_autoscaling_policy resource. - * @returns {string} A string representing the autoscaling_policy. - */ - matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { - return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).autoscaling_policy; - } - - /** - * Return a fully-qualified projectRegionWorkflowTemplate resource name string. - * - * @param {string} project - * @param {string} region - * @param {string} workflow_template - * @returns {string} Resource name string. - */ - projectRegionWorkflowTemplatePath(project:string,region:string,workflowTemplate:string) { - return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render({ - project: project, - region: region, - workflow_template: workflowTemplate, - }); - } - - /** - * Parse the project from ProjectRegionWorkflowTemplate resource. - * - * @param {string} projectRegionWorkflowTemplateName - * A fully-qualified path representing project_region_workflow_template resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { - return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).project; - } - - /** - * Parse the region from ProjectRegionWorkflowTemplate resource. - * - * @param {string} projectRegionWorkflowTemplateName - * A fully-qualified path representing project_region_workflow_template resource. - * @returns {string} A string representing the region. - */ - matchRegionFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { - return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).region; - } - - /** - * Parse the workflow_template from ProjectRegionWorkflowTemplate resource. - * - * @param {string} projectRegionWorkflowTemplateName - * A fully-qualified path representing project_region_workflow_template resource. - * @returns {string} A string representing the workflow_template. - */ - matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { - return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).workflow_template; - } - - /** - * Return a fully-qualified session resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} session - * @returns {string} Resource name string. - */ - sessionPath(project:string,location:string,session:string) { - return this.pathTemplates.sessionPathTemplate.render({ - project: project, - location: location, - session: session, - }); - } - - /** - * Parse the project from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).project; - } - - /** - * Parse the location from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).location; - } - - /** - * Parse the session from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the session. - */ - matchSessionFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).session; - } - - /** - * Return a fully-qualified sessionTemplate resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} template - * @returns {string} Resource name string. - */ - sessionTemplatePath(project:string,location:string,template:string) { - return this.pathTemplates.sessionTemplatePathTemplate.render({ - project: project, - location: location, - template: template, - }); - } - - /** - * Parse the project from SessionTemplate resource. - * - * @param {string} sessionTemplateName - * A fully-qualified path representing SessionTemplate resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSessionTemplateName(sessionTemplateName: string) { - return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).project; - } - - /** - * Parse the location from SessionTemplate resource. - * - * @param {string} sessionTemplateName - * A fully-qualified path representing SessionTemplate resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSessionTemplateName(sessionTemplateName: string) { - return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).location; - } - - /** - * Parse the template from SessionTemplate resource. - * - * @param {string} sessionTemplateName - * A fully-qualified path representing SessionTemplate resource. - * @returns {string} A string representing the template. - */ - matchTemplateFromSessionTemplateName(sessionTemplateName: string) { - return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).template; - } - - /** - * 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.sessionTemplateControllerStub && !this._terminated) { - return this.sessionTemplateControllerStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.iamClient.close().catch(err => {throw err}); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/session_template_controller_client_config.json b/owl-bot-staging/google-cloud-dataproc/src/v1/session_template_controller_client_config.json deleted file mode 100644 index b7fed36bf851..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/src/v1/session_template_controller_client_config.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "interfaces": { - "google.cloud.dataproc.v1.SessionTemplateController": { - "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": { - "CreateSessionTemplate": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateSessionTemplate": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetSessionTemplate": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListSessionTemplates": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteSessionTemplate": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/session_template_controller_proto_list.json b/owl-bot-staging/google-cloud-dataproc/src/v1/session_template_controller_proto_list.json deleted file mode 100644 index d6798f50ae7c..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/src/v1/session_template_controller_proto_list.json +++ /dev/null @@ -1,12 +0,0 @@ -[ - "../../protos/google/cloud/dataproc/v1/autoscaling_policies.proto", - "../../protos/google/cloud/dataproc/v1/batches.proto", - "../../protos/google/cloud/dataproc/v1/clusters.proto", - "../../protos/google/cloud/dataproc/v1/jobs.proto", - "../../protos/google/cloud/dataproc/v1/node_groups.proto", - "../../protos/google/cloud/dataproc/v1/operations.proto", - "../../protos/google/cloud/dataproc/v1/session_templates.proto", - "../../protos/google/cloud/dataproc/v1/sessions.proto", - "../../protos/google/cloud/dataproc/v1/shared.proto", - "../../protos/google/cloud/dataproc/v1/workflow_templates.proto" -] diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/workflow_template_service_client.ts b/owl-bot-staging/google-cloud-dataproc/src/v1/workflow_template_service_client.ts deleted file mode 100644 index 4ce5d8aa5068..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/src/v1/workflow_template_service_client.ts +++ /dev/null @@ -1,2209 +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, IamClient, IamProtos} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v1/workflow_template_service_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './workflow_template_service_client_config.json'; -const version = require('../../../package.json').version; - -/** - * The API interface for managing Workflow Templates in the - * Dataproc API. - * @class - * @memberof v1 - */ -export class WorkflowTemplateServiceClient { - 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('dataproc'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - iamClient: IamClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - workflowTemplateServiceStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of WorkflowTemplateServiceClient. - * - * @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 WorkflowTemplateServiceClient({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 WorkflowTemplateServiceClient; - 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 = 'dataproc.' + 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.iamClient = new this._gaxModule.IamClient(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 = { - batchPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/batches/{batch}' - ), - nodeGroupPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{node_group}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - projectLocationAutoscalingPolicyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/autoscalingPolicies/{autoscaling_policy}' - ), - projectLocationWorkflowTemplatePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/workflowTemplates/{workflow_template}' - ), - projectRegionAutoscalingPolicyPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/regions/{region}/autoscalingPolicies/{autoscaling_policy}' - ), - projectRegionWorkflowTemplatePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/regions/{region}/workflowTemplates/{workflow_template}' - ), - regionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/regions/{region}' - ), - sessionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/sessions/{session}' - ), - sessionTemplatePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/sessionTemplates/{template}' - ), - }; - - // 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 = { - listWorkflowTemplates: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'templates') - }; - - 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.iam.v1.IAMPolicy.GetIamPolicy',post: '/v1/{resource=projects/*/regions/*/clusters/*}:getIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:getIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:getIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/regions/*/clusters/*}:setIamPolicy',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:setIamPolicy',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:setIamPolicy',body: '*',}], - },{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/regions/*/clusters/*}:testIamPermissions',body: '*',additional_bindings: [{post: '/v1/{resource=projects/*/regions/*/jobs/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/operations/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/workflowTemplates/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/workflowTemplates/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/regions/*/autoscalingPolicies/*}:testIamPermissions',body: '*',},{post: '/v1/{resource=projects/*/locations/*/autoscalingPolicies/*}:testIamPermissions',body: '*',}], - },{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/regions/*/operations/*}:cancel',additional_bindings: [{post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',}], - },{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/regions/*/operations/*}',additional_bindings: [{delete: '/v1/{name=projects/*/locations/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/regions/*/operations/*}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*/operations/*}',}], - },{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/regions/*/operations}',additional_bindings: [{get: '/v1/{name=projects/*/locations/*/operations}',}], - }]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const instantiateWorkflowTemplateResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const instantiateWorkflowTemplateMetadata = protoFilesRoot.lookup( - '.google.cloud.dataproc.v1.WorkflowMetadata') as gax.protobuf.Type; - const instantiateInlineWorkflowTemplateResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const instantiateInlineWorkflowTemplateMetadata = protoFilesRoot.lookup( - '.google.cloud.dataproc.v1.WorkflowMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - instantiateWorkflowTemplate: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - instantiateWorkflowTemplateResponse.decode.bind(instantiateWorkflowTemplateResponse), - instantiateWorkflowTemplateMetadata.decode.bind(instantiateWorkflowTemplateMetadata)), - instantiateInlineWorkflowTemplate: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - instantiateInlineWorkflowTemplateResponse.decode.bind(instantiateInlineWorkflowTemplateResponse), - instantiateInlineWorkflowTemplateMetadata.decode.bind(instantiateInlineWorkflowTemplateMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.dataproc.v1.WorkflowTemplateService', 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.workflowTemplateServiceStub) { - return this.workflowTemplateServiceStub; - } - - // Put together the "service stub" for - // google.cloud.dataproc.v1.WorkflowTemplateService. - this.workflowTemplateServiceStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.dataproc.v1.WorkflowTemplateService') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.dataproc.v1.WorkflowTemplateService, - 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 workflowTemplateServiceStubMethods = - ['createWorkflowTemplate', 'getWorkflowTemplate', 'instantiateWorkflowTemplate', 'instantiateInlineWorkflowTemplate', 'updateWorkflowTemplate', 'listWorkflowTemplates', 'deleteWorkflowTemplate']; - for (const methodName of workflowTemplateServiceStubMethods) { - const callPromise = this.workflowTemplateServiceStub.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.workflowTemplateServiceStub; - } - - /** - * 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 'dataproc.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 'dataproc.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 -- - // ------------------- -/** - * Creates new workflow template. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the region or location, as described - * in https://cloud.google.com/apis/design/resource_names. - * - * * For `projects.regions.workflowTemplates.create`, the resource name of the - * region has the following format: - * `projects/{project_id}/regions/{region}` - * - * * For `projects.locations.workflowTemplates.create`, the resource name of - * the location has the following format: - * `projects/{project_id}/locations/{location}` - * @param {google.cloud.dataproc.v1.WorkflowTemplate} request.template - * Required. The Dataproc workflow template to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.dataproc.v1.WorkflowTemplate|WorkflowTemplate}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/workflow_template_service.create_workflow_template.js - * region_tag:dataproc_v1_generated_WorkflowTemplateService_CreateWorkflowTemplate_async - */ - createWorkflowTemplate( - request?: protos.google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataproc.v1.IWorkflowTemplate, - protos.google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest|undefined, {}|undefined - ]>; - createWorkflowTemplate( - request: protos.google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataproc.v1.IWorkflowTemplate, - protos.google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest|null|undefined, - {}|null|undefined>): void; - createWorkflowTemplate( - request: protos.google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest, - callback: Callback< - protos.google.cloud.dataproc.v1.IWorkflowTemplate, - protos.google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest|null|undefined, - {}|null|undefined>): void; - createWorkflowTemplate( - request?: protos.google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataproc.v1.IWorkflowTemplate, - protos.google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataproc.v1.IWorkflowTemplate, - protos.google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataproc.v1.IWorkflowTemplate, - protos.google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof 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('createWorkflowTemplate request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.dataproc.v1.IWorkflowTemplate, - protos.google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('createWorkflowTemplate response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.createWorkflowTemplate(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.dataproc.v1.IWorkflowTemplate, - protos.google.cloud.dataproc.v1.ICreateWorkflowTemplateRequest|undefined, - {}|undefined - ]) => { - this._log.info('createWorkflowTemplate 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; - }); - } -/** - * Retrieves the latest workflow template. - * - * Can retrieve previously instantiated template by specifying optional - * version parameter. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the workflow template, as described - * in https://cloud.google.com/apis/design/resource_names. - * - * * For `projects.regions.workflowTemplates.get`, the resource name of the - * template has the following format: - * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` - * - * * For `projects.locations.workflowTemplates.get`, the resource name of the - * template has the following format: - * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` - * @param {number} [request.version] - * Optional. The version of workflow template to retrieve. Only previously - * instantiated versions can be retrieved. - * - * If unspecified, retrieves the current version. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.dataproc.v1.WorkflowTemplate|WorkflowTemplate}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/workflow_template_service.get_workflow_template.js - * region_tag:dataproc_v1_generated_WorkflowTemplateService_GetWorkflowTemplate_async - */ - getWorkflowTemplate( - request?: protos.google.cloud.dataproc.v1.IGetWorkflowTemplateRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataproc.v1.IWorkflowTemplate, - protos.google.cloud.dataproc.v1.IGetWorkflowTemplateRequest|undefined, {}|undefined - ]>; - getWorkflowTemplate( - request: protos.google.cloud.dataproc.v1.IGetWorkflowTemplateRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataproc.v1.IWorkflowTemplate, - protos.google.cloud.dataproc.v1.IGetWorkflowTemplateRequest|null|undefined, - {}|null|undefined>): void; - getWorkflowTemplate( - request: protos.google.cloud.dataproc.v1.IGetWorkflowTemplateRequest, - callback: Callback< - protos.google.cloud.dataproc.v1.IWorkflowTemplate, - protos.google.cloud.dataproc.v1.IGetWorkflowTemplateRequest|null|undefined, - {}|null|undefined>): void; - getWorkflowTemplate( - request?: protos.google.cloud.dataproc.v1.IGetWorkflowTemplateRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataproc.v1.IWorkflowTemplate, - protos.google.cloud.dataproc.v1.IGetWorkflowTemplateRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataproc.v1.IWorkflowTemplate, - protos.google.cloud.dataproc.v1.IGetWorkflowTemplateRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataproc.v1.IWorkflowTemplate, - protos.google.cloud.dataproc.v1.IGetWorkflowTemplateRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof 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('getWorkflowTemplate request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.dataproc.v1.IWorkflowTemplate, - protos.google.cloud.dataproc.v1.IGetWorkflowTemplateRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getWorkflowTemplate response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getWorkflowTemplate(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.dataproc.v1.IWorkflowTemplate, - protos.google.cloud.dataproc.v1.IGetWorkflowTemplateRequest|undefined, - {}|undefined - ]) => { - this._log.info('getWorkflowTemplate response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } -/** - * Updates (replaces) workflow template. The updated template - * must contain version that matches the current server version. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.dataproc.v1.WorkflowTemplate} request.template - * Required. The updated workflow template. - * - * The `template.version` field must match the current version. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.dataproc.v1.WorkflowTemplate|WorkflowTemplate}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/workflow_template_service.update_workflow_template.js - * region_tag:dataproc_v1_generated_WorkflowTemplateService_UpdateWorkflowTemplate_async - */ - updateWorkflowTemplate( - request?: protos.google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataproc.v1.IWorkflowTemplate, - protos.google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest|undefined, {}|undefined - ]>; - updateWorkflowTemplate( - request: protos.google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.dataproc.v1.IWorkflowTemplate, - protos.google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest|null|undefined, - {}|null|undefined>): void; - updateWorkflowTemplate( - request: protos.google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest, - callback: Callback< - protos.google.cloud.dataproc.v1.IWorkflowTemplate, - protos.google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest|null|undefined, - {}|null|undefined>): void; - updateWorkflowTemplate( - request?: protos.google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.dataproc.v1.IWorkflowTemplate, - protos.google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.dataproc.v1.IWorkflowTemplate, - protos.google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.dataproc.v1.IWorkflowTemplate, - protos.google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof 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({ - 'template.name': request.template!.name ?? '', - }); - this.initialize().catch(err => {throw err}); - this._log.info('updateWorkflowTemplate request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.dataproc.v1.IWorkflowTemplate, - protos.google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('updateWorkflowTemplate response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.updateWorkflowTemplate(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.dataproc.v1.IWorkflowTemplate, - protos.google.cloud.dataproc.v1.IUpdateWorkflowTemplateRequest|undefined, - {}|undefined - ]) => { - this._log.info('updateWorkflowTemplate 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 workflow template. It does not cancel in-progress workflows. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the workflow template, as described - * in https://cloud.google.com/apis/design/resource_names. - * - * * For `projects.regions.workflowTemplates.delete`, the resource name - * of the template has the following format: - * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` - * - * * For `projects.locations.workflowTemplates.instantiate`, the resource name - * of the template has the following format: - * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` - * @param {number} [request.version] - * Optional. The version of workflow template to delete. If specified, - * will only delete the template if the current server version matches - * specified version. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/workflow_template_service.delete_workflow_template.js - * region_tag:dataproc_v1_generated_WorkflowTemplateService_DeleteWorkflowTemplate_async - */ - deleteWorkflowTemplate( - request?: protos.google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest, - options?: CallOptions): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest|undefined, {}|undefined - ]>; - deleteWorkflowTemplate( - request: protos.google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest, - options: CallOptions, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest|null|undefined, - {}|null|undefined>): void; - deleteWorkflowTemplate( - request: protos.google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest, - callback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest|null|undefined, - {}|null|undefined>): void; - deleteWorkflowTemplate( - request?: protos.google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof 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('deleteWorkflowTemplate request %j', request); - const wrappedCallback: Callback< - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('deleteWorkflowTemplate response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.deleteWorkflowTemplate(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.protobuf.IEmpty, - protos.google.cloud.dataproc.v1.IDeleteWorkflowTemplateRequest|undefined, - {}|undefined - ]) => { - this._log.info('deleteWorkflowTemplate 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; - }); - } - -/** - * Instantiates a template and begins execution. - * - * The returned Operation can be used to track execution of - * workflow by polling - * {@link protos.google.longrunning.Operations.GetOperation|operations.get}. - * The Operation will complete when entire workflow is finished. - * - * The running workflow can be aborted via - * {@link protos.google.longrunning.Operations.CancelOperation|operations.cancel}. - * This will cause any inflight jobs to be cancelled and workflow-owned - * clusters to be deleted. - * - * The {@link protos.google.longrunning.Operation.metadata|Operation.metadata} will be - * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). - * Also see [Using - * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). - * - * On successful completion, - * {@link protos.google.longrunning.Operation.response|Operation.response} will be - * {@link protos.google.protobuf.Empty|Empty}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the workflow template, as described - * in https://cloud.google.com/apis/design/resource_names. - * - * * For `projects.regions.workflowTemplates.instantiate`, the resource name - * of the template has the following format: - * `projects/{project_id}/regions/{region}/workflowTemplates/{template_id}` - * - * * For `projects.locations.workflowTemplates.instantiate`, the resource name - * of the template has the following format: - * `projects/{project_id}/locations/{location}/workflowTemplates/{template_id}` - * @param {number} [request.version] - * Optional. The version of workflow template to instantiate. If specified, - * the workflow will be instantiated only if the current version of - * the workflow template has the supplied version. - * - * This option cannot be used to instantiate a previous version of - * workflow template. - * @param {string} [request.requestId] - * Optional. A tag that prevents multiple concurrent workflow - * instances with the same tag from running. This mitigates risk of - * concurrent instances started due to retries. - * - * It is recommended to always set this value to a - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - * - * The tag must contain only letters (a-z, A-Z), numbers (0-9), - * underscores (_), and hyphens (-). The maximum length is 40 characters. - * @param {number[]} [request.parameters] - * Optional. Map from parameter names to values that should be used for those - * parameters. Values may not exceed 1000 characters. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/workflow_template_service.instantiate_workflow_template.js - * region_tag:dataproc_v1_generated_WorkflowTemplateService_InstantiateWorkflowTemplate_async - */ - instantiateWorkflowTemplate( - request?: protos.google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - instantiateWorkflowTemplate( - request: protos.google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - instantiateWorkflowTemplate( - request: protos.google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - instantiateWorkflowTemplate( - request?: protos.google.cloud.dataproc.v1.IInstantiateWorkflowTemplateRequest, - 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('instantiateWorkflowTemplate response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('instantiateWorkflowTemplate request %j', request); - return this.innerApiCalls.instantiateWorkflowTemplate(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('instantiateWorkflowTemplate response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `instantiateWorkflowTemplate()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/workflow_template_service.instantiate_workflow_template.js - * region_tag:dataproc_v1_generated_WorkflowTemplateService_InstantiateWorkflowTemplate_async - */ - async checkInstantiateWorkflowTemplateProgress(name: string): Promise>{ - this._log.info('instantiateWorkflowTemplate 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.instantiateWorkflowTemplate, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Instantiates a template and begins execution. - * - * This method is equivalent to executing the sequence - * {@link protos.google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate|CreateWorkflowTemplate}, - * {@link protos.google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate|InstantiateWorkflowTemplate}, - * {@link protos.google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate|DeleteWorkflowTemplate}. - * - * The returned Operation can be used to track execution of - * workflow by polling - * {@link protos.google.longrunning.Operations.GetOperation|operations.get}. - * The Operation will complete when entire workflow is finished. - * - * The running workflow can be aborted via - * {@link protos.google.longrunning.Operations.CancelOperation|operations.cancel}. - * This will cause any inflight jobs to be cancelled and workflow-owned - * clusters to be deleted. - * - * The {@link protos.google.longrunning.Operation.metadata|Operation.metadata} will be - * [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). - * Also see [Using - * WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata). - * - * On successful completion, - * {@link protos.google.longrunning.Operation.response|Operation.response} will be - * {@link protos.google.protobuf.Empty|Empty}. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the region or location, as described - * in https://cloud.google.com/apis/design/resource_names. - * - * * For `projects.regions.workflowTemplates,instantiateinline`, the resource - * name of the region has the following format: - * `projects/{project_id}/regions/{region}` - * - * * For `projects.locations.workflowTemplates.instantiateinline`, the - * resource name of the location has the following format: - * `projects/{project_id}/locations/{location}` - * @param {google.cloud.dataproc.v1.WorkflowTemplate} request.template - * Required. The workflow template to instantiate. - * @param {string} [request.requestId] - * Optional. A tag that prevents multiple concurrent workflow - * instances with the same tag from running. This mitigates risk of - * concurrent instances started due to retries. - * - * It is recommended to always set this value to a - * [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). - * - * The tag must contain only letters (a-z, A-Z), numbers (0-9), - * underscores (_), and hyphens (-). The maximum length is 40 characters. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/workflow_template_service.instantiate_inline_workflow_template.js - * region_tag:dataproc_v1_generated_WorkflowTemplateService_InstantiateInlineWorkflowTemplate_async - */ - instantiateInlineWorkflowTemplate( - request?: protos.google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - instantiateInlineWorkflowTemplate( - request: protos.google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - instantiateInlineWorkflowTemplate( - request: protos.google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - instantiateInlineWorkflowTemplate( - request?: protos.google.cloud.dataproc.v1.IInstantiateInlineWorkflowTemplateRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = this._gaxModule.routingHeader.fromParams({ - 'parent': request.parent ?? '', - }); - this.initialize().catch(err => {throw err}); - const wrappedCallback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('instantiateInlineWorkflowTemplate response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('instantiateInlineWorkflowTemplate request %j', request); - return this.innerApiCalls.instantiateInlineWorkflowTemplate(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('instantiateInlineWorkflowTemplate response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `instantiateInlineWorkflowTemplate()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/workflow_template_service.instantiate_inline_workflow_template.js - * region_tag:dataproc_v1_generated_WorkflowTemplateService_InstantiateInlineWorkflowTemplate_async - */ - async checkInstantiateInlineWorkflowTemplateProgress(name: string): Promise>{ - this._log.info('instantiateInlineWorkflowTemplate 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.instantiateInlineWorkflowTemplate, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists workflows that match the specified filter in the request. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the region or location, as described - * in https://cloud.google.com/apis/design/resource_names. - * - * * For `projects.regions.workflowTemplates,list`, the resource - * name of the region has the following format: - * `projects/{project_id}/regions/{region}` - * - * * For `projects.locations.workflowTemplates.list`, the - * resource name of the location has the following format: - * `projects/{project_id}/locations/{location}` - * @param {number} [request.pageSize] - * Optional. The maximum number of results to return in each response. - * @param {string} [request.pageToken] - * Optional. The page token, returned by a previous call, to request the - * next page of results. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.dataproc.v1.WorkflowTemplate|WorkflowTemplate}. - * 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 `listWorkflowTemplatesAsync()` - * 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. - */ - listWorkflowTemplates( - request?: protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.dataproc.v1.IWorkflowTemplate[], - protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest|null, - protos.google.cloud.dataproc.v1.IListWorkflowTemplatesResponse - ]>; - listWorkflowTemplates( - request: protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest, - protos.google.cloud.dataproc.v1.IListWorkflowTemplatesResponse|null|undefined, - protos.google.cloud.dataproc.v1.IWorkflowTemplate>): void; - listWorkflowTemplates( - request: protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest, - callback: PaginationCallback< - protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest, - protos.google.cloud.dataproc.v1.IListWorkflowTemplatesResponse|null|undefined, - protos.google.cloud.dataproc.v1.IWorkflowTemplate>): void; - listWorkflowTemplates( - request?: protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest, - protos.google.cloud.dataproc.v1.IListWorkflowTemplatesResponse|null|undefined, - protos.google.cloud.dataproc.v1.IWorkflowTemplate>, - callback?: PaginationCallback< - protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest, - protos.google.cloud.dataproc.v1.IListWorkflowTemplatesResponse|null|undefined, - protos.google.cloud.dataproc.v1.IWorkflowTemplate>): - Promise<[ - protos.google.cloud.dataproc.v1.IWorkflowTemplate[], - protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest|null, - protos.google.cloud.dataproc.v1.IListWorkflowTemplatesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof 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.dataproc.v1.IListWorkflowTemplatesRequest, - protos.google.cloud.dataproc.v1.IListWorkflowTemplatesResponse|null|undefined, - protos.google.cloud.dataproc.v1.IWorkflowTemplate>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listWorkflowTemplates values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listWorkflowTemplates request %j', request); - return this.innerApiCalls - .listWorkflowTemplates(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.dataproc.v1.IWorkflowTemplate[], - protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest|null, - protos.google.cloud.dataproc.v1.IListWorkflowTemplatesResponse - ]) => { - this._log.info('listWorkflowTemplates values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listWorkflowTemplates`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource name of the region or location, as described - * in https://cloud.google.com/apis/design/resource_names. - * - * * For `projects.regions.workflowTemplates,list`, the resource - * name of the region has the following format: - * `projects/{project_id}/regions/{region}` - * - * * For `projects.locations.workflowTemplates.list`, the - * resource name of the location has the following format: - * `projects/{project_id}/locations/{location}` - * @param {number} [request.pageSize] - * Optional. The maximum number of results to return in each response. - * @param {string} [request.pageToken] - * Optional. The page token, returned by a previous call, to request the - * next page of results. - * @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.dataproc.v1.WorkflowTemplate|WorkflowTemplate} 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 `listWorkflowTemplatesAsync()` - * 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. - */ - listWorkflowTemplatesStream( - request?: protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest, - 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['listWorkflowTemplates']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listWorkflowTemplates stream %j', request); - return this.descriptors.page.listWorkflowTemplates.createStream( - this.innerApiCalls.listWorkflowTemplates as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listWorkflowTemplates`, 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 resource name of the region or location, as described - * in https://cloud.google.com/apis/design/resource_names. - * - * * For `projects.regions.workflowTemplates,list`, the resource - * name of the region has the following format: - * `projects/{project_id}/regions/{region}` - * - * * For `projects.locations.workflowTemplates.list`, the - * resource name of the location has the following format: - * `projects/{project_id}/locations/{location}` - * @param {number} [request.pageSize] - * Optional. The maximum number of results to return in each response. - * @param {string} [request.pageToken] - * Optional. The page token, returned by a previous call, to request the - * next page of results. - * @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.dataproc.v1.WorkflowTemplate|WorkflowTemplate}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/workflow_template_service.list_workflow_templates.js - * region_tag:dataproc_v1_generated_WorkflowTemplateService_ListWorkflowTemplates_async - */ - listWorkflowTemplatesAsync( - request?: protos.google.cloud.dataproc.v1.IListWorkflowTemplatesRequest, - 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['listWorkflowTemplates']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listWorkflowTemplates iterate %j', request); - return this.descriptors.page.listWorkflowTemplates.asyncIterate( - this.innerApiCalls['listWorkflowTemplates'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } -/** - * Gets the access control policy for a resource. Returns an empty policy - * if the resource exists and does not have a policy set. - * - * @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 {Object} [request.options] - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. This field is only used by Cloud IAM. - * - * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. - * @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/interfaces/CallOptions.html | 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.iam.v1.Policy | Policy}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - getIamPolicy( - request: IamProtos.google.iam.v1.GetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.getIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - setIamPolicy( - request: IamProtos.google.iam.v1.SetIamPolicyRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.Policy, - IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.Policy]> { - return this.iamClient.setIamPolicy(request, options, callback); - } - -/** - * Returns permissions that a caller has on the specified resource. If the - * resource does not exist, this will return an empty set of - * permissions, not a NOT_FOUND error. - * - * Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * - * @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 {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. - * @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/interfaces/CallOptions.html | 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.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - */ - testIamPermissions( - request: IamProtos.google.iam.v1.TestIamPermissionsRequest, - options?: - | gax.CallOptions - | Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - IamProtos.google.iam.v1.TestIamPermissionsResponse, - IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, - {} | null | undefined - > - ):Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { - return this.iamClient.testIamPermissions(request, options, callback); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@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 batch resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} batch - * @returns {string} Resource name string. - */ - batchPath(project:string,location:string,batch:string) { - return this.pathTemplates.batchPathTemplate.render({ - project: project, - location: location, - batch: batch, - }); - } - - /** - * Parse the project from Batch resource. - * - * @param {string} batchName - * A fully-qualified path representing Batch resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBatchName(batchName: string) { - return this.pathTemplates.batchPathTemplate.match(batchName).project; - } - - /** - * Parse the location from Batch resource. - * - * @param {string} batchName - * A fully-qualified path representing Batch resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBatchName(batchName: string) { - return this.pathTemplates.batchPathTemplate.match(batchName).location; - } - - /** - * Parse the batch from Batch resource. - * - * @param {string} batchName - * A fully-qualified path representing Batch resource. - * @returns {string} A string representing the batch. - */ - matchBatchFromBatchName(batchName: string) { - return this.pathTemplates.batchPathTemplate.match(batchName).batch; - } - - /** - * Return a fully-qualified nodeGroup resource name string. - * - * @param {string} project - * @param {string} region - * @param {string} cluster - * @param {string} node_group - * @returns {string} Resource name string. - */ - nodeGroupPath(project:string,region:string,cluster:string,nodeGroup:string) { - return this.pathTemplates.nodeGroupPathTemplate.render({ - project: project, - region: region, - cluster: cluster, - node_group: nodeGroup, - }); - } - - /** - * Parse the project from NodeGroup resource. - * - * @param {string} nodeGroupName - * A fully-qualified path representing NodeGroup resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNodeGroupName(nodeGroupName: string) { - return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).project; - } - - /** - * Parse the region from NodeGroup resource. - * - * @param {string} nodeGroupName - * A fully-qualified path representing NodeGroup resource. - * @returns {string} A string representing the region. - */ - matchRegionFromNodeGroupName(nodeGroupName: string) { - return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).region; - } - - /** - * Parse the cluster from NodeGroup resource. - * - * @param {string} nodeGroupName - * A fully-qualified path representing NodeGroup resource. - * @returns {string} A string representing the cluster. - */ - matchClusterFromNodeGroupName(nodeGroupName: string) { - return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).cluster; - } - - /** - * Parse the node_group from NodeGroup resource. - * - * @param {string} nodeGroupName - * A fully-qualified path representing NodeGroup resource. - * @returns {string} A string representing the node_group. - */ - matchNodeGroupFromNodeGroupName(nodeGroupName: string) { - return this.pathTemplates.nodeGroupPathTemplate.match(nodeGroupName).node_group; - } - - /** - * 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 projectLocationAutoscalingPolicy resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} autoscaling_policy - * @returns {string} Resource name string. - */ - projectLocationAutoscalingPolicyPath(project:string,location:string,autoscalingPolicy:string) { - return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render({ - project: project, - location: location, - autoscaling_policy: autoscalingPolicy, - }); - } - - /** - * Parse the project from ProjectLocationAutoscalingPolicy resource. - * - * @param {string} projectLocationAutoscalingPolicyName - * A fully-qualified path representing project_location_autoscaling_policy resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { - return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).project; - } - - /** - * Parse the location from ProjectLocationAutoscalingPolicy resource. - * - * @param {string} projectLocationAutoscalingPolicyName - * A fully-qualified path representing project_location_autoscaling_policy resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { - return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).location; - } - - /** - * Parse the autoscaling_policy from ProjectLocationAutoscalingPolicy resource. - * - * @param {string} projectLocationAutoscalingPolicyName - * A fully-qualified path representing project_location_autoscaling_policy resource. - * @returns {string} A string representing the autoscaling_policy. - */ - matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(projectLocationAutoscalingPolicyName: string) { - return this.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match(projectLocationAutoscalingPolicyName).autoscaling_policy; - } - - /** - * Return a fully-qualified projectLocationWorkflowTemplate resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} workflow_template - * @returns {string} Resource name string. - */ - projectLocationWorkflowTemplatePath(project:string,location:string,workflowTemplate:string) { - return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render({ - project: project, - location: location, - workflow_template: workflowTemplate, - }); - } - - /** - * Parse the project from ProjectLocationWorkflowTemplate resource. - * - * @param {string} projectLocationWorkflowTemplateName - * A fully-qualified path representing project_location_workflow_template resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { - return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).project; - } - - /** - * Parse the location from ProjectLocationWorkflowTemplate resource. - * - * @param {string} projectLocationWorkflowTemplateName - * A fully-qualified path representing project_location_workflow_template resource. - * @returns {string} A string representing the location. - */ - matchLocationFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { - return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).location; - } - - /** - * Parse the workflow_template from ProjectLocationWorkflowTemplate resource. - * - * @param {string} projectLocationWorkflowTemplateName - * A fully-qualified path representing project_location_workflow_template resource. - * @returns {string} A string representing the workflow_template. - */ - matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(projectLocationWorkflowTemplateName: string) { - return this.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match(projectLocationWorkflowTemplateName).workflow_template; - } - - /** - * Return a fully-qualified projectRegionAutoscalingPolicy resource name string. - * - * @param {string} project - * @param {string} region - * @param {string} autoscaling_policy - * @returns {string} Resource name string. - */ - projectRegionAutoscalingPolicyPath(project:string,region:string,autoscalingPolicy:string) { - return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render({ - project: project, - region: region, - autoscaling_policy: autoscalingPolicy, - }); - } - - /** - * Parse the project from ProjectRegionAutoscalingPolicy resource. - * - * @param {string} projectRegionAutoscalingPolicyName - * A fully-qualified path representing project_region_autoscaling_policy resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { - return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).project; - } - - /** - * Parse the region from ProjectRegionAutoscalingPolicy resource. - * - * @param {string} projectRegionAutoscalingPolicyName - * A fully-qualified path representing project_region_autoscaling_policy resource. - * @returns {string} A string representing the region. - */ - matchRegionFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { - return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).region; - } - - /** - * Parse the autoscaling_policy from ProjectRegionAutoscalingPolicy resource. - * - * @param {string} projectRegionAutoscalingPolicyName - * A fully-qualified path representing project_region_autoscaling_policy resource. - * @returns {string} A string representing the autoscaling_policy. - */ - matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(projectRegionAutoscalingPolicyName: string) { - return this.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match(projectRegionAutoscalingPolicyName).autoscaling_policy; - } - - /** - * Return a fully-qualified projectRegionWorkflowTemplate resource name string. - * - * @param {string} project - * @param {string} region - * @param {string} workflow_template - * @returns {string} Resource name string. - */ - projectRegionWorkflowTemplatePath(project:string,region:string,workflowTemplate:string) { - return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render({ - project: project, - region: region, - workflow_template: workflowTemplate, - }); - } - - /** - * Parse the project from ProjectRegionWorkflowTemplate resource. - * - * @param {string} projectRegionWorkflowTemplateName - * A fully-qualified path representing project_region_workflow_template resource. - * @returns {string} A string representing the project. - */ - matchProjectFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { - return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).project; - } - - /** - * Parse the region from ProjectRegionWorkflowTemplate resource. - * - * @param {string} projectRegionWorkflowTemplateName - * A fully-qualified path representing project_region_workflow_template resource. - * @returns {string} A string representing the region. - */ - matchRegionFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { - return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).region; - } - - /** - * Parse the workflow_template from ProjectRegionWorkflowTemplate resource. - * - * @param {string} projectRegionWorkflowTemplateName - * A fully-qualified path representing project_region_workflow_template resource. - * @returns {string} A string representing the workflow_template. - */ - matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(projectRegionWorkflowTemplateName: string) { - return this.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match(projectRegionWorkflowTemplateName).workflow_template; - } - - /** - * Return a fully-qualified region resource name string. - * - * @param {string} project - * @param {string} region - * @returns {string} Resource name string. - */ - regionPath(project:string,region:string) { - return this.pathTemplates.regionPathTemplate.render({ - project: project, - region: region, - }); - } - - /** - * Parse the project from Region resource. - * - * @param {string} regionName - * A fully-qualified path representing Region resource. - * @returns {string} A string representing the project. - */ - matchProjectFromRegionName(regionName: string) { - return this.pathTemplates.regionPathTemplate.match(regionName).project; - } - - /** - * Parse the region from Region resource. - * - * @param {string} regionName - * A fully-qualified path representing Region resource. - * @returns {string} A string representing the region. - */ - matchRegionFromRegionName(regionName: string) { - return this.pathTemplates.regionPathTemplate.match(regionName).region; - } - - /** - * Return a fully-qualified session resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} session - * @returns {string} Resource name string. - */ - sessionPath(project:string,location:string,session:string) { - return this.pathTemplates.sessionPathTemplate.render({ - project: project, - location: location, - session: session, - }); - } - - /** - * Parse the project from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).project; - } - - /** - * Parse the location from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).location; - } - - /** - * Parse the session from Session resource. - * - * @param {string} sessionName - * A fully-qualified path representing Session resource. - * @returns {string} A string representing the session. - */ - matchSessionFromSessionName(sessionName: string) { - return this.pathTemplates.sessionPathTemplate.match(sessionName).session; - } - - /** - * Return a fully-qualified sessionTemplate resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} template - * @returns {string} Resource name string. - */ - sessionTemplatePath(project:string,location:string,template:string) { - return this.pathTemplates.sessionTemplatePathTemplate.render({ - project: project, - location: location, - template: template, - }); - } - - /** - * Parse the project from SessionTemplate resource. - * - * @param {string} sessionTemplateName - * A fully-qualified path representing SessionTemplate resource. - * @returns {string} A string representing the project. - */ - matchProjectFromSessionTemplateName(sessionTemplateName: string) { - return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).project; - } - - /** - * Parse the location from SessionTemplate resource. - * - * @param {string} sessionTemplateName - * A fully-qualified path representing SessionTemplate resource. - * @returns {string} A string representing the location. - */ - matchLocationFromSessionTemplateName(sessionTemplateName: string) { - return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).location; - } - - /** - * Parse the template from SessionTemplate resource. - * - * @param {string} sessionTemplateName - * A fully-qualified path representing SessionTemplate resource. - * @returns {string} A string representing the template. - */ - matchTemplateFromSessionTemplateName(sessionTemplateName: string) { - return this.pathTemplates.sessionTemplatePathTemplate.match(sessionTemplateName).template; - } - - /** - * 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.workflowTemplateServiceStub && !this._terminated) { - return this.workflowTemplateServiceStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.iamClient.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-dataproc/src/v1/workflow_template_service_client_config.json b/owl-bot-staging/google-cloud-dataproc/src/v1/workflow_template_service_client_config.json deleted file mode 100644 index 62d3aa9b9a02..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/src/v1/workflow_template_service_client_config.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "interfaces": { - "google.cloud.dataproc.v1.WorkflowTemplateService": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "unavailable": [ - "UNAVAILABLE" - ], - "deadline_exceeded_internal_unavailable": [ - "DEADLINE_EXCEEDED", - "INTERNAL", - "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": { - "CreateWorkflowTemplate": { - "timeout_millis": 600000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - }, - "GetWorkflowTemplate": { - "timeout_millis": 600000, - "retry_codes_name": "deadline_exceeded_internal_unavailable", - "retry_params_name": "default" - }, - "InstantiateWorkflowTemplate": { - "timeout_millis": 600000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - }, - "InstantiateInlineWorkflowTemplate": { - "timeout_millis": 600000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - }, - "UpdateWorkflowTemplate": { - "timeout_millis": 600000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - }, - "ListWorkflowTemplates": { - "timeout_millis": 600000, - "retry_codes_name": "deadline_exceeded_internal_unavailable", - "retry_params_name": "default" - }, - "DeleteWorkflowTemplate": { - "timeout_millis": 600000, - "retry_codes_name": "unavailable", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-dataproc/src/v1/workflow_template_service_proto_list.json b/owl-bot-staging/google-cloud-dataproc/src/v1/workflow_template_service_proto_list.json deleted file mode 100644 index d6798f50ae7c..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/src/v1/workflow_template_service_proto_list.json +++ /dev/null @@ -1,12 +0,0 @@ -[ - "../../protos/google/cloud/dataproc/v1/autoscaling_policies.proto", - "../../protos/google/cloud/dataproc/v1/batches.proto", - "../../protos/google/cloud/dataproc/v1/clusters.proto", - "../../protos/google/cloud/dataproc/v1/jobs.proto", - "../../protos/google/cloud/dataproc/v1/node_groups.proto", - "../../protos/google/cloud/dataproc/v1/operations.proto", - "../../protos/google/cloud/dataproc/v1/session_templates.proto", - "../../protos/google/cloud/dataproc/v1/sessions.proto", - "../../protos/google/cloud/dataproc/v1/shared.proto", - "../../protos/google/cloud/dataproc/v1/workflow_templates.proto" -] diff --git a/owl-bot-staging/google-cloud-dataproc/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-dataproc/system-test/fixtures/sample/src/index.js deleted file mode 100644 index 614acc37b5cf..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/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 dataproc = require('@google-cloud/dataproc'); - -function main() { - const autoscalingPolicyServiceClient = new dataproc.AutoscalingPolicyServiceClient(); - const batchControllerClient = new dataproc.BatchControllerClient(); - const clusterControllerClient = new dataproc.ClusterControllerClient(); - const jobControllerClient = new dataproc.JobControllerClient(); - const nodeGroupControllerClient = new dataproc.NodeGroupControllerClient(); - const sessionControllerClient = new dataproc.SessionControllerClient(); - const sessionTemplateControllerClient = new dataproc.SessionTemplateControllerClient(); - const workflowTemplateServiceClient = new dataproc.WorkflowTemplateServiceClient(); -} - -main(); diff --git a/owl-bot-staging/google-cloud-dataproc/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-dataproc/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 1fb8c08a3116..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/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 {AutoscalingPolicyServiceClient, BatchControllerClient, ClusterControllerClient, JobControllerClient, NodeGroupControllerClient, SessionControllerClient, SessionTemplateControllerClient, WorkflowTemplateServiceClient} from '@google-cloud/dataproc'; - -// check that the client class type name can be used -function doStuffWithAutoscalingPolicyServiceClient(client: AutoscalingPolicyServiceClient) { - client.close(); -} -function doStuffWithBatchControllerClient(client: BatchControllerClient) { - client.close(); -} -function doStuffWithClusterControllerClient(client: ClusterControllerClient) { - client.close(); -} -function doStuffWithJobControllerClient(client: JobControllerClient) { - client.close(); -} -function doStuffWithNodeGroupControllerClient(client: NodeGroupControllerClient) { - client.close(); -} -function doStuffWithSessionControllerClient(client: SessionControllerClient) { - client.close(); -} -function doStuffWithSessionTemplateControllerClient(client: SessionTemplateControllerClient) { - client.close(); -} -function doStuffWithWorkflowTemplateServiceClient(client: WorkflowTemplateServiceClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const autoscalingPolicyServiceClient = new AutoscalingPolicyServiceClient(); - doStuffWithAutoscalingPolicyServiceClient(autoscalingPolicyServiceClient); - // check that the client instance can be created - const batchControllerClient = new BatchControllerClient(); - doStuffWithBatchControllerClient(batchControllerClient); - // check that the client instance can be created - const clusterControllerClient = new ClusterControllerClient(); - doStuffWithClusterControllerClient(clusterControllerClient); - // check that the client instance can be created - const jobControllerClient = new JobControllerClient(); - doStuffWithJobControllerClient(jobControllerClient); - // check that the client instance can be created - const nodeGroupControllerClient = new NodeGroupControllerClient(); - doStuffWithNodeGroupControllerClient(nodeGroupControllerClient); - // check that the client instance can be created - const sessionControllerClient = new SessionControllerClient(); - doStuffWithSessionControllerClient(sessionControllerClient); - // check that the client instance can be created - const sessionTemplateControllerClient = new SessionTemplateControllerClient(); - doStuffWithSessionTemplateControllerClient(sessionTemplateControllerClient); - // check that the client instance can be created - const workflowTemplateServiceClient = new WorkflowTemplateServiceClient(); - doStuffWithWorkflowTemplateServiceClient(workflowTemplateServiceClient); -} - -main(); diff --git a/owl-bot-staging/google-cloud-dataproc/system-test/install.ts b/owl-bot-staging/google-cloud-dataproc/system-test/install.ts deleted file mode 100644 index f66069aa3940..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/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', - cjs: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } - }; - await packNTest(options); - }); - -}); diff --git a/owl-bot-staging/google-cloud-dataproc/test/gapic_autoscaling_policy_service_v1.ts b/owl-bot-staging/google-cloud-dataproc/test/gapic_autoscaling_policy_service_v1.ts deleted file mode 100644 index aa9d2a84883a..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/test/gapic_autoscaling_policy_service_v1.ts +++ /dev/null @@ -1,1665 +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 autoscalingpolicyserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, IamProtos} 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('v1.AutoscalingPolicyServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'dataproc.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient(); - 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 = autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient.servicePath; - assert.strictEqual(servicePath, 'dataproc.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'dataproc.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'dataproc.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'dataproc.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 autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'dataproc.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 autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'dataproc.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 autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.autoscalingPolicyServiceStub, undefined); - await client.initialize(); - assert(client.autoscalingPolicyServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.autoscalingPolicyServiceStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.autoscalingPolicyServiceStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - 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 autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - 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('createAutoscalingPolicy', () => { - it('invokes createAutoscalingPolicy without error', async () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.dataproc.v1.AutoscalingPolicy() - ); - client.innerApiCalls.createAutoscalingPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.createAutoscalingPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createAutoscalingPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createAutoscalingPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createAutoscalingPolicy without error using callback', async () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.dataproc.v1.AutoscalingPolicy() - ); - client.innerApiCalls.createAutoscalingPolicy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createAutoscalingPolicy( - request, - (err?: Error|null, result?: protos.google.cloud.dataproc.v1.IAutoscalingPolicy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createAutoscalingPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createAutoscalingPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createAutoscalingPolicy with error', async () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createAutoscalingPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createAutoscalingPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.createAutoscalingPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createAutoscalingPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createAutoscalingPolicy with closed client', async () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CreateAutoscalingPolicyRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createAutoscalingPolicy(request), expectedError); - }); - }); - - describe('updateAutoscalingPolicy', () => { - it('invokes updateAutoscalingPolicy without error', async () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest() - ); - request.policy ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest', ['policy', 'name']); - request.policy.name = defaultValue1; - const expectedHeaderRequestParams = `policy.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.dataproc.v1.AutoscalingPolicy() - ); - client.innerApiCalls.updateAutoscalingPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.updateAutoscalingPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateAutoscalingPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAutoscalingPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateAutoscalingPolicy without error using callback', async () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest() - ); - request.policy ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest', ['policy', 'name']); - request.policy.name = defaultValue1; - const expectedHeaderRequestParams = `policy.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.dataproc.v1.AutoscalingPolicy() - ); - client.innerApiCalls.updateAutoscalingPolicy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateAutoscalingPolicy( - request, - (err?: Error|null, result?: protos.google.cloud.dataproc.v1.IAutoscalingPolicy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateAutoscalingPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAutoscalingPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateAutoscalingPolicy with error', async () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest() - ); - request.policy ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest', ['policy', 'name']); - request.policy.name = defaultValue1; - const expectedHeaderRequestParams = `policy.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateAutoscalingPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateAutoscalingPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.updateAutoscalingPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateAutoscalingPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateAutoscalingPolicy with closed client', async () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest() - ); - request.policy ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateAutoscalingPolicyRequest', ['policy', 'name']); - request.policy.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateAutoscalingPolicy(request), expectedError); - }); - }); - - describe('getAutoscalingPolicy', () => { - it('invokes getAutoscalingPolicy without error', async () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.dataproc.v1.AutoscalingPolicy() - ); - client.innerApiCalls.getAutoscalingPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.getAutoscalingPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getAutoscalingPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAutoscalingPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAutoscalingPolicy without error using callback', async () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.dataproc.v1.AutoscalingPolicy() - ); - client.innerApiCalls.getAutoscalingPolicy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getAutoscalingPolicy( - request, - (err?: Error|null, result?: protos.google.cloud.dataproc.v1.IAutoscalingPolicy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getAutoscalingPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAutoscalingPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAutoscalingPolicy with error', async () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getAutoscalingPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getAutoscalingPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.getAutoscalingPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getAutoscalingPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getAutoscalingPolicy with closed client', async () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetAutoscalingPolicyRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getAutoscalingPolicy(request), expectedError); - }); - }); - - describe('deleteAutoscalingPolicy', () => { - it('invokes deleteAutoscalingPolicy without error', async () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteAutoscalingPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.deleteAutoscalingPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteAutoscalingPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAutoscalingPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteAutoscalingPolicy without error using callback', async () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteAutoscalingPolicy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteAutoscalingPolicy( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteAutoscalingPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAutoscalingPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteAutoscalingPolicy with error', async () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteAutoscalingPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteAutoscalingPolicy(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteAutoscalingPolicy as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteAutoscalingPolicy as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteAutoscalingPolicy with closed client', async () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteAutoscalingPolicyRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteAutoscalingPolicy(request), expectedError); - }); - }); - - describe('listAutoscalingPolicies', () => { - it('invokes listAutoscalingPolicies without error', async () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataproc.v1.AutoscalingPolicy()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.AutoscalingPolicy()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.AutoscalingPolicy()), - ]; - client.innerApiCalls.listAutoscalingPolicies = stubSimpleCall(expectedResponse); - const [response] = await client.listAutoscalingPolicies(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listAutoscalingPolicies as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAutoscalingPolicies as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAutoscalingPolicies without error using callback', async () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataproc.v1.AutoscalingPolicy()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.AutoscalingPolicy()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.AutoscalingPolicy()), - ]; - client.innerApiCalls.listAutoscalingPolicies = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listAutoscalingPolicies( - request, - (err?: Error|null, result?: protos.google.cloud.dataproc.v1.IAutoscalingPolicy[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listAutoscalingPolicies as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAutoscalingPolicies as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAutoscalingPolicies with error', async () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listAutoscalingPolicies = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listAutoscalingPolicies(request), expectedError); - const actualRequest = (client.innerApiCalls.listAutoscalingPolicies as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listAutoscalingPolicies as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listAutoscalingPoliciesStream without error', async () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataproc.v1.AutoscalingPolicy()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.AutoscalingPolicy()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.AutoscalingPolicy()), - ]; - client.descriptors.page.listAutoscalingPolicies.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listAutoscalingPoliciesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataproc.v1.AutoscalingPolicy[] = []; - stream.on('data', (response: protos.google.cloud.dataproc.v1.AutoscalingPolicy) => { - 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.listAutoscalingPolicies.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAutoscalingPolicies, request)); - assert( - (client.descriptors.page.listAutoscalingPolicies.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listAutoscalingPoliciesStream with error', async () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listAutoscalingPolicies.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listAutoscalingPoliciesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataproc.v1.AutoscalingPolicy[] = []; - stream.on('data', (response: protos.google.cloud.dataproc.v1.AutoscalingPolicy) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listAutoscalingPolicies.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAutoscalingPolicies, request)); - assert( - (client.descriptors.page.listAutoscalingPolicies.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listAutoscalingPolicies without error', async () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataproc.v1.AutoscalingPolicy()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.AutoscalingPolicy()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.AutoscalingPolicy()), - ]; - client.descriptors.page.listAutoscalingPolicies.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.dataproc.v1.IAutoscalingPolicy[] = []; - const iterable = client.listAutoscalingPoliciesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listAutoscalingPolicies.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listAutoscalingPolicies.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listAutoscalingPolicies with error', async () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListAutoscalingPoliciesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listAutoscalingPolicies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listAutoscalingPoliciesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.dataproc.v1.IAutoscalingPolicy[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listAutoscalingPolicies.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listAutoscalingPolicies.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy without error using callback', async () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy without error using callback', async () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions without error using callback', async () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - - describe('Path templates', () => { - - describe('batch', async () => { - const fakePath = "/rendered/path/batch"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch: "batchValue", - }; - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.batchPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPath', () => { - const result = client.batchPath("projectValue", "locationValue", "batchValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchName', () => { - const result = client.matchProjectFromBatchName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchName', () => { - const result = client.matchLocationFromBatchName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchFromBatchName', () => { - const result = client.matchBatchFromBatchName(fakePath); - assert.strictEqual(result, "batchValue"); - assert((client.pathTemplates.batchPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', async () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - 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('nodeGroup', async () => { - const fakePath = "/rendered/path/nodeGroup"; - const expectedParameters = { - project: "projectValue", - region: "regionValue", - cluster: "clusterValue", - node_group: "nodeGroupValue", - }; - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.nodeGroupPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nodeGroupPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nodeGroupPath', () => { - const result = client.nodeGroupPath("projectValue", "regionValue", "clusterValue", "nodeGroupValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nodeGroupPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNodeGroupName', () => { - const result = client.matchProjectFromNodeGroupName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRegionFromNodeGroupName', () => { - const result = client.matchRegionFromNodeGroupName(fakePath); - assert.strictEqual(result, "regionValue"); - assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromNodeGroupName', () => { - const result = client.matchClusterFromNodeGroupName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNodeGroupFromNodeGroupName', () => { - const result = client.matchNodeGroupFromNodeGroupName(fakePath); - assert.strictEqual(result, "nodeGroupValue"); - assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', async () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - 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('projectLocationAutoscalingPolicy', async () => { - const fakePath = "/rendered/path/projectLocationAutoscalingPolicy"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - autoscaling_policy: "autoscalingPolicyValue", - }; - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationAutoscalingPolicyPath', () => { - const result = client.projectLocationAutoscalingPolicyPath("projectValue", "locationValue", "autoscalingPolicyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationAutoscalingPolicyName', () => { - const result = client.matchProjectFromProjectLocationAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationAutoscalingPolicyName', () => { - const result = client.matchLocationFromProjectLocationAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName', () => { - const result = client.matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "autoscalingPolicyValue"); - assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationWorkflowTemplate', async () => { - const fakePath = "/rendered/path/projectLocationWorkflowTemplate"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - workflow_template: "workflowTemplateValue", - }; - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationWorkflowTemplatePath', () => { - const result = client.projectLocationWorkflowTemplatePath("projectValue", "locationValue", "workflowTemplateValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationWorkflowTemplateName', () => { - const result = client.matchProjectFromProjectLocationWorkflowTemplateName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationWorkflowTemplateName', () => { - const result = client.matchLocationFromProjectLocationWorkflowTemplateName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchWorkflowTemplateFromProjectLocationWorkflowTemplateName', () => { - const result = client.matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(fakePath); - assert.strictEqual(result, "workflowTemplateValue"); - assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectRegionAutoscalingPolicy', async () => { - const fakePath = "/rendered/path/projectRegionAutoscalingPolicy"; - const expectedParameters = { - project: "projectValue", - region: "regionValue", - autoscaling_policy: "autoscalingPolicyValue", - }; - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectRegionAutoscalingPolicyPath', () => { - const result = client.projectRegionAutoscalingPolicyPath("projectValue", "regionValue", "autoscalingPolicyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectRegionAutoscalingPolicyName', () => { - const result = client.matchProjectFromProjectRegionAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRegionFromProjectRegionAutoscalingPolicyName', () => { - const result = client.matchRegionFromProjectRegionAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "regionValue"); - assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName', () => { - const result = client.matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "autoscalingPolicyValue"); - assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectRegionWorkflowTemplate', async () => { - const fakePath = "/rendered/path/projectRegionWorkflowTemplate"; - const expectedParameters = { - project: "projectValue", - region: "regionValue", - workflow_template: "workflowTemplateValue", - }; - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectRegionWorkflowTemplatePath', () => { - const result = client.projectRegionWorkflowTemplatePath("projectValue", "regionValue", "workflowTemplateValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectRegionWorkflowTemplateName', () => { - const result = client.matchProjectFromProjectRegionWorkflowTemplateName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRegionFromProjectRegionWorkflowTemplateName', () => { - const result = client.matchRegionFromProjectRegionWorkflowTemplateName(fakePath); - assert.strictEqual(result, "regionValue"); - assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchWorkflowTemplateFromProjectRegionWorkflowTemplateName', () => { - const result = client.matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(fakePath); - assert.strictEqual(result, "workflowTemplateValue"); - assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('session', async () => { - const fakePath = "/rendered/path/session"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - session: "sessionValue", - }; - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.sessionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.sessionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('sessionPath', () => { - const result = client.sessionPath("projectValue", "locationValue", "sessionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.sessionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSessionName', () => { - const result = client.matchProjectFromSessionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSessionName', () => { - const result = client.matchLocationFromSessionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSessionFromSessionName', () => { - const result = client.matchSessionFromSessionName(fakePath); - assert.strictEqual(result, "sessionValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('sessionTemplate', async () => { - const fakePath = "/rendered/path/sessionTemplate"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - template: "templateValue", - }; - const client = new autoscalingpolicyserviceModule.v1.AutoscalingPolicyServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.sessionTemplatePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.sessionTemplatePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('sessionTemplatePath', () => { - const result = client.sessionTemplatePath("projectValue", "locationValue", "templateValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.sessionTemplatePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSessionTemplateName', () => { - const result = client.matchProjectFromSessionTemplateName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSessionTemplateName', () => { - const result = client.matchLocationFromSessionTemplateName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTemplateFromSessionTemplateName', () => { - const result = client.matchTemplateFromSessionTemplateName(fakePath); - assert.strictEqual(result, "templateValue"); - assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-dataproc/test/gapic_batch_controller_v1.ts b/owl-bot-staging/google-cloud-dataproc/test/gapic_batch_controller_v1.ts deleted file mode 100644 index 444d1494efb4..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/test/gapic_batch_controller_v1.ts +++ /dev/null @@ -1,1870 +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 batchcontrollerModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos, IamProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.BatchControllerClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new batchcontrollerModule.v1.BatchControllerClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'dataproc.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new batchcontrollerModule.v1.BatchControllerClient(); - 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 = batchcontrollerModule.v1.BatchControllerClient.servicePath; - assert.strictEqual(servicePath, 'dataproc.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = batchcontrollerModule.v1.BatchControllerClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'dataproc.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new batchcontrollerModule.v1.BatchControllerClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'dataproc.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new batchcontrollerModule.v1.BatchControllerClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'dataproc.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 batchcontrollerModule.v1.BatchControllerClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'dataproc.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 batchcontrollerModule.v1.BatchControllerClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'dataproc.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 batchcontrollerModule.v1.BatchControllerClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = batchcontrollerModule.v1.BatchControllerClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new batchcontrollerModule.v1.BatchControllerClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new batchcontrollerModule.v1.BatchControllerClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.batchControllerStub, undefined); - await client.initialize(); - assert(client.batchControllerStub); - }); - - it('has close method for the initialized client', done => { - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.batchControllerStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.batchControllerStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new batchcontrollerModule.v1.BatchControllerClient({ - 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 batchcontrollerModule.v1.BatchControllerClient({ - 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('getBatch', () => { - it('invokes getBatch without error', async () => { - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.GetBatchRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetBatchRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.dataproc.v1.Batch() - ); - client.innerApiCalls.getBatch = stubSimpleCall(expectedResponse); - const [response] = await client.getBatch(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getBatch as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBatch as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBatch without error using callback', async () => { - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.GetBatchRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetBatchRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.dataproc.v1.Batch() - ); - client.innerApiCalls.getBatch = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getBatch( - request, - (err?: Error|null, result?: protos.google.cloud.dataproc.v1.IBatch|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getBatch as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBatch as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBatch with error', async () => { - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.GetBatchRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetBatchRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getBatch = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getBatch(request), expectedError); - const actualRequest = (client.innerApiCalls.getBatch as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBatch as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBatch with closed client', async () => { - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.GetBatchRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetBatchRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getBatch(request), expectedError); - }); - }); - - describe('deleteBatch', () => { - it('invokes deleteBatch without error', async () => { - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.DeleteBatchRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteBatchRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteBatch = stubSimpleCall(expectedResponse); - const [response] = await client.deleteBatch(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteBatch as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBatch as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteBatch without error using callback', async () => { - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.DeleteBatchRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteBatchRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteBatch = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteBatch( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteBatch as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBatch as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteBatch with error', async () => { - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.DeleteBatchRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteBatchRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteBatch = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteBatch(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteBatch as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBatch as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteBatch with closed client', async () => { - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.DeleteBatchRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteBatchRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteBatch(request), expectedError); - }); - }); - - describe('createBatch', () => { - it('invokes createBatch without error', async () => { - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.CreateBatchRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CreateBatchRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createBatch = stubLongRunningCall(expectedResponse); - const [operation] = await client.createBatch(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createBatch as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBatch as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createBatch without error using callback', async () => { - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.CreateBatchRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CreateBatchRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createBatch = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createBatch( - 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.createBatch as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBatch as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createBatch with call error', async () => { - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.CreateBatchRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CreateBatchRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createBatch = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createBatch(request), expectedError); - const actualRequest = (client.innerApiCalls.createBatch as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBatch as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createBatch with LRO error', async () => { - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.CreateBatchRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CreateBatchRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createBatch = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createBatch(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createBatch as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBatch as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateBatchProgress without error', async () => { - const client = new batchcontrollerModule.v1.BatchControllerClient({ - 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.checkCreateBatchProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateBatchProgress with error', async () => { - const client = new batchcontrollerModule.v1.BatchControllerClient({ - 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.checkCreateBatchProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listBatches', () => { - it('invokes listBatches without error', async () => { - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListBatchesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListBatchesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataproc.v1.Batch()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.Batch()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.Batch()), - ]; - client.innerApiCalls.listBatches = stubSimpleCall(expectedResponse); - const [response] = await client.listBatches(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listBatches as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBatches as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBatches without error using callback', async () => { - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListBatchesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListBatchesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataproc.v1.Batch()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.Batch()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.Batch()), - ]; - client.innerApiCalls.listBatches = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listBatches( - request, - (err?: Error|null, result?: protos.google.cloud.dataproc.v1.IBatch[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listBatches as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBatches as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBatches with error', async () => { - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListBatchesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListBatchesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listBatches = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listBatches(request), expectedError); - const actualRequest = (client.innerApiCalls.listBatches as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBatches as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBatchesStream without error', async () => { - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListBatchesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListBatchesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataproc.v1.Batch()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.Batch()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.Batch()), - ]; - client.descriptors.page.listBatches.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listBatchesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataproc.v1.Batch[] = []; - stream.on('data', (response: protos.google.cloud.dataproc.v1.Batch) => { - 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.listBatches.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBatches, request)); - assert( - (client.descriptors.page.listBatches.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listBatchesStream with error', async () => { - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListBatchesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListBatchesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listBatches.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listBatchesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataproc.v1.Batch[] = []; - stream.on('data', (response: protos.google.cloud.dataproc.v1.Batch) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listBatches.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBatches, request)); - assert( - (client.descriptors.page.listBatches.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listBatches without error', async () => { - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListBatchesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListBatchesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataproc.v1.Batch()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.Batch()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.Batch()), - ]; - client.descriptors.page.listBatches.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.dataproc.v1.IBatch[] = []; - const iterable = client.listBatchesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listBatches.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listBatches.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listBatches with error', async () => { - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListBatchesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListBatchesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listBatches.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listBatchesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.dataproc.v1.IBatch[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listBatches.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listBatches.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy without error using callback', async () => { - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy without error using callback', async () => { - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions without error using callback', async () => { - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new batchcontrollerModule.v1.BatchControllerClient({ - 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 batchcontrollerModule.v1.BatchControllerClient({ - 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 batchcontrollerModule.v1.BatchControllerClient({ - 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 batchcontrollerModule.v1.BatchControllerClient({ - 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 batchcontrollerModule.v1.BatchControllerClient({ - 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 batchcontrollerModule.v1.BatchControllerClient({ - 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 batchcontrollerModule.v1.BatchControllerClient({ - 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 batchcontrollerModule.v1.BatchControllerClient({ - 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 batchcontrollerModule.v1.BatchControllerClient({ - 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 batchcontrollerModule.v1.BatchControllerClient({ - 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 batchcontrollerModule.v1.BatchControllerClient({ - 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('batch', async () => { - const fakePath = "/rendered/path/batch"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch: "batchValue", - }; - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.batchPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPath', () => { - const result = client.batchPath("projectValue", "locationValue", "batchValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchName', () => { - const result = client.matchProjectFromBatchName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchName', () => { - const result = client.matchLocationFromBatchName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchFromBatchName', () => { - const result = client.matchBatchFromBatchName(fakePath); - assert.strictEqual(result, "batchValue"); - assert((client.pathTemplates.batchPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', async () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new batchcontrollerModule.v1.BatchControllerClient({ - 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('nodeGroup', async () => { - const fakePath = "/rendered/path/nodeGroup"; - const expectedParameters = { - project: "projectValue", - region: "regionValue", - cluster: "clusterValue", - node_group: "nodeGroupValue", - }; - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.nodeGroupPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nodeGroupPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nodeGroupPath', () => { - const result = client.nodeGroupPath("projectValue", "regionValue", "clusterValue", "nodeGroupValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nodeGroupPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNodeGroupName', () => { - const result = client.matchProjectFromNodeGroupName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRegionFromNodeGroupName', () => { - const result = client.matchRegionFromNodeGroupName(fakePath); - assert.strictEqual(result, "regionValue"); - assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromNodeGroupName', () => { - const result = client.matchClusterFromNodeGroupName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNodeGroupFromNodeGroupName', () => { - const result = client.matchNodeGroupFromNodeGroupName(fakePath); - assert.strictEqual(result, "nodeGroupValue"); - assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', async () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new batchcontrollerModule.v1.BatchControllerClient({ - 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('projectLocationAutoscalingPolicy', async () => { - const fakePath = "/rendered/path/projectLocationAutoscalingPolicy"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - autoscaling_policy: "autoscalingPolicyValue", - }; - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationAutoscalingPolicyPath', () => { - const result = client.projectLocationAutoscalingPolicyPath("projectValue", "locationValue", "autoscalingPolicyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationAutoscalingPolicyName', () => { - const result = client.matchProjectFromProjectLocationAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationAutoscalingPolicyName', () => { - const result = client.matchLocationFromProjectLocationAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName', () => { - const result = client.matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "autoscalingPolicyValue"); - assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationWorkflowTemplate', async () => { - const fakePath = "/rendered/path/projectLocationWorkflowTemplate"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - workflow_template: "workflowTemplateValue", - }; - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationWorkflowTemplatePath', () => { - const result = client.projectLocationWorkflowTemplatePath("projectValue", "locationValue", "workflowTemplateValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationWorkflowTemplateName', () => { - const result = client.matchProjectFromProjectLocationWorkflowTemplateName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationWorkflowTemplateName', () => { - const result = client.matchLocationFromProjectLocationWorkflowTemplateName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchWorkflowTemplateFromProjectLocationWorkflowTemplateName', () => { - const result = client.matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(fakePath); - assert.strictEqual(result, "workflowTemplateValue"); - assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectRegionAutoscalingPolicy', async () => { - const fakePath = "/rendered/path/projectRegionAutoscalingPolicy"; - const expectedParameters = { - project: "projectValue", - region: "regionValue", - autoscaling_policy: "autoscalingPolicyValue", - }; - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectRegionAutoscalingPolicyPath', () => { - const result = client.projectRegionAutoscalingPolicyPath("projectValue", "regionValue", "autoscalingPolicyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectRegionAutoscalingPolicyName', () => { - const result = client.matchProjectFromProjectRegionAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRegionFromProjectRegionAutoscalingPolicyName', () => { - const result = client.matchRegionFromProjectRegionAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "regionValue"); - assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName', () => { - const result = client.matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "autoscalingPolicyValue"); - assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectRegionWorkflowTemplate', async () => { - const fakePath = "/rendered/path/projectRegionWorkflowTemplate"; - const expectedParameters = { - project: "projectValue", - region: "regionValue", - workflow_template: "workflowTemplateValue", - }; - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectRegionWorkflowTemplatePath', () => { - const result = client.projectRegionWorkflowTemplatePath("projectValue", "regionValue", "workflowTemplateValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectRegionWorkflowTemplateName', () => { - const result = client.matchProjectFromProjectRegionWorkflowTemplateName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRegionFromProjectRegionWorkflowTemplateName', () => { - const result = client.matchRegionFromProjectRegionWorkflowTemplateName(fakePath); - assert.strictEqual(result, "regionValue"); - assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchWorkflowTemplateFromProjectRegionWorkflowTemplateName', () => { - const result = client.matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(fakePath); - assert.strictEqual(result, "workflowTemplateValue"); - assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('session', async () => { - const fakePath = "/rendered/path/session"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - session: "sessionValue", - }; - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.sessionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.sessionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('sessionPath', () => { - const result = client.sessionPath("projectValue", "locationValue", "sessionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.sessionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSessionName', () => { - const result = client.matchProjectFromSessionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSessionName', () => { - const result = client.matchLocationFromSessionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSessionFromSessionName', () => { - const result = client.matchSessionFromSessionName(fakePath); - assert.strictEqual(result, "sessionValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('sessionTemplate', async () => { - const fakePath = "/rendered/path/sessionTemplate"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - template: "templateValue", - }; - const client = new batchcontrollerModule.v1.BatchControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.sessionTemplatePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.sessionTemplatePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('sessionTemplatePath', () => { - const result = client.sessionTemplatePath("projectValue", "locationValue", "templateValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.sessionTemplatePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSessionTemplateName', () => { - const result = client.matchProjectFromSessionTemplateName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSessionTemplateName', () => { - const result = client.matchLocationFromSessionTemplateName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTemplateFromSessionTemplateName', () => { - const result = client.matchTemplateFromSessionTemplateName(fakePath); - assert.strictEqual(result, "templateValue"); - assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-dataproc/test/gapic_cluster_controller_v1.ts b/owl-bot-staging/google-cloud-dataproc/test/gapic_cluster_controller_v1.ts deleted file mode 100644 index 41d831ea1add..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/test/gapic_cluster_controller_v1.ts +++ /dev/null @@ -1,2741 +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 clustercontrollerModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos, IamProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.ClusterControllerClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'dataproc.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient(); - 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 = clustercontrollerModule.v1.ClusterControllerClient.servicePath; - assert.strictEqual(servicePath, 'dataproc.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = clustercontrollerModule.v1.ClusterControllerClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'dataproc.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'dataproc.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'dataproc.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 clustercontrollerModule.v1.ClusterControllerClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'dataproc.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 clustercontrollerModule.v1.ClusterControllerClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'dataproc.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 clustercontrollerModule.v1.ClusterControllerClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = clustercontrollerModule.v1.ClusterControllerClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.clusterControllerStub, undefined); - await client.initialize(); - assert(client.clusterControllerStub); - }); - - it('has close method for the initialized client', done => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.clusterControllerStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.clusterControllerStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - 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 clustercontrollerModule.v1.ClusterControllerClient({ - 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('getCluster', () => { - it('invokes getCluster without error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetClusterRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetClusterRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetClusterRequest', ['clusterName']); - request.clusterName = defaultValue3; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.dataproc.v1.Cluster() - ); - client.innerApiCalls.getCluster = stubSimpleCall(expectedResponse); - const [response] = await client.getCluster(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCluster without error using callback', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetClusterRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetClusterRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetClusterRequest', ['clusterName']); - request.clusterName = defaultValue3; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.dataproc.v1.Cluster() - ); - client.innerApiCalls.getCluster = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getCluster( - request, - (err?: Error|null, result?: protos.google.cloud.dataproc.v1.ICluster|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCluster with error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetClusterRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetClusterRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetClusterRequest', ['clusterName']); - request.clusterName = defaultValue3; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getCluster = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getCluster with closed client', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.GetClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetClusterRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetClusterRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetClusterRequest', ['clusterName']); - request.clusterName = defaultValue3; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getCluster(request), expectedError); - }); - }); - - describe('createCluster', () => { - it('invokes createCluster without error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CreateClusterRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CreateClusterRequest', ['region']); - request.region = defaultValue2; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.createCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCluster without error using callback', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CreateClusterRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CreateClusterRequest', ['region']); - request.region = defaultValue2; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createCluster( - 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.createCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCluster with call error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CreateClusterRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CreateClusterRequest', ['region']); - request.region = defaultValue2; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createCluster with LRO error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.CreateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CreateClusterRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CreateClusterRequest', ['region']); - request.region = defaultValue2; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateClusterProgress without error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - 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.checkCreateClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateClusterProgress with error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - 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.checkCreateClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateCluster', () => { - it('invokes updateCluster without error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.UpdateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateClusterRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateClusterRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateClusterRequest', ['clusterName']); - request.clusterName = defaultValue3; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCluster without error using callback', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.UpdateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateClusterRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateClusterRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateClusterRequest', ['clusterName']); - request.clusterName = defaultValue3; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateCluster( - 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.updateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCluster with call error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.UpdateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateClusterRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateClusterRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateClusterRequest', ['clusterName']); - request.clusterName = defaultValue3; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateCluster with LRO error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.UpdateClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateClusterRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateClusterRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateClusterRequest', ['clusterName']); - request.clusterName = defaultValue3; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateClusterProgress without error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - 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.checkUpdateClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateClusterProgress with error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - 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.checkUpdateClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('stopCluster', () => { - it('invokes stopCluster without error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.StopClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.StopClusterRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.StopClusterRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.StopClusterRequest', ['clusterName']); - request.clusterName = defaultValue3; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.stopCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.stopCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.stopCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.stopCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes stopCluster without error using callback', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.StopClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.StopClusterRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.StopClusterRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.StopClusterRequest', ['clusterName']); - request.clusterName = defaultValue3; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.stopCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.stopCluster( - 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.stopCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.stopCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes stopCluster with call error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.StopClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.StopClusterRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.StopClusterRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.StopClusterRequest', ['clusterName']); - request.clusterName = defaultValue3; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.stopCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.stopCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.stopCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.stopCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes stopCluster with LRO error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.StopClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.StopClusterRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.StopClusterRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.StopClusterRequest', ['clusterName']); - request.clusterName = defaultValue3; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.stopCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.stopCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.stopCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.stopCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkStopClusterProgress without error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - 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.checkStopClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkStopClusterProgress with error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - 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.checkStopClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('startCluster', () => { - it('invokes startCluster without error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.StartClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.StartClusterRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.StartClusterRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.StartClusterRequest', ['clusterName']); - request.clusterName = defaultValue3; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.startCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.startCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.startCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.startCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes startCluster without error using callback', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.StartClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.StartClusterRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.StartClusterRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.StartClusterRequest', ['clusterName']); - request.clusterName = defaultValue3; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.startCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.startCluster( - 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.startCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.startCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes startCluster with call error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.StartClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.StartClusterRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.StartClusterRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.StartClusterRequest', ['clusterName']); - request.clusterName = defaultValue3; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.startCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.startCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.startCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.startCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes startCluster with LRO error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.StartClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.StartClusterRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.StartClusterRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.StartClusterRequest', ['clusterName']); - request.clusterName = defaultValue3; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.startCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.startCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.startCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.startCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkStartClusterProgress without error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - 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.checkStartClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkStartClusterProgress with error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - 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.checkStartClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteCluster', () => { - it('invokes deleteCluster without error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteClusterRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteClusterRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteClusterRequest', ['clusterName']); - request.clusterName = defaultValue3; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCluster without error using callback', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteClusterRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteClusterRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteClusterRequest', ['clusterName']); - request.clusterName = defaultValue3; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteCluster( - 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.deleteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCluster with call error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteClusterRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteClusterRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteClusterRequest', ['clusterName']); - request.clusterName = defaultValue3; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteCluster with LRO error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.DeleteClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteClusterRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteClusterRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteClusterRequest', ['clusterName']); - request.clusterName = defaultValue3; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteClusterProgress without error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - 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.checkDeleteClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteClusterProgress with error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - 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.checkDeleteClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('diagnoseCluster', () => { - it('invokes diagnoseCluster without error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.DiagnoseClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DiagnoseClusterRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DiagnoseClusterRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DiagnoseClusterRequest', ['clusterName']); - request.clusterName = defaultValue3; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.diagnoseCluster = stubLongRunningCall(expectedResponse); - const [operation] = await client.diagnoseCluster(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.diagnoseCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.diagnoseCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes diagnoseCluster without error using callback', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.DiagnoseClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DiagnoseClusterRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DiagnoseClusterRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DiagnoseClusterRequest', ['clusterName']); - request.clusterName = defaultValue3; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.diagnoseCluster = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.diagnoseCluster( - 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.diagnoseCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.diagnoseCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes diagnoseCluster with call error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.DiagnoseClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DiagnoseClusterRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DiagnoseClusterRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DiagnoseClusterRequest', ['clusterName']); - request.clusterName = defaultValue3; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.diagnoseCluster = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.diagnoseCluster(request), expectedError); - const actualRequest = (client.innerApiCalls.diagnoseCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.diagnoseCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes diagnoseCluster with LRO error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.DiagnoseClusterRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DiagnoseClusterRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DiagnoseClusterRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DiagnoseClusterRequest', ['clusterName']); - request.clusterName = defaultValue3; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&cluster_name=${defaultValue3 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.diagnoseCluster = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.diagnoseCluster(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.diagnoseCluster as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.diagnoseCluster as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDiagnoseClusterProgress without error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - 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.checkDiagnoseClusterProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDiagnoseClusterProgress with error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - 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.checkDiagnoseClusterProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listClusters', () => { - it('invokes listClusters without error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListClustersRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListClustersRequest', ['region']); - request.region = defaultValue2; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataproc.v1.Cluster()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.Cluster()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.Cluster()), - ]; - client.innerApiCalls.listClusters = stubSimpleCall(expectedResponse); - const [response] = await client.listClusters(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listClusters without error using callback', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListClustersRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListClustersRequest', ['region']); - request.region = defaultValue2; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataproc.v1.Cluster()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.Cluster()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.Cluster()), - ]; - client.innerApiCalls.listClusters = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listClusters( - request, - (err?: Error|null, result?: protos.google.cloud.dataproc.v1.ICluster[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listClusters with error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListClustersRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListClustersRequest', ['region']); - request.region = defaultValue2; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listClusters = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listClusters(request), expectedError); - const actualRequest = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listClusters as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listClustersStream without error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListClustersRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListClustersRequest', ['region']); - request.region = defaultValue2; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataproc.v1.Cluster()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.Cluster()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.Cluster()), - ]; - client.descriptors.page.listClusters.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listClustersStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataproc.v1.Cluster[] = []; - stream.on('data', (response: protos.google.cloud.dataproc.v1.Cluster) => { - 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.listClusters.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listClusters, request)); - assert( - (client.descriptors.page.listClusters.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listClustersStream with error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListClustersRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListClustersRequest', ['region']); - request.region = defaultValue2; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listClusters.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listClustersStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataproc.v1.Cluster[] = []; - stream.on('data', (response: protos.google.cloud.dataproc.v1.Cluster) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listClusters.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listClusters, request)); - assert( - (client.descriptors.page.listClusters.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listClusters without error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListClustersRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListClustersRequest', ['region']); - request.region = defaultValue2; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataproc.v1.Cluster()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.Cluster()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.Cluster()), - ]; - client.descriptors.page.listClusters.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.dataproc.v1.ICluster[] = []; - const iterable = client.listClustersAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listClusters.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listClusters.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listClusters with error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListClustersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListClustersRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListClustersRequest', ['region']); - request.region = defaultValue2; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listClusters.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listClustersAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.dataproc.v1.ICluster[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listClusters.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listClusters.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy without error using callback', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy without error using callback', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions without error using callback', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - 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 clustercontrollerModule.v1.ClusterControllerClient({ - 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 clustercontrollerModule.v1.ClusterControllerClient({ - 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 clustercontrollerModule.v1.ClusterControllerClient({ - 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 clustercontrollerModule.v1.ClusterControllerClient({ - 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 clustercontrollerModule.v1.ClusterControllerClient({ - 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 clustercontrollerModule.v1.ClusterControllerClient({ - 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 clustercontrollerModule.v1.ClusterControllerClient({ - 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 clustercontrollerModule.v1.ClusterControllerClient({ - 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 clustercontrollerModule.v1.ClusterControllerClient({ - 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 clustercontrollerModule.v1.ClusterControllerClient({ - 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('batch', async () => { - const fakePath = "/rendered/path/batch"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch: "batchValue", - }; - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.batchPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPath', () => { - const result = client.batchPath("projectValue", "locationValue", "batchValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchName', () => { - const result = client.matchProjectFromBatchName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchName', () => { - const result = client.matchLocationFromBatchName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchFromBatchName', () => { - const result = client.matchBatchFromBatchName(fakePath); - assert.strictEqual(result, "batchValue"); - assert((client.pathTemplates.batchPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('cryptoKey', async () => { - const fakePath = "/rendered/path/cryptoKey"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - key_ring: "keyRingValue", - crypto_key: "cryptoKeyValue", - }; - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - 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('nodeGroup', async () => { - const fakePath = "/rendered/path/nodeGroup"; - const expectedParameters = { - project: "projectValue", - region: "regionValue", - cluster: "clusterValue", - node_group: "nodeGroupValue", - }; - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.nodeGroupPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nodeGroupPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nodeGroupPath', () => { - const result = client.nodeGroupPath("projectValue", "regionValue", "clusterValue", "nodeGroupValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nodeGroupPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNodeGroupName', () => { - const result = client.matchProjectFromNodeGroupName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRegionFromNodeGroupName', () => { - const result = client.matchRegionFromNodeGroupName(fakePath); - assert.strictEqual(result, "regionValue"); - assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromNodeGroupName', () => { - const result = client.matchClusterFromNodeGroupName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNodeGroupFromNodeGroupName', () => { - const result = client.matchNodeGroupFromNodeGroupName(fakePath); - assert.strictEqual(result, "nodeGroupValue"); - assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationAutoscalingPolicy', async () => { - const fakePath = "/rendered/path/projectLocationAutoscalingPolicy"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - autoscaling_policy: "autoscalingPolicyValue", - }; - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationAutoscalingPolicyPath', () => { - const result = client.projectLocationAutoscalingPolicyPath("projectValue", "locationValue", "autoscalingPolicyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationAutoscalingPolicyName', () => { - const result = client.matchProjectFromProjectLocationAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationAutoscalingPolicyName', () => { - const result = client.matchLocationFromProjectLocationAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName', () => { - const result = client.matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "autoscalingPolicyValue"); - assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationWorkflowTemplate', async () => { - const fakePath = "/rendered/path/projectLocationWorkflowTemplate"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - workflow_template: "workflowTemplateValue", - }; - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationWorkflowTemplatePath', () => { - const result = client.projectLocationWorkflowTemplatePath("projectValue", "locationValue", "workflowTemplateValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationWorkflowTemplateName', () => { - const result = client.matchProjectFromProjectLocationWorkflowTemplateName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationWorkflowTemplateName', () => { - const result = client.matchLocationFromProjectLocationWorkflowTemplateName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchWorkflowTemplateFromProjectLocationWorkflowTemplateName', () => { - const result = client.matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(fakePath); - assert.strictEqual(result, "workflowTemplateValue"); - assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectRegionAutoscalingPolicy', async () => { - const fakePath = "/rendered/path/projectRegionAutoscalingPolicy"; - const expectedParameters = { - project: "projectValue", - region: "regionValue", - autoscaling_policy: "autoscalingPolicyValue", - }; - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectRegionAutoscalingPolicyPath', () => { - const result = client.projectRegionAutoscalingPolicyPath("projectValue", "regionValue", "autoscalingPolicyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectRegionAutoscalingPolicyName', () => { - const result = client.matchProjectFromProjectRegionAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRegionFromProjectRegionAutoscalingPolicyName', () => { - const result = client.matchRegionFromProjectRegionAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "regionValue"); - assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName', () => { - const result = client.matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "autoscalingPolicyValue"); - assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectRegionWorkflowTemplate', async () => { - const fakePath = "/rendered/path/projectRegionWorkflowTemplate"; - const expectedParameters = { - project: "projectValue", - region: "regionValue", - workflow_template: "workflowTemplateValue", - }; - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectRegionWorkflowTemplatePath', () => { - const result = client.projectRegionWorkflowTemplatePath("projectValue", "regionValue", "workflowTemplateValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectRegionWorkflowTemplateName', () => { - const result = client.matchProjectFromProjectRegionWorkflowTemplateName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRegionFromProjectRegionWorkflowTemplateName', () => { - const result = client.matchRegionFromProjectRegionWorkflowTemplateName(fakePath); - assert.strictEqual(result, "regionValue"); - assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchWorkflowTemplateFromProjectRegionWorkflowTemplateName', () => { - const result = client.matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(fakePath); - assert.strictEqual(result, "workflowTemplateValue"); - assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.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 clustercontrollerModule.v1.ClusterControllerClient({ - 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('session', async () => { - const fakePath = "/rendered/path/session"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - session: "sessionValue", - }; - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.sessionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.sessionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('sessionPath', () => { - const result = client.sessionPath("projectValue", "locationValue", "sessionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.sessionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSessionName', () => { - const result = client.matchProjectFromSessionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSessionName', () => { - const result = client.matchLocationFromSessionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSessionFromSessionName', () => { - const result = client.matchSessionFromSessionName(fakePath); - assert.strictEqual(result, "sessionValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('sessionTemplate', async () => { - const fakePath = "/rendered/path/sessionTemplate"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - template: "templateValue", - }; - const client = new clustercontrollerModule.v1.ClusterControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.sessionTemplatePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.sessionTemplatePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('sessionTemplatePath', () => { - const result = client.sessionTemplatePath("projectValue", "locationValue", "templateValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.sessionTemplatePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSessionTemplateName', () => { - const result = client.matchProjectFromSessionTemplateName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSessionTemplateName', () => { - const result = client.matchLocationFromSessionTemplateName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTemplateFromSessionTemplateName', () => { - const result = client.matchTemplateFromSessionTemplateName(fakePath); - assert.strictEqual(result, "templateValue"); - assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-dataproc/test/gapic_job_controller_v1.ts b/owl-bot-staging/google-cloud-dataproc/test/gapic_job_controller_v1.ts deleted file mode 100644 index 923a04d1d1d8..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/test/gapic_job_controller_v1.ts +++ /dev/null @@ -1,2267 +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 jobcontrollerModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos, IamProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.JobControllerClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new jobcontrollerModule.v1.JobControllerClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'dataproc.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new jobcontrollerModule.v1.JobControllerClient(); - 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 = jobcontrollerModule.v1.JobControllerClient.servicePath; - assert.strictEqual(servicePath, 'dataproc.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = jobcontrollerModule.v1.JobControllerClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'dataproc.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new jobcontrollerModule.v1.JobControllerClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'dataproc.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new jobcontrollerModule.v1.JobControllerClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'dataproc.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 jobcontrollerModule.v1.JobControllerClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'dataproc.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 jobcontrollerModule.v1.JobControllerClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'dataproc.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 jobcontrollerModule.v1.JobControllerClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = jobcontrollerModule.v1.JobControllerClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new jobcontrollerModule.v1.JobControllerClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.jobControllerStub, undefined); - await client.initialize(); - assert(client.jobControllerStub); - }); - - it('has close method for the initialized client', done => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.jobControllerStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.jobControllerStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new jobcontrollerModule.v1.JobControllerClient({ - 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 jobcontrollerModule.v1.JobControllerClient({ - 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('submitJob', () => { - it('invokes submitJob without error', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.SubmitJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.SubmitJobRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.SubmitJobRequest', ['region']); - request.region = defaultValue2; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.dataproc.v1.Job() - ); - client.innerApiCalls.submitJob = stubSimpleCall(expectedResponse); - const [response] = await client.submitJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.submitJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.submitJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes submitJob without error using callback', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.SubmitJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.SubmitJobRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.SubmitJobRequest', ['region']); - request.region = defaultValue2; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.dataproc.v1.Job() - ); - client.innerApiCalls.submitJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.submitJob( - request, - (err?: Error|null, result?: protos.google.cloud.dataproc.v1.IJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.submitJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.submitJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes submitJob with error', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.SubmitJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.SubmitJobRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.SubmitJobRequest', ['region']); - request.region = defaultValue2; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.submitJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.submitJob(request), expectedError); - const actualRequest = (client.innerApiCalls.submitJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.submitJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes submitJob with closed client', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.SubmitJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.SubmitJobRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.SubmitJobRequest', ['region']); - request.region = defaultValue2; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.submitJob(request), expectedError); - }); - }); - - describe('getJob', () => { - it('invokes getJob without error', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.GetJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetJobRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetJobRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetJobRequest', ['jobId']); - request.jobId = defaultValue3; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&job_id=${defaultValue3 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.dataproc.v1.Job() - ); - client.innerApiCalls.getJob = stubSimpleCall(expectedResponse); - const [response] = await client.getJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getJob without error using callback', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.GetJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetJobRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetJobRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetJobRequest', ['jobId']); - request.jobId = defaultValue3; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&job_id=${defaultValue3 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.dataproc.v1.Job() - ); - client.innerApiCalls.getJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getJob( - request, - (err?: Error|null, result?: protos.google.cloud.dataproc.v1.IJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getJob with error', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.GetJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetJobRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetJobRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetJobRequest', ['jobId']); - request.jobId = defaultValue3; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&job_id=${defaultValue3 ?? '' }`; - 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 jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.GetJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetJobRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetJobRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetJobRequest', ['jobId']); - request.jobId = defaultValue3; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getJob(request), expectedError); - }); - }); - - describe('updateJob', () => { - it('invokes updateJob without error', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.UpdateJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateJobRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateJobRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateJobRequest', ['jobId']); - request.jobId = defaultValue3; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&job_id=${defaultValue3 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.dataproc.v1.Job() - ); - client.innerApiCalls.updateJob = stubSimpleCall(expectedResponse); - const [response] = await client.updateJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateJob without error using callback', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.UpdateJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateJobRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateJobRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateJobRequest', ['jobId']); - request.jobId = defaultValue3; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&job_id=${defaultValue3 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.dataproc.v1.Job() - ); - client.innerApiCalls.updateJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateJob( - request, - (err?: Error|null, result?: protos.google.cloud.dataproc.v1.IJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateJob with error', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.UpdateJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateJobRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateJobRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateJobRequest', ['jobId']); - request.jobId = defaultValue3; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&job_id=${defaultValue3 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateJob(request), expectedError); - const actualRequest = (client.innerApiCalls.updateJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateJob with closed client', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.UpdateJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateJobRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateJobRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateJobRequest', ['jobId']); - request.jobId = defaultValue3; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateJob(request), expectedError); - }); - }); - - describe('cancelJob', () => { - it('invokes cancelJob without error', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.CancelJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CancelJobRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CancelJobRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CancelJobRequest', ['jobId']); - request.jobId = defaultValue3; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&job_id=${defaultValue3 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.dataproc.v1.Job() - ); - client.innerApiCalls.cancelJob = stubSimpleCall(expectedResponse); - const [response] = await client.cancelJob(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.cancelJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelJob without error using callback', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.CancelJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CancelJobRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CancelJobRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CancelJobRequest', ['jobId']); - request.jobId = defaultValue3; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&job_id=${defaultValue3 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.dataproc.v1.Job() - ); - client.innerApiCalls.cancelJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.cancelJob( - request, - (err?: Error|null, result?: protos.google.cloud.dataproc.v1.IJob|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.cancelJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelJob with error', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.CancelJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CancelJobRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CancelJobRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CancelJobRequest', ['jobId']); - request.jobId = defaultValue3; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&job_id=${defaultValue3 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.cancelJob = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.cancelJob(request), expectedError); - const actualRequest = (client.innerApiCalls.cancelJob as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.cancelJob as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes cancelJob with closed client', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.CancelJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CancelJobRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CancelJobRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CancelJobRequest', ['jobId']); - request.jobId = defaultValue3; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.cancelJob(request), expectedError); - }); - }); - - describe('deleteJob', () => { - it('invokes deleteJob without error', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.DeleteJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteJobRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteJobRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteJobRequest', ['jobId']); - request.jobId = defaultValue3; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&job_id=${defaultValue3 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteJob = stubSimpleCall(expectedResponse); - const [response] = await client.deleteJob(request); - 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 jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.DeleteJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteJobRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteJobRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteJobRequest', ['jobId']); - request.jobId = defaultValue3; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&job_id=${defaultValue3 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteJob = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteJob( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.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 error', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.DeleteJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteJobRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteJobRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteJobRequest', ['jobId']); - request.jobId = defaultValue3; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }&job_id=${defaultValue3 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteJob = stubSimpleCall(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 closed client', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.DeleteJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteJobRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteJobRequest', ['region']); - request.region = defaultValue2; - const defaultValue3 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteJobRequest', ['jobId']); - request.jobId = defaultValue3; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteJob(request), expectedError); - }); - }); - - describe('submitJobAsOperation', () => { - it('invokes submitJobAsOperation without error', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.SubmitJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.SubmitJobRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.SubmitJobRequest', ['region']); - request.region = defaultValue2; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.submitJobAsOperation = stubLongRunningCall(expectedResponse); - const [operation] = await client.submitJobAsOperation(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.submitJobAsOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.submitJobAsOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes submitJobAsOperation without error using callback', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.SubmitJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.SubmitJobRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.SubmitJobRequest', ['region']); - request.region = defaultValue2; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.submitJobAsOperation = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.submitJobAsOperation( - 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.submitJobAsOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.submitJobAsOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes submitJobAsOperation with call error', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.SubmitJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.SubmitJobRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.SubmitJobRequest', ['region']); - request.region = defaultValue2; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.submitJobAsOperation = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.submitJobAsOperation(request), expectedError); - const actualRequest = (client.innerApiCalls.submitJobAsOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.submitJobAsOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes submitJobAsOperation with LRO error', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.SubmitJobRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.SubmitJobRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.SubmitJobRequest', ['region']); - request.region = defaultValue2; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.submitJobAsOperation = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.submitJobAsOperation(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.submitJobAsOperation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.submitJobAsOperation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkSubmitJobAsOperationProgress without error', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - 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.checkSubmitJobAsOperationProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkSubmitJobAsOperationProgress with error', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - 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.checkSubmitJobAsOperationProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listJobs', () => { - it('invokes listJobs without error', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListJobsRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListJobsRequest', ['region']); - request.region = defaultValue2; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataproc.v1.Job()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.Job()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.Job()), - ]; - client.innerApiCalls.listJobs = stubSimpleCall(expectedResponse); - const [response] = await client.listJobs(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listJobs without error using callback', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListJobsRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListJobsRequest', ['region']); - request.region = defaultValue2; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataproc.v1.Job()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.Job()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.Job()), - ]; - client.innerApiCalls.listJobs = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listJobs( - request, - (err?: Error|null, result?: protos.google.cloud.dataproc.v1.IJob[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listJobs as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listJobs as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listJobs with error', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListJobsRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListJobsRequest', ['region']); - request.region = defaultValue2; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; - 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 jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListJobsRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListJobsRequest', ['region']); - request.region = defaultValue2; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataproc.v1.Job()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.Job()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.Job()), - ]; - client.descriptors.page.listJobs.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listJobsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataproc.v1.Job[] = []; - stream.on('data', (response: protos.google.cloud.dataproc.v1.Job) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listJobs, request)); - assert( - (client.descriptors.page.listJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listJobsStream with error', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListJobsRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListJobsRequest', ['region']); - request.region = defaultValue2; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; - 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.dataproc.v1.Job[] = []; - stream.on('data', (response: protos.google.cloud.dataproc.v1.Job) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listJobs.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listJobs, request)); - assert( - (client.descriptors.page.listJobs.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listJobs without error', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListJobsRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListJobsRequest', ['region']); - request.region = defaultValue2; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataproc.v1.Job()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.Job()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.Job()), - ]; - client.descriptors.page.listJobs.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.dataproc.v1.IJob[] = []; - const iterable = client.listJobsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listJobs with error', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListJobsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListJobsRequest', ['projectId']); - request.projectId = defaultValue1; - const defaultValue2 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListJobsRequest', ['region']); - request.region = defaultValue2; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? '' }®ion=${defaultValue2 ?? '' }`; - 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.dataproc.v1.IJob[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listJobs.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listJobs.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy without error using callback', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy without error using callback', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions without error using callback', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new jobcontrollerModule.v1.JobControllerClient({ - 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 jobcontrollerModule.v1.JobControllerClient({ - 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 jobcontrollerModule.v1.JobControllerClient({ - 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 jobcontrollerModule.v1.JobControllerClient({ - 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 jobcontrollerModule.v1.JobControllerClient({ - 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 jobcontrollerModule.v1.JobControllerClient({ - 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 jobcontrollerModule.v1.JobControllerClient({ - 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 jobcontrollerModule.v1.JobControllerClient({ - 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 jobcontrollerModule.v1.JobControllerClient({ - 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 jobcontrollerModule.v1.JobControllerClient({ - 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 jobcontrollerModule.v1.JobControllerClient({ - 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('batch', async () => { - const fakePath = "/rendered/path/batch"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch: "batchValue", - }; - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.batchPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPath', () => { - const result = client.batchPath("projectValue", "locationValue", "batchValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchName', () => { - const result = client.matchProjectFromBatchName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchName', () => { - const result = client.matchLocationFromBatchName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchFromBatchName', () => { - const result = client.matchBatchFromBatchName(fakePath); - assert.strictEqual(result, "batchValue"); - assert((client.pathTemplates.batchPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nodeGroup', async () => { - const fakePath = "/rendered/path/nodeGroup"; - const expectedParameters = { - project: "projectValue", - region: "regionValue", - cluster: "clusterValue", - node_group: "nodeGroupValue", - }; - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.nodeGroupPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nodeGroupPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nodeGroupPath', () => { - const result = client.nodeGroupPath("projectValue", "regionValue", "clusterValue", "nodeGroupValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nodeGroupPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNodeGroupName', () => { - const result = client.matchProjectFromNodeGroupName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRegionFromNodeGroupName', () => { - const result = client.matchRegionFromNodeGroupName(fakePath); - assert.strictEqual(result, "regionValue"); - assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromNodeGroupName', () => { - const result = client.matchClusterFromNodeGroupName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNodeGroupFromNodeGroupName', () => { - const result = client.matchNodeGroupFromNodeGroupName(fakePath); - assert.strictEqual(result, "nodeGroupValue"); - assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationAutoscalingPolicy', async () => { - const fakePath = "/rendered/path/projectLocationAutoscalingPolicy"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - autoscaling_policy: "autoscalingPolicyValue", - }; - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationAutoscalingPolicyPath', () => { - const result = client.projectLocationAutoscalingPolicyPath("projectValue", "locationValue", "autoscalingPolicyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationAutoscalingPolicyName', () => { - const result = client.matchProjectFromProjectLocationAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationAutoscalingPolicyName', () => { - const result = client.matchLocationFromProjectLocationAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName', () => { - const result = client.matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "autoscalingPolicyValue"); - assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationWorkflowTemplate', async () => { - const fakePath = "/rendered/path/projectLocationWorkflowTemplate"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - workflow_template: "workflowTemplateValue", - }; - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationWorkflowTemplatePath', () => { - const result = client.projectLocationWorkflowTemplatePath("projectValue", "locationValue", "workflowTemplateValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationWorkflowTemplateName', () => { - const result = client.matchProjectFromProjectLocationWorkflowTemplateName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationWorkflowTemplateName', () => { - const result = client.matchLocationFromProjectLocationWorkflowTemplateName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchWorkflowTemplateFromProjectLocationWorkflowTemplateName', () => { - const result = client.matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(fakePath); - assert.strictEqual(result, "workflowTemplateValue"); - assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectRegionAutoscalingPolicy', async () => { - const fakePath = "/rendered/path/projectRegionAutoscalingPolicy"; - const expectedParameters = { - project: "projectValue", - region: "regionValue", - autoscaling_policy: "autoscalingPolicyValue", - }; - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectRegionAutoscalingPolicyPath', () => { - const result = client.projectRegionAutoscalingPolicyPath("projectValue", "regionValue", "autoscalingPolicyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectRegionAutoscalingPolicyName', () => { - const result = client.matchProjectFromProjectRegionAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRegionFromProjectRegionAutoscalingPolicyName', () => { - const result = client.matchRegionFromProjectRegionAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "regionValue"); - assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName', () => { - const result = client.matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "autoscalingPolicyValue"); - assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectRegionWorkflowTemplate', async () => { - const fakePath = "/rendered/path/projectRegionWorkflowTemplate"; - const expectedParameters = { - project: "projectValue", - region: "regionValue", - workflow_template: "workflowTemplateValue", - }; - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectRegionWorkflowTemplatePath', () => { - const result = client.projectRegionWorkflowTemplatePath("projectValue", "regionValue", "workflowTemplateValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectRegionWorkflowTemplateName', () => { - const result = client.matchProjectFromProjectRegionWorkflowTemplateName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRegionFromProjectRegionWorkflowTemplateName', () => { - const result = client.matchRegionFromProjectRegionWorkflowTemplateName(fakePath); - assert.strictEqual(result, "regionValue"); - assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchWorkflowTemplateFromProjectRegionWorkflowTemplateName', () => { - const result = client.matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(fakePath); - assert.strictEqual(result, "workflowTemplateValue"); - assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('session', async () => { - const fakePath = "/rendered/path/session"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - session: "sessionValue", - }; - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.sessionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.sessionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('sessionPath', () => { - const result = client.sessionPath("projectValue", "locationValue", "sessionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.sessionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSessionName', () => { - const result = client.matchProjectFromSessionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSessionName', () => { - const result = client.matchLocationFromSessionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSessionFromSessionName', () => { - const result = client.matchSessionFromSessionName(fakePath); - assert.strictEqual(result, "sessionValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('sessionTemplate', async () => { - const fakePath = "/rendered/path/sessionTemplate"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - template: "templateValue", - }; - const client = new jobcontrollerModule.v1.JobControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.sessionTemplatePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.sessionTemplatePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('sessionTemplatePath', () => { - const result = client.sessionTemplatePath("projectValue", "locationValue", "templateValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.sessionTemplatePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSessionTemplateName', () => { - const result = client.matchProjectFromSessionTemplateName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSessionTemplateName', () => { - const result = client.matchLocationFromSessionTemplateName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTemplateFromSessionTemplateName', () => { - const result = client.matchTemplateFromSessionTemplateName(fakePath); - assert.strictEqual(result, "templateValue"); - assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-dataproc/test/gapic_node_group_controller_v1.ts b/owl-bot-staging/google-cloud-dataproc/test/gapic_node_group_controller_v1.ts deleted file mode 100644 index 9113bb3fcb9c..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/test/gapic_node_group_controller_v1.ts +++ /dev/null @@ -1,1690 +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 nodegroupcontrollerModule from '../src'; - -import {protobuf, LROperation, operationsProtos, IamProtos} 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 stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.NodeGroupControllerClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'dataproc.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient(); - 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 = nodegroupcontrollerModule.v1.NodeGroupControllerClient.servicePath; - assert.strictEqual(servicePath, 'dataproc.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = nodegroupcontrollerModule.v1.NodeGroupControllerClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'dataproc.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'dataproc.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'dataproc.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 nodegroupcontrollerModule.v1.NodeGroupControllerClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'dataproc.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 nodegroupcontrollerModule.v1.NodeGroupControllerClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'dataproc.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 nodegroupcontrollerModule.v1.NodeGroupControllerClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = nodegroupcontrollerModule.v1.NodeGroupControllerClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.nodeGroupControllerStub, undefined); - await client.initialize(); - assert(client.nodeGroupControllerStub); - }); - - it('has close method for the initialized client', done => { - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.nodeGroupControllerStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.nodeGroupControllerStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - 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 nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - 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('getNodeGroup', () => { - it('invokes getNodeGroup without error', async () => { - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.GetNodeGroupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetNodeGroupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.dataproc.v1.NodeGroup() - ); - client.innerApiCalls.getNodeGroup = stubSimpleCall(expectedResponse); - const [response] = await client.getNodeGroup(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getNodeGroup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getNodeGroup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getNodeGroup without error using callback', async () => { - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.GetNodeGroupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetNodeGroupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.dataproc.v1.NodeGroup() - ); - client.innerApiCalls.getNodeGroup = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getNodeGroup( - request, - (err?: Error|null, result?: protos.google.cloud.dataproc.v1.INodeGroup|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getNodeGroup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getNodeGroup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getNodeGroup with error', async () => { - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.GetNodeGroupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetNodeGroupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getNodeGroup = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getNodeGroup(request), expectedError); - const actualRequest = (client.innerApiCalls.getNodeGroup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getNodeGroup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getNodeGroup with closed client', async () => { - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.GetNodeGroupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetNodeGroupRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getNodeGroup(request), expectedError); - }); - }); - - describe('createNodeGroup', () => { - it('invokes createNodeGroup without error', async () => { - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.CreateNodeGroupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CreateNodeGroupRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createNodeGroup = stubLongRunningCall(expectedResponse); - const [operation] = await client.createNodeGroup(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createNodeGroup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createNodeGroup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createNodeGroup without error using callback', async () => { - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.CreateNodeGroupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CreateNodeGroupRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createNodeGroup = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createNodeGroup( - 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.createNodeGroup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createNodeGroup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createNodeGroup with call error', async () => { - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.CreateNodeGroupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CreateNodeGroupRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createNodeGroup = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createNodeGroup(request), expectedError); - const actualRequest = (client.innerApiCalls.createNodeGroup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createNodeGroup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createNodeGroup with LRO error', async () => { - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.CreateNodeGroupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CreateNodeGroupRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createNodeGroup = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createNodeGroup(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createNodeGroup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createNodeGroup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateNodeGroupProgress without error', async () => { - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - 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.checkCreateNodeGroupProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateNodeGroupProgress with error', async () => { - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - 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.checkCreateNodeGroupProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('resizeNodeGroup', () => { - it('invokes resizeNodeGroup without error', async () => { - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ResizeNodeGroupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ResizeNodeGroupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.resizeNodeGroup = stubLongRunningCall(expectedResponse); - const [operation] = await client.resizeNodeGroup(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.resizeNodeGroup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.resizeNodeGroup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes resizeNodeGroup without error using callback', async () => { - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ResizeNodeGroupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ResizeNodeGroupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.resizeNodeGroup = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.resizeNodeGroup( - 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.resizeNodeGroup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.resizeNodeGroup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes resizeNodeGroup with call error', async () => { - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ResizeNodeGroupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ResizeNodeGroupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.resizeNodeGroup = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.resizeNodeGroup(request), expectedError); - const actualRequest = (client.innerApiCalls.resizeNodeGroup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.resizeNodeGroup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes resizeNodeGroup with LRO error', async () => { - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ResizeNodeGroupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ResizeNodeGroupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.resizeNodeGroup = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.resizeNodeGroup(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.resizeNodeGroup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.resizeNodeGroup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkResizeNodeGroupProgress without error', async () => { - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - 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.checkResizeNodeGroupProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkResizeNodeGroupProgress with error', async () => { - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - 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.checkResizeNodeGroupProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy without error using callback', async () => { - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy without error using callback', async () => { - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions without error using callback', async () => { - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - 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 nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - 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 nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - 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 nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - 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 nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - 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 nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - 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 nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - 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 nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - 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 nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - 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 nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - 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 nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - 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('batch', async () => { - const fakePath = "/rendered/path/batch"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch: "batchValue", - }; - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.batchPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPath', () => { - const result = client.batchPath("projectValue", "locationValue", "batchValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchName', () => { - const result = client.matchProjectFromBatchName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchName', () => { - const result = client.matchLocationFromBatchName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchFromBatchName', () => { - const result = client.matchBatchFromBatchName(fakePath); - assert.strictEqual(result, "batchValue"); - assert((client.pathTemplates.batchPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('clusterRegion', async () => { - const fakePath = "/rendered/path/clusterRegion"; - const expectedParameters = { - project: "projectValue", - region: "regionValue", - cluster: "clusterValue", - }; - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.clusterRegionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.clusterRegionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('clusterRegionPath', () => { - const result = client.clusterRegionPath("projectValue", "regionValue", "clusterValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.clusterRegionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromClusterRegionName', () => { - const result = client.matchProjectFromClusterRegionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.clusterRegionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRegionFromClusterRegionName', () => { - const result = client.matchRegionFromClusterRegionName(fakePath); - assert.strictEqual(result, "regionValue"); - assert((client.pathTemplates.clusterRegionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromClusterRegionName', () => { - const result = client.matchClusterFromClusterRegionName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.clusterRegionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nodeGroup', async () => { - const fakePath = "/rendered/path/nodeGroup"; - const expectedParameters = { - project: "projectValue", - region: "regionValue", - cluster: "clusterValue", - node_group: "nodeGroupValue", - }; - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.nodeGroupPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nodeGroupPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nodeGroupPath', () => { - const result = client.nodeGroupPath("projectValue", "regionValue", "clusterValue", "nodeGroupValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nodeGroupPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNodeGroupName', () => { - const result = client.matchProjectFromNodeGroupName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRegionFromNodeGroupName', () => { - const result = client.matchRegionFromNodeGroupName(fakePath); - assert.strictEqual(result, "regionValue"); - assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromNodeGroupName', () => { - const result = client.matchClusterFromNodeGroupName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNodeGroupFromNodeGroupName', () => { - const result = client.matchNodeGroupFromNodeGroupName(fakePath); - assert.strictEqual(result, "nodeGroupValue"); - assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', async () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - 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('projectLocationAutoscalingPolicy', async () => { - const fakePath = "/rendered/path/projectLocationAutoscalingPolicy"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - autoscaling_policy: "autoscalingPolicyValue", - }; - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationAutoscalingPolicyPath', () => { - const result = client.projectLocationAutoscalingPolicyPath("projectValue", "locationValue", "autoscalingPolicyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationAutoscalingPolicyName', () => { - const result = client.matchProjectFromProjectLocationAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationAutoscalingPolicyName', () => { - const result = client.matchLocationFromProjectLocationAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName', () => { - const result = client.matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "autoscalingPolicyValue"); - assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationWorkflowTemplate', async () => { - const fakePath = "/rendered/path/projectLocationWorkflowTemplate"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - workflow_template: "workflowTemplateValue", - }; - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationWorkflowTemplatePath', () => { - const result = client.projectLocationWorkflowTemplatePath("projectValue", "locationValue", "workflowTemplateValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationWorkflowTemplateName', () => { - const result = client.matchProjectFromProjectLocationWorkflowTemplateName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationWorkflowTemplateName', () => { - const result = client.matchLocationFromProjectLocationWorkflowTemplateName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchWorkflowTemplateFromProjectLocationWorkflowTemplateName', () => { - const result = client.matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(fakePath); - assert.strictEqual(result, "workflowTemplateValue"); - assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectRegionAutoscalingPolicy', async () => { - const fakePath = "/rendered/path/projectRegionAutoscalingPolicy"; - const expectedParameters = { - project: "projectValue", - region: "regionValue", - autoscaling_policy: "autoscalingPolicyValue", - }; - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectRegionAutoscalingPolicyPath', () => { - const result = client.projectRegionAutoscalingPolicyPath("projectValue", "regionValue", "autoscalingPolicyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectRegionAutoscalingPolicyName', () => { - const result = client.matchProjectFromProjectRegionAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRegionFromProjectRegionAutoscalingPolicyName', () => { - const result = client.matchRegionFromProjectRegionAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "regionValue"); - assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName', () => { - const result = client.matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "autoscalingPolicyValue"); - assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectRegionWorkflowTemplate', async () => { - const fakePath = "/rendered/path/projectRegionWorkflowTemplate"; - const expectedParameters = { - project: "projectValue", - region: "regionValue", - workflow_template: "workflowTemplateValue", - }; - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectRegionWorkflowTemplatePath', () => { - const result = client.projectRegionWorkflowTemplatePath("projectValue", "regionValue", "workflowTemplateValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectRegionWorkflowTemplateName', () => { - const result = client.matchProjectFromProjectRegionWorkflowTemplateName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRegionFromProjectRegionWorkflowTemplateName', () => { - const result = client.matchRegionFromProjectRegionWorkflowTemplateName(fakePath); - assert.strictEqual(result, "regionValue"); - assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchWorkflowTemplateFromProjectRegionWorkflowTemplateName', () => { - const result = client.matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(fakePath); - assert.strictEqual(result, "workflowTemplateValue"); - assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('region', async () => { - const fakePath = "/rendered/path/region"; - const expectedParameters = { - project: "projectValue", - region: "regionValue", - }; - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.regionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.regionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('regionPath', () => { - const result = client.regionPath("projectValue", "regionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.regionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRegionName', () => { - const result = client.matchProjectFromRegionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.regionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRegionFromRegionName', () => { - const result = client.matchRegionFromRegionName(fakePath); - assert.strictEqual(result, "regionValue"); - assert((client.pathTemplates.regionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('session', async () => { - const fakePath = "/rendered/path/session"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - session: "sessionValue", - }; - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.sessionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.sessionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('sessionPath', () => { - const result = client.sessionPath("projectValue", "locationValue", "sessionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.sessionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSessionName', () => { - const result = client.matchProjectFromSessionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSessionName', () => { - const result = client.matchLocationFromSessionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSessionFromSessionName', () => { - const result = client.matchSessionFromSessionName(fakePath); - assert.strictEqual(result, "sessionValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('sessionTemplate', async () => { - const fakePath = "/rendered/path/sessionTemplate"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - template: "templateValue", - }; - const client = new nodegroupcontrollerModule.v1.NodeGroupControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.sessionTemplatePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.sessionTemplatePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('sessionTemplatePath', () => { - const result = client.sessionTemplatePath("projectValue", "locationValue", "templateValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.sessionTemplatePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSessionTemplateName', () => { - const result = client.matchProjectFromSessionTemplateName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSessionTemplateName', () => { - const result = client.matchLocationFromSessionTemplateName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTemplateFromSessionTemplateName', () => { - const result = client.matchTemplateFromSessionTemplateName(fakePath); - assert.strictEqual(result, "templateValue"); - assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-dataproc/test/gapic_session_controller_v1.ts b/owl-bot-staging/google-cloud-dataproc/test/gapic_session_controller_v1.ts deleted file mode 100644 index 342680072047..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/test/gapic_session_controller_v1.ts +++ /dev/null @@ -1,2070 +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 sessioncontrollerModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos, IamProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.SessionControllerClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'dataproc.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient(); - 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 = sessioncontrollerModule.v1.SessionControllerClient.servicePath; - assert.strictEqual(servicePath, 'dataproc.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = sessioncontrollerModule.v1.SessionControllerClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'dataproc.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'dataproc.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'dataproc.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 sessioncontrollerModule.v1.SessionControllerClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'dataproc.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 sessioncontrollerModule.v1.SessionControllerClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'dataproc.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 sessioncontrollerModule.v1.SessionControllerClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = sessioncontrollerModule.v1.SessionControllerClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.sessionControllerStub, undefined); - await client.initialize(); - assert(client.sessionControllerStub); - }); - - it('has close method for the initialized client', done => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.sessionControllerStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.sessionControllerStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - 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 sessioncontrollerModule.v1.SessionControllerClient({ - 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('getSession', () => { - it('invokes getSession without error', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.GetSessionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetSessionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.dataproc.v1.Session() - ); - client.innerApiCalls.getSession = stubSimpleCall(expectedResponse); - const [response] = await client.getSession(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSession as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSession as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSession without error using callback', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.GetSessionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetSessionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.dataproc.v1.Session() - ); - client.innerApiCalls.getSession = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getSession( - request, - (err?: Error|null, result?: protos.google.cloud.dataproc.v1.ISession|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSession as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSession as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSession with error', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.GetSessionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetSessionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getSession = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getSession(request), expectedError); - const actualRequest = (client.innerApiCalls.getSession as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSession as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSession with closed client', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.GetSessionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetSessionRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getSession(request), expectedError); - }); - }); - - describe('createSession', () => { - it('invokes createSession without error', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.CreateSessionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CreateSessionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createSession = stubLongRunningCall(expectedResponse); - const [operation] = await client.createSession(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createSession as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSession as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSession without error using callback', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.CreateSessionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CreateSessionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createSession = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createSession( - 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.createSession as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSession as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSession with call error', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.CreateSessionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CreateSessionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createSession = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createSession(request), expectedError); - const actualRequest = (client.innerApiCalls.createSession as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSession as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSession with LRO error', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.CreateSessionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CreateSessionRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createSession = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createSession(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createSession as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSession as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateSessionProgress without error', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - 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.checkCreateSessionProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateSessionProgress with error', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - 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.checkCreateSessionProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('terminateSession', () => { - it('invokes terminateSession without error', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.TerminateSessionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.TerminateSessionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.terminateSession = stubLongRunningCall(expectedResponse); - const [operation] = await client.terminateSession(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.terminateSession as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.terminateSession as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes terminateSession without error using callback', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.TerminateSessionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.TerminateSessionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.terminateSession = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.terminateSession( - 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.terminateSession as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.terminateSession as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes terminateSession with call error', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.TerminateSessionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.TerminateSessionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.terminateSession = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.terminateSession(request), expectedError); - const actualRequest = (client.innerApiCalls.terminateSession as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.terminateSession as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes terminateSession with LRO error', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.TerminateSessionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.TerminateSessionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.terminateSession = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.terminateSession(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.terminateSession as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.terminateSession as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkTerminateSessionProgress without error', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - 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.checkTerminateSessionProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkTerminateSessionProgress with error', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - 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.checkTerminateSessionProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteSession', () => { - it('invokes deleteSession without error', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.DeleteSessionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteSessionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteSession = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteSession(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteSession as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSession as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSession without error using callback', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.DeleteSessionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteSessionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteSession = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteSession( - 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.deleteSession as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSession as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSession with call error', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.DeleteSessionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteSessionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteSession = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteSession(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteSession as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSession as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSession with LRO error', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.DeleteSessionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteSessionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteSession = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteSession(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteSession as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSession as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteSessionProgress without error', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - 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.checkDeleteSessionProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteSessionProgress with error', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - 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.checkDeleteSessionProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listSessions', () => { - it('invokes listSessions without error', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListSessionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListSessionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataproc.v1.Session()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.Session()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.Session()), - ]; - client.innerApiCalls.listSessions = stubSimpleCall(expectedResponse); - const [response] = await client.listSessions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSessions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSessions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSessions without error using callback', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListSessionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListSessionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataproc.v1.Session()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.Session()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.Session()), - ]; - client.innerApiCalls.listSessions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listSessions( - request, - (err?: Error|null, result?: protos.google.cloud.dataproc.v1.ISession[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSessions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSessions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSessions with error', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListSessionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListSessionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listSessions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listSessions(request), expectedError); - const actualRequest = (client.innerApiCalls.listSessions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSessions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSessionsStream without error', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListSessionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListSessionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataproc.v1.Session()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.Session()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.Session()), - ]; - client.descriptors.page.listSessions.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listSessionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataproc.v1.Session[] = []; - stream.on('data', (response: protos.google.cloud.dataproc.v1.Session) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert((client.descriptors.page.listSessions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSessions, request)); - assert( - (client.descriptors.page.listSessions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listSessionsStream with error', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListSessionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListSessionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listSessions.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listSessionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataproc.v1.Session[] = []; - stream.on('data', (response: protos.google.cloud.dataproc.v1.Session) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listSessions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSessions, request)); - assert( - (client.descriptors.page.listSessions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSessions without error', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListSessionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListSessionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataproc.v1.Session()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.Session()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.Session()), - ]; - client.descriptors.page.listSessions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.dataproc.v1.ISession[] = []; - const iterable = client.listSessionsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listSessions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSessions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSessions with error', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListSessionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListSessionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listSessions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listSessionsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.dataproc.v1.ISession[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listSessions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSessions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy without error using callback', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy without error using callback', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions without error using callback', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - 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 sessioncontrollerModule.v1.SessionControllerClient({ - 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 sessioncontrollerModule.v1.SessionControllerClient({ - 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 sessioncontrollerModule.v1.SessionControllerClient({ - 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 sessioncontrollerModule.v1.SessionControllerClient({ - 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 sessioncontrollerModule.v1.SessionControllerClient({ - 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 sessioncontrollerModule.v1.SessionControllerClient({ - 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 sessioncontrollerModule.v1.SessionControllerClient({ - 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 sessioncontrollerModule.v1.SessionControllerClient({ - 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 sessioncontrollerModule.v1.SessionControllerClient({ - 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 sessioncontrollerModule.v1.SessionControllerClient({ - 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('batch', async () => { - const fakePath = "/rendered/path/batch"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch: "batchValue", - }; - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.batchPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPath', () => { - const result = client.batchPath("projectValue", "locationValue", "batchValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchName', () => { - const result = client.matchProjectFromBatchName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchName', () => { - const result = client.matchLocationFromBatchName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchFromBatchName', () => { - const result = client.matchBatchFromBatchName(fakePath); - assert.strictEqual(result, "batchValue"); - assert((client.pathTemplates.batchPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', async () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - 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('nodeGroup', async () => { - const fakePath = "/rendered/path/nodeGroup"; - const expectedParameters = { - project: "projectValue", - region: "regionValue", - cluster: "clusterValue", - node_group: "nodeGroupValue", - }; - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.nodeGroupPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nodeGroupPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nodeGroupPath', () => { - const result = client.nodeGroupPath("projectValue", "regionValue", "clusterValue", "nodeGroupValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nodeGroupPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNodeGroupName', () => { - const result = client.matchProjectFromNodeGroupName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRegionFromNodeGroupName', () => { - const result = client.matchRegionFromNodeGroupName(fakePath); - assert.strictEqual(result, "regionValue"); - assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromNodeGroupName', () => { - const result = client.matchClusterFromNodeGroupName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNodeGroupFromNodeGroupName', () => { - const result = client.matchNodeGroupFromNodeGroupName(fakePath); - assert.strictEqual(result, "nodeGroupValue"); - assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', async () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - 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('projectLocationAutoscalingPolicy', async () => { - const fakePath = "/rendered/path/projectLocationAutoscalingPolicy"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - autoscaling_policy: "autoscalingPolicyValue", - }; - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationAutoscalingPolicyPath', () => { - const result = client.projectLocationAutoscalingPolicyPath("projectValue", "locationValue", "autoscalingPolicyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationAutoscalingPolicyName', () => { - const result = client.matchProjectFromProjectLocationAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationAutoscalingPolicyName', () => { - const result = client.matchLocationFromProjectLocationAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName', () => { - const result = client.matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "autoscalingPolicyValue"); - assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationWorkflowTemplate', async () => { - const fakePath = "/rendered/path/projectLocationWorkflowTemplate"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - workflow_template: "workflowTemplateValue", - }; - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationWorkflowTemplatePath', () => { - const result = client.projectLocationWorkflowTemplatePath("projectValue", "locationValue", "workflowTemplateValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationWorkflowTemplateName', () => { - const result = client.matchProjectFromProjectLocationWorkflowTemplateName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationWorkflowTemplateName', () => { - const result = client.matchLocationFromProjectLocationWorkflowTemplateName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchWorkflowTemplateFromProjectLocationWorkflowTemplateName', () => { - const result = client.matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(fakePath); - assert.strictEqual(result, "workflowTemplateValue"); - assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectRegionAutoscalingPolicy', async () => { - const fakePath = "/rendered/path/projectRegionAutoscalingPolicy"; - const expectedParameters = { - project: "projectValue", - region: "regionValue", - autoscaling_policy: "autoscalingPolicyValue", - }; - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectRegionAutoscalingPolicyPath', () => { - const result = client.projectRegionAutoscalingPolicyPath("projectValue", "regionValue", "autoscalingPolicyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectRegionAutoscalingPolicyName', () => { - const result = client.matchProjectFromProjectRegionAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRegionFromProjectRegionAutoscalingPolicyName', () => { - const result = client.matchRegionFromProjectRegionAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "regionValue"); - assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName', () => { - const result = client.matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "autoscalingPolicyValue"); - assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectRegionWorkflowTemplate', async () => { - const fakePath = "/rendered/path/projectRegionWorkflowTemplate"; - const expectedParameters = { - project: "projectValue", - region: "regionValue", - workflow_template: "workflowTemplateValue", - }; - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectRegionWorkflowTemplatePath', () => { - const result = client.projectRegionWorkflowTemplatePath("projectValue", "regionValue", "workflowTemplateValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectRegionWorkflowTemplateName', () => { - const result = client.matchProjectFromProjectRegionWorkflowTemplateName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRegionFromProjectRegionWorkflowTemplateName', () => { - const result = client.matchRegionFromProjectRegionWorkflowTemplateName(fakePath); - assert.strictEqual(result, "regionValue"); - assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchWorkflowTemplateFromProjectRegionWorkflowTemplateName', () => { - const result = client.matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(fakePath); - assert.strictEqual(result, "workflowTemplateValue"); - assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('session', async () => { - const fakePath = "/rendered/path/session"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - session: "sessionValue", - }; - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.sessionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.sessionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('sessionPath', () => { - const result = client.sessionPath("projectValue", "locationValue", "sessionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.sessionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSessionName', () => { - const result = client.matchProjectFromSessionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSessionName', () => { - const result = client.matchLocationFromSessionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSessionFromSessionName', () => { - const result = client.matchSessionFromSessionName(fakePath); - assert.strictEqual(result, "sessionValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('sessionTemplate', async () => { - const fakePath = "/rendered/path/sessionTemplate"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - template: "templateValue", - }; - const client = new sessioncontrollerModule.v1.SessionControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.sessionTemplatePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.sessionTemplatePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('sessionTemplatePath', () => { - const result = client.sessionTemplatePath("projectValue", "locationValue", "templateValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.sessionTemplatePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSessionTemplateName', () => { - const result = client.matchProjectFromSessionTemplateName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSessionTemplateName', () => { - const result = client.matchLocationFromSessionTemplateName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTemplateFromSessionTemplateName', () => { - const result = client.matchTemplateFromSessionTemplateName(fakePath); - assert.strictEqual(result, "templateValue"); - assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-dataproc/test/gapic_session_template_controller_v1.ts b/owl-bot-staging/google-cloud-dataproc/test/gapic_session_template_controller_v1.ts deleted file mode 100644 index 3387d28ae53a..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/test/gapic_session_template_controller_v1.ts +++ /dev/null @@ -1,1665 +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 sessiontemplatecontrollerModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, IamProtos} 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('v1.SessionTemplateControllerClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'dataproc.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient(); - 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 = sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient.servicePath; - assert.strictEqual(servicePath, 'dataproc.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'dataproc.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'dataproc.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'dataproc.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 sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'dataproc.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 sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'dataproc.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 sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.sessionTemplateControllerStub, undefined); - await client.initialize(); - assert(client.sessionTemplateControllerStub); - }); - - it('has close method for the initialized client', done => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.sessionTemplateControllerStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.sessionTemplateControllerStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - 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 sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - 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('createSessionTemplate', () => { - it('invokes createSessionTemplate without error', async () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.CreateSessionTemplateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CreateSessionTemplateRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.dataproc.v1.SessionTemplate() - ); - client.innerApiCalls.createSessionTemplate = stubSimpleCall(expectedResponse); - const [response] = await client.createSessionTemplate(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createSessionTemplate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSessionTemplate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSessionTemplate without error using callback', async () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.CreateSessionTemplateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CreateSessionTemplateRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.dataproc.v1.SessionTemplate() - ); - client.innerApiCalls.createSessionTemplate = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createSessionTemplate( - request, - (err?: Error|null, result?: protos.google.cloud.dataproc.v1.ISessionTemplate|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createSessionTemplate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSessionTemplate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSessionTemplate with error', async () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.CreateSessionTemplateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CreateSessionTemplateRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createSessionTemplate = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createSessionTemplate(request), expectedError); - const actualRequest = (client.innerApiCalls.createSessionTemplate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createSessionTemplate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createSessionTemplate with closed client', async () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.CreateSessionTemplateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CreateSessionTemplateRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createSessionTemplate(request), expectedError); - }); - }); - - describe('updateSessionTemplate', () => { - it('invokes updateSessionTemplate without error', async () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.UpdateSessionTemplateRequest() - ); - request.sessionTemplate ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateSessionTemplateRequest', ['sessionTemplate', 'name']); - request.sessionTemplate.name = defaultValue1; - const expectedHeaderRequestParams = `session_template.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.dataproc.v1.SessionTemplate() - ); - client.innerApiCalls.updateSessionTemplate = stubSimpleCall(expectedResponse); - const [response] = await client.updateSessionTemplate(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateSessionTemplate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSessionTemplate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateSessionTemplate without error using callback', async () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.UpdateSessionTemplateRequest() - ); - request.sessionTemplate ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateSessionTemplateRequest', ['sessionTemplate', 'name']); - request.sessionTemplate.name = defaultValue1; - const expectedHeaderRequestParams = `session_template.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.dataproc.v1.SessionTemplate() - ); - client.innerApiCalls.updateSessionTemplate = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateSessionTemplate( - request, - (err?: Error|null, result?: protos.google.cloud.dataproc.v1.ISessionTemplate|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateSessionTemplate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSessionTemplate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateSessionTemplate with error', async () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.UpdateSessionTemplateRequest() - ); - request.sessionTemplate ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateSessionTemplateRequest', ['sessionTemplate', 'name']); - request.sessionTemplate.name = defaultValue1; - const expectedHeaderRequestParams = `session_template.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateSessionTemplate = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateSessionTemplate(request), expectedError); - const actualRequest = (client.innerApiCalls.updateSessionTemplate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateSessionTemplate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateSessionTemplate with closed client', async () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.UpdateSessionTemplateRequest() - ); - request.sessionTemplate ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateSessionTemplateRequest', ['sessionTemplate', 'name']); - request.sessionTemplate.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateSessionTemplate(request), expectedError); - }); - }); - - describe('getSessionTemplate', () => { - it('invokes getSessionTemplate without error', async () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.GetSessionTemplateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetSessionTemplateRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.dataproc.v1.SessionTemplate() - ); - client.innerApiCalls.getSessionTemplate = stubSimpleCall(expectedResponse); - const [response] = await client.getSessionTemplate(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSessionTemplate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSessionTemplate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSessionTemplate without error using callback', async () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.GetSessionTemplateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetSessionTemplateRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.dataproc.v1.SessionTemplate() - ); - client.innerApiCalls.getSessionTemplate = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getSessionTemplate( - request, - (err?: Error|null, result?: protos.google.cloud.dataproc.v1.ISessionTemplate|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getSessionTemplate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSessionTemplate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSessionTemplate with error', async () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.GetSessionTemplateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetSessionTemplateRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getSessionTemplate = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getSessionTemplate(request), expectedError); - const actualRequest = (client.innerApiCalls.getSessionTemplate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getSessionTemplate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getSessionTemplate with closed client', async () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.GetSessionTemplateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetSessionTemplateRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getSessionTemplate(request), expectedError); - }); - }); - - describe('deleteSessionTemplate', () => { - it('invokes deleteSessionTemplate without error', async () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.DeleteSessionTemplateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteSessionTemplateRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteSessionTemplate = stubSimpleCall(expectedResponse); - const [response] = await client.deleteSessionTemplate(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteSessionTemplate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSessionTemplate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSessionTemplate without error using callback', async () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.DeleteSessionTemplateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteSessionTemplateRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteSessionTemplate = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteSessionTemplate( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteSessionTemplate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSessionTemplate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSessionTemplate with error', async () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.DeleteSessionTemplateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteSessionTemplateRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteSessionTemplate = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteSessionTemplate(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteSessionTemplate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteSessionTemplate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteSessionTemplate with closed client', async () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.DeleteSessionTemplateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteSessionTemplateRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteSessionTemplate(request), expectedError); - }); - }); - - describe('listSessionTemplates', () => { - it('invokes listSessionTemplates without error', async () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListSessionTemplatesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListSessionTemplatesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataproc.v1.SessionTemplate()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.SessionTemplate()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.SessionTemplate()), - ]; - client.innerApiCalls.listSessionTemplates = stubSimpleCall(expectedResponse); - const [response] = await client.listSessionTemplates(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSessionTemplates as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSessionTemplates as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSessionTemplates without error using callback', async () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListSessionTemplatesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListSessionTemplatesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataproc.v1.SessionTemplate()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.SessionTemplate()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.SessionTemplate()), - ]; - client.innerApiCalls.listSessionTemplates = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listSessionTemplates( - request, - (err?: Error|null, result?: protos.google.cloud.dataproc.v1.ISessionTemplate[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listSessionTemplates as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSessionTemplates as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSessionTemplates with error', async () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListSessionTemplatesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListSessionTemplatesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listSessionTemplates = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listSessionTemplates(request), expectedError); - const actualRequest = (client.innerApiCalls.listSessionTemplates as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listSessionTemplates as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listSessionTemplatesStream without error', async () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListSessionTemplatesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListSessionTemplatesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataproc.v1.SessionTemplate()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.SessionTemplate()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.SessionTemplate()), - ]; - client.descriptors.page.listSessionTemplates.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listSessionTemplatesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataproc.v1.SessionTemplate[] = []; - stream.on('data', (response: protos.google.cloud.dataproc.v1.SessionTemplate) => { - 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.listSessionTemplates.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSessionTemplates, request)); - assert( - (client.descriptors.page.listSessionTemplates.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listSessionTemplatesStream with error', async () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListSessionTemplatesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListSessionTemplatesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listSessionTemplates.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listSessionTemplatesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataproc.v1.SessionTemplate[] = []; - stream.on('data', (response: protos.google.cloud.dataproc.v1.SessionTemplate) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listSessionTemplates.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listSessionTemplates, request)); - assert( - (client.descriptors.page.listSessionTemplates.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSessionTemplates without error', async () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListSessionTemplatesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListSessionTemplatesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataproc.v1.SessionTemplate()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.SessionTemplate()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.SessionTemplate()), - ]; - client.descriptors.page.listSessionTemplates.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.dataproc.v1.ISessionTemplate[] = []; - const iterable = client.listSessionTemplatesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listSessionTemplates.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSessionTemplates.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listSessionTemplates with error', async () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListSessionTemplatesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListSessionTemplatesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listSessionTemplates.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listSessionTemplatesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.dataproc.v1.ISessionTemplate[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listSessionTemplates.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listSessionTemplates.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy without error using callback', async () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy without error using callback', async () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions without error using callback', async () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - - describe('Path templates', () => { - - describe('batch', async () => { - const fakePath = "/rendered/path/batch"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch: "batchValue", - }; - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.batchPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPath', () => { - const result = client.batchPath("projectValue", "locationValue", "batchValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchName', () => { - const result = client.matchProjectFromBatchName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchName', () => { - const result = client.matchLocationFromBatchName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchFromBatchName', () => { - const result = client.matchBatchFromBatchName(fakePath); - assert.strictEqual(result, "batchValue"); - assert((client.pathTemplates.batchPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', async () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - 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('nodeGroup', async () => { - const fakePath = "/rendered/path/nodeGroup"; - const expectedParameters = { - project: "projectValue", - region: "regionValue", - cluster: "clusterValue", - node_group: "nodeGroupValue", - }; - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.nodeGroupPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nodeGroupPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nodeGroupPath', () => { - const result = client.nodeGroupPath("projectValue", "regionValue", "clusterValue", "nodeGroupValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nodeGroupPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNodeGroupName', () => { - const result = client.matchProjectFromNodeGroupName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRegionFromNodeGroupName', () => { - const result = client.matchRegionFromNodeGroupName(fakePath); - assert.strictEqual(result, "regionValue"); - assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromNodeGroupName', () => { - const result = client.matchClusterFromNodeGroupName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNodeGroupFromNodeGroupName', () => { - const result = client.matchNodeGroupFromNodeGroupName(fakePath); - assert.strictEqual(result, "nodeGroupValue"); - assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', async () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - 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('projectLocationAutoscalingPolicy', async () => { - const fakePath = "/rendered/path/projectLocationAutoscalingPolicy"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - autoscaling_policy: "autoscalingPolicyValue", - }; - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationAutoscalingPolicyPath', () => { - const result = client.projectLocationAutoscalingPolicyPath("projectValue", "locationValue", "autoscalingPolicyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationAutoscalingPolicyName', () => { - const result = client.matchProjectFromProjectLocationAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationAutoscalingPolicyName', () => { - const result = client.matchLocationFromProjectLocationAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName', () => { - const result = client.matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "autoscalingPolicyValue"); - assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationWorkflowTemplate', async () => { - const fakePath = "/rendered/path/projectLocationWorkflowTemplate"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - workflow_template: "workflowTemplateValue", - }; - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationWorkflowTemplatePath', () => { - const result = client.projectLocationWorkflowTemplatePath("projectValue", "locationValue", "workflowTemplateValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationWorkflowTemplateName', () => { - const result = client.matchProjectFromProjectLocationWorkflowTemplateName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationWorkflowTemplateName', () => { - const result = client.matchLocationFromProjectLocationWorkflowTemplateName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchWorkflowTemplateFromProjectLocationWorkflowTemplateName', () => { - const result = client.matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(fakePath); - assert.strictEqual(result, "workflowTemplateValue"); - assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectRegionAutoscalingPolicy', async () => { - const fakePath = "/rendered/path/projectRegionAutoscalingPolicy"; - const expectedParameters = { - project: "projectValue", - region: "regionValue", - autoscaling_policy: "autoscalingPolicyValue", - }; - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectRegionAutoscalingPolicyPath', () => { - const result = client.projectRegionAutoscalingPolicyPath("projectValue", "regionValue", "autoscalingPolicyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectRegionAutoscalingPolicyName', () => { - const result = client.matchProjectFromProjectRegionAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRegionFromProjectRegionAutoscalingPolicyName', () => { - const result = client.matchRegionFromProjectRegionAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "regionValue"); - assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName', () => { - const result = client.matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "autoscalingPolicyValue"); - assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectRegionWorkflowTemplate', async () => { - const fakePath = "/rendered/path/projectRegionWorkflowTemplate"; - const expectedParameters = { - project: "projectValue", - region: "regionValue", - workflow_template: "workflowTemplateValue", - }; - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectRegionWorkflowTemplatePath', () => { - const result = client.projectRegionWorkflowTemplatePath("projectValue", "regionValue", "workflowTemplateValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectRegionWorkflowTemplateName', () => { - const result = client.matchProjectFromProjectRegionWorkflowTemplateName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRegionFromProjectRegionWorkflowTemplateName', () => { - const result = client.matchRegionFromProjectRegionWorkflowTemplateName(fakePath); - assert.strictEqual(result, "regionValue"); - assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchWorkflowTemplateFromProjectRegionWorkflowTemplateName', () => { - const result = client.matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(fakePath); - assert.strictEqual(result, "workflowTemplateValue"); - assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('session', async () => { - const fakePath = "/rendered/path/session"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - session: "sessionValue", - }; - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.sessionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.sessionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('sessionPath', () => { - const result = client.sessionPath("projectValue", "locationValue", "sessionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.sessionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSessionName', () => { - const result = client.matchProjectFromSessionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSessionName', () => { - const result = client.matchLocationFromSessionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSessionFromSessionName', () => { - const result = client.matchSessionFromSessionName(fakePath); - assert.strictEqual(result, "sessionValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('sessionTemplate', async () => { - const fakePath = "/rendered/path/sessionTemplate"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - template: "templateValue", - }; - const client = new sessiontemplatecontrollerModule.v1.SessionTemplateControllerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.sessionTemplatePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.sessionTemplatePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('sessionTemplatePath', () => { - const result = client.sessionTemplatePath("projectValue", "locationValue", "templateValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.sessionTemplatePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSessionTemplateName', () => { - const result = client.matchProjectFromSessionTemplateName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSessionTemplateName', () => { - const result = client.matchLocationFromSessionTemplateName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTemplateFromSessionTemplateName', () => { - const result = client.matchTemplateFromSessionTemplateName(fakePath); - assert.strictEqual(result, "templateValue"); - assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-dataproc/test/gapic_workflow_template_service_v1.ts b/owl-bot-staging/google-cloud-dataproc/test/gapic_workflow_template_service_v1.ts deleted file mode 100644 index 902e80dbe365..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/test/gapic_workflow_template_service_v1.ts +++ /dev/null @@ -1,2244 +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 workflowtemplateserviceModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos, IamProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.WorkflowTemplateServiceClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'dataproc.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient(); - 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 = workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient.servicePath; - assert.strictEqual(servicePath, 'dataproc.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'dataproc.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'dataproc.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'dataproc.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 workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'dataproc.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 workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'dataproc.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 workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.workflowTemplateServiceStub, undefined); - await client.initialize(); - assert(client.workflowTemplateServiceStub); - }); - - it('has close method for the initialized client', done => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.workflowTemplateServiceStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.workflowTemplateServiceStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - 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 workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - 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('createWorkflowTemplate', () => { - it('invokes createWorkflowTemplate without error', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.dataproc.v1.WorkflowTemplate() - ); - client.innerApiCalls.createWorkflowTemplate = stubSimpleCall(expectedResponse); - const [response] = await client.createWorkflowTemplate(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createWorkflowTemplate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createWorkflowTemplate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createWorkflowTemplate without error using callback', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.dataproc.v1.WorkflowTemplate() - ); - client.innerApiCalls.createWorkflowTemplate = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createWorkflowTemplate( - request, - (err?: Error|null, result?: protos.google.cloud.dataproc.v1.IWorkflowTemplate|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createWorkflowTemplate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createWorkflowTemplate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createWorkflowTemplate with error', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createWorkflowTemplate = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.createWorkflowTemplate(request), expectedError); - const actualRequest = (client.innerApiCalls.createWorkflowTemplate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createWorkflowTemplate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createWorkflowTemplate with closed client', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.CreateWorkflowTemplateRequest', ['parent']); - request.parent = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.createWorkflowTemplate(request), expectedError); - }); - }); - - describe('getWorkflowTemplate', () => { - it('invokes getWorkflowTemplate without error', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.GetWorkflowTemplateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetWorkflowTemplateRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.dataproc.v1.WorkflowTemplate() - ); - client.innerApiCalls.getWorkflowTemplate = stubSimpleCall(expectedResponse); - const [response] = await client.getWorkflowTemplate(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getWorkflowTemplate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getWorkflowTemplate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getWorkflowTemplate without error using callback', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.GetWorkflowTemplateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetWorkflowTemplateRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.dataproc.v1.WorkflowTemplate() - ); - client.innerApiCalls.getWorkflowTemplate = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getWorkflowTemplate( - request, - (err?: Error|null, result?: protos.google.cloud.dataproc.v1.IWorkflowTemplate|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getWorkflowTemplate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getWorkflowTemplate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getWorkflowTemplate with error', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.GetWorkflowTemplateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetWorkflowTemplateRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getWorkflowTemplate = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getWorkflowTemplate(request), expectedError); - const actualRequest = (client.innerApiCalls.getWorkflowTemplate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getWorkflowTemplate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getWorkflowTemplate with closed client', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.GetWorkflowTemplateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.GetWorkflowTemplateRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getWorkflowTemplate(request), expectedError); - }); - }); - - describe('updateWorkflowTemplate', () => { - it('invokes updateWorkflowTemplate without error', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest() - ); - request.template ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest', ['template', 'name']); - request.template.name = defaultValue1; - const expectedHeaderRequestParams = `template.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.dataproc.v1.WorkflowTemplate() - ); - client.innerApiCalls.updateWorkflowTemplate = stubSimpleCall(expectedResponse); - const [response] = await client.updateWorkflowTemplate(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateWorkflowTemplate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateWorkflowTemplate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateWorkflowTemplate without error using callback', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest() - ); - request.template ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest', ['template', 'name']); - request.template.name = defaultValue1; - const expectedHeaderRequestParams = `template.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.dataproc.v1.WorkflowTemplate() - ); - client.innerApiCalls.updateWorkflowTemplate = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateWorkflowTemplate( - request, - (err?: Error|null, result?: protos.google.cloud.dataproc.v1.IWorkflowTemplate|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateWorkflowTemplate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateWorkflowTemplate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateWorkflowTemplate with error', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest() - ); - request.template ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest', ['template', 'name']); - request.template.name = defaultValue1; - const expectedHeaderRequestParams = `template.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateWorkflowTemplate = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.updateWorkflowTemplate(request), expectedError); - const actualRequest = (client.innerApiCalls.updateWorkflowTemplate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateWorkflowTemplate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateWorkflowTemplate with closed client', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest() - ); - request.template ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.UpdateWorkflowTemplateRequest', ['template', 'name']); - request.template.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.updateWorkflowTemplate(request), expectedError); - }); - }); - - describe('deleteWorkflowTemplate', () => { - it('invokes deleteWorkflowTemplate without error', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteWorkflowTemplate = stubSimpleCall(expectedResponse); - const [response] = await client.deleteWorkflowTemplate(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteWorkflowTemplate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteWorkflowTemplate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteWorkflowTemplate without error using callback', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() - ); - client.innerApiCalls.deleteWorkflowTemplate = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteWorkflowTemplate( - request, - (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteWorkflowTemplate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteWorkflowTemplate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteWorkflowTemplate with error', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteWorkflowTemplate = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.deleteWorkflowTemplate(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteWorkflowTemplate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteWorkflowTemplate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteWorkflowTemplate with closed client', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.DeleteWorkflowTemplateRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.deleteWorkflowTemplate(request), expectedError); - }); - }); - - describe('instantiateWorkflowTemplate', () => { - it('invokes instantiateWorkflowTemplate without error', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.instantiateWorkflowTemplate = stubLongRunningCall(expectedResponse); - const [operation] = await client.instantiateWorkflowTemplate(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.instantiateWorkflowTemplate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.instantiateWorkflowTemplate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes instantiateWorkflowTemplate without error using callback', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.instantiateWorkflowTemplate = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.instantiateWorkflowTemplate( - 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.instantiateWorkflowTemplate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.instantiateWorkflowTemplate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes instantiateWorkflowTemplate with call error', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.instantiateWorkflowTemplate = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.instantiateWorkflowTemplate(request), expectedError); - const actualRequest = (client.innerApiCalls.instantiateWorkflowTemplate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.instantiateWorkflowTemplate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes instantiateWorkflowTemplate with LRO error', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.InstantiateWorkflowTemplateRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.instantiateWorkflowTemplate = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.instantiateWorkflowTemplate(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.instantiateWorkflowTemplate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.instantiateWorkflowTemplate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkInstantiateWorkflowTemplateProgress without error', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - 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.checkInstantiateWorkflowTemplateProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkInstantiateWorkflowTemplateProgress with error', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - 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.checkInstantiateWorkflowTemplateProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('instantiateInlineWorkflowTemplate', () => { - it('invokes instantiateInlineWorkflowTemplate without error', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.instantiateInlineWorkflowTemplate = stubLongRunningCall(expectedResponse); - const [operation] = await client.instantiateInlineWorkflowTemplate(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.instantiateInlineWorkflowTemplate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.instantiateInlineWorkflowTemplate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes instantiateInlineWorkflowTemplate without error using callback', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.instantiateInlineWorkflowTemplate = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.instantiateInlineWorkflowTemplate( - 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.instantiateInlineWorkflowTemplate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.instantiateInlineWorkflowTemplate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes instantiateInlineWorkflowTemplate with call error', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.instantiateInlineWorkflowTemplate = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.instantiateInlineWorkflowTemplate(request), expectedError); - const actualRequest = (client.innerApiCalls.instantiateInlineWorkflowTemplate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.instantiateInlineWorkflowTemplate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes instantiateInlineWorkflowTemplate with LRO error', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.InstantiateInlineWorkflowTemplateRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.instantiateInlineWorkflowTemplate = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.instantiateInlineWorkflowTemplate(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.instantiateInlineWorkflowTemplate as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.instantiateInlineWorkflowTemplate as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkInstantiateInlineWorkflowTemplateProgress without error', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - 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.checkInstantiateInlineWorkflowTemplateProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkInstantiateInlineWorkflowTemplateProgress with error', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - 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.checkInstantiateInlineWorkflowTemplateProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listWorkflowTemplates', () => { - it('invokes listWorkflowTemplates without error', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataproc.v1.WorkflowTemplate()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.WorkflowTemplate()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.WorkflowTemplate()), - ]; - client.innerApiCalls.listWorkflowTemplates = stubSimpleCall(expectedResponse); - const [response] = await client.listWorkflowTemplates(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listWorkflowTemplates as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listWorkflowTemplates as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listWorkflowTemplates without error using callback', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataproc.v1.WorkflowTemplate()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.WorkflowTemplate()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.WorkflowTemplate()), - ]; - client.innerApiCalls.listWorkflowTemplates = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listWorkflowTemplates( - request, - (err?: Error|null, result?: protos.google.cloud.dataproc.v1.IWorkflowTemplate[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listWorkflowTemplates as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listWorkflowTemplates as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listWorkflowTemplates with error', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listWorkflowTemplates = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listWorkflowTemplates(request), expectedError); - const actualRequest = (client.innerApiCalls.listWorkflowTemplates as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listWorkflowTemplates as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listWorkflowTemplatesStream without error', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataproc.v1.WorkflowTemplate()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.WorkflowTemplate()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.WorkflowTemplate()), - ]; - client.descriptors.page.listWorkflowTemplates.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listWorkflowTemplatesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataproc.v1.WorkflowTemplate[] = []; - stream.on('data', (response: protos.google.cloud.dataproc.v1.WorkflowTemplate) => { - 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.listWorkflowTemplates.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listWorkflowTemplates, request)); - assert( - (client.descriptors.page.listWorkflowTemplates.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listWorkflowTemplatesStream with error', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listWorkflowTemplates.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listWorkflowTemplatesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.dataproc.v1.WorkflowTemplate[] = []; - stream.on('data', (response: protos.google.cloud.dataproc.v1.WorkflowTemplate) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listWorkflowTemplates.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listWorkflowTemplates, request)); - assert( - (client.descriptors.page.listWorkflowTemplates.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listWorkflowTemplates without error', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.dataproc.v1.WorkflowTemplate()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.WorkflowTemplate()), - generateSampleMessage(new protos.google.cloud.dataproc.v1.WorkflowTemplate()), - ]; - client.descriptors.page.listWorkflowTemplates.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.dataproc.v1.IWorkflowTemplate[] = []; - const iterable = client.listWorkflowTemplatesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listWorkflowTemplates.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listWorkflowTemplates.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listWorkflowTemplates with error', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.dataproc.v1.ListWorkflowTemplatesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listWorkflowTemplates.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listWorkflowTemplatesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.dataproc.v1.IWorkflowTemplate[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listWorkflowTemplates.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listWorkflowTemplates.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getIamPolicy without error using callback', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.getIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes getIamPolicy with error', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.getIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes setIamPolicy without error using callback', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() - ); - client.iamClient.setIamPolicy = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.setIamPolicy( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.Policy|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0)); - }); - it('invokes setIamPolicy with error', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.setIamPolicy(request, expectedOptions), expectedError); - assert((client.iamClient.setIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes testIamPermissions without error using callback', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.testIamPermissions( - request, - expectedOptions, - (err?: Error|null, result?: IamProtos.google.iam.v1.TestIamPermissionsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }).catch(err => {throw err}); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0)); - }); - it('invokes testIamPermissions with error', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() - ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.testIamPermissions(request, expectedOptions), expectedError); - assert((client.iamClient.testIamPermissions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - 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 workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - 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 workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - 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 workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - 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 workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - 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 workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - 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 workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - 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 workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - 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 workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - 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 workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - 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 workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - 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('batch', async () => { - const fakePath = "/rendered/path/batch"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - batch: "batchValue", - }; - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.batchPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.batchPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('batchPath', () => { - const result = client.batchPath("projectValue", "locationValue", "batchValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.batchPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBatchName', () => { - const result = client.matchProjectFromBatchName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.batchPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBatchName', () => { - const result = client.matchLocationFromBatchName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.batchPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBatchFromBatchName', () => { - const result = client.matchBatchFromBatchName(fakePath); - assert.strictEqual(result, "batchValue"); - assert((client.pathTemplates.batchPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('nodeGroup', async () => { - const fakePath = "/rendered/path/nodeGroup"; - const expectedParameters = { - project: "projectValue", - region: "regionValue", - cluster: "clusterValue", - node_group: "nodeGroupValue", - }; - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.nodeGroupPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.nodeGroupPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('nodeGroupPath', () => { - const result = client.nodeGroupPath("projectValue", "regionValue", "clusterValue", "nodeGroupValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.nodeGroupPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNodeGroupName', () => { - const result = client.matchProjectFromNodeGroupName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRegionFromNodeGroupName', () => { - const result = client.matchRegionFromNodeGroupName(fakePath); - assert.strictEqual(result, "regionValue"); - assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchClusterFromNodeGroupName', () => { - const result = client.matchClusterFromNodeGroupName(fakePath); - assert.strictEqual(result, "clusterValue"); - assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNodeGroupFromNodeGroupName', () => { - const result = client.matchNodeGroupFromNodeGroupName(fakePath); - assert.strictEqual(result, "nodeGroupValue"); - assert((client.pathTemplates.nodeGroupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', async () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - 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('projectLocationAutoscalingPolicy', async () => { - const fakePath = "/rendered/path/projectLocationAutoscalingPolicy"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - autoscaling_policy: "autoscalingPolicyValue", - }; - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationAutoscalingPolicyPath', () => { - const result = client.projectLocationAutoscalingPolicyPath("projectValue", "locationValue", "autoscalingPolicyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationAutoscalingPolicyName', () => { - const result = client.matchProjectFromProjectLocationAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationAutoscalingPolicyName', () => { - const result = client.matchLocationFromProjectLocationAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName', () => { - const result = client.matchAutoscalingPolicyFromProjectLocationAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "autoscalingPolicyValue"); - assert((client.pathTemplates.projectLocationAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectLocationWorkflowTemplate', async () => { - const fakePath = "/rendered/path/projectLocationWorkflowTemplate"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - workflow_template: "workflowTemplateValue", - }; - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectLocationWorkflowTemplatePath', () => { - const result = client.projectLocationWorkflowTemplatePath("projectValue", "locationValue", "workflowTemplateValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectLocationWorkflowTemplateName', () => { - const result = client.matchProjectFromProjectLocationWorkflowTemplateName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromProjectLocationWorkflowTemplateName', () => { - const result = client.matchLocationFromProjectLocationWorkflowTemplateName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchWorkflowTemplateFromProjectLocationWorkflowTemplateName', () => { - const result = client.matchWorkflowTemplateFromProjectLocationWorkflowTemplateName(fakePath); - assert.strictEqual(result, "workflowTemplateValue"); - assert((client.pathTemplates.projectLocationWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectRegionAutoscalingPolicy', async () => { - const fakePath = "/rendered/path/projectRegionAutoscalingPolicy"; - const expectedParameters = { - project: "projectValue", - region: "regionValue", - autoscaling_policy: "autoscalingPolicyValue", - }; - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectRegionAutoscalingPolicyPath', () => { - const result = client.projectRegionAutoscalingPolicyPath("projectValue", "regionValue", "autoscalingPolicyValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectRegionAutoscalingPolicyName', () => { - const result = client.matchProjectFromProjectRegionAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRegionFromProjectRegionAutoscalingPolicyName', () => { - const result = client.matchRegionFromProjectRegionAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "regionValue"); - assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName', () => { - const result = client.matchAutoscalingPolicyFromProjectRegionAutoscalingPolicyName(fakePath); - assert.strictEqual(result, "autoscalingPolicyValue"); - assert((client.pathTemplates.projectRegionAutoscalingPolicyPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('projectRegionWorkflowTemplate', async () => { - const fakePath = "/rendered/path/projectRegionWorkflowTemplate"; - const expectedParameters = { - project: "projectValue", - region: "regionValue", - workflow_template: "workflowTemplateValue", - }; - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('projectRegionWorkflowTemplatePath', () => { - const result = client.projectRegionWorkflowTemplatePath("projectValue", "regionValue", "workflowTemplateValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromProjectRegionWorkflowTemplateName', () => { - const result = client.matchProjectFromProjectRegionWorkflowTemplateName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRegionFromProjectRegionWorkflowTemplateName', () => { - const result = client.matchRegionFromProjectRegionWorkflowTemplateName(fakePath); - assert.strictEqual(result, "regionValue"); - assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchWorkflowTemplateFromProjectRegionWorkflowTemplateName', () => { - const result = client.matchWorkflowTemplateFromProjectRegionWorkflowTemplateName(fakePath); - assert.strictEqual(result, "workflowTemplateValue"); - assert((client.pathTemplates.projectRegionWorkflowTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('region', async () => { - const fakePath = "/rendered/path/region"; - const expectedParameters = { - project: "projectValue", - region: "regionValue", - }; - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.regionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.regionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('regionPath', () => { - const result = client.regionPath("projectValue", "regionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.regionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromRegionName', () => { - const result = client.matchProjectFromRegionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.regionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRegionFromRegionName', () => { - const result = client.matchRegionFromRegionName(fakePath); - assert.strictEqual(result, "regionValue"); - assert((client.pathTemplates.regionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('session', async () => { - const fakePath = "/rendered/path/session"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - session: "sessionValue", - }; - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.sessionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.sessionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('sessionPath', () => { - const result = client.sessionPath("projectValue", "locationValue", "sessionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.sessionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSessionName', () => { - const result = client.matchProjectFromSessionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSessionName', () => { - const result = client.matchLocationFromSessionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchSessionFromSessionName', () => { - const result = client.matchSessionFromSessionName(fakePath); - assert.strictEqual(result, "sessionValue"); - assert((client.pathTemplates.sessionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('sessionTemplate', async () => { - const fakePath = "/rendered/path/sessionTemplate"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - template: "templateValue", - }; - const client = new workflowtemplateserviceModule.v1.WorkflowTemplateServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.sessionTemplatePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.sessionTemplatePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('sessionTemplatePath', () => { - const result = client.sessionTemplatePath("projectValue", "locationValue", "templateValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.sessionTemplatePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromSessionTemplateName', () => { - const result = client.matchProjectFromSessionTemplateName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromSessionTemplateName', () => { - const result = client.matchLocationFromSessionTemplateName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchTemplateFromSessionTemplateName', () => { - const result = client.matchTemplateFromSessionTemplateName(fakePath); - assert.strictEqual(result, "templateValue"); - assert((client.pathTemplates.sessionTemplatePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-dataproc/tsconfig.json b/owl-bot-staging/google-cloud-dataproc/tsconfig.json deleted file mode 100644 index ca73e7bfc824..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/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-dataproc/webpack.config.js b/owl-bot-staging/google-cloud-dataproc/webpack.config.js deleted file mode 100644 index 050b272c0e03..000000000000 --- a/owl-bot-staging/google-cloud-dataproc/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: 'dataproc', - filename: './dataproc.js', - }, - node: { - child_process: 'empty', - fs: 'empty', - crypto: 'empty', - }, - resolve: { - alias: { - '../../../package.json': path.resolve(__dirname, 'package.json'), - }, - extensions: ['.js', '.json', '.ts'], - }, - module: { - rules: [ - { - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/ - }, - { - test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]grpc/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]retry-request/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]gtoken/, - use: 'null-loader' - }, - ], - }, - mode: 'production', -}; diff --git a/owl-bot-staging/google-cloud-dataproc/.gitattributes b/packages/google-cloud-dataproc/.gitattributes similarity index 100% rename from owl-bot-staging/google-cloud-dataproc/.gitattributes rename to packages/google-cloud-dataproc/.gitattributes diff --git a/owl-bot-staging/google-cloud-dataproc/.prettierignore b/packages/google-cloud-dataproc/.prettierignore similarity index 100% rename from owl-bot-staging/google-cloud-dataproc/.prettierignore rename to packages/google-cloud-dataproc/.prettierignore diff --git a/owl-bot-staging/google-cloud-dataproc/.prettierrc.js b/packages/google-cloud-dataproc/.prettierrc.js similarity index 100% rename from owl-bot-staging/google-cloud-dataproc/.prettierrc.js rename to packages/google-cloud-dataproc/.prettierrc.js diff --git a/owl-bot-staging/google-cloud-dataproc/CODE_OF_CONDUCT.md b/packages/google-cloud-dataproc/CODE_OF_CONDUCT.md similarity index 100% rename from owl-bot-staging/google-cloud-dataproc/CODE_OF_CONDUCT.md rename to packages/google-cloud-dataproc/CODE_OF_CONDUCT.md diff --git a/owl-bot-staging/google-cloud-dataproc/CONTRIBUTING.md b/packages/google-cloud-dataproc/CONTRIBUTING.md similarity index 100% rename from owl-bot-staging/google-cloud-dataproc/CONTRIBUTING.md rename to packages/google-cloud-dataproc/CONTRIBUTING.md diff --git a/owl-bot-staging/google-cloud-dataproc/LICENSE b/packages/google-cloud-dataproc/LICENSE similarity index 100% rename from owl-bot-staging/google-cloud-dataproc/LICENSE rename to packages/google-cloud-dataproc/LICENSE diff --git a/packages/google-cloud-dataproc/protos/google/cloud/dataproc/v1/batches.proto b/packages/google-cloud-dataproc/protos/google/cloud/dataproc/v1/batches.proto index bc57cb52344b..04bec6acd990 100644 --- a/packages/google-cloud-dataproc/protos/google/cloud/dataproc/v1/batches.proto +++ b/packages/google-cloud-dataproc/protos/google/cloud/dataproc/v1/batches.proto @@ -1,4 +1,4 @@ -// Copyright 2025 Google LLC +// Copyright 2026 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -256,6 +256,10 @@ message Batch { // Optional. SparkSql batch config. SparkSqlBatch spark_sql_batch = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. PySpark notebook batch config. + PySparkNotebookBatch pyspark_notebook_batch = 19 + [(google.api.field_behavior) = OPTIONAL]; } // Output only. Runtime information about batch execution. @@ -406,3 +410,27 @@ message SparkSqlBatch { // Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH. repeated string jar_file_uris = 3 [(google.api.field_behavior) = OPTIONAL]; } + +// A configuration for running a PySpark Notebook batch workload. +message PySparkNotebookBatch { + // Required. The HCFS URI of the notebook file to execute. + string notebook_file_uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The parameters to pass to the notebook. + map params = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HCFS URIs of Python files to pass to the PySpark framework. + repeated string python_file_uris = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH. + repeated string jar_file_uris = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HCFS URIs of files to be placed in the working directory of + // each executor + repeated string file_uris = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. HCFS URIs of archives to be extracted into the working directory + // of each executor. Supported file types: + // `.jar`, `.tar`, `.tar.gz`, `.tgz`, and `.zip`. + repeated string archive_uris = 6 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-dataproc/protos/protos.d.ts b/packages/google-cloud-dataproc/protos/protos.d.ts index d143de6926b0..0f88e851d408 100644 --- a/packages/google-cloud-dataproc/protos/protos.d.ts +++ b/packages/google-cloud-dataproc/protos/protos.d.ts @@ -1914,6 +1914,9 @@ export namespace google { /** Batch sparkSqlBatch */ sparkSqlBatch?: (google.cloud.dataproc.v1.ISparkSqlBatch|null); + /** Batch pysparkNotebookBatch */ + pysparkNotebookBatch?: (google.cloud.dataproc.v1.IPySparkNotebookBatch|null); + /** Batch runtimeInfo */ runtimeInfo?: (google.cloud.dataproc.v1.IRuntimeInfo|null); @@ -1975,6 +1978,9 @@ export namespace google { /** Batch sparkSqlBatch. */ public sparkSqlBatch?: (google.cloud.dataproc.v1.ISparkSqlBatch|null); + /** Batch pysparkNotebookBatch. */ + public pysparkNotebookBatch?: (google.cloud.dataproc.v1.IPySparkNotebookBatch|null); + /** Batch runtimeInfo. */ public runtimeInfo?: (google.cloud.dataproc.v1.IRuntimeInfo|null); @@ -2006,7 +2012,7 @@ export namespace google { public stateHistory: google.cloud.dataproc.v1.Batch.IStateHistory[]; /** Batch batchConfig. */ - public batchConfig?: ("pysparkBatch"|"sparkBatch"|"sparkRBatch"|"sparkSqlBatch"); + public batchConfig?: ("pysparkBatch"|"sparkBatch"|"sparkRBatch"|"sparkSqlBatch"|"pysparkNotebookBatch"); /** * Creates a new Batch instance using the specified properties. @@ -2690,6 +2696,133 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a PySparkNotebookBatch. */ + interface IPySparkNotebookBatch { + + /** PySparkNotebookBatch notebookFileUri */ + notebookFileUri?: (string|null); + + /** PySparkNotebookBatch params */ + params?: ({ [k: string]: string }|null); + + /** PySparkNotebookBatch pythonFileUris */ + pythonFileUris?: (string[]|null); + + /** PySparkNotebookBatch jarFileUris */ + jarFileUris?: (string[]|null); + + /** PySparkNotebookBatch fileUris */ + fileUris?: (string[]|null); + + /** PySparkNotebookBatch archiveUris */ + archiveUris?: (string[]|null); + } + + /** Represents a PySparkNotebookBatch. */ + class PySparkNotebookBatch implements IPySparkNotebookBatch { + + /** + * Constructs a new PySparkNotebookBatch. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dataproc.v1.IPySparkNotebookBatch); + + /** PySparkNotebookBatch notebookFileUri. */ + public notebookFileUri: string; + + /** PySparkNotebookBatch params. */ + public params: { [k: string]: string }; + + /** PySparkNotebookBatch pythonFileUris. */ + public pythonFileUris: string[]; + + /** PySparkNotebookBatch jarFileUris. */ + public jarFileUris: string[]; + + /** PySparkNotebookBatch fileUris. */ + public fileUris: string[]; + + /** PySparkNotebookBatch archiveUris. */ + public archiveUris: string[]; + + /** + * Creates a new PySparkNotebookBatch instance using the specified properties. + * @param [properties] Properties to set + * @returns PySparkNotebookBatch instance + */ + public static create(properties?: google.cloud.dataproc.v1.IPySparkNotebookBatch): google.cloud.dataproc.v1.PySparkNotebookBatch; + + /** + * Encodes the specified PySparkNotebookBatch message. Does not implicitly {@link google.cloud.dataproc.v1.PySparkNotebookBatch.verify|verify} messages. + * @param message PySparkNotebookBatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dataproc.v1.IPySparkNotebookBatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PySparkNotebookBatch message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.PySparkNotebookBatch.verify|verify} messages. + * @param message PySparkNotebookBatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dataproc.v1.IPySparkNotebookBatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PySparkNotebookBatch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PySparkNotebookBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dataproc.v1.PySparkNotebookBatch; + + /** + * Decodes a PySparkNotebookBatch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PySparkNotebookBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dataproc.v1.PySparkNotebookBatch; + + /** + * Verifies a PySparkNotebookBatch message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PySparkNotebookBatch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PySparkNotebookBatch + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dataproc.v1.PySparkNotebookBatch; + + /** + * Creates a plain object from a PySparkNotebookBatch message. Also converts values to other types if specified. + * @param message PySparkNotebookBatch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dataproc.v1.PySparkNotebookBatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PySparkNotebookBatch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PySparkNotebookBatch + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a RuntimeConfig. */ interface IRuntimeConfig { diff --git a/packages/google-cloud-dataproc/protos/protos.js b/packages/google-cloud-dataproc/protos/protos.js index 573c43086bca..6dbcef9c0aca 100644 --- a/packages/google-cloud-dataproc/protos/protos.js +++ b/packages/google-cloud-dataproc/protos/protos.js @@ -4348,6 +4348,7 @@ * @property {google.cloud.dataproc.v1.ISparkBatch|null} [sparkBatch] Batch sparkBatch * @property {google.cloud.dataproc.v1.ISparkRBatch|null} [sparkRBatch] Batch sparkRBatch * @property {google.cloud.dataproc.v1.ISparkSqlBatch|null} [sparkSqlBatch] Batch sparkSqlBatch + * @property {google.cloud.dataproc.v1.IPySparkNotebookBatch|null} [pysparkNotebookBatch] Batch pysparkNotebookBatch * @property {google.cloud.dataproc.v1.IRuntimeInfo|null} [runtimeInfo] Batch runtimeInfo * @property {google.cloud.dataproc.v1.Batch.State|null} [state] Batch state * @property {string|null} [stateMessage] Batch stateMessage @@ -4433,6 +4434,14 @@ */ Batch.prototype.sparkSqlBatch = null; + /** + * Batch pysparkNotebookBatch. + * @member {google.cloud.dataproc.v1.IPySparkNotebookBatch|null|undefined} pysparkNotebookBatch + * @memberof google.cloud.dataproc.v1.Batch + * @instance + */ + Batch.prototype.pysparkNotebookBatch = null; + /** * Batch runtimeInfo. * @member {google.cloud.dataproc.v1.IRuntimeInfo|null|undefined} runtimeInfo @@ -4518,12 +4527,12 @@ /** * Batch batchConfig. - * @member {"pysparkBatch"|"sparkBatch"|"sparkRBatch"|"sparkSqlBatch"|undefined} batchConfig + * @member {"pysparkBatch"|"sparkBatch"|"sparkRBatch"|"sparkSqlBatch"|"pysparkNotebookBatch"|undefined} batchConfig * @memberof google.cloud.dataproc.v1.Batch * @instance */ Object.defineProperty(Batch.prototype, "batchConfig", { - get: $util.oneOfGetter($oneOfFields = ["pysparkBatch", "sparkBatch", "sparkRBatch", "sparkSqlBatch"]), + get: $util.oneOfGetter($oneOfFields = ["pysparkBatch", "sparkBatch", "sparkRBatch", "sparkSqlBatch", "pysparkNotebookBatch"]), set: $util.oneOfSetter($oneOfFields) }); @@ -4587,6 +4596,8 @@ if (message.stateHistory != null && message.stateHistory.length) for (var i = 0; i < message.stateHistory.length; ++i) $root.google.cloud.dataproc.v1.Batch.StateHistory.encode(message.stateHistory[i], writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.pysparkNotebookBatch != null && Object.hasOwnProperty.call(message, "pysparkNotebookBatch")) + $root.google.cloud.dataproc.v1.PySparkNotebookBatch.encode(message.pysparkNotebookBatch, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); return writer; }; @@ -4651,6 +4662,10 @@ message.sparkSqlBatch = $root.google.cloud.dataproc.v1.SparkSqlBatch.decode(reader, reader.uint32()); break; } + case 19: { + message.pysparkNotebookBatch = $root.google.cloud.dataproc.v1.PySparkNotebookBatch.decode(reader, reader.uint32()); + break; + } case 8: { message.runtimeInfo = $root.google.cloud.dataproc.v1.RuntimeInfo.decode(reader, reader.uint32()); break; @@ -4797,6 +4812,16 @@ return "sparkSqlBatch." + error; } } + if (message.pysparkNotebookBatch != null && message.hasOwnProperty("pysparkNotebookBatch")) { + if (properties.batchConfig === 1) + return "batchConfig: multiple values"; + properties.batchConfig = 1; + { + var error = $root.google.cloud.dataproc.v1.PySparkNotebookBatch.verify(message.pysparkNotebookBatch); + if (error) + return "pysparkNotebookBatch." + error; + } + } if (message.runtimeInfo != null && message.hasOwnProperty("runtimeInfo")) { var error = $root.google.cloud.dataproc.v1.RuntimeInfo.verify(message.runtimeInfo); if (error) @@ -4900,6 +4925,11 @@ throw TypeError(".google.cloud.dataproc.v1.Batch.sparkSqlBatch: object expected"); message.sparkSqlBatch = $root.google.cloud.dataproc.v1.SparkSqlBatch.fromObject(object.sparkSqlBatch); } + if (object.pysparkNotebookBatch != null) { + if (typeof object.pysparkNotebookBatch !== "object") + throw TypeError(".google.cloud.dataproc.v1.Batch.pysparkNotebookBatch: object expected"); + message.pysparkNotebookBatch = $root.google.cloud.dataproc.v1.PySparkNotebookBatch.fromObject(object.pysparkNotebookBatch); + } if (object.runtimeInfo != null) { if (typeof object.runtimeInfo !== "object") throw TypeError(".google.cloud.dataproc.v1.Batch.runtimeInfo: object expected"); @@ -5065,6 +5095,11 @@ for (var j = 0; j < message.stateHistory.length; ++j) object.stateHistory[j] = $root.google.cloud.dataproc.v1.Batch.StateHistory.toObject(message.stateHistory[j], options); } + if (message.pysparkNotebookBatch != null && message.hasOwnProperty("pysparkNotebookBatch")) { + object.pysparkNotebookBatch = $root.google.cloud.dataproc.v1.PySparkNotebookBatch.toObject(message.pysparkNotebookBatch, options); + if (options.oneofs) + object.batchConfig = "pysparkNotebookBatch"; + } return object; }; @@ -6862,6 +6897,428 @@ return SparkSqlBatch; })(); + v1.PySparkNotebookBatch = (function() { + + /** + * Properties of a PySparkNotebookBatch. + * @memberof google.cloud.dataproc.v1 + * @interface IPySparkNotebookBatch + * @property {string|null} [notebookFileUri] PySparkNotebookBatch notebookFileUri + * @property {Object.|null} [params] PySparkNotebookBatch params + * @property {Array.|null} [pythonFileUris] PySparkNotebookBatch pythonFileUris + * @property {Array.|null} [jarFileUris] PySparkNotebookBatch jarFileUris + * @property {Array.|null} [fileUris] PySparkNotebookBatch fileUris + * @property {Array.|null} [archiveUris] PySparkNotebookBatch archiveUris + */ + + /** + * Constructs a new PySparkNotebookBatch. + * @memberof google.cloud.dataproc.v1 + * @classdesc Represents a PySparkNotebookBatch. + * @implements IPySparkNotebookBatch + * @constructor + * @param {google.cloud.dataproc.v1.IPySparkNotebookBatch=} [properties] Properties to set + */ + function PySparkNotebookBatch(properties) { + this.params = {}; + this.pythonFileUris = []; + this.jarFileUris = []; + this.fileUris = []; + this.archiveUris = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PySparkNotebookBatch notebookFileUri. + * @member {string} notebookFileUri + * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch + * @instance + */ + PySparkNotebookBatch.prototype.notebookFileUri = ""; + + /** + * PySparkNotebookBatch params. + * @member {Object.} params + * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch + * @instance + */ + PySparkNotebookBatch.prototype.params = $util.emptyObject; + + /** + * PySparkNotebookBatch pythonFileUris. + * @member {Array.} pythonFileUris + * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch + * @instance + */ + PySparkNotebookBatch.prototype.pythonFileUris = $util.emptyArray; + + /** + * PySparkNotebookBatch jarFileUris. + * @member {Array.} jarFileUris + * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch + * @instance + */ + PySparkNotebookBatch.prototype.jarFileUris = $util.emptyArray; + + /** + * PySparkNotebookBatch fileUris. + * @member {Array.} fileUris + * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch + * @instance + */ + PySparkNotebookBatch.prototype.fileUris = $util.emptyArray; + + /** + * PySparkNotebookBatch archiveUris. + * @member {Array.} archiveUris + * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch + * @instance + */ + PySparkNotebookBatch.prototype.archiveUris = $util.emptyArray; + + /** + * Creates a new PySparkNotebookBatch instance using the specified properties. + * @function create + * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch + * @static + * @param {google.cloud.dataproc.v1.IPySparkNotebookBatch=} [properties] Properties to set + * @returns {google.cloud.dataproc.v1.PySparkNotebookBatch} PySparkNotebookBatch instance + */ + PySparkNotebookBatch.create = function create(properties) { + return new PySparkNotebookBatch(properties); + }; + + /** + * Encodes the specified PySparkNotebookBatch message. Does not implicitly {@link google.cloud.dataproc.v1.PySparkNotebookBatch.verify|verify} messages. + * @function encode + * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch + * @static + * @param {google.cloud.dataproc.v1.IPySparkNotebookBatch} message PySparkNotebookBatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PySparkNotebookBatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.notebookFileUri != null && Object.hasOwnProperty.call(message, "notebookFileUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.notebookFileUri); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + for (var keys = Object.keys(message.params), 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.params[keys[i]]).ldelim(); + if (message.pythonFileUris != null && message.pythonFileUris.length) + for (var i = 0; i < message.pythonFileUris.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pythonFileUris[i]); + if (message.jarFileUris != null && message.jarFileUris.length) + for (var i = 0; i < message.jarFileUris.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.jarFileUris[i]); + if (message.fileUris != null && message.fileUris.length) + for (var i = 0; i < message.fileUris.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.fileUris[i]); + if (message.archiveUris != null && message.archiveUris.length) + for (var i = 0; i < message.archiveUris.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.archiveUris[i]); + return writer; + }; + + /** + * Encodes the specified PySparkNotebookBatch message, length delimited. Does not implicitly {@link google.cloud.dataproc.v1.PySparkNotebookBatch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch + * @static + * @param {google.cloud.dataproc.v1.IPySparkNotebookBatch} message PySparkNotebookBatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PySparkNotebookBatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PySparkNotebookBatch message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dataproc.v1.PySparkNotebookBatch} PySparkNotebookBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PySparkNotebookBatch.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dataproc.v1.PySparkNotebookBatch(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.notebookFileUri = reader.string(); + break; + } + case 2: { + if (message.params === $util.emptyObject) + message.params = {}; + 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.params[key] = value; + break; + } + case 3: { + if (!(message.pythonFileUris && message.pythonFileUris.length)) + message.pythonFileUris = []; + message.pythonFileUris.push(reader.string()); + break; + } + case 4: { + if (!(message.jarFileUris && message.jarFileUris.length)) + message.jarFileUris = []; + message.jarFileUris.push(reader.string()); + break; + } + case 5: { + if (!(message.fileUris && message.fileUris.length)) + message.fileUris = []; + message.fileUris.push(reader.string()); + break; + } + case 6: { + if (!(message.archiveUris && message.archiveUris.length)) + message.archiveUris = []; + message.archiveUris.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PySparkNotebookBatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dataproc.v1.PySparkNotebookBatch} PySparkNotebookBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PySparkNotebookBatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PySparkNotebookBatch message. + * @function verify + * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PySparkNotebookBatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.notebookFileUri != null && message.hasOwnProperty("notebookFileUri")) + if (!$util.isString(message.notebookFileUri)) + return "notebookFileUri: string expected"; + if (message.params != null && message.hasOwnProperty("params")) { + if (!$util.isObject(message.params)) + return "params: object expected"; + var key = Object.keys(message.params); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.params[key[i]])) + return "params: string{k:string} expected"; + } + if (message.pythonFileUris != null && message.hasOwnProperty("pythonFileUris")) { + if (!Array.isArray(message.pythonFileUris)) + return "pythonFileUris: array expected"; + for (var i = 0; i < message.pythonFileUris.length; ++i) + if (!$util.isString(message.pythonFileUris[i])) + return "pythonFileUris: string[] expected"; + } + if (message.jarFileUris != null && message.hasOwnProperty("jarFileUris")) { + if (!Array.isArray(message.jarFileUris)) + return "jarFileUris: array expected"; + for (var i = 0; i < message.jarFileUris.length; ++i) + if (!$util.isString(message.jarFileUris[i])) + return "jarFileUris: string[] expected"; + } + if (message.fileUris != null && message.hasOwnProperty("fileUris")) { + if (!Array.isArray(message.fileUris)) + return "fileUris: array expected"; + for (var i = 0; i < message.fileUris.length; ++i) + if (!$util.isString(message.fileUris[i])) + return "fileUris: string[] expected"; + } + if (message.archiveUris != null && message.hasOwnProperty("archiveUris")) { + if (!Array.isArray(message.archiveUris)) + return "archiveUris: array expected"; + for (var i = 0; i < message.archiveUris.length; ++i) + if (!$util.isString(message.archiveUris[i])) + return "archiveUris: string[] expected"; + } + return null; + }; + + /** + * Creates a PySparkNotebookBatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dataproc.v1.PySparkNotebookBatch} PySparkNotebookBatch + */ + PySparkNotebookBatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dataproc.v1.PySparkNotebookBatch) + return object; + var message = new $root.google.cloud.dataproc.v1.PySparkNotebookBatch(); + if (object.notebookFileUri != null) + message.notebookFileUri = String(object.notebookFileUri); + if (object.params) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.dataproc.v1.PySparkNotebookBatch.params: object expected"); + message.params = {}; + for (var keys = Object.keys(object.params), i = 0; i < keys.length; ++i) + message.params[keys[i]] = String(object.params[keys[i]]); + } + if (object.pythonFileUris) { + if (!Array.isArray(object.pythonFileUris)) + throw TypeError(".google.cloud.dataproc.v1.PySparkNotebookBatch.pythonFileUris: array expected"); + message.pythonFileUris = []; + for (var i = 0; i < object.pythonFileUris.length; ++i) + message.pythonFileUris[i] = String(object.pythonFileUris[i]); + } + if (object.jarFileUris) { + if (!Array.isArray(object.jarFileUris)) + throw TypeError(".google.cloud.dataproc.v1.PySparkNotebookBatch.jarFileUris: array expected"); + message.jarFileUris = []; + for (var i = 0; i < object.jarFileUris.length; ++i) + message.jarFileUris[i] = String(object.jarFileUris[i]); + } + if (object.fileUris) { + if (!Array.isArray(object.fileUris)) + throw TypeError(".google.cloud.dataproc.v1.PySparkNotebookBatch.fileUris: array expected"); + message.fileUris = []; + for (var i = 0; i < object.fileUris.length; ++i) + message.fileUris[i] = String(object.fileUris[i]); + } + if (object.archiveUris) { + if (!Array.isArray(object.archiveUris)) + throw TypeError(".google.cloud.dataproc.v1.PySparkNotebookBatch.archiveUris: array expected"); + message.archiveUris = []; + for (var i = 0; i < object.archiveUris.length; ++i) + message.archiveUris[i] = String(object.archiveUris[i]); + } + return message; + }; + + /** + * Creates a plain object from a PySparkNotebookBatch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch + * @static + * @param {google.cloud.dataproc.v1.PySparkNotebookBatch} message PySparkNotebookBatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PySparkNotebookBatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pythonFileUris = []; + object.jarFileUris = []; + object.fileUris = []; + object.archiveUris = []; + } + if (options.objects || options.defaults) + object.params = {}; + if (options.defaults) + object.notebookFileUri = ""; + if (message.notebookFileUri != null && message.hasOwnProperty("notebookFileUri")) + object.notebookFileUri = message.notebookFileUri; + var keys2; + if (message.params && (keys2 = Object.keys(message.params)).length) { + object.params = {}; + for (var j = 0; j < keys2.length; ++j) + object.params[keys2[j]] = message.params[keys2[j]]; + } + if (message.pythonFileUris && message.pythonFileUris.length) { + object.pythonFileUris = []; + for (var j = 0; j < message.pythonFileUris.length; ++j) + object.pythonFileUris[j] = message.pythonFileUris[j]; + } + if (message.jarFileUris && message.jarFileUris.length) { + object.jarFileUris = []; + for (var j = 0; j < message.jarFileUris.length; ++j) + object.jarFileUris[j] = message.jarFileUris[j]; + } + if (message.fileUris && message.fileUris.length) { + object.fileUris = []; + for (var j = 0; j < message.fileUris.length; ++j) + object.fileUris[j] = message.fileUris[j]; + } + if (message.archiveUris && message.archiveUris.length) { + object.archiveUris = []; + for (var j = 0; j < message.archiveUris.length; ++j) + object.archiveUris[j] = message.archiveUris[j]; + } + return object; + }; + + /** + * Converts this PySparkNotebookBatch to JSON. + * @function toJSON + * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch + * @instance + * @returns {Object.} JSON object + */ + PySparkNotebookBatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PySparkNotebookBatch + * @function getTypeUrl + * @memberof google.cloud.dataproc.v1.PySparkNotebookBatch + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PySparkNotebookBatch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.dataproc.v1.PySparkNotebookBatch"; + }; + + return PySparkNotebookBatch; + })(); + v1.RuntimeConfig = (function() { /** diff --git a/packages/google-cloud-dataproc/protos/protos.json b/packages/google-cloud-dataproc/protos/protos.json index a1e23f9dad7a..317724581919 100644 --- a/packages/google-cloud-dataproc/protos/protos.json +++ b/packages/google-cloud-dataproc/protos/protos.json @@ -620,7 +620,8 @@ "pysparkBatch", "sparkBatch", "sparkRBatch", - "sparkSqlBatch" + "sparkSqlBatch", + "pysparkNotebookBatch" ] } }, @@ -674,6 +675,13 @@ "(google.api.field_behavior)": "OPTIONAL" } }, + "pysparkNotebookBatch": { + "type": "PySparkNotebookBatch", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "runtimeInfo": { "type": "RuntimeInfo", "id": 8, @@ -957,6 +965,57 @@ } } }, + "PySparkNotebookBatch": { + "fields": { + "notebookFileUri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "params": { + "keyType": "string", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pythonFileUris": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "jarFileUris": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fileUris": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "archiveUris": { + "rule": "repeated", + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, "RuntimeConfig": { "fields": { "version": { diff --git a/packages/google-cloud-dataproc/samples/generated/v1/snippet_metadata_google.cloud.dataproc.v1.json b/packages/google-cloud-dataproc/samples/generated/v1/snippet_metadata_google.cloud.dataproc.v1.json index 97c601873750..6e8593086d41 100644 --- a/packages/google-cloud-dataproc/samples/generated/v1/snippet_metadata_google.cloud.dataproc.v1.json +++ b/packages/google-cloud-dataproc/samples/generated/v1/snippet_metadata_google.cloud.dataproc.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-dataproc", - "version": "6.3.0", + "version": "0.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-dataproc/src/index.ts b/packages/google-cloud-dataproc/src/index.ts index 5db1abc6576a..49417fe6517c 100644 --- a/packages/google-cloud-dataproc/src/index.ts +++ b/packages/google-cloud-dataproc/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2026 Google LLC +// 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. diff --git a/packages/google-cloud-dataproc/webpack.config.js b/packages/google-cloud-dataproc/webpack.config.js index e6ae2897925d..050b272c0e03 100644 --- a/packages/google-cloud-dataproc/webpack.config.js +++ b/packages/google-cloud-dataproc/webpack.config.js @@ -1,4 +1,4 @@ -// Copyright 2026 Google LLC +// 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.